Merge remote-tracking branch 'refs/remotes/origin/develop' into feature/gem-hunters
This commit is contained in:
commit
3a4e973551
@ -1,14 +1,18 @@
|
|||||||
package mineplex.core.common.shape;
|
package mineplex.core.common.shape;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import mineplex.core.common.util.UtilParticle;
|
import mineplex.core.common.util.UtilParticle;
|
||||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
|
import mineplex.core.common.util.particles.ColoredParticle;
|
||||||
|
import mineplex.core.common.util.particles.DustSpellColor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Some simple wing shapes implementing {@link ICosmeticShape} storing additional particle information
|
* Some simple wing shapes implementing {@link CosmeticShape} storing additional particle information
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ShapeWings extends ShapeGrid implements CosmeticShape
|
public class ShapeWings extends ShapeGrid implements CosmeticShape
|
||||||
@ -51,20 +55,60 @@ public class ShapeWings extends ShapeGrid implements CosmeticShape
|
|||||||
|
|
||||||
public static final String[] BUTTERFLY_WING_PATTERN = new String[]
|
public static final String[] BUTTERFLY_WING_PATTERN = new String[]
|
||||||
{
|
{
|
||||||
"0$$0000000000000000$$0",
|
"0$$000000000000000$$0",
|
||||||
"$##$00000000000000$##$",
|
"$##$0000000000000$##$",
|
||||||
"0$##$000000000000$##$0",
|
"0$##$00000000000$##$0",
|
||||||
"00$##$0000000000$##$00",
|
"00$##$000000000$##$00",
|
||||||
"00$###$00000000$###$00",
|
"00$###$0000000$###$00",
|
||||||
"000$####$0000$####$000",
|
"000$###$$000$$###$000",
|
||||||
"000$######$$#####$0000",
|
"0000$####$$$####$0000",
|
||||||
"0000$############$0000",
|
"0000$###########$0000",
|
||||||
"00000$##########$00000",
|
"00000$#########$00000",
|
||||||
"00000$##########$00000",
|
"00000$#########$00000",
|
||||||
"00000$####$$$###$00000",
|
"00000$###$$$###$00000",
|
||||||
"00000$###$000$###$0000",
|
"0000$###$000$###$0000",
|
||||||
"00000$##$00000$##$0000",
|
"0000$##$00000$##$0000",
|
||||||
"000000$000000000$00000"
|
"00000$$0000000$$00000"
|
||||||
|
};
|
||||||
|
|
||||||
|
public static final String[] SMALL_BUTTERFLY_WING_PATTERN = new String[]
|
||||||
|
{
|
||||||
|
"0$$00000000$$0",
|
||||||
|
"$##$000000$##$",
|
||||||
|
"0$##$0000$##$0",
|
||||||
|
"00$##$$$$##$00",
|
||||||
|
"000$######$000",
|
||||||
|
"000$######$000",
|
||||||
|
"00$###$$###$00",
|
||||||
|
"000$#$00$#$000",
|
||||||
|
"0000$0000$0000"
|
||||||
|
};
|
||||||
|
|
||||||
|
public static final String[] HEART_WING_PATTERN = new String[]
|
||||||
|
{
|
||||||
|
"00$00000000000000000$00",
|
||||||
|
"0$%$000000000000000$%$0",
|
||||||
|
"$%%%$$00$$000$$00$$%%%$",
|
||||||
|
"$%%%%%$$##$0$##$$%%%%%$",
|
||||||
|
"$%%%%%$####$####$%%%%%$",
|
||||||
|
"0$%%%%$#########$%%%%$0",
|
||||||
|
"00$%%%$#########$%%%$00",
|
||||||
|
"000$%%$$#######$$%%$000",
|
||||||
|
"0000$$00$#####$00$$0000",
|
||||||
|
"000000000$###$000000000",
|
||||||
|
"0000000000$#$0000000000",
|
||||||
|
"00000000000$00000000000"
|
||||||
|
};
|
||||||
|
|
||||||
|
public static final String[] SMALL_HEART_WING_PATTERN = new String[]
|
||||||
|
{
|
||||||
|
"0$000000000$0",
|
||||||
|
"$%$0$$0$$0$%$",
|
||||||
|
"$%%$##$##$%%$",
|
||||||
|
"0$%$00000$%$0",
|
||||||
|
"00$0$###$0$00",
|
||||||
|
"00000$#$00000",
|
||||||
|
"000000$000000"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -163,18 +207,39 @@ public class ShapeWings extends ShapeGrid implements CosmeticShape
|
|||||||
rotateOnXAxis(xRotation);
|
rotateOnXAxis(xRotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ShapeWings(String particle, Vector offsetData, float speed, int count, char c, double xRotation, String... pattern)
|
||||||
|
{
|
||||||
|
super(0.15, c, pattern);
|
||||||
|
_particle = particle;
|
||||||
|
_offsetData = offsetData;
|
||||||
|
_speed = speed;
|
||||||
|
_count = count;
|
||||||
|
rotateOnXAxis(xRotation);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void display(Location loc)
|
public void display(Location loc)
|
||||||
{
|
{
|
||||||
Shape clone = clone();
|
Shape clone = clone();
|
||||||
clone.rotateOnYAxis(Math.toRadians(loc.getYaw()));
|
clone.rotateOnYAxis(Math.toRadians(loc.getYaw()));
|
||||||
for(Vector v : clone._points)
|
for (Vector v : clone.getPoints())
|
||||||
{
|
{
|
||||||
Location ploc = loc.clone().add(v);
|
Location ploc = loc.clone().add(v);
|
||||||
displayParticle(ploc);
|
displayParticle(ploc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void displayColored(Location loc, Color color)
|
||||||
|
{
|
||||||
|
Shape clone = clone();
|
||||||
|
clone.rotateOnYAxis(Math.toRadians(loc.getYaw()));
|
||||||
|
for (Vector v : clone.getPoints())
|
||||||
|
{
|
||||||
|
Location ploc = loc.clone().add(v);
|
||||||
|
displayColoredParticle(ploc, color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display a single particle of the type provided to this shape at the given location.
|
* Display a single particle of the type provided to this shape at the given location.
|
||||||
*/
|
*/
|
||||||
@ -183,4 +248,10 @@ public class ShapeWings extends ShapeGrid implements CosmeticShape
|
|||||||
UtilParticle.PlayParticleToAll(_particle, loc, _offsetData, _speed, _count, ViewDist.NORMAL);
|
UtilParticle.PlayParticleToAll(_particle, loc, _offsetData, _speed, _count, ViewDist.NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void displayColoredParticle(Location loc, Color color)
|
||||||
|
{
|
||||||
|
ColoredParticle coloredParticle = new ColoredParticle(ParticleType.RED_DUST, new DustSpellColor(color), loc);
|
||||||
|
coloredParticle.display(ViewDist.NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,7 @@ public class SkinData
|
|||||||
public final static SkinData WITCH = new SkinData("eyJ0aW1lc3RhbXAiOjE0NzM5OTEyMTE1NDQsInByb2ZpbGVJZCI6IjlmY2FlZDhiMTRiNTRmN2ZhNjRjYjYwNDBlNzA1MjcyIiwicHJvZmlsZU5hbWUiOiJMQ2FzdHIxIiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS81NDg1ZDZlMTBhNmNmMmY3Mzg2NmZhMGRiNjEzOWQ5NWViZDM0ZGZiMGY0YzAxMmRkM2YzYWYxMWQ5ZjQxYyJ9fX0=", "cojkGLflVWxwnhDXmHMke7crkeA78iUYOWY7H3YvMJFD+VZi9E7vUahLTTx5ELH+PvcaHJerSDmuV+Nasc3K2n6zlXXb0B7RB/ose/kdPxHAIJee7IbZX0iFNDn6irUSOS4wOYF/BwaqG3HmpoSxV52SGMs6kqTer2Rjg3X+XwYFFiDHAR/gwhfXLzrM1iBc171vgu6T+kx65iBHa/YB/V/mj8FSxwM0f5IsLpgAEdxDL9PvEKQWgWeZ1CAqEXlGnjPkd9oGzW0TgDz2MksBbYZ2kmn/S53kK9vCrVB7egZPS4VBtKpq1P7Jeu8rtgjnAKVFQJZ2lMHnVRuvGTd8JKoPHarUPpU2LURUMaCtHzSv9v/4gjkafnDhqxG4TTcr5hxFV+ho72HQchoeaUXzIO+Yo71zrVqkrS0hw6OtgMIBlvaGaEUsFvGiCZePBEiHojO43AKqJcJAVeT2RAzHcAaBAO79ACGjNKw/oj02rOurLha9i+99bKui96Eg7SS/nPchbmu5YQ9nSpkW+JeYXnBzGGzNG4y02VWgz15L718+8161zXobhuK07qlY9i1nipFbEJedqG0cfS+AUzauETFvS9nMtxhtftYPCIxm40GQj6e77asNCAEElGssaUGKO3bjm348+oF9tR/eBOYWJQ8kL46IQLDRoop7UhG4ewY=");
|
public final static SkinData WITCH = new SkinData("eyJ0aW1lc3RhbXAiOjE0NzM5OTEyMTE1NDQsInByb2ZpbGVJZCI6IjlmY2FlZDhiMTRiNTRmN2ZhNjRjYjYwNDBlNzA1MjcyIiwicHJvZmlsZU5hbWUiOiJMQ2FzdHIxIiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS81NDg1ZDZlMTBhNmNmMmY3Mzg2NmZhMGRiNjEzOWQ5NWViZDM0ZGZiMGY0YzAxMmRkM2YzYWYxMWQ5ZjQxYyJ9fX0=", "cojkGLflVWxwnhDXmHMke7crkeA78iUYOWY7H3YvMJFD+VZi9E7vUahLTTx5ELH+PvcaHJerSDmuV+Nasc3K2n6zlXXb0B7RB/ose/kdPxHAIJee7IbZX0iFNDn6irUSOS4wOYF/BwaqG3HmpoSxV52SGMs6kqTer2Rjg3X+XwYFFiDHAR/gwhfXLzrM1iBc171vgu6T+kx65iBHa/YB/V/mj8FSxwM0f5IsLpgAEdxDL9PvEKQWgWeZ1CAqEXlGnjPkd9oGzW0TgDz2MksBbYZ2kmn/S53kK9vCrVB7egZPS4VBtKpq1P7Jeu8rtgjnAKVFQJZ2lMHnVRuvGTd8JKoPHarUPpU2LURUMaCtHzSv9v/4gjkafnDhqxG4TTcr5hxFV+ho72HQchoeaUXzIO+Yo71zrVqkrS0hw6OtgMIBlvaGaEUsFvGiCZePBEiHojO43AKqJcJAVeT2RAzHcAaBAO79ACGjNKw/oj02rOurLha9i+99bKui96Eg7SS/nPchbmu5YQ9nSpkW+JeYXnBzGGzNG4y02VWgz15L718+8161zXobhuK07qlY9i1nipFbEJedqG0cfS+AUzauETFvS9nMtxhtftYPCIxm40GQj6e77asNCAEElGssaUGKO3bjm348+oF9tR/eBOYWJQ8kL46IQLDRoop7UhG4ewY=");
|
||||||
public final static SkinData TURKEY = new SkinData("eyJ0aW1lc3RhbXAiOjE0NzU3NzM2MTc5MDQsInByb2ZpbGVJZCI6IjlmY2FlZDhiMTRiNTRmN2ZhNjRjYjYwNDBlNzA1MjcyIiwicHJvZmlsZU5hbWUiOiJMQ2FzdHIxIiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS8xYzdmYjczMTRkNmY1ZTMzNmVjN2ViNTI1ZGM0ODMzOWNhMjI4ZDk3ODU1MDM3ZDZhNDIwOGZjNzYwNDc1NiJ9fX0=", "eZWi1LOD8ke7MCUAfhspBCnyfCoGM8suFLKtbW6b27CURoRBG3eKIfwLYYeMp3ObjoZ8gCB90s28Qyw5XMzwvvowy9W/b5cYC0OzQ8+GR7tDZoWc28tGqGBM8cmDJIFQgZdceBIIr2lXeAvEJfLbyrus46hPjk8YTiQW2DsBq88BhKIy6Igb1rGqJ1goVERF07b6+/yMdLKCaT8OZFzKLXfo5rY5gr6HLnvsQiNL9aTrl74agXn1GUcP+QVNe7/c9lYmv5vLCBst1YiIPq27NZASZ++Fwyv6+PRlaFZZYtMHVd4UZeYPl7ak1Cdi/1sUcRpkBbJM8AHIrqq0iuXxrLbc6ldQ2cYQKHg9ljIpW/EZanuf6Wgm/LK1JnxXne9GUb/xPzB1EnZ95i8/u9WJa+NixEcfc3pAzDPYncIR8lishFwyBRta6BCG76U3UY2lQr3YD/48AJ49r7+WVU0gOP/h2SDSdAZHEdvkpVJ0w/xA+SevJ7Y7xA5EJ655YMQ0F8f3WUFTf1pFklE5E+fwkMVCWOPw7UMy558IcRSpdWAPPyf8sc7CpDqRk37/vXWRDa+7YBfgskK6B2eXowrzThUOBx+AmDTF3Rv8ZSr1Un0FWGi+GQ5ny7W9dJBMomzyMUbzz9stsCml5XB+6xLP2MD+9lO1bHipKS6qkhtZChE=");
|
public final static SkinData TURKEY = new SkinData("eyJ0aW1lc3RhbXAiOjE0NzU3NzM2MTc5MDQsInByb2ZpbGVJZCI6IjlmY2FlZDhiMTRiNTRmN2ZhNjRjYjYwNDBlNzA1MjcyIiwicHJvZmlsZU5hbWUiOiJMQ2FzdHIxIiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS8xYzdmYjczMTRkNmY1ZTMzNmVjN2ViNTI1ZGM0ODMzOWNhMjI4ZDk3ODU1MDM3ZDZhNDIwOGZjNzYwNDc1NiJ9fX0=", "eZWi1LOD8ke7MCUAfhspBCnyfCoGM8suFLKtbW6b27CURoRBG3eKIfwLYYeMp3ObjoZ8gCB90s28Qyw5XMzwvvowy9W/b5cYC0OzQ8+GR7tDZoWc28tGqGBM8cmDJIFQgZdceBIIr2lXeAvEJfLbyrus46hPjk8YTiQW2DsBq88BhKIy6Igb1rGqJ1goVERF07b6+/yMdLKCaT8OZFzKLXfo5rY5gr6HLnvsQiNL9aTrl74agXn1GUcP+QVNe7/c9lYmv5vLCBst1YiIPq27NZASZ++Fwyv6+PRlaFZZYtMHVd4UZeYPl7ak1Cdi/1sUcRpkBbJM8AHIrqq0iuXxrLbc6ldQ2cYQKHg9ljIpW/EZanuf6Wgm/LK1JnxXne9GUb/xPzB1EnZ95i8/u9WJa+NixEcfc3pAzDPYncIR8lishFwyBRta6BCG76U3UY2lQr3YD/48AJ49r7+WVU0gOP/h2SDSdAZHEdvkpVJ0w/xA+SevJ7Y7xA5EJ655YMQ0F8f3WUFTf1pFklE5E+fwkMVCWOPw7UMy558IcRSpdWAPPyf8sc7CpDqRk37/vXWRDa+7YBfgskK6B2eXowrzThUOBx+AmDTF3Rv8ZSr1Un0FWGi+GQ5ny7W9dJBMomzyMUbzz9stsCml5XB+6xLP2MD+9lO1bHipKS6qkhtZChE=");
|
||||||
public final static SkinData GINGERBREAD = new SkinData("eyJ0aW1lc3RhbXAiOjE0ODAxOTk5MjM0NTUsInByb2ZpbGVJZCI6IjRjOGQ1NjllZWZlMTRkOGE4YzJmMmM4ODA3ODA3ODRmIiwicHJvZmlsZU5hbWUiOiJHaW5nZXJicmVhZE1hbiIsInNpZ25hdHVyZVJlcXVpcmVkIjp0cnVlLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzAyM2IxZGQ5MWQyYjM2Y2FkZTU2NjVjM2Y3ODk3ZmNiOGRlMWFlNjE5YTRlOTYxODU2MzdiMTliZGNmZjQ3In19fQ==", "lND5lQCzd5DKdn+ps82zn55hrSDr12bBLFoSbxetOj7MaYAuHCkJPQQOXdcMh3TLLSgxmQzEWkIHSUo760/2Qfd2uDDOTVfZZqiFjiOwDQ7YQjkokqNaC3U9gEq+LBJ+IgEkwaCsluXYMIK0Wvqx1DFa82pg8bSYGczJfTw/1kQsUUTpmao6ChZw3yrHTPow38onD95f9i6yVcnhSpPfM/JTQuL4N6Jdcql6VRJNSvCHJvEgh6R2p0w7DJhEGIzkFaF3lPdBqw+Mm97fBPvznscd4s6gpH07gUl/T+vlyHyRBLm85Pgm70r4MQ+c/nGOQOXzFMNpO8RIot/uhd7t3bvSi6yFzZQm7P9QLCLm/0C84x0sCugjeN/hVA347FWnuRPcya5xPzlpTWAW7pCjheAz0mvnPUMYT6Wp4CJx6bPdePnaiLFSeK8EyQIU9IUQJgXqMA3cOwqMBdh/0r71fTInPdgXsVxabmGbCgIuK3A2hSgxpcZv9412T0NIJYSTi0s2B3dyAaZJrdF5wa1hIr8au63SWFJww3GEEOF5YObEyVvKj2yS40iaHaRrfn1DeALT0eD0oN1zzK66FKbFuDmZmm4Thel9gKt+QcnR2uHlFLEBUogpIXyeC8zca7SOppANloOpO4mBbf22dXBJogenVd425JWaXOHJ6NVqIBw=");
|
public final static SkinData GINGERBREAD = new SkinData("eyJ0aW1lc3RhbXAiOjE0ODAxOTk5MjM0NTUsInByb2ZpbGVJZCI6IjRjOGQ1NjllZWZlMTRkOGE4YzJmMmM4ODA3ODA3ODRmIiwicHJvZmlsZU5hbWUiOiJHaW5nZXJicmVhZE1hbiIsInNpZ25hdHVyZVJlcXVpcmVkIjp0cnVlLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzAyM2IxZGQ5MWQyYjM2Y2FkZTU2NjVjM2Y3ODk3ZmNiOGRlMWFlNjE5YTRlOTYxODU2MzdiMTliZGNmZjQ3In19fQ==", "lND5lQCzd5DKdn+ps82zn55hrSDr12bBLFoSbxetOj7MaYAuHCkJPQQOXdcMh3TLLSgxmQzEWkIHSUo760/2Qfd2uDDOTVfZZqiFjiOwDQ7YQjkokqNaC3U9gEq+LBJ+IgEkwaCsluXYMIK0Wvqx1DFa82pg8bSYGczJfTw/1kQsUUTpmao6ChZw3yrHTPow38onD95f9i6yVcnhSpPfM/JTQuL4N6Jdcql6VRJNSvCHJvEgh6R2p0w7DJhEGIzkFaF3lPdBqw+Mm97fBPvznscd4s6gpH07gUl/T+vlyHyRBLm85Pgm70r4MQ+c/nGOQOXzFMNpO8RIot/uhd7t3bvSi6yFzZQm7P9QLCLm/0C84x0sCugjeN/hVA347FWnuRPcya5xPzlpTWAW7pCjheAz0mvnPUMYT6Wp4CJx6bPdePnaiLFSeK8EyQIU9IUQJgXqMA3cOwqMBdh/0r71fTInPdgXsVxabmGbCgIuK3A2hSgxpcZv9412T0NIJYSTi0s2B3dyAaZJrdF5wa1hIr8au63SWFJww3GEEOF5YObEyVvKj2yS40iaHaRrfn1DeALT0eD0oN1zzK66FKbFuDmZmm4Thel9gKt+QcnR2uHlFLEBUogpIXyeC8zca7SOppANloOpO4mBbf22dXBJogenVd425JWaXOHJ6NVqIBw=");
|
||||||
|
public final static SkinData LOVE_DOCTOR = new SkinData("eyJ0aW1lc3RhbXAiOjE0ODQ0MzM1MjQxMjAsInByb2ZpbGVJZCI6IjlmY2FlZDhiMTRiNTRmN2ZhNjRjYjYwNDBlNzA1MjcyIiwicHJvZmlsZU5hbWUiOiJMQ2FzdHIxIiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS9iY2RiZTM2OTM1NGZjMzUxY2RhNGRmY2Y2OWM0MzY3ODcwYjI4ZWE3NDUzYWVjM2IzMjgyM2YyMWMzNTJlNTUifX19", "KD0NsKFlS+9/JpPQdT0Lq2jo942WeHpFevJPR3T9JO/5NVmNprupsWuTgepw14iHoax8/xyP8S4XksYq8hJ30e+gRKXVReqtq4l8JetXJILI7JTL6EHj/Flg4t0O6ASIm3Hr+w86IKrPb0NwHTjHJHvbf0r7k3E/TMLbq0/c7Xgi+JgC0uQd+wIPZhQe92P3O7eGH858X0vsxG0FVzgnEAlHVLmqBCwqxMU5CsBp0JCTVIbtp+JNmveCsfLagP6mi39rUudbueXJQgqLv7H7Zw+ZNINLLaKPNVO6Od8sX3c+CSUQ+Bm9bakYr628k/z0krTdNpLG7OGXWoT3XShW6HXB/z7o7hpuDXJW7HdyvmWv9GVyWLm2USNe7/3Ugs2zWZI1f+t6t+V3EVr3T+nR4zpY/ISdlTsLtV/Daebr0v/V0YlaM0UaASzz16ob3p1cfao7C7BZwKqOBKoSyHpnuLhd70wOtNrhhPDU9dWQBC/l6uojcMJ9lQMsxFmHj4JFqJYl7p/UXnq1vnYBo1P3A//IGl4gL1Hv8U0I14LT77/AMYH57mItgD0/VnE4bvPIFML/4cX7L9qpdLoOAAyfa5P9cAfzhUnVnRRLM016MpGtvY8SfbZ68Of1Xjz/dZ9/fBEcObXPHGX2QNuJRFiWJjRVKjO7ok0qfiVUEmuZr6I=");
|
||||||
|
|
||||||
// Comments this out for now, so it doesn't load the player profile
|
// Comments this out for now, so it doesn't load the player profile
|
||||||
// A better way to do this would check for the properties when getting the skull or the skin
|
// A better way to do this would check for the properties when getting the skull or the skin
|
||||||
|
@ -97,6 +97,10 @@ public class UtilShapes
|
|||||||
|
|
||||||
public static BlockFace getFacing(float yaw)
|
public static BlockFace getFacing(float yaw)
|
||||||
{
|
{
|
||||||
|
while (yaw < 0)
|
||||||
|
{
|
||||||
|
yaw += 360;
|
||||||
|
}
|
||||||
return radial[Math.round(yaw / 45f) % 8];
|
return radial[Math.round(yaw / 45f) % 8];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package mineplex.core.common.util.particles;
|
package mineplex.core.common.util.particles;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
import java.awt.Color;
|
||||||
|
|
||||||
public class DustSpellColor extends ParticleColor
|
public class DustSpellColor extends ParticleColor
|
||||||
{
|
{
|
||||||
|
@ -13,6 +13,7 @@ import mineplex.core.common.util.F;
|
|||||||
import mineplex.core.common.util.UUIDFetcher;
|
import mineplex.core.common.util.UUIDFetcher;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.serverdata.commands.UpdateRankCommand;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@ -55,6 +56,11 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
|||||||
|
|
||||||
final Rank rank = tempRank;
|
final Rank rank = tempRank;
|
||||||
|
|
||||||
|
Plugin.runAsync(() ->
|
||||||
|
{
|
||||||
|
new UpdateRankCommand(caller.getName(), caller.getUniqueId().toString(), playerName, rank.name()).publish();
|
||||||
|
});
|
||||||
|
|
||||||
Plugin.getRepository().matchPlayerName(new Callback<List<String>>()
|
Plugin.getRepository().matchPlayerName(new Callback<List<String>>()
|
||||||
{
|
{
|
||||||
public void run(List<String> matches)
|
public void run(List<String> matches)
|
||||||
|
@ -149,6 +149,8 @@ public class AntiHack extends MiniPlugin
|
|||||||
private HashSet<Class<? extends Check>> _ignoredChecks = new HashSet<>();
|
private HashSet<Class<? extends Check>> _ignoredChecks = new HashSet<>();
|
||||||
private boolean _strict;
|
private boolean _strict;
|
||||||
|
|
||||||
|
private BanWaveManager _banWaveManager;
|
||||||
|
|
||||||
private AntiHack()
|
private AntiHack()
|
||||||
{
|
{
|
||||||
super("AntiHack");
|
super("AntiHack");
|
||||||
@ -156,7 +158,7 @@ public class AntiHack extends MiniPlugin
|
|||||||
_detailedMessages.add("Spoobncoobr");
|
_detailedMessages.add("Spoobncoobr");
|
||||||
|
|
||||||
require(GuardianManager.class);
|
require(GuardianManager.class);
|
||||||
require(BanWaveManager.class);
|
_banWaveManager = require(BanWaveManager.class);
|
||||||
|
|
||||||
Bukkit.getServicesManager().register(MineplexLink.class, new MineplexLinkImpl(), this._plugin, ServicePriority.Normal);
|
Bukkit.getServicesManager().register(MineplexLink.class, new MineplexLinkImpl(), this._plugin, ServicePriority.Normal);
|
||||||
|
|
||||||
@ -207,47 +209,47 @@ public class AntiHack extends MiniPlugin
|
|||||||
{
|
{
|
||||||
CoreClient coreClient = _clientManager.Get(player);
|
CoreClient coreClient = _clientManager.Get(player);
|
||||||
|
|
||||||
Consumer<Consumer<PunishmentResponse>> doPunish = after ->
|
String id = generateId();
|
||||||
{
|
String finalMessage = "[GWEN] " + id;
|
||||||
JsonObject custom = new JsonObject();
|
JsonObject custom = new JsonObject();
|
||||||
custom.addProperty("ban-reason", CheckManager.getCheckSimpleName(cause));
|
custom.addProperty("ban-reason", CheckManager.getCheckSimpleName(cause));
|
||||||
|
|
||||||
String id = generateId();
|
_logger.saveMetadata(player, id, () ->
|
||||||
String finalMessage = "[GWEN] " + id;
|
{
|
||||||
_logger.saveMetadata(player, id, () ->
|
Consumer<Consumer<PunishmentResponse>> doPunish = after ->
|
||||||
{
|
{
|
||||||
runAsync(() ->
|
runAsync(() ->
|
||||||
{
|
|
||||||
GwenBanNotification notification = new GwenBanNotification(_thisServer, player.getName(), player.getUniqueId().toString(), CheckManager.getCheckSimpleName(cause), id);
|
|
||||||
ServerCommandManager.getInstance().publishCommand(notification);
|
|
||||||
});
|
|
||||||
|
|
||||||
_punish.AddPunishment(coreClient.getName(), Category.Hacking, finalMessage, AntiHack.NAME, 3, true, -1, true, after);
|
|
||||||
}, custom);
|
|
||||||
};
|
|
||||||
|
|
||||||
if (coreClient.GetRank().has(Rank.TWITCH))
|
|
||||||
{
|
|
||||||
doPunish.accept(result ->
|
|
||||||
{
|
|
||||||
_pendingBan.remove(player);
|
|
||||||
_banned.add(player.getUniqueId());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
runBanAnimation(player, () ->
|
|
||||||
doPunish.accept(result ->
|
|
||||||
{
|
{
|
||||||
if (result == PunishmentResponse.Punished)
|
new GwenBanNotification(_thisServer, player.getName(), player.getUniqueId().toString(), coreClient.GetRank().name(), CheckManager.getCheckSimpleName(cause), id).publish();
|
||||||
|
});
|
||||||
|
|
||||||
|
_punish.AddPunishment(coreClient.getName(), Category.Hacking, finalMessage, AntiHack.NAME, 3, true, -1, true, after);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (coreClient.GetRank().has(Rank.TWITCH))
|
||||||
|
{
|
||||||
|
doPunish.accept(result ->
|
||||||
|
{
|
||||||
|
_pendingBan.remove(player);
|
||||||
|
_banned.add(player.getUniqueId());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
runBanAnimation(player, () ->
|
||||||
|
doPunish.accept(result ->
|
||||||
{
|
{
|
||||||
announceBan(player);
|
if (result == PunishmentResponse.Punished)
|
||||||
_banned.add(player.getUniqueId());
|
{
|
||||||
}
|
announceBan(player);
|
||||||
_pendingBan.remove(player);
|
_banned.add(player.getUniqueId());
|
||||||
})
|
_banWaveManager.flagDone(coreClient);
|
||||||
);
|
}
|
||||||
}
|
_pendingBan.remove(player);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}, custom);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -68,8 +68,7 @@ public class BanWaveManager extends MiniPlugin
|
|||||||
{
|
{
|
||||||
runAsync(() ->
|
runAsync(() ->
|
||||||
{
|
{
|
||||||
GwenBanwaveNotification notification = new GwenBanwaveNotification(UtilServer.getServerName(), player.getName(), player.getUniqueId().toString(), CheckManager.getCheckSimpleName(checkClass), id, timeToBan);
|
new GwenBanwaveNotification(UtilServer.getServerName(), player.getName(), player.getUniqueId().toString(), client.GetRank().name(), CheckManager.getCheckSimpleName(checkClass), id, timeToBan).publish();
|
||||||
ServerCommandManager.getInstance().publishCommand(notification);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
JsonObject custom = new JsonObject();
|
JsonObject custom = new JsonObject();
|
||||||
@ -79,4 +78,9 @@ public class BanWaveManager extends MiniPlugin
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void flagDone(CoreClient client)
|
||||||
|
{
|
||||||
|
_repository.flagDone(client.getAccountId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,12 @@ public class BanWaveRepository extends RepositoryBase
|
|||||||
|
|
||||||
void flagDone(BanWaveInfo info)
|
void flagDone(BanWaveInfo info)
|
||||||
{
|
{
|
||||||
executeUpdate(PROCESS_WAVE_FOR_ACCOUNT, new ColumnInt("id", info.getAccountId()));
|
flagDone(info.getAccountId());
|
||||||
executeUpdate(DELETE_PENDING, new ColumnInt("id", info.getAccountId()));
|
}
|
||||||
|
|
||||||
|
public void flagDone(int accountId)
|
||||||
|
{
|
||||||
|
executeUpdate(PROCESS_WAVE_FOR_ACCOUNT, new ColumnInt("id", accountId));
|
||||||
|
executeUpdate(DELETE_PENDING, new ColumnInt("id", accountId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import java.sql.Connection;
|
|||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilTasks;
|
||||||
import mineplex.core.database.MinecraftRepository;
|
import mineplex.core.database.MinecraftRepository;
|
||||||
import mineplex.serverdata.database.DBPool;
|
import mineplex.serverdata.database.DBPool;
|
||||||
import mineplex.serverdata.database.RepositoryBase;
|
import mineplex.serverdata.database.RepositoryBase;
|
||||||
@ -39,7 +40,9 @@ public class AnticheatDatabase extends RepositoryBase
|
|||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
if (after != null)
|
if (after != null)
|
||||||
after.run();
|
{
|
||||||
|
UtilTasks.onMainThread(after).run();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,14 +7,16 @@ public class GwenBanNotification extends ServerCommand
|
|||||||
private final String _serverName;
|
private final String _serverName;
|
||||||
private final String _playerName;
|
private final String _playerName;
|
||||||
private final String _playerUUID;
|
private final String _playerUUID;
|
||||||
|
private final String _playerRank;
|
||||||
private final String _hackType;
|
private final String _hackType;
|
||||||
private final String _metadataId;
|
private final String _metadataId;
|
||||||
|
|
||||||
public GwenBanNotification(String serverName, String playerName, String playerUUID, String hackType, String metadataId)
|
public GwenBanNotification(String serverName, String playerName, String playerUUID, String playerRank, String hackType, String metadataId)
|
||||||
{
|
{
|
||||||
_serverName = serverName;
|
_serverName = serverName;
|
||||||
_playerName = playerName;
|
_playerName = playerName;
|
||||||
_playerUUID = playerUUID;
|
_playerUUID = playerUUID;
|
||||||
|
_playerRank = playerRank;
|
||||||
_hackType = hackType;
|
_hackType = hackType;
|
||||||
_metadataId = metadataId;
|
_metadataId = metadataId;
|
||||||
}
|
}
|
||||||
|
@ -7,15 +7,17 @@ public class GwenBanwaveNotification extends ServerCommand
|
|||||||
private final String _serverName;
|
private final String _serverName;
|
||||||
private final String _playerName;
|
private final String _playerName;
|
||||||
private final String _playerUUID;
|
private final String _playerUUID;
|
||||||
|
private final String _playerRank;
|
||||||
private final String _hackType;
|
private final String _hackType;
|
||||||
private final String _metadataId;
|
private final String _metadataId;
|
||||||
private final long _timeToBan;
|
private final long _timeToBan;
|
||||||
|
|
||||||
public GwenBanwaveNotification(String serverName, String playerName, String playerUUID, String hackType, String metadataId, long timeToBan)
|
public GwenBanwaveNotification(String serverName, String playerName, String playerUUID, String playerRank, String hackType, String metadataId, long timeToBan)
|
||||||
{
|
{
|
||||||
_serverName = serverName;
|
_serverName = serverName;
|
||||||
_playerName = playerName;
|
_playerName = playerName;
|
||||||
_playerUUID = playerUUID;
|
_playerUUID = playerUUID;
|
||||||
|
_playerRank = playerRank;
|
||||||
_hackType = hackType;
|
_hackType = hackType;
|
||||||
_metadataId = metadataId;
|
_metadataId = metadataId;
|
||||||
_timeToBan = timeToBan;
|
_timeToBan = timeToBan;
|
||||||
|
@ -152,7 +152,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
|||||||
System.out.print("GM NULL");
|
System.out.print("GM NULL");
|
||||||
}
|
}
|
||||||
|
|
||||||
_rewardManager = new RewardManager(_clientManager, _donationManager, _inventoryManager, petManager, statsManager, gadgetManager);
|
_rewardManager = new RewardManager(_clientManager, _donationManager, _inventoryManager, petManager, gadgetManager);
|
||||||
|
|
||||||
_pollManager = pollManager;
|
_pollManager = pollManager;
|
||||||
_statsManager = statsManager;
|
_statsManager = statsManager;
|
||||||
|
@ -170,6 +170,11 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
itemLore.add(C.cBlack);
|
itemLore.add(C.cBlack);
|
||||||
itemLore.add(C.cBlue + "Found in Gingerbread Chests");
|
itemLore.add(C.cBlue + "Found in Gingerbread Chests");
|
||||||
}
|
}
|
||||||
|
else if (gadget.getCost(GlobalCurrency.TREASURE_SHARD) == -17)
|
||||||
|
{
|
||||||
|
itemLore.add(C.cBlack);
|
||||||
|
itemLore.add(C.cBlue + "Found in Love Chests");
|
||||||
|
}
|
||||||
|
|
||||||
//Rank Unlocks
|
//Rank Unlocks
|
||||||
else if (gadget.getCost(GlobalCurrency.TREASURE_SHARD) == -10)
|
else if (gadget.getCost(GlobalCurrency.TREASURE_SHARD) == -10)
|
||||||
|
@ -21,7 +21,6 @@ import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
|||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
|
||||||
|
|
||||||
import mineplex.core.command.CommandCenter;
|
import mineplex.core.command.CommandCenter;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
@ -34,8 +33,8 @@ import mineplex.core.friend.data.FriendData;
|
|||||||
import mineplex.core.friend.data.FriendStatus;
|
import mineplex.core.friend.data.FriendStatus;
|
||||||
import mineplex.core.itemstack.ItemBuilder;
|
import mineplex.core.itemstack.ItemBuilder;
|
||||||
import mineplex.core.itemstack.ItemLayout;
|
import mineplex.core.itemstack.ItemLayout;
|
||||||
import mineplex.core.portal.Intent;
|
|
||||||
import mineplex.core.shop.item.IButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
|
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
||||||
|
|
||||||
public class FriendsGUI implements Listener
|
public class FriendsGUI implements Listener
|
||||||
{
|
{
|
||||||
@ -153,7 +152,6 @@ public class FriendsGUI implements Listener
|
|||||||
|
|
||||||
AddButton(slot, builder.build(), new IButton()
|
AddButton(slot, builder.build(), new IButton()
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(Player player, ClickType clickType)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
@ -299,11 +297,10 @@ public class FriendsGUI implements Listener
|
|||||||
|
|
||||||
AddButton(slot, builder.build(), new IButton()
|
AddButton(slot, builder.build(), new IButton()
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(Player player, ClickType clickType)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_plugin.getPortal().sendPlayerToServer(player, serverName, Intent.PLAYER_REQUEST);
|
CommandCenter.Instance.onPlayerCommandPreprocess(new PlayerCommandPreprocessEvent(player, "/server " + serverName));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -121,6 +121,7 @@ import mineplex.core.gadget.gadgets.morph.MorphCreeper;
|
|||||||
import mineplex.core.gadget.gadgets.morph.MorphDinnerbone;
|
import mineplex.core.gadget.gadgets.morph.MorphDinnerbone;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphEnderman;
|
import mineplex.core.gadget.gadgets.morph.MorphEnderman;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphGrimReaper;
|
import mineplex.core.gadget.gadgets.morph.MorphGrimReaper;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphLoveDoctor;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphMetalMan;
|
import mineplex.core.gadget.gadgets.morph.MorphMetalMan;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphPig;
|
import mineplex.core.gadget.gadgets.morph.MorphPig;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphPumpkinKing;
|
import mineplex.core.gadget.gadgets.morph.MorphPumpkinKing;
|
||||||
@ -158,6 +159,7 @@ import mineplex.core.gadget.gadgets.particle.ParticleLegend;
|
|||||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel;
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsDemons;
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsDemons;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsInfernal;
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsInfernal;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsLove;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsPixie;
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsPixie;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleYinYang;
|
import mineplex.core.gadget.gadgets.particle.ParticleYinYang;
|
||||||
import mineplex.core.gadget.gadgets.particle.candycane.ParticleCandyCane;
|
import mineplex.core.gadget.gadgets.particle.candycane.ParticleCandyCane;
|
||||||
@ -172,12 +174,14 @@ import mineplex.core.gadget.gadgets.particle.shadow.ParticleFoot;
|
|||||||
import mineplex.core.gadget.gadgets.particle.titan.ParticleTitan;
|
import mineplex.core.gadget.gadgets.particle.titan.ParticleTitan;
|
||||||
import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood;
|
import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood;
|
||||||
import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant;
|
import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant;
|
||||||
|
import mineplex.core.gadget.gadgets.taunts.BlowAKissTaunt;
|
||||||
import mineplex.core.gadget.gadgets.taunts.EternalTaunt;
|
import mineplex.core.gadget.gadgets.taunts.EternalTaunt;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectFlames;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectFlames;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectHalloween;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectHalloween;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectLavaTrap;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectLavaTrap;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectLightningStrike;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectLightningStrike;
|
||||||
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectLoveIsABattlefield;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectMrPunchMan;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectMrPunchMan;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectPodium;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectPodium;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectRiseOfTheElderGuardian;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectRiseOfTheElderGuardian;
|
||||||
@ -398,6 +402,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
//addGadget(new MorphStray(this));
|
//addGadget(new MorphStray(this));
|
||||||
addGadget(new MorphSanta(this));
|
addGadget(new MorphSanta(this));
|
||||||
addGadget(new MorphDinnerbone(this));
|
addGadget(new MorphDinnerbone(this));
|
||||||
|
addGadget(new MorphLoveDoctor(this));
|
||||||
|
|
||||||
// Particles
|
// Particles
|
||||||
addGadget(new ParticleFoot(this));
|
addGadget(new ParticleFoot(this));
|
||||||
@ -422,6 +427,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new ParticleYinYang(this));
|
addGadget(new ParticleYinYang(this));
|
||||||
addGadget(new ParticleFreedom(this));
|
addGadget(new ParticleFreedom(this));
|
||||||
addGadget(new ParticleChristmasTree(this));
|
addGadget(new ParticleChristmasTree(this));
|
||||||
|
addGadget(new ParticleWingsLove(this));
|
||||||
|
|
||||||
// Arrow Trails
|
// Arrow Trails
|
||||||
addGadget(new ArrowTrailFrostLord(this));
|
addGadget(new ArrowTrailFrostLord(this));
|
||||||
@ -487,6 +493,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new WinEffectLavaTrap(this));
|
addGadget(new WinEffectLavaTrap(this));
|
||||||
addGadget(new WinEffectHalloween(this));
|
addGadget(new WinEffectHalloween(this));
|
||||||
addGadget(new WinEffectWinterWarfare(this));
|
addGadget(new WinEffectWinterWarfare(this));
|
||||||
|
addGadget(new WinEffectLoveIsABattlefield(this));
|
||||||
|
|
||||||
// Music
|
// Music
|
||||||
addGadget(new MusicGadget(this, "13 Disc", new String[] {""}, -2, 2256, 178000));
|
addGadget(new MusicGadget(this, "13 Disc", new String[] {""}, -2, 2256, 178000));
|
||||||
@ -549,6 +556,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
|
|
||||||
// TAUNTS!!!
|
// TAUNTS!!!
|
||||||
addGadget(new EternalTaunt(this));
|
addGadget(new EternalTaunt(this));
|
||||||
|
addGadget(new BlowAKissTaunt(this));
|
||||||
|
|
||||||
for (GadgetType gadgetType : GadgetType.values())
|
for (GadgetType gadgetType : GadgetType.values())
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,7 @@ public class UnlockCosmeticsCommand extends CommandBase<GadgetManager>
|
|||||||
|
|
||||||
public UnlockCosmeticsCommand(GadgetManager plugin)
|
public UnlockCosmeticsCommand(GadgetManager plugin)
|
||||||
{
|
{
|
||||||
super(plugin, Rank.JNR_DEV, "unlockCosmetics");
|
super(plugin, Rank.SNR_MODERATOR, "unlockCosmetics");
|
||||||
_plugin = plugin;
|
_plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package mineplex.core.gadget.gadgets.arrowtrail;
|
package mineplex.core.gadget.gadgets.arrowtrail;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
package mineplex.core.gadget.gadgets.arrowtrail.freedom;
|
package mineplex.core.gadget.gadgets.arrowtrail.freedom;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Color;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package mineplex.core.gadget.gadgets.doublejump;
|
package mineplex.core.gadget.gadgets.doublejump;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
@ -0,0 +1,93 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.morph;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.PlayerToggleSneakEvent;
|
||||||
|
|
||||||
|
import com.mojang.authlib.GameProfile;
|
||||||
|
|
||||||
|
import mineplex.core.common.skin.SkinData;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.LineFormat;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
|
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.event.GadgetSelectLocationEvent;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.managers.UtilMorph;
|
||||||
|
import mineplex.core.gadget.types.MorphGadget;
|
||||||
|
import mineplex.core.particleeffects.LoveDoctorEffect;
|
||||||
|
import mineplex.core.recharge.Recharge;
|
||||||
|
import mineplex.core.utils.UtilGameProfile;
|
||||||
|
|
||||||
|
public class MorphLoveDoctor extends MorphGadget
|
||||||
|
{
|
||||||
|
|
||||||
|
public MorphLoveDoctor(GadgetManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Love Doctor", UtilText.splitLinesToArray(new String[]{C.cGray + "The Doctor is in! Sneak to diagnose players with cooties!"}, LineFormat.LORE),
|
||||||
|
-17, Material.GLASS, (byte) 0);
|
||||||
|
setDisplayItem(SkinData.LOVE_DOCTOR.getSkull());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enableCustom(Player player, boolean message)
|
||||||
|
{
|
||||||
|
applyArmor(player, message);
|
||||||
|
|
||||||
|
GameProfile gameProfile = UtilGameProfile.getGameProfile(player);
|
||||||
|
gameProfile.getProperties().clear();
|
||||||
|
gameProfile.getProperties().put("textures", SkinData.LOVE_DOCTOR.getProperty());
|
||||||
|
|
||||||
|
DisguisePlayer disguisePlayer = new DisguisePlayer(player, gameProfile);
|
||||||
|
disguisePlayer.showInTabList(true, 0);
|
||||||
|
UtilMorph.disguise(player, disguisePlayer, Manager);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disableCustom(Player player, boolean message)
|
||||||
|
{
|
||||||
|
removeArmor(player);
|
||||||
|
|
||||||
|
UtilMorph.undisguise(player, Manager.getDisguiseManager());
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onSneak(PlayerToggleSneakEvent event)
|
||||||
|
{
|
||||||
|
if (!isActive(event.getPlayer()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
if (!Recharge.Instance.use(player, "Love Doctor Laser", 5000, true, false, "Cosmetics"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
HashSet<Material> ignore = new HashSet<Material>();
|
||||||
|
ignore.add(Material.AIR);
|
||||||
|
Location loc = player.getTargetBlock(ignore, 64).getLocation().add(0.5, 0.5, 0.5);
|
||||||
|
|
||||||
|
GadgetSelectLocationEvent gadgetSelectLocationEvent = new GadgetSelectLocationEvent(player, this, loc);
|
||||||
|
Bukkit.getServer().getPluginManager().callEvent(gadgetSelectLocationEvent);
|
||||||
|
|
||||||
|
// Checks to see if it's a valid location
|
||||||
|
if (gadgetSelectLocationEvent.isCancelled())
|
||||||
|
{
|
||||||
|
if (gadgetSelectLocationEvent.canShowMessage())
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, F.main("Gadget", "You cannot use the laser on this area!"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
LoveDoctorEffect loveDoctorEffect = new LoveDoctorEffect(player, loc, this);
|
||||||
|
loveDoctorEffect.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.particle;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.potion.PotionType;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.common.shape.ShapeWings;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.LineFormat;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.types.ParticleGadget;
|
||||||
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
|
public class ParticleWingsLove extends ParticleGadget
|
||||||
|
{
|
||||||
|
|
||||||
|
private ShapeWings _wings = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, false, ShapeWings.DEFAULT_ROTATION, ShapeWings.HEART_WING_PATTERN);
|
||||||
|
private ShapeWings _wingsWhite = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '%', ShapeWings.DEFAULT_ROTATION, ShapeWings.HEART_WING_PATTERN);
|
||||||
|
private ShapeWings _wingsEdge = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, true, ShapeWings.DEFAULT_ROTATION, ShapeWings.HEART_WING_PATTERN);
|
||||||
|
|
||||||
|
public ParticleWingsLove(GadgetManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Love Wings",
|
||||||
|
UtilText.splitLineToArray(C.cGray + "Sometimes Love just makes you want to fly.", LineFormat.LORE),
|
||||||
|
-17, Material.NETHER_STAR, (byte) 0);
|
||||||
|
setDisplayItem(ItemStackFactory.Instance.createCustomPotion(PotionType.INSTANT_HEAL));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void playParticle(Player player, UpdateEvent event)
|
||||||
|
{
|
||||||
|
Location loc = player.getLocation().add(0, 1.2, 0).add(player.getLocation().getDirection().multiply(-0.2));
|
||||||
|
if (Manager.isMoving(player))
|
||||||
|
{
|
||||||
|
if (event.getType() == UpdateType.TICK)
|
||||||
|
{
|
||||||
|
_wings.displayColoredParticle(loc, Color.PINK);
|
||||||
|
_wingsWhite.displayColoredParticle(loc, Color.WHITE);
|
||||||
|
_wingsEdge.displayColoredParticle(loc, Color.BLACK);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getType() == UpdateType.FAST)
|
||||||
|
{
|
||||||
|
_wings.displayColored(loc, Color.PINK);
|
||||||
|
_wingsWhite.displayColored(loc, Color.WHITE);
|
||||||
|
_wingsEdge.displayColored(loc, Color.BLACK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.taunts;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.potion.PotionType;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.LineFormat;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.types.TauntGadget;
|
||||||
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
|
import mineplex.core.particleeffects.BlowAKissEffect;
|
||||||
|
import mineplex.core.recharge.Recharge;
|
||||||
|
|
||||||
|
public class BlowAKissTaunt extends TauntGadget
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final int COOLDOWN = 30000;
|
||||||
|
private static final int PVP_COOLDOWN = 10000;
|
||||||
|
|
||||||
|
public BlowAKissTaunt(GadgetManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Blow A Kiss", UtilText.splitLinesToArray(new String[]{
|
||||||
|
C.cWhite + "Type /taunt in game to blow a kiss at your enemies.",
|
||||||
|
C.cRed + "Cannot be used while in PvP!"}, LineFormat.LORE),
|
||||||
|
-17, Material.GLASS, (byte) 0);
|
||||||
|
setDisplayItem(ItemStackFactory.Instance.createCustomPotion(PotionType.INSTANT_HEAL));
|
||||||
|
setCanPlayWithPvp(false);
|
||||||
|
setPvpCooldown(PVP_COOLDOWN);
|
||||||
|
setShouldPlay(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart(Player player)
|
||||||
|
{
|
||||||
|
if (!Recharge.Instance.use(player, getName(), COOLDOWN, true, false, "Cosmetics"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
HashSet<Material> ignore = new HashSet<>();
|
||||||
|
ignore.add(Material.AIR);
|
||||||
|
Location loc = player.getTargetBlock(ignore, 64).getLocation().add(0.5, 0.5, 0.5);
|
||||||
|
|
||||||
|
BlowAKissEffect blowAKissEffect = new BlowAKissEffect(player, loc, this);
|
||||||
|
blowAKissEffect.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPlay(Player player)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinish(Player player)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
package mineplex.core.gadget.gadgets.taunts;
|
package mineplex.core.gadget.gadgets.taunts;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -151,3 +152,152 @@ public class EternalTaunt extends TauntGadget
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
package mineplex.core.gadget.gadgets.taunts;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Color;
|
||||||
|
import org.bukkit.FireworkEffect;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Item;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.common.Rank;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.LineFormat;
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilFirework;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseSkeleton;
|
||||||
|
import mineplex.core.events.EnableArcadeSpawnEvent;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.managers.UtilMorph;
|
||||||
|
import mineplex.core.gadget.types.TauntGadget;
|
||||||
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
|
import mineplex.core.recharge.Recharge;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
|
||||||
|
public class EternalTaunt extends TauntGadget
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final int COOLDOWN = 30000;
|
||||||
|
private static final int PVP_COOLDOWN = 10000;
|
||||||
|
|
||||||
|
private Map<UUID, List<Item>> _clocks = new HashMap<>();
|
||||||
|
|
||||||
|
public EternalTaunt(GadgetManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Eternal Taunt", UtilText.splitLinesToArray(new String[]{C.cGray + "Although the Eternal has been around forever, he waited too long for a worthy opponent and he turned to bones.",
|
||||||
|
"",
|
||||||
|
C.cWhite + "Use /taunt in game to show how long you've been waiting.",
|
||||||
|
C.cRed + "Cannot be used while in PvP!"}, LineFormat.LORE),
|
||||||
|
-15, Material.WATCH, (byte) 0);
|
||||||
|
setCanPlayWithPvp(false);
|
||||||
|
setPvpCooldown(PVP_COOLDOWN);
|
||||||
|
setShouldPlay(true);
|
||||||
|
setEventType(UpdateType.FAST);
|
||||||
|
addDisabledGames(GameType.SMASH, GameType.SMASHTEAMS, GameType.SMASHDOMINATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart(Player player)
|
||||||
|
{
|
||||||
|
if (!Recharge.Instance.use(player, getName(), COOLDOWN, true, false, "Cosmetics"))
|
||||||
|
return;
|
||||||
|
UtilFirework.playFirework(player.getLocation(), FireworkEffect.builder().with(FireworkEffect.Type.BALL_LARGE).withColor(Color.fromRGB(255, 175, 175)).withFade(Color.RED).build());
|
||||||
|
|
||||||
|
_clocks.put(player.getUniqueId(), new ArrayList<>());
|
||||||
|
|
||||||
|
Bukkit.broadcastMessage(F.main("Taunt", F.name(player.getName()) + " waited so long they turned to bones."));
|
||||||
|
|
||||||
|
DisguiseSkeleton disguiseSkeleton = new DisguiseSkeleton(player);
|
||||||
|
UtilMorph.disguise(player, disguiseSkeleton, Manager);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPlay(Player player)
|
||||||
|
{
|
||||||
|
if (!_clocks.containsKey(player.getUniqueId()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
int i = getPlayerTicks(player);
|
||||||
|
|
||||||
|
EnableArcadeSpawnEvent enableArcadeSpawnEvent = new EnableArcadeSpawnEvent(true);
|
||||||
|
Bukkit.getPluginManager().callEvent(enableArcadeSpawnEvent);
|
||||||
|
|
||||||
|
Item clock = player.getWorld().dropItem(player.getLocation().add(0.5, 1.5, 0.5),
|
||||||
|
ItemStackFactory.Instance.CreateStack(Material.WATCH, (byte) 0, 1, " " + i));
|
||||||
|
|
||||||
|
enableArcadeSpawnEvent = new EnableArcadeSpawnEvent(false);
|
||||||
|
Bukkit.getPluginManager().callEvent(enableArcadeSpawnEvent);
|
||||||
|
|
||||||
|
Vector vel = new Vector(Math.sin(i * 9/5d), 0, Math.cos(i * 9/5d));
|
||||||
|
UtilAction.velocity(clock, vel, Math.abs(Math.sin(i * 12/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i * 12/3000d))*0.6, 1, false);
|
||||||
|
|
||||||
|
_clocks.get(player.getUniqueId()).add(clock);
|
||||||
|
|
||||||
|
if (_clocks.get(player.getUniqueId()).size() >= 5)
|
||||||
|
{
|
||||||
|
_clocks.get(player.getUniqueId()).get(0).remove();
|
||||||
|
_clocks.get(player.getUniqueId()).remove(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i % 2 == 0)
|
||||||
|
player.playSound(player.getLocation(), Sound.CLICK, 1f, 1f);
|
||||||
|
else
|
||||||
|
player.playSound(player.getLocation(), Sound.CLICK, 0.5f, 0.5f);
|
||||||
|
|
||||||
|
if (i >= 15)
|
||||||
|
{
|
||||||
|
finish(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinish(Player player)
|
||||||
|
{
|
||||||
|
UtilMorph.undisguise(player, Manager.getDisguiseManager());
|
||||||
|
if (_clocks.containsKey(player.getUniqueId()))
|
||||||
|
{
|
||||||
|
_clocks.get(player.getUniqueId()).forEach(c -> c.remove());
|
||||||
|
_clocks.get(player.getUniqueId()).clear();
|
||||||
|
_clocks.remove(player.getUniqueId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void titanOwner(PlayerJoinEvent event)
|
||||||
|
{
|
||||||
|
if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.ETERNAL))
|
||||||
|
{
|
||||||
|
Manager.getDonationManager().Get(event.getPlayer()).addOwnedUnknownSalesPackage(getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onClockPickup(PlayerPickupItemEvent event)
|
||||||
|
{
|
||||||
|
for (List<Item> clocks : _clocks.values())
|
||||||
|
{
|
||||||
|
for (Item item : clocks)
|
||||||
|
{
|
||||||
|
if (event.getItem().equals(item))
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
>>>>>>> refs/remotes/origin/develop
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package mineplex.core.gadget.gadgets.wineffect;
|
package mineplex.core.gadget.gadgets.wineffect;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
@ -26,8 +26,8 @@ import mineplex.core.common.util.particles.ColoredParticle;
|
|||||||
import mineplex.core.common.util.particles.DustSpellColor;
|
import mineplex.core.common.util.particles.DustSpellColor;
|
||||||
import mineplex.core.disguise.disguises.DisguisePlayer;
|
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||||
import mineplex.core.gadget.GadgetManager;
|
import mineplex.core.gadget.GadgetManager;
|
||||||
import mineplex.core.particleeffects.BabyFireworkEffect;
|
|
||||||
import mineplex.core.gadget.types.WinEffectGadget;
|
import mineplex.core.gadget.types.WinEffectGadget;
|
||||||
|
import mineplex.core.particleeffects.BabyFireworkEffect;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.core.utils.UtilVariant;
|
import mineplex.core.utils.UtilVariant;
|
||||||
|
@ -0,0 +1,136 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.wineffect;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.common.animation.AnimationPoint;
|
||||||
|
import mineplex.core.common.animation.AnimatorEntity;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.LineFormat;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilShapes;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
|
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.types.WinEffectGadget;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
|
public class WinEffectLoveIsABattlefield extends WinEffectGadget
|
||||||
|
{
|
||||||
|
|
||||||
|
private DisguisePlayer _npc;
|
||||||
|
private int _ticks = 0;
|
||||||
|
private List<ArmorStand> _nonTeamArmorStands = new ArrayList<>();
|
||||||
|
|
||||||
|
public WinEffectLoveIsABattlefield(GadgetManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Love is a Battlefield", UtilText.splitLineToArray(C.cGray + "Don't hate the players. Hate the game.", LineFormat.LORE),
|
||||||
|
-17, Material.WOOL, (byte) 6);
|
||||||
|
_schematicName = "WinRoomLove";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void teleport()
|
||||||
|
{
|
||||||
|
Location loc = getBaseLocation().add(getBaseLocation().getDirection().normalize().multiply(17)).add(0, 3, 0);
|
||||||
|
loc.setDirection(getBaseLocation().clone().subtract(loc).toVector());
|
||||||
|
super.teleport(loc);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void play()
|
||||||
|
{
|
||||||
|
_npc = getNPC(this._player, getBaseLocation());
|
||||||
|
|
||||||
|
AnimatorEntity animator = new AnimatorEntity(Manager.getPlugin(), _npc.getEntity().getBukkitEntity());
|
||||||
|
|
||||||
|
animator.addPoint(new AnimationPoint(20, new Vector(0,0,0), new Vector(-1, 0.5, 0)));
|
||||||
|
animator.addPoint(new AnimationPoint(40, new Vector(0,0,0), new Vector( 0, 0.5,-1)));
|
||||||
|
animator.addPoint(new AnimationPoint(60, new Vector(0,0,0), new Vector( 1, 0.5, 0)));
|
||||||
|
animator.addPoint(new AnimationPoint(80, new Vector(0,0,0), new Vector( 0, 0.5, 1)));
|
||||||
|
|
||||||
|
animator.setRepeat(true);
|
||||||
|
|
||||||
|
Location loc = _npc.getEntity().getBukkitEntity().getLocation();
|
||||||
|
loc.setDirection(new Vector(0, 0.5, 1));
|
||||||
|
animator.start(loc);
|
||||||
|
|
||||||
|
spawnNonTeam();
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onUpdate(UpdateEvent event)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(!isRunning()) return;
|
||||||
|
|
||||||
|
if (event.getType() == UpdateType.TICK)
|
||||||
|
{
|
||||||
|
_ticks++;
|
||||||
|
if (_ticks == 70)
|
||||||
|
knockPlayers();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(event.getType() == UpdateType.FASTER)
|
||||||
|
{
|
||||||
|
_npc.sendHit();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(event.getType() != UpdateType.FAST) return;
|
||||||
|
|
||||||
|
Location loc = getBaseLocation();
|
||||||
|
|
||||||
|
for(int i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
double r = 3;
|
||||||
|
double rad = (((Math.PI*2)/3.0)*i) + ((event.getTick()%240) * Math.PI/120.0);
|
||||||
|
double x = Math.sin(rad) * r;
|
||||||
|
double z = Math.cos(rad) * r;
|
||||||
|
|
||||||
|
Location l = loc.clone().add(x, 0, z);
|
||||||
|
UtilParticle.PlayParticle(UtilParticle.ParticleType.HEART, l, 0.75f, 0.75f, 0.75f, 0.5f, 5, UtilParticle.ViewDist.NORMAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void finish()
|
||||||
|
{
|
||||||
|
Manager.getDisguiseManager().undisguise(_npc);
|
||||||
|
_npc = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void knockPlayers()
|
||||||
|
{
|
||||||
|
for (ArmorStand armorStand : _nonTeamArmorStands)
|
||||||
|
{
|
||||||
|
armorStand.setVelocity(armorStand.getLocation().getDirection().multiply(-1).multiply(5));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void spawnNonTeam()
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
List<Location> circle = UtilShapes.getPointsInCircle(getBaseLocation(), _nonTeam.size(), 2.5);
|
||||||
|
for (Player player : _nonTeam)
|
||||||
|
{
|
||||||
|
Location loc = circle.get(i);
|
||||||
|
DisguisePlayer disguisePlayer = getNPC(player, loc);
|
||||||
|
ArmorStand armorStand = (ArmorStand) disguisePlayer.getEntity().getBukkitEntity();
|
||||||
|
Vector direction = _player.getEyeLocation().toVector().subtract(armorStand.getEyeLocation().toVector());
|
||||||
|
Location teleport = armorStand.getLocation().setDirection(direction);
|
||||||
|
armorStand.teleport(teleport);
|
||||||
|
armorStand.setGravity(true);
|
||||||
|
_nonTeamArmorStands.add(armorStand);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -184,7 +184,7 @@ public abstract class Gadget extends SalesPackageBase implements Listener
|
|||||||
|
|
||||||
public boolean ownsGadget(Player player)
|
public boolean ownsGadget(Player player)
|
||||||
{
|
{
|
||||||
if(isFree() || _free) return true;
|
if(isFree() || _free) { return true; }
|
||||||
if(Manager.getDonationManager().Get(player).ownsUnknownSalesPackage(getName())) { return true; }
|
if(Manager.getDonationManager().Get(player).ownsUnknownSalesPackage(getName())) { return true; }
|
||||||
if(Manager.getInventoryManager().Get(player).getItemCount(getName()) > 0) { return true; }
|
if(Manager.getInventoryManager().Get(player).getItemCount(getName()) > 0) { return true; }
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
package mineplex.core.gadget.types;
|
package mineplex.core.gadget.types;
|
||||||
|
|
||||||
import java.time.YearMonth;
|
import java.time.YearMonth;
|
||||||
@ -154,3 +155,167 @@ public abstract class TauntGadget extends Gadget
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
package mineplex.core.gadget.types;
|
||||||
|
|
||||||
|
import java.time.YearMonth;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.gadgets.taunts.GameType;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles Taunts
|
||||||
|
*/
|
||||||
|
public abstract class TauntGadget extends Gadget
|
||||||
|
{
|
||||||
|
|
||||||
|
/** Sets if this specific taunt can be used while in PvP */
|
||||||
|
private boolean _canPlayWithPvp = false;
|
||||||
|
/** Sets the cooldown for pvp */
|
||||||
|
private long _pvpCooldown = 0;
|
||||||
|
/** Sets if this taunt needs to run on updates */
|
||||||
|
private boolean _shouldPlay = false;
|
||||||
|
/** Sets when the taunt will run, if set above */
|
||||||
|
private UpdateType _updateType = UpdateType.TICK;
|
||||||
|
/** List of games where this item is disabled */
|
||||||
|
private List<GameType> _disabledGames = new ArrayList<>();
|
||||||
|
/** The ticks that passed since the player started the effect */
|
||||||
|
private Map<UUID, Integer> _ticksPerPlayer = new HashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param manager The normal GadgetManager
|
||||||
|
* @param name The name of the item
|
||||||
|
* @param desc The lore/description of the item
|
||||||
|
* @param cost The cost of the item
|
||||||
|
* @param mat The display material of the item
|
||||||
|
* @param data The display data of the item
|
||||||
|
* @param alternativeSalesPackageNames Possible alternative names for this package
|
||||||
|
*/
|
||||||
|
public TauntGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data,
|
||||||
|
String... alternativeSalesPackageNames)
|
||||||
|
{
|
||||||
|
super(manager, GadgetType.TAUNT, name, desc, cost, mat, data, 1, alternativeSalesPackageNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param manager The normal GadgetManager
|
||||||
|
* @param name The name of the item
|
||||||
|
* @param desc The lore/description of the item
|
||||||
|
* @param cost The cost of the item
|
||||||
|
* @param mat The display material of the item
|
||||||
|
* @param data The display data of the item
|
||||||
|
* @param yearMonth The year and month of this item, if it is a PPC item
|
||||||
|
* @param alternativeSalesPackageNames Possible alternative names for this package
|
||||||
|
*/
|
||||||
|
public TauntGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data,
|
||||||
|
YearMonth yearMonth, String... alternativeSalesPackageNames)
|
||||||
|
{
|
||||||
|
super(manager, GadgetType.TAUNT, name, desc, cost, mat, data, yearMonth, 1, alternativeSalesPackageNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disableCustom(Player player, boolean message)
|
||||||
|
{
|
||||||
|
finish(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void start(Player player)
|
||||||
|
{
|
||||||
|
onStart(player);
|
||||||
|
_ticksPerPlayer.put(player.getUniqueId(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void onStart(Player player);
|
||||||
|
|
||||||
|
public void play(Player player)
|
||||||
|
{
|
||||||
|
onPlay(player);
|
||||||
|
int ticks = getPlayerTicks(player) + 1;
|
||||||
|
_ticksPerPlayer.put(player.getUniqueId(), ticks);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void onPlay(Player player);
|
||||||
|
|
||||||
|
public void finish(Player player)
|
||||||
|
{
|
||||||
|
onFinish(player);
|
||||||
|
_ticksPerPlayer.remove(player.getUniqueId());
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void onFinish(Player player);
|
||||||
|
|
||||||
|
public void setCanPlayWithPvp(boolean canPlayWithPvp)
|
||||||
|
{
|
||||||
|
_canPlayWithPvp = canPlayWithPvp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPvpCooldown(long pvpCooldown)
|
||||||
|
{
|
||||||
|
_pvpCooldown = pvpCooldown;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShouldPlay(boolean shouldPlay)
|
||||||
|
{
|
||||||
|
_shouldPlay = shouldPlay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEventType(UpdateType updateType)
|
||||||
|
{
|
||||||
|
_updateType = updateType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addDisabledGames(GameType... disabledGames)
|
||||||
|
{
|
||||||
|
_disabledGames.addAll(Arrays.asList(disabledGames));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canPlayWithPvp()
|
||||||
|
{
|
||||||
|
return _canPlayWithPvp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isGameDisabled(GameType gameType)
|
||||||
|
{
|
||||||
|
return _disabledGames.contains(gameType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getPvpCooldown()
|
||||||
|
{
|
||||||
|
return _pvpCooldown;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPlayerTicks(Player player)
|
||||||
|
{
|
||||||
|
return (_ticksPerPlayer.containsKey(player.getUniqueId())) ? _ticksPerPlayer.get(player.getUniqueId()) : -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onUpdate(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (!_shouldPlay)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getType() != _updateType)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Player player : getActive())
|
||||||
|
{
|
||||||
|
if (_ticksPerPlayer.containsKey(player.getUniqueId()))
|
||||||
|
play(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
>>>>>>> refs/remotes/origin/develop
|
||||||
|
@ -32,6 +32,8 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.bukkit.inventory.meta.LeatherArmorMeta;
|
import org.bukkit.inventory.meta.LeatherArmorMeta;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.bukkit.potion.Potion;
|
||||||
|
import org.bukkit.potion.PotionType;
|
||||||
|
|
||||||
import mineplex.core.MiniPlugin;
|
import mineplex.core.MiniPlugin;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
@ -1092,4 +1094,28 @@ public class ItemStackFactory extends MiniPlugin
|
|||||||
stack.setItemMeta(leatherArmorMeta);
|
stack.setItemMeta(leatherArmorMeta);
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a potion item stack
|
||||||
|
* @param potionType
|
||||||
|
* @param level
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public ItemStack createCustomPotion(PotionType potionType, int level)
|
||||||
|
{
|
||||||
|
Potion potion = new Potion(potionType, level);
|
||||||
|
return potion.toItemStack(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a potion item stack
|
||||||
|
* @param potionType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public ItemStack createCustomPotion(PotionType potionType)
|
||||||
|
{
|
||||||
|
return createCustomPotion(potionType, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ import mineplex.core.mount.types.MountChicken;
|
|||||||
import mineplex.core.mount.types.MountDragon;
|
import mineplex.core.mount.types.MountDragon;
|
||||||
import mineplex.core.mount.types.MountFreedomHorse;
|
import mineplex.core.mount.types.MountFreedomHorse;
|
||||||
import mineplex.core.mount.types.MountFrost;
|
import mineplex.core.mount.types.MountFrost;
|
||||||
|
import mineplex.core.mount.types.MountLoveTrain;
|
||||||
import mineplex.core.mount.types.MountMule;
|
import mineplex.core.mount.types.MountMule;
|
||||||
import mineplex.core.mount.types.MountNightmareSteed;
|
import mineplex.core.mount.types.MountNightmareSteed;
|
||||||
import mineplex.core.mount.types.MountSlime;
|
import mineplex.core.mount.types.MountSlime;
|
||||||
@ -81,6 +82,7 @@ public class MountManager extends MiniPlugin
|
|||||||
// Hidden in this update
|
// Hidden in this update
|
||||||
_types.add(new MountChicken(this));
|
_types.add(new MountChicken(this));
|
||||||
_types.add(new MountCake(this));
|
_types.add(new MountCake(this));
|
||||||
|
_types.add(new MountLoveTrain(this));
|
||||||
//_types.add(new MountSheep(this));
|
//_types.add(new MountSheep(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,138 @@
|
|||||||
|
package mineplex.core.mount.types;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Horse;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.LineFormat;
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseBlock;
|
||||||
|
import mineplex.core.mount.HorseMount;
|
||||||
|
import mineplex.core.mount.MountManager;
|
||||||
|
import mineplex.core.mount.SingleEntityMountData;
|
||||||
|
import mineplex.core.recharge.Recharge;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
import mineplex.core.utils.UtilVariant;
|
||||||
|
|
||||||
|
public class MountLoveTrain extends HorseMount
|
||||||
|
{
|
||||||
|
|
||||||
|
public MountLoveTrain(MountManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Love Train",
|
||||||
|
UtilText.splitLinesToArray(new String[]{C.cGray + "Woo Woo! All aboard!"}, LineFormat.LORE),
|
||||||
|
Material.WOOL, (byte) 6, -17, Horse.Color.BLACK, Horse.Style.NONE, Horse.Variant.HORSE, 2.0, Material.AIR);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enableCustom(Player player)
|
||||||
|
{
|
||||||
|
player.leaveVehicle();
|
||||||
|
player.eject();
|
||||||
|
|
||||||
|
//Remove other mounts
|
||||||
|
Manager.DeregisterAll(player);
|
||||||
|
|
||||||
|
Horse horse = UtilVariant.spawnHorse(player.getLocation(), _variant);
|
||||||
|
horse.setAdult();
|
||||||
|
horse.setAgeLock(true);
|
||||||
|
horse.setColor(_color);
|
||||||
|
horse.setStyle(_style);
|
||||||
|
horse.setOwner(player);
|
||||||
|
horse.setMaxDomestication(1);
|
||||||
|
horse.setJumpStrength(_jump);
|
||||||
|
horse.setMaxHealth(20);
|
||||||
|
horse.setHealth(horse.getMaxHealth());
|
||||||
|
horse.getInventory().setSaddle(new ItemStack(Material.SADDLE));
|
||||||
|
|
||||||
|
if (horse.getVariant() == Horse.Variant.MULE)
|
||||||
|
horse.setCarryingChest(true);
|
||||||
|
|
||||||
|
if (_armor != null)
|
||||||
|
horse.getInventory().setArmor(new ItemStack(_armor));
|
||||||
|
|
||||||
|
horse.setCustomName(player.getName() + "'s " + getName());
|
||||||
|
|
||||||
|
//Inform
|
||||||
|
UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(getName()) + "."));
|
||||||
|
|
||||||
|
//Store
|
||||||
|
SingleEntityMountData<Horse> mount = new SingleEntityMountData<>(player, horse);
|
||||||
|
_active.put(player, mount);
|
||||||
|
|
||||||
|
DisguiseBlock block = new DisguiseBlock(horse, Material.BARRIER.getId(), 0);
|
||||||
|
Manager.getDisguiseManager().disguise(block);
|
||||||
|
|
||||||
|
UtilEnt.silence(horse, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void updateBounce(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Collide
|
||||||
|
for (SingleEntityMountData<Horse> loveTrainData : getActive().values())
|
||||||
|
{
|
||||||
|
Horse loveTrain = loveTrainData.getEntity();
|
||||||
|
|
||||||
|
UtilParticle.PlayParticle(UtilParticle.ParticleType.HEART, loveTrain.getLocation(), 0.25f, 0.25f, 0.25f, 0.5f, 3, UtilParticle.ViewDist.NORMAL);
|
||||||
|
|
||||||
|
if (loveTrain.getPassenger() == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!(loveTrain.getPassenger() instanceof Player))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Player player = (Player) loveTrain.getPassenger();
|
||||||
|
|
||||||
|
if (!Recharge.Instance.usable(player, getName() + " Collide"))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for (SingleEntityMountData<Horse> otherData : getActive().values())
|
||||||
|
{
|
||||||
|
Horse other = otherData.getEntity();
|
||||||
|
if (other.equals(loveTrain))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (other.getPassenger() == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!(other.getPassenger() instanceof Player))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Player otherPlayer = (Player)other.getPassenger();
|
||||||
|
|
||||||
|
if (!Recharge.Instance.usable(otherPlayer, getName() + " Collide"))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//Collide
|
||||||
|
if (UtilMath.offset(loveTrain, other) > 2)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Recharge.Instance.useForce(player, getName() + " Collide", 500);
|
||||||
|
Recharge.Instance.useForce(otherPlayer, getName() + " Collide", 500);
|
||||||
|
|
||||||
|
UtilAction.velocity(loveTrain, UtilAlg.getTrajectory(other, loveTrain), 1.2, false, 0, 0.8, 10, true);
|
||||||
|
UtilAction.velocity(other, UtilAlg.getTrajectory(loveTrain, other), 1.2, false, 0, 0.8, 10, true);
|
||||||
|
|
||||||
|
loveTrain.getWorld().playSound(loveTrain.getLocation(), Sound.SLIME_WALK, 1f, 0.75f);
|
||||||
|
other.getWorld().playSound(other.getLocation(), Sound.SLIME_WALK, 1f, 0.75f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,18 +1,10 @@
|
|||||||
package mineplex.core.mount.types;
|
package mineplex.core.mount.types;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import mineplex.core.common.util.*;
|
|
||||||
import mineplex.core.common.util.particles.ColoredParticle;
|
|
||||||
import mineplex.core.common.util.particles.DustSpellColor;
|
|
||||||
import mineplex.core.mount.HorseMount;
|
|
||||||
import mineplex.core.mount.MountManager;
|
|
||||||
import mineplex.core.mount.SingleEntityMountData;
|
|
||||||
import mineplex.core.updater.UpdateType;
|
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
|
||||||
import org.bukkit.Color;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
@ -21,6 +13,24 @@ import org.bukkit.entity.Horse;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.LineFormat;
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilBlock;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.common.util.particles.ColoredParticle;
|
||||||
|
import mineplex.core.common.util.particles.DustSpellColor;
|
||||||
|
import mineplex.core.mount.HorseMount;
|
||||||
|
import mineplex.core.mount.MountManager;
|
||||||
|
import mineplex.core.mount.SingleEntityMountData;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
public class MountNightmareSteed extends HorseMount
|
public class MountNightmareSteed extends HorseMount
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package mineplex.core.particleeffects;
|
package mineplex.core.particleeffects;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
@ -0,0 +1,85 @@
|
|||||||
|
package mineplex.core.particleeffects;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.gadget.types.Gadget;
|
||||||
|
|
||||||
|
public class BlowAKissEffect extends Effect
|
||||||
|
{
|
||||||
|
|
||||||
|
private int _particles = 100;
|
||||||
|
private int _count = 0;
|
||||||
|
private Vector _vector;
|
||||||
|
private Location _fixedLoc;
|
||||||
|
private Gadget _gadget;
|
||||||
|
private Player _player;
|
||||||
|
|
||||||
|
public BlowAKissEffect(Player player, Location target, Gadget gadget)
|
||||||
|
{
|
||||||
|
super(-1, new EffectLocation(player), gadget.Manager.getPlugin());
|
||||||
|
_gadget = gadget;
|
||||||
|
_player = player;
|
||||||
|
setTargetLocation(new EffectLocation(target));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart()
|
||||||
|
{
|
||||||
|
_player.getWorld().playSound(_player.getLocation(), Sound.PISTON_RETRACT, 1f, 1f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runEffect()
|
||||||
|
{
|
||||||
|
Location location = _effectLocation.getFixedLocation().clone().add(0, 1, 0);
|
||||||
|
if (_vector == null)
|
||||||
|
{
|
||||||
|
Location targetLoc = getTargetLocation().getFixedLocation().clone();
|
||||||
|
Vector link = targetLoc.toVector().subtract(location.toVector());
|
||||||
|
float length = (float) link.length();
|
||||||
|
link.normalize();
|
||||||
|
_vector = link.multiply(length / _particles);
|
||||||
|
_fixedLoc = location.clone().subtract(_vector);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 5; i++){
|
||||||
|
_fixedLoc.add(_vector);
|
||||||
|
UtilParticle.PlayParticle(UtilParticle.ParticleType.HEART, _fixedLoc, 0, 0, 0, 0, 2, UtilParticle.ViewDist.LONG);
|
||||||
|
}
|
||||||
|
if (checkPlayer())
|
||||||
|
{
|
||||||
|
stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (_fixedLoc.getBlock().getType() != Material.AIR || _count >= 1000)
|
||||||
|
{
|
||||||
|
UtilServer.broadcast(F.main("Blow A Kiss", F.name(_player.getName()) + " wanted to kiss someone but no one was around!"));
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
_count += 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean checkPlayer()
|
||||||
|
{
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
|
{
|
||||||
|
if (player.equals(_player))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (player.getLocation().distanceSquared(_fixedLoc) <= 2.25)
|
||||||
|
{
|
||||||
|
UtilParticle.PlayParticle(UtilParticle.ParticleType.HEART, player.getLocation(), 0.25f, 0.25f, 0.25f, 0.5f, 7, UtilParticle.ViewDist.NORMAL);
|
||||||
|
UtilServer.broadcast(F.main("Blow A Kiss", F.name(_player.getName()) + " blows a kiss at " + F.name(player.getName()) + "!"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package mineplex.core.particleeffects;
|
package mineplex.core.particleeffects;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
import java.awt.Color;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
@ -39,7 +40,7 @@ public class ChristmasTreeEffect extends Effect
|
|||||||
if (_manager.isMoving(_player))
|
if (_manager.isMoving(_player))
|
||||||
{
|
{
|
||||||
Location loc = _player.getLocation().add(0, 1.2, 0).add(_player.getLocation().getDirection().multiply(-0.2));
|
Location loc = _player.getLocation().add(0, 1.2, 0).add(_player.getLocation().getDirection().multiply(-0.2));
|
||||||
ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST, new DustSpellColor(Color.MAROON), loc);
|
ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST, new DustSpellColor(new Color(8388608)), loc);
|
||||||
coloredParticle.display();
|
coloredParticle.display();
|
||||||
coloredParticle.setColor(new DustSpellColor(Color.GREEN));
|
coloredParticle.setColor(new DustSpellColor(Color.GREEN));
|
||||||
coloredParticle.display();
|
coloredParticle.display();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package mineplex.core.particleeffects;
|
package mineplex.core.particleeffects;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package mineplex.core.particleeffects;
|
package mineplex.core.particleeffects;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
import java.awt.Color;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package mineplex.core.particleeffects;
|
package mineplex.core.particleeffects;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
import java.awt.Color;
|
||||||
|
|
||||||
import org.bukkit.FireworkEffect;
|
import org.bukkit.FireworkEffect;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
package mineplex.core.particleeffects;
|
package mineplex.core.particleeffects;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
import org.bukkit.Color;
|
||||||
@ -49,3 +50,57 @@ public class LineEffect extends Effect
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
package mineplex.core.particleeffects;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.particles.ColoredParticle;
|
||||||
|
import mineplex.core.common.util.particles.DustSpellColor;
|
||||||
|
|
||||||
|
public class LineEffect extends Effect
|
||||||
|
{
|
||||||
|
|
||||||
|
private int _particles = 100;
|
||||||
|
private Color _color;
|
||||||
|
private int _count = 0;
|
||||||
|
private Vector _vector;
|
||||||
|
private Location _fixedLoc;
|
||||||
|
|
||||||
|
public LineEffect(JavaPlugin plugin, Location location, Location target, Color color)
|
||||||
|
{
|
||||||
|
super(-1, new EffectLocation(location), plugin);
|
||||||
|
setTargetLocation(new EffectLocation(target));
|
||||||
|
_color = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runEffect()
|
||||||
|
{
|
||||||
|
Location location = _effectLocation.getFixedLocation().clone().add(0, 1, 0);
|
||||||
|
if (_vector == null)
|
||||||
|
{
|
||||||
|
Location targetLoc = getTargetLocation().getFixedLocation().clone();
|
||||||
|
Vector link = targetLoc.toVector().subtract(location.toVector());
|
||||||
|
float length = (float) link.length();
|
||||||
|
link.normalize();
|
||||||
|
Vector vector = link.multiply(length / _particles);
|
||||||
|
_vector = vector;
|
||||||
|
_fixedLoc = location.clone().subtract(_vector);
|
||||||
|
}
|
||||||
|
ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST,
|
||||||
|
new DustSpellColor(_color), _effectLocation.getLocation().clone());
|
||||||
|
_fixedLoc.add(_vector);
|
||||||
|
if (_count == _particles)
|
||||||
|
{
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
>>>>>>> refs/remotes/origin/develop
|
||||||
|
@ -0,0 +1,94 @@
|
|||||||
|
package mineplex.core.particleeffects;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.gadget.types.Gadget;
|
||||||
|
|
||||||
|
public class LoveDoctorEffect extends Effect
|
||||||
|
{
|
||||||
|
|
||||||
|
private int _particles = 100;
|
||||||
|
private int _count = 0;
|
||||||
|
private Vector _vector;
|
||||||
|
private Location _fixedLoc;
|
||||||
|
private Gadget _gadget;
|
||||||
|
private Player _player;
|
||||||
|
private boolean _forceStop = false;
|
||||||
|
|
||||||
|
public LoveDoctorEffect(Player player, Location target, Gadget gadget)
|
||||||
|
{
|
||||||
|
super(-1, new EffectLocation(player), gadget.Manager.getPlugin());
|
||||||
|
_gadget = gadget;
|
||||||
|
_player = player;
|
||||||
|
setTargetLocation(new EffectLocation(target));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart()
|
||||||
|
{
|
||||||
|
_player.getWorld().playSound(_player.getLocation(), Sound.PISTON_RETRACT, 1f, 1f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runEffect()
|
||||||
|
{
|
||||||
|
Location location = _effectLocation.getFixedLocation().clone().add(0, 1, 0);
|
||||||
|
if (_vector == null)
|
||||||
|
{
|
||||||
|
Location targetLoc = getTargetLocation().getFixedLocation().clone();
|
||||||
|
Vector link = targetLoc.toVector().subtract(location.toVector());
|
||||||
|
float length = (float) link.length();
|
||||||
|
link.normalize();
|
||||||
|
_vector = link.multiply(length / _particles);
|
||||||
|
_fixedLoc = location.clone().subtract(_vector);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 5; i++){
|
||||||
|
_fixedLoc.add(_vector);
|
||||||
|
UtilParticle.PlayParticle(UtilParticle.ParticleType.HEART, _fixedLoc, 0, 0, 0, 0, 1, UtilParticle.ViewDist.LONG);
|
||||||
|
}
|
||||||
|
if (_fixedLoc.getBlock().getType() != Material.AIR )
|
||||||
|
{
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
else if (_count >= 1000)
|
||||||
|
{
|
||||||
|
_forceStop = true;
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
_count += 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStop()
|
||||||
|
{
|
||||||
|
// Creates the explosion and knockback players
|
||||||
|
Location loc = _fixedLoc;
|
||||||
|
loc.getWorld().createExplosion(loc, 0f);
|
||||||
|
UtilParticle.PlayParticle(UtilParticle.ParticleType.EXPLODE, loc, 3f, 3f, 3f, 0, 32, UtilParticle.ViewDist.MAX, UtilServer.getPlayers());
|
||||||
|
HashMap<Player, Double> players = UtilPlayer.getInRadius(loc, 9d);
|
||||||
|
for (Player ent : players.keySet())
|
||||||
|
{
|
||||||
|
if (_gadget.Manager.collideEvent(_player, _gadget, ent))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
double mult = players.get(ent);
|
||||||
|
|
||||||
|
//Knockback
|
||||||
|
UtilAction.velocity(ent, UtilAlg.getTrajectory(loc, ent.getLocation()), 2 * mult, false, 0, 1 + 1 * mult, 10, true);
|
||||||
|
LoveDoctorHitEffect loveDoctorHitEffect = new LoveDoctorHitEffect(ent);
|
||||||
|
loveDoctorHitEffect.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package mineplex.core.particleeffects;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
|
||||||
|
public class LoveDoctorHitEffect extends Effect
|
||||||
|
{
|
||||||
|
|
||||||
|
public LoveDoctorHitEffect(Player player)
|
||||||
|
{
|
||||||
|
super(200, new EffectLocation(player.getLocation()), UtilServer.getPlugin());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runEffect()
|
||||||
|
{
|
||||||
|
Location location = getEffectLocation().getLocation();
|
||||||
|
UtilParticle.PlayParticle(UtilParticle.ParticleType.HEART, location.clone().add(0, 1, 0), 0.75f, 0.75f, 0.75f, 0, 1, UtilParticle.ViewDist.NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,9 +1,9 @@
|
|||||||
package mineplex.core.particleeffects;
|
package mineplex.core.particleeffects;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
|
@ -3,7 +3,6 @@ package mineplex.core.particleeffects;
|
|||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package mineplex.core.pet;
|
package mineplex.core.pet;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@ -11,7 +12,6 @@ import net.minecraft.server.v1_8_R3.EntityCreature;
|
|||||||
import net.minecraft.server.v1_8_R3.NavigationAbstract;
|
import net.minecraft.server.v1_8_R3.NavigationAbstract;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Color;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.SkullType;
|
import org.bukkit.SkullType;
|
||||||
@ -42,6 +42,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
@ -65,6 +66,7 @@ import mineplex.core.common.util.UtilServer;
|
|||||||
import mineplex.core.disguise.DisguiseManager;
|
import mineplex.core.disguise.DisguiseManager;
|
||||||
import mineplex.core.disguise.disguises.DisguiseChicken;
|
import mineplex.core.disguise.disguises.DisguiseChicken;
|
||||||
import mineplex.core.disguise.disguises.DisguiseGuardian;
|
import mineplex.core.disguise.disguises.DisguiseGuardian;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseVillager;
|
||||||
import mineplex.core.disguise.disguises.DisguiseWither;
|
import mineplex.core.disguise.disguises.DisguiseWither;
|
||||||
import mineplex.core.disguise.disguises.DisguiseZombie;
|
import mineplex.core.disguise.disguises.DisguiseZombie;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
@ -98,8 +100,12 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
private Map<Creature, FlyingPetManager> _flyingPets = new HashMap<>();
|
private Map<Creature, FlyingPetManager> _flyingPets = new HashMap<>();
|
||||||
private Map<Creature, TrueLoveData> _trueLovePets = new HashMap<>();
|
private Map<Creature, TrueLoveData> _trueLovePets = new HashMap<>();
|
||||||
|
|
||||||
private ShapeWings _wings = new ShapeWings(ParticleType.RED_DUST.particleName, new org.bukkit.util.Vector(0.2,0.2,0.2), 1, 0, false, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_ANGEL_WING_PATTERN);
|
private ShapeWings _grimReaperWings = new ShapeWings(ParticleType.RED_DUST.particleName, new org.bukkit.util.Vector(0.2, 0.2, 0.2), 1, 0, false, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_ANGEL_WING_PATTERN);
|
||||||
private ShapeWings _wingsEdge = new ShapeWings(ParticleType.RED_DUST.particleName, new org.bukkit.util.Vector(0.1,0.1,0.1), 1, 0, true, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_ANGEL_WING_PATTERN);
|
private ShapeWings _grimReaperWingsEdge = new ShapeWings(ParticleType.RED_DUST.particleName, new org.bukkit.util.Vector(0.1, 0.1, 0.1), 1, 0, true, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_ANGEL_WING_PATTERN);
|
||||||
|
|
||||||
|
private ShapeWings _cupidWings = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, false, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_HEART_WING_PATTERN);
|
||||||
|
private ShapeWings _cupidWingsWhite = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(1, 1, 1), 1, 0, '%', ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_HEART_WING_PATTERN);
|
||||||
|
private ShapeWings _cupidWingsEdge = new ShapeWings(UtilParticle.ParticleType.RED_DUST.particleName, new Vector(0, 0, 0), 1, 0, true, ShapeWings.DEFAULT_ROTATION, ShapeWings.SMALL_HEART_WING_PATTERN);
|
||||||
|
|
||||||
public PetManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager
|
public PetManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager
|
||||||
, InventoryManager inventoryManager, DisguiseManager disguiseManager, mineplex.core.creature.Creature creatureModule, BlockRestore restore)
|
, InventoryManager inventoryManager, DisguiseManager disguiseManager, mineplex.core.creature.Creature creatureModule, BlockRestore restore)
|
||||||
@ -336,9 +342,9 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
Zombie zombie = (Zombie) pet;
|
Zombie zombie = (Zombie) pet;
|
||||||
zombie.setBaby(true);
|
zombie.setBaby(true);
|
||||||
zombie.getEquipment().setHelmet(SkinData.GINGERBREAD.getSkull());
|
zombie.getEquipment().setHelmet(SkinData.GINGERBREAD.getSkull());
|
||||||
zombie.getEquipment().setChestplate(ItemStackFactory.Instance.createColoredLeatherArmor(1, Color.fromRGB(203, 122, 56)));
|
zombie.getEquipment().setChestplate(ItemStackFactory.Instance.createColoredLeatherArmor(1, org.bukkit.Color.fromRGB(203, 122, 56)));
|
||||||
zombie.getEquipment().setLeggings(ItemStackFactory.Instance.createColoredLeatherArmor(2, Color.fromRGB(203, 122, 56)));
|
zombie.getEquipment().setLeggings(ItemStackFactory.Instance.createColoredLeatherArmor(2, org.bukkit.Color.fromRGB(203, 122, 56)));
|
||||||
zombie.getEquipment().setBoots(ItemStackFactory.Instance.createColoredLeatherArmor(3, Color.fromRGB(203, 122, 56)));
|
zombie.getEquipment().setBoots(ItemStackFactory.Instance.createColoredLeatherArmor(3, org.bukkit.Color.fromRGB(203, 122, 56)));
|
||||||
|
|
||||||
UtilEnt.silence(zombie, true);
|
UtilEnt.silence(zombie, true);
|
||||||
|
|
||||||
@ -348,6 +354,25 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
zombie.setCustomNameVisible(true);
|
zombie.setCustomNameVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (petType.equals(PetType.CUPID_PET))
|
||||||
|
{
|
||||||
|
Zombie zombie = (Zombie) pet;
|
||||||
|
UtilEnt.silence(zombie, true);
|
||||||
|
|
||||||
|
DisguiseVillager disguiseVillager = new DisguiseVillager(zombie);
|
||||||
|
disguiseVillager.setBaby();
|
||||||
|
disguiseVillager.setHeldItem(new ItemStack(Material.BOW));
|
||||||
|
|
||||||
|
if (Get(player).getPets().get(entityType) != null && Get(player).getPets().get(entityType).length() > 0)
|
||||||
|
{
|
||||||
|
disguiseVillager.setName(Get(player).getPets().get(entityType));
|
||||||
|
disguiseVillager.setCustomNameVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
_disguiseManager.disguise(disguiseVillager);
|
||||||
|
FlyingPetManager flyingPetManager = new FlyingPetManager(player, pet);
|
||||||
|
_flyingPets.put(pet, flyingPetManager);
|
||||||
|
}
|
||||||
else if (petType.equals(PetType.TRUE_LOVE_PET))
|
else if (petType.equals(PetType.TRUE_LOVE_PET))
|
||||||
{
|
{
|
||||||
Zombie zombie = (Zombie) pet;
|
Zombie zombie = (Zombie) pet;
|
||||||
@ -474,23 +499,53 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onUpdate(UpdateEvent event)
|
public void onUpdate(UpdateEvent event)
|
||||||
{
|
{
|
||||||
for(Creature pet : _activePetOwners.values())
|
|
||||||
|
for (Entry<String, Creature> entry : _activePetOwners.entrySet())
|
||||||
{
|
{
|
||||||
if(pet instanceof PigZombie && event.getType() == UpdateType.TICK)
|
String playerName = entry.getKey();
|
||||||
|
Creature creature = entry.getValue();
|
||||||
|
|
||||||
|
if (event.getType() == UpdateType.TICK)
|
||||||
{
|
{
|
||||||
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, pet.getLocation(), 0.2f,0.0f,0.2f, 0.0f, 4, ViewDist.NORMAL);
|
if (creature instanceof PigZombie)
|
||||||
if(event.getTick()%3 == 0) pet.getWorld().playSound(pet.getLocation(), Sound.BLAZE_BREATH, 0.03f, 0f);
|
|
||||||
if(!((CraftPigZombie)pet).getHandle().isSilent())
|
|
||||||
{
|
{
|
||||||
((CraftPigZombie)pet).getHandle().setSilent(true);
|
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, creature.getLocation(), 0.2f, 0.0f, 0.2f, 0.0f, 4, ViewDist.NORMAL);
|
||||||
|
if(event.getTick() % 3 == 0) creature.getWorld().playSound(creature.getLocation(), Sound.BLAZE_BREATH, 0.03f, 0f);
|
||||||
|
if(!((CraftPigZombie) creature).getHandle().isSilent())
|
||||||
|
{
|
||||||
|
((CraftPigZombie) creature).getHandle().setSilent(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pet instanceof Blaze && event.getType() == UpdateType.FAST)
|
else if (event.getType() == UpdateType.FAST)
|
||||||
{
|
{
|
||||||
Location loc = pet.getLocation().clone().add(0, .5, 0).add(pet.getLocation().getDirection().multiply(-0.2));
|
if (creature instanceof Blaze)
|
||||||
|
{
|
||||||
|
Location loc = creature.getLocation().clone().add(0, .5, 0).add(creature.getLocation().getDirection().multiply(-0.2));
|
||||||
|
_grimReaperWings.display(loc);
|
||||||
|
_grimReaperWingsEdge.display(loc);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PetType petType = getActivePetType(playerName);
|
||||||
|
if (petType == PetType.CUPID_PET)
|
||||||
|
{
|
||||||
|
Location loc = creature.getLocation().clone().add(0, .5, 0).add(creature.getLocation().getDirection().multiply(-0.2));
|
||||||
|
|
||||||
if (event.getType() == UpdateType.FAST) _wings.display(loc);
|
_cupidWings.displayColored(loc, Color.PINK);
|
||||||
if (event.getType() == UpdateType.FAST) _wingsEdge.display(loc);
|
_cupidWingsWhite.displayColored(loc, Color.WHITE);
|
||||||
|
_cupidWingsEdge.displayColored(loc, Color.BLACK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (event.getType() == UpdateType.SEC)
|
||||||
|
{
|
||||||
|
PetType petType = getActivePetType(playerName);
|
||||||
|
if (petType == PetType.CUPID_PET)
|
||||||
|
{
|
||||||
|
Location loc = creature.getLocation().clone().add(0, .5, 0);
|
||||||
|
UtilParticle.PlayParticle(ParticleType.HEART, loc, 0.25f, 0.25f, 0.25f, 0.25f, 3, ViewDist.NORMAL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ public enum PetType
|
|||||||
RABBIT("Baby Zombie", EntityType.RABBIT, -9, "They're so cute - until a pack of them chases down your family and eats them."),
|
RABBIT("Baby Zombie", EntityType.RABBIT, -9, "They're so cute - until a pack of them chases down your family and eats them."),
|
||||||
BLAZE("Grim Reaper", EntityType.BLAZE, -8, "Aww isn't he so cute with his little wings and little scythe?"),
|
BLAZE("Grim Reaper", EntityType.BLAZE, -8, "Aww isn't he so cute with his little wings and little scythe?"),
|
||||||
GINGERBREAD_MAN("Gingerbread Man", EntityType.ZOMBIE, -16, "Looks like you can catch him after all."),
|
GINGERBREAD_MAN("Gingerbread Man", EntityType.ZOMBIE, -16, "Looks like you can catch him after all."),
|
||||||
|
CUPID_PET("Cupid", EntityType.ZOMBIE, -17, "Sometimes you need a little extra help finding true Love. Why not have Cupid help you out?", Material.BOW, (byte) 0),
|
||||||
TRUE_LOVE_PET("True Love", EntityType.ZOMBIE, -14, "Sometimes love means chasing the person of your dreams until you catch them.", Material.APPLE, YearMonth.of(2017, Month.FEBRUARY))
|
TRUE_LOVE_PET("True Love", EntityType.ZOMBIE, -14, "Sometimes love means chasing the person of your dreams until you catch them.", Material.APPLE, YearMonth.of(2017, Month.FEBRUARY))
|
||||||
// TODO CHECK IF LOBBY IS 1.9+
|
// TODO CHECK IF LOBBY IS 1.9+
|
||||||
// Not in this update
|
// Not in this update
|
||||||
|
@ -83,6 +83,10 @@ public class Portal extends MiniPlugin
|
|||||||
|
|
||||||
public void sendAllPlayersToGenericServer(GenericServer hub, Intent kick)
|
public void sendAllPlayersToGenericServer(GenericServer hub, Intent kick)
|
||||||
{
|
{
|
||||||
|
for (Player player : UtilServer.GetPlayers())
|
||||||
|
{
|
||||||
|
sendPlayerToGenericServer(player, hub, kick);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendPlayerToGenericServer(Player player, GenericServer genericServer, Intent intent)
|
public void sendPlayerToGenericServer(Player player, GenericServer genericServer, Intent intent)
|
||||||
@ -125,6 +129,11 @@ public class Portal extends MiniPlugin
|
|||||||
|
|
||||||
runSync(() ->
|
runSync(() ->
|
||||||
{
|
{
|
||||||
|
if (server.getGroup().equalsIgnoreCase("Clans") && server.getMotd().equalsIgnoreCase("Restarting soon"))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, F.main(getName(), C.cGold + "serverName" + C.cRed + " is restarting!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (server.getPlayerCount() < server.getMaxPlayerCount() || playerRank.has(Rank.ULTRA))
|
if (server.getPlayerCount() < server.getMaxPlayerCount() || playerRank.has(Rank.ULTRA))
|
||||||
{
|
{
|
||||||
sendPlayer(player, serverName);
|
sendPlayer(player, serverName);
|
||||||
|
@ -18,10 +18,12 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
|||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
import mineplex.core.MiniPlugin;
|
import mineplex.core.MiniPlugin;
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.account.event.ClientWebResponseEvent;
|
import mineplex.core.account.event.ClientWebResponseEvent;
|
||||||
|
import mineplex.core.common.Constants;
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.Callback;
|
import mineplex.core.common.util.Callback;
|
||||||
@ -243,7 +245,7 @@ public class Punish extends MiniPlugin
|
|||||||
{
|
{
|
||||||
runAsync(() ->
|
runAsync(() ->
|
||||||
{
|
{
|
||||||
ServerCommandManager.getInstance().publishCommand(new AddPunishCommand(finalPlayerName, category.name(), sentence.name(), reason, duration, finalCallerName, caller != null ? caller.getUniqueId().toString() : null));
|
new AddPunishCommand(finalPlayerName, severity, category.name(), sentence.name(), reason, duration, finalCallerName, caller != null ? caller.getUniqueId().toString() : null).publish();
|
||||||
});
|
});
|
||||||
final String durationString = UtilTime.convertString(finalDuration < 0 ? -1 : (long)(finalDuration * 3600000), 1, TimeUnit.FIT);
|
final String durationString = UtilTime.convertString(finalDuration < 0 ? -1 : (long)(finalDuration * 3600000), 1, TimeUnit.FIT);
|
||||||
|
|
||||||
@ -398,7 +400,7 @@ public class Punish extends MiniPlugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemovePunishment(int punishmentId, String target, final Player admin, String reason, Callback<String> callback)
|
public void RemovePunishment(Punishment punishment, String target, final Player admin, String reason, Callback<String> callback)
|
||||||
{
|
{
|
||||||
CoreClient client = _clientManager.Get(admin);
|
CoreClient client = _clientManager.Get(admin);
|
||||||
_repository.RemovePunishment(string ->
|
_repository.RemovePunishment(string ->
|
||||||
@ -408,12 +410,12 @@ public class Punish extends MiniPlugin
|
|||||||
PunishmentResponse punishResponse = PunishmentResponse.valueOf(string);
|
PunishmentResponse punishResponse = PunishmentResponse.valueOf(string);
|
||||||
if (punishResponse == PunishmentResponse.PunishmentRemoved)
|
if (punishResponse == PunishmentResponse.PunishmentRemoved)
|
||||||
{
|
{
|
||||||
ServerCommandManager.getInstance().publishCommand(new RemovePunishCommand(punishmentId, target, admin.getName(), admin.getUniqueId(), reason));
|
ServerCommandManager.getInstance().publishCommand(new RemovePunishCommand(Constants.GSON.fromJson(Constants.GSON.toJson(punishment), JsonObject.class), target, admin.getName(), admin.getUniqueId(), reason));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
callback.run(string);
|
callback.run(string);
|
||||||
}, punishmentId, target, reason, client.getName());
|
}, punishment.GetPunishmentId(), target, reason, client.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreClientManager GetClients()
|
public CoreClientManager GetClients()
|
||||||
|
@ -511,7 +511,7 @@ public class PunishPage extends CraftInventoryCustom implements Listener
|
|||||||
|
|
||||||
public void RemovePunishment(final Punishment punishment, final ItemStack item)
|
public void RemovePunishment(final Punishment punishment, final ItemStack item)
|
||||||
{
|
{
|
||||||
_plugin.RemovePunishment(punishment.GetPunishmentId(), _target, _player, _reason, new Callback<String>()
|
_plugin.RemovePunishment(punishment, _target, _player, _reason, new Callback<String>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void run(String result)
|
public void run(String result)
|
||||||
|
@ -73,6 +73,7 @@ import mineplex.core.gadget.gadgets.morph.MorphChicken;
|
|||||||
import mineplex.core.gadget.gadgets.morph.MorphCow;
|
import mineplex.core.gadget.gadgets.morph.MorphCow;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphEnderman;
|
import mineplex.core.gadget.gadgets.morph.MorphEnderman;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphGrimReaper;
|
import mineplex.core.gadget.gadgets.morph.MorphGrimReaper;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphLoveDoctor;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphPumpkinKing;
|
import mineplex.core.gadget.gadgets.morph.MorphPumpkinKing;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphSlime;
|
import mineplex.core.gadget.gadgets.morph.MorphSlime;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphSnowman;
|
import mineplex.core.gadget.gadgets.morph.MorphSnowman;
|
||||||
@ -97,6 +98,7 @@ import mineplex.core.gadget.gadgets.particle.ParticleFireRings;
|
|||||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel;
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsDemons;
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsDemons;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsInfernal;
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsInfernal;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsLove;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsPixie;
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsPixie;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleYinYang;
|
import mineplex.core.gadget.gadgets.particle.ParticleYinYang;
|
||||||
import mineplex.core.gadget.gadgets.particle.candycane.ParticleCandyCane;
|
import mineplex.core.gadget.gadgets.particle.candycane.ParticleCandyCane;
|
||||||
@ -110,11 +112,13 @@ import mineplex.core.gadget.gadgets.particle.party.ParticlePartyTime;
|
|||||||
import mineplex.core.gadget.gadgets.particle.shadow.ParticleFoot;
|
import mineplex.core.gadget.gadgets.particle.shadow.ParticleFoot;
|
||||||
import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood;
|
import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood;
|
||||||
import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant;
|
import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant;
|
||||||
|
import mineplex.core.gadget.gadgets.taunts.BlowAKissTaunt;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectFlames;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectFlames;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectHalloween;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectHalloween;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectLavaTrap;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectLavaTrap;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectLightningStrike;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectLightningStrike;
|
||||||
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectLoveIsABattlefield;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectMrPunchMan;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectMrPunchMan;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectRiseOfTheElderGuardian;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectRiseOfTheElderGuardian;
|
||||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectSnowTrails;
|
import mineplex.core.gadget.gadgets.wineffect.WinEffectSnowTrails;
|
||||||
@ -131,6 +135,7 @@ import mineplex.core.mount.types.MountCart;
|
|||||||
import mineplex.core.mount.types.MountChicken;
|
import mineplex.core.mount.types.MountChicken;
|
||||||
import mineplex.core.mount.types.MountFreedomHorse;
|
import mineplex.core.mount.types.MountFreedomHorse;
|
||||||
import mineplex.core.mount.types.MountFrost;
|
import mineplex.core.mount.types.MountFrost;
|
||||||
|
import mineplex.core.mount.types.MountLoveTrain;
|
||||||
import mineplex.core.mount.types.MountMule;
|
import mineplex.core.mount.types.MountMule;
|
||||||
import mineplex.core.mount.types.MountNightmareSteed;
|
import mineplex.core.mount.types.MountNightmareSteed;
|
||||||
import mineplex.core.mount.types.MountSlime;
|
import mineplex.core.mount.types.MountSlime;
|
||||||
@ -152,7 +157,6 @@ import mineplex.core.reward.rewards.RuneAmplifierReward;
|
|||||||
import mineplex.core.reward.rewards.SpinTicketReward;
|
import mineplex.core.reward.rewards.SpinTicketReward;
|
||||||
import mineplex.core.reward.rewards.TreasureShardReward;
|
import mineplex.core.reward.rewards.TreasureShardReward;
|
||||||
import mineplex.core.reward.rewards.UnknownPackageReward;
|
import mineplex.core.reward.rewards.UnknownPackageReward;
|
||||||
import mineplex.core.stats.StatsManager;
|
|
||||||
import mineplex.core.treasure.TreasureType;
|
import mineplex.core.treasure.TreasureType;
|
||||||
|
|
||||||
public class RewardManager
|
public class RewardManager
|
||||||
@ -162,7 +166,6 @@ public class RewardManager
|
|||||||
|
|
||||||
private CoreClientManager _clientManager;
|
private CoreClientManager _clientManager;
|
||||||
private DonationManager _donationManager;
|
private DonationManager _donationManager;
|
||||||
private StatsManager _statsManager;
|
|
||||||
private InventoryManager _inventoryManager;
|
private InventoryManager _inventoryManager;
|
||||||
private GadgetManager _gadgetManager;
|
private GadgetManager _gadgetManager;
|
||||||
private PetManager _petManager;
|
private PetManager _petManager;
|
||||||
@ -179,9 +182,9 @@ public class RewardManager
|
|||||||
private int _legendaryShards = 5000;
|
private int _legendaryShards = 5000;
|
||||||
|
|
||||||
public RewardManager(CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager,
|
public RewardManager(CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager,
|
||||||
PetManager petManager, StatsManager statsManager, GadgetManager gadgetManager)
|
PetManager petManager, GadgetManager gadgetManager)
|
||||||
{
|
{
|
||||||
_rewardPools = new EnumMap<RewardPool.Type, RewardPool>(RewardPool.Type.class);
|
_rewardPools = new EnumMap<>(RewardPool.Type.class);
|
||||||
_random = new Random();
|
_random = new Random();
|
||||||
|
|
||||||
for (RewardPool.Type type : RewardPool.Type.values())
|
for (RewardPool.Type type : RewardPool.Type.values())
|
||||||
@ -191,7 +194,6 @@ public class RewardManager
|
|||||||
|
|
||||||
_clientManager = clientManager;
|
_clientManager = clientManager;
|
||||||
_donationManager = donationManager;
|
_donationManager = donationManager;
|
||||||
_statsManager = statsManager;
|
|
||||||
_inventoryManager = inventoryManager;
|
_inventoryManager = inventoryManager;
|
||||||
_gadgetManager = gadgetManager;
|
_gadgetManager = gadgetManager;
|
||||||
_petManager = petManager;
|
_petManager = petManager;
|
||||||
@ -237,10 +239,7 @@ public class RewardManager
|
|||||||
addInventoryReward(Type.VALENTINES_GIFT, getGadget(ItemBow.class), rarity, 300, 0, 1, 5);
|
addInventoryReward(Type.VALENTINES_GIFT, getGadget(ItemBow.class), rarity, 300, 0, 1, 5);
|
||||||
|
|
||||||
// INFUSED CHESTS
|
// INFUSED CHESTS
|
||||||
addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemCoal.class), rarity, 30, 0, 50, 100);
|
|
||||||
addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemFreezeCannon.class), rarity, 45, 0, 5, 10);
|
|
||||||
addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemPartyPopper.class), rarity, 60, 0, 5, 10);
|
|
||||||
addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemSnowball.class), rarity, 60, 0, 5, 10);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addUncommon()
|
public void addUncommon()
|
||||||
@ -324,13 +323,7 @@ public class RewardManager
|
|||||||
addBalloon(Type.NORMAL, BalloonType.BABY_SHEEP, rarity, 15, 100);
|
addBalloon(Type.NORMAL, BalloonType.BABY_SHEEP, rarity, 15, 100);
|
||||||
|
|
||||||
// INFUSED CHESTS
|
// INFUSED CHESTS
|
||||||
addHat(Type.INFUSED_CHESTS, HatType.PRESENT, rarity, 40, 100);
|
|
||||||
addHat(Type.INFUSED_CHESTS, HatType.SNOWMAN, rarity, 38, 100);
|
|
||||||
|
|
||||||
addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemCoal.class), rarity, 33, 0, 65, 200);
|
|
||||||
addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemFreezeCannon.class), rarity, 45, 0, 25, 40);
|
|
||||||
addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemPartyPopper.class), rarity, 60, 0, 25, 40);
|
|
||||||
addInventoryReward(Type.INFUSED_GADGETS, getGadget(ItemSnowball.class), rarity, 60, 0, 25, 40);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addRare()
|
public void addRare()
|
||||||
@ -519,7 +512,7 @@ public class RewardManager
|
|||||||
addHat(Type.HAUNTED, HatType.PUMPKIN, rarity, 10);
|
addHat(Type.HAUNTED, HatType.PUMPKIN, rarity, 10);
|
||||||
addGadget(Type.HAUNTED, getGadget(ArrowTrailHalloween.class), rarity, 100);
|
addGadget(Type.HAUNTED, getGadget(ArrowTrailHalloween.class), rarity, 100);
|
||||||
|
|
||||||
//TRICK OR TREAT
|
// TRICK OR TREAT
|
||||||
addReward(Type.TRICK_OR_TREAT, new SpinTicketReward(_clientManager, 1, 3, rarity, 150, 0));
|
addReward(Type.TRICK_OR_TREAT, new SpinTicketReward(_clientManager, 1, 3, rarity, 150, 0));
|
||||||
addReward(Type.TRICK_OR_TREAT, new GameAmplifierReward(_inventoryManager, 1, 2, rarity, 150, 0));
|
addReward(Type.TRICK_OR_TREAT, new GameAmplifierReward(_inventoryManager, 1, 2, rarity, 150, 0));
|
||||||
addReward(Type.TRICK_OR_TREAT, new RuneAmplifierReward(_inventoryManager, 20, 1, 3, rarity, 120, 0));
|
addReward(Type.TRICK_OR_TREAT, new RuneAmplifierReward(_inventoryManager, 20, 1, 3, rarity, 120, 0));
|
||||||
@ -528,13 +521,12 @@ public class RewardManager
|
|||||||
addReward(Type.TRICK_OR_TREAT, new ChestReward(_inventoryManager, TreasureType.ANCIENT, 1, 5, rarity, 80, 0));
|
addReward(Type.TRICK_OR_TREAT, new ChestReward(_inventoryManager, TreasureType.ANCIENT, 1, 5, rarity, 80, 0));
|
||||||
|
|
||||||
// INFUSED CHESTS
|
// INFUSED CHESTS
|
||||||
addGadget(Type.INFUSED_CHESTS, getGadget(ArrowTrailCandyCane.class), rarity, 30, 500);
|
addHat(Type.INFUSED_CHESTS, HatType.COMPANION_BLOCK, rarity, 100);
|
||||||
addGadget(Type.INFUSED_CHESTS, getGadget(DoubleJumpCandyCane.class), rarity, 30, 500);
|
addHat(Type.INFUSED_CHESTS, HatType.LOVESTRUCK, rarity, 100);
|
||||||
addGadget(Type.INFUSED_CHESTS, getGadget(DeathCandyCane.class), rarity, 30, 500);
|
addHat(Type.INFUSED_CHESTS, HatType.SECRET_PACKAGE, rarity, 100);
|
||||||
addGadget(Type.INFUSED_CHESTS, getGadget(ParticleCandyCane.class), rarity, 30, 500);
|
addHat(Type.INFUSED_CHESTS, HatType.TEDDY_BEAR, rarity, 100);
|
||||||
addHat(Type.INFUSED_CHESTS, HatType.SANTA, rarity, 55, 500);
|
|
||||||
|
|
||||||
//THANKFUL
|
// THANKFUL
|
||||||
addReward(Type.THANKFUL, new SpinTicketReward(_clientManager, 1, 3, rarity, 150, 0));
|
addReward(Type.THANKFUL, new SpinTicketReward(_clientManager, 1, 3, rarity, 150, 0));
|
||||||
addReward(Type.THANKFUL, new RuneAmplifierReward(_inventoryManager, 20, 1, 3, rarity, 120, 0));
|
addReward(Type.THANKFUL, new RuneAmplifierReward(_inventoryManager, 20, 1, 3, rarity, 120, 0));
|
||||||
addReward(Type.THANKFUL, new UnknownPackageReward(_donationManager, "Clan Banner Access", "Wear/Place Clan Banner", "Clan Banner Usage", new ItemStack(Material.BANNER), rarity, 110, 0));
|
addReward(Type.THANKFUL, new UnknownPackageReward(_donationManager, "Clan Banner Access", "Wear/Place Clan Banner", "Clan Banner Usage", new ItemStack(Material.BANNER), rarity, 110, 0));
|
||||||
@ -546,6 +538,13 @@ public class RewardManager
|
|||||||
addGadget(Type.GINGERBREAD, getGadget(OutfitFreezeSuitChestplate.class), rarity, 100);
|
addGadget(Type.GINGERBREAD, getGadget(OutfitFreezeSuitChestplate.class), rarity, 100);
|
||||||
addGadget(Type.GINGERBREAD, getGadget(OutfitFreezeSuitLeggings.class), rarity, 100);
|
addGadget(Type.GINGERBREAD, getGadget(OutfitFreezeSuitLeggings.class), rarity, 100);
|
||||||
addGadget(Type.GINGERBREAD, getGadget(OutfitFreezeSuitBoots.class), rarity, 50);
|
addGadget(Type.GINGERBREAD, getGadget(OutfitFreezeSuitBoots.class), rarity, 50);
|
||||||
|
|
||||||
|
// LOVE CHEST
|
||||||
|
addMount(Type.LOVECHEST, getMount(MountLoveTrain.class), rarity, 30, 500);
|
||||||
|
|
||||||
|
addPetReward(Type.LOVECHEST, PetType.CUPID_PET, rarity, 50, 500);
|
||||||
|
|
||||||
|
addGadget(Type.LOVECHEST, getGadget(WinEffectLoveIsABattlefield.class), rarity, 100, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addLegendary()
|
public void addLegendary()
|
||||||
@ -729,7 +728,7 @@ public class RewardManager
|
|||||||
addGadget(Type.HAUNTED, getGadget(WinEffectHalloween.class), rarity, 50);
|
addGadget(Type.HAUNTED, getGadget(WinEffectHalloween.class), rarity, 50);
|
||||||
addMount(Type.HAUNTED, getMount(MountNightmareSteed.class), rarity, 60);
|
addMount(Type.HAUNTED, getMount(MountNightmareSteed.class), rarity, 60);
|
||||||
|
|
||||||
//TRICK OR TREAT
|
// TRICK OR TREAT
|
||||||
addReward(Type.TRICK_OR_TREAT, new ChestReward(_inventoryManager, TreasureType.MYTHICAL, 1, 3, rarity, 50, 0));
|
addReward(Type.TRICK_OR_TREAT, new ChestReward(_inventoryManager, TreasureType.MYTHICAL, 1, 3, rarity, 50, 0));
|
||||||
addReward(Type.TRICK_OR_TREAT, new ChestReward(_inventoryManager, TreasureType.ILLUMINATED, 1, 1, rarity, 30, 0));
|
addReward(Type.TRICK_OR_TREAT, new ChestReward(_inventoryManager, TreasureType.ILLUMINATED, 1, 1, rarity, 30, 0));
|
||||||
addMount(Type.TRICK_OR_TREAT, getMount(MountZombie.class), rarity, 25);
|
addMount(Type.TRICK_OR_TREAT, getMount(MountZombie.class), rarity, 25);
|
||||||
@ -738,15 +737,12 @@ public class RewardManager
|
|||||||
|
|
||||||
|
|
||||||
// INFUSED CHESTS
|
// INFUSED CHESTS
|
||||||
addGadget(Type.INFUSED_CHESTS, getGadget(ArrowTrailFrostLord.class), rarity, 5, 5000);
|
addGadget(Type.INFUSED_CHESTS, getGadget(ArrowTrailCupid.class), rarity, 100, 5000);
|
||||||
addMount(Type.INFUSED_CHESTS, getMount(MountBabyReindeer.class), rarity, 10, 5000);
|
addGadget(Type.INFUSED_CHESTS, getGadget(DeathCupidsBrokenHeart.class), rarity, 100, 5000);
|
||||||
addGadget(Type.INFUSED_CHESTS, getGadget(DeathFrostLord.class), rarity, 35, 5000);
|
addGadget(Type.INFUSED_CHESTS, getGadget(ParticleHeart.class), rarity, 100, 5000);
|
||||||
addGadget(Type.INFUSED_CHESTS, getGadget(DoubleJumpFrostLord.class), rarity, 35, 5000);
|
addGadget(Type.INFUSED_CHESTS, getGadget(DoubleJumpCupidsWings.class), rarity, 100, 5000);
|
||||||
addGadget(Type.INFUSED_CHESTS, getGadget(MorphSnowman.class), rarity, 35, 5000);
|
|
||||||
addHat(Type.INFUSED_CHESTS, HatType.GRINCH, rarity, 35, 5000);
|
|
||||||
addGadget(Type.INFUSED_CHESTS, getGadget(ParticleFrostLord.class), rarity, 35, 500);
|
|
||||||
|
|
||||||
//THANKFUL
|
// THANKFUL
|
||||||
addReward(Type.THANKFUL, new ChestReward(_inventoryManager, TreasureType.MYTHICAL, 1, 3, rarity, 50, 0));
|
addReward(Type.THANKFUL, new ChestReward(_inventoryManager, TreasureType.MYTHICAL, 1, 3, rarity, 50, 0));
|
||||||
addReward(Type.THANKFUL, new ChestReward(_inventoryManager, TreasureType.ILLUMINATED, 1, 1, rarity, 30, 0));
|
addReward(Type.THANKFUL, new ChestReward(_inventoryManager, TreasureType.ILLUMINATED, 1, 1, rarity, 30, 0));
|
||||||
addReward(Type.THANKFUL, new ChestReward(_inventoryManager, TreasureType.ILLUMINATED, 1, 1, rarity, 30, 0));
|
addReward(Type.THANKFUL, new ChestReward(_inventoryManager, TreasureType.ILLUMINATED, 1, 1, rarity, 30, 0));
|
||||||
@ -760,6 +756,11 @@ public class RewardManager
|
|||||||
addGadget(Type.GINGERBREAD, getGadget(WinEffectWinterWarfare.class), rarity, 25);
|
addGadget(Type.GINGERBREAD, getGadget(WinEffectWinterWarfare.class), rarity, 25);
|
||||||
addGadget(Type.GINGERBREAD, getGadget(OutfitFreezeSuitHelmet.class), rarity, 1);
|
addGadget(Type.GINGERBREAD, getGadget(OutfitFreezeSuitHelmet.class), rarity, 1);
|
||||||
addPetReward(Type.GINGERBREAD, PetType.GINGERBREAD_MAN, rarity, 10);
|
addPetReward(Type.GINGERBREAD, PetType.GINGERBREAD_MAN, rarity, 10);
|
||||||
|
|
||||||
|
// LOVE CHEST
|
||||||
|
addGadget(Type.LOVECHEST, getGadget(MorphLoveDoctor.class), rarity, 30, 5000);
|
||||||
|
addGadget(Type.LOVECHEST, getGadget(BlowAKissTaunt.class), rarity, 50, 5000);
|
||||||
|
addGadget(Type.LOVECHEST, getGadget(ParticleWingsLove.class), rarity, 10, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
public UnknownPackageReward addMount(Type type, Mount<?> mount, RewardRarity rarity, int weight)
|
public UnknownPackageReward addMount(Type type, Mount<?> mount, RewardRarity rarity, int weight)
|
||||||
|
@ -64,6 +64,7 @@ public class RewardPool
|
|||||||
THANKFUL(false),
|
THANKFUL(false),
|
||||||
GINGERBREAD(false, 1),
|
GINGERBREAD(false, 1),
|
||||||
MINESTRIKE(true, 2),
|
MINESTRIKE(true, 2),
|
||||||
|
LOVECHEST(false, 1),
|
||||||
CARL_SPINNER(true);
|
CARL_SPINNER(true);
|
||||||
|
|
||||||
private boolean _useDuplicates;
|
private boolean _useDuplicates;
|
||||||
|
@ -19,6 +19,7 @@ public enum RewardType
|
|||||||
THANKFUL_CHEST( 0.1, 2, 16, 0),
|
THANKFUL_CHEST( 0.1, 2, 16, 0),
|
||||||
GINGERBREAD_CHEST( 0, 2, 16, 0),
|
GINGERBREAD_CHEST( 0, 2, 16, 0),
|
||||||
MINESTRIKE_CHEST( 0, 2, 16, 0),
|
MINESTRIKE_CHEST( 0, 2, 16, 0),
|
||||||
|
LOVE_CHEST( 0, 6, 18, 0),
|
||||||
VALENTINES_GIFT( 0, 7, 20, 20),
|
VALENTINES_GIFT( 0, 7, 20, 20),
|
||||||
|
|
||||||
SPINNER_FILLER( 0.1, 1, 4, 20),
|
SPINNER_FILLER( 0.1, 1, 4, 20),
|
||||||
|
@ -47,6 +47,7 @@ public class HolidayCheerTrack extends Track
|
|||||||
HOLIDAY_CHESTS.add(TreasureType.THANKFUL);
|
HOLIDAY_CHESTS.add(TreasureType.THANKFUL);
|
||||||
HOLIDAY_CHESTS.add(TreasureType.TRICK_OR_TREAT);
|
HOLIDAY_CHESTS.add(TreasureType.TRICK_OR_TREAT);
|
||||||
HOLIDAY_CHESTS.add(TreasureType.GINGERBREAD);
|
HOLIDAY_CHESTS.add(TreasureType.GINGERBREAD);
|
||||||
|
HOLIDAY_CHESTS.add(TreasureType.LOVE_CHEST);
|
||||||
|
|
||||||
HOLIDAY_SETS.add(SetFreedom.class);
|
HOLIDAY_SETS.add(SetFreedom.class);
|
||||||
HOLIDAY_SETS.add(SetCupidsLove.class);
|
HOLIDAY_SETS.add(SetCupidsLove.class);
|
||||||
|
@ -26,6 +26,7 @@ public class TreasureHunterTrack extends Track
|
|||||||
POINTS.put(TreasureType.TRICK_OR_TREAT, 25);
|
POINTS.put(TreasureType.TRICK_OR_TREAT, 25);
|
||||||
POINTS.put(TreasureType.THANKFUL, 25);
|
POINTS.put(TreasureType.THANKFUL, 25);
|
||||||
POINTS.put(TreasureType.GINGERBREAD, 25);
|
POINTS.put(TreasureType.GINGERBREAD, 25);
|
||||||
|
POINTS.put(TreasureType.LOVE_CHEST, 25);
|
||||||
POINTS.put(TreasureType.OMEGA, 50);
|
POINTS.put(TreasureType.OMEGA, 50);
|
||||||
POINTS.put(TreasureType.MINESTRIKE, 3);
|
POINTS.put(TreasureType.MINESTRIKE, 3);
|
||||||
}
|
}
|
||||||
|
@ -1,29 +1,54 @@
|
|||||||
package mineplex.core.treasure;
|
package mineplex.core.treasure;
|
||||||
|
|
||||||
import java.util.*;
|
import java.awt.Color;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import mineplex.core.blockrestore.BlockRestore;
|
|
||||||
import mineplex.core.common.Rank;
|
|
||||||
import mineplex.core.common.util.*;
|
|
||||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
|
||||||
import mineplex.core.common.util.particles.ColoredParticle;
|
|
||||||
import mineplex.core.common.util.particles.DustSpellColor;
|
|
||||||
import mineplex.core.hologram.HologramManager;
|
|
||||||
import mineplex.core.reward.*;
|
|
||||||
import mineplex.core.status.ServerStatusManager;
|
|
||||||
import mineplex.core.rankGiveaway.redis.TitanChestGiveawayMessage;
|
|
||||||
import mineplex.core.treasure.animation.*;
|
|
||||||
import net.minecraft.server.v1_8_R3.BlockPosition;
|
import net.minecraft.server.v1_8_R3.BlockPosition;
|
||||||
import net.minecraft.server.v1_8_R3.PacketPlayOutBlockAction;
|
import net.minecraft.server.v1_8_R3.PacketPlayOutBlockAction;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Color;
|
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.util.CraftMagicNumbers;
|
import org.bukkit.craftbukkit.v1_8_R3.util.CraftMagicNumbers;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.blockrestore.BlockRestore;
|
||||||
|
import mineplex.core.common.Rank;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.Callback;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.particles.ColoredParticle;
|
||||||
|
import mineplex.core.common.util.particles.DustSpellColor;
|
||||||
|
import mineplex.core.hologram.HologramManager;
|
||||||
|
import mineplex.core.rankGiveaway.redis.TitanChestGiveawayMessage;
|
||||||
|
import mineplex.core.reward.RankRewardData;
|
||||||
|
import mineplex.core.reward.Reward;
|
||||||
|
import mineplex.core.reward.RewardData;
|
||||||
|
import mineplex.core.reward.RewardRarity;
|
||||||
|
import mineplex.core.reward.RewardType;
|
||||||
|
import mineplex.core.status.ServerStatusManager;
|
||||||
|
import mineplex.core.treasure.animation.Animation;
|
||||||
|
import mineplex.core.treasure.animation.BlockChangeAnimation;
|
||||||
|
import mineplex.core.treasure.animation.ChestOpenAnimation;
|
||||||
|
import mineplex.core.treasure.animation.ChestSpawnAnimation;
|
||||||
|
import mineplex.core.treasure.animation.FreedomChestAnimation;
|
||||||
|
import mineplex.core.treasure.animation.LootLegendaryAnimation;
|
||||||
|
import mineplex.core.treasure.animation.LootMythicalAnimation;
|
||||||
|
import mineplex.core.treasure.animation.LootRareAnimation;
|
||||||
|
import mineplex.core.treasure.animation.LootUncommonAnimation;
|
||||||
|
import mineplex.core.treasure.animation.TreasureRemoveAnimation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Shaun on 8/27/2014.
|
* Created by Shaun on 8/27/2014.
|
||||||
*/
|
*/
|
||||||
@ -184,6 +209,12 @@ public class Treasure
|
|||||||
block.getLocation().add(.5 + rX, .7, .5 + rZ));
|
block.getLocation().add(.5 + rX, .7, .5 + rZ));
|
||||||
coloredParticle.display();
|
coloredParticle.display();
|
||||||
}
|
}
|
||||||
|
else if (_treasureType == TreasureType.LOVE_CHEST)
|
||||||
|
{
|
||||||
|
int r = (int) (Math.random() * 2);
|
||||||
|
double rX = Math.random() * 2 - 1, rZ = Math.random() * 2 - 1;
|
||||||
|
UtilParticle.PlayParticle(type, block.getLocation().add(.5 + rX, .7, .5 + rZ), .5f, .5f, .5f, .25f, 1, ViewDist.NORMAL);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UtilParticle.PlayParticle(type, block.getLocation().add(0.5, 0.5, 0.5), 0.5F, 0.5F, 0.5F, 0.2F, 0,
|
UtilParticle.PlayParticle(type, block.getLocation().add(0.5, 0.5, 0.5), 0.5F, 0.5F, 0.5F, 0.2F, 0,
|
||||||
|
@ -138,7 +138,7 @@ public class TreasureLocation implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(treasureType == TreasureType.ILLUMINATED || treasureType == TreasureType.FREEDOM || treasureType == TreasureType.OMEGA
|
if(treasureType == TreasureType.ILLUMINATED || treasureType == TreasureType.FREEDOM || treasureType == TreasureType.OMEGA
|
||||||
|| treasureType == TreasureType.HAUNTED || treasureType == TreasureType.GINGERBREAD)
|
|| treasureType == TreasureType.HAUNTED || treasureType == TreasureType.GINGERBREAD || treasureType == TreasureType.LOVE_CHEST)
|
||||||
{
|
{
|
||||||
if(!_treasureManager.hasItemsToGivePlayer(treasureType.getRewardPool(), player))
|
if(!_treasureManager.hasItemsToGivePlayer(treasureType.getRewardPool(), player))
|
||||||
{
|
{
|
||||||
|
@ -83,6 +83,13 @@ public enum TreasureStyle
|
|||||||
ParticleType.INSTANT_SPELL,
|
ParticleType.INSTANT_SPELL,
|
||||||
Sound.EXPLODE,
|
Sound.EXPLODE,
|
||||||
Sound.EXPLODE
|
Sound.EXPLODE
|
||||||
|
),
|
||||||
|
LOVECHEST(
|
||||||
|
ParticleType.HEART,
|
||||||
|
ParticleType.HEART,
|
||||||
|
ParticleType.HEART,
|
||||||
|
Sound.VILLAGER_YES,
|
||||||
|
Sound.VILLAGER_YES
|
||||||
);
|
);
|
||||||
|
|
||||||
private ParticleType _secondaryParticle;
|
private ParticleType _secondaryParticle;
|
||||||
|
@ -30,7 +30,9 @@ public enum TreasureType
|
|||||||
|
|
||||||
GINGERBREAD(C.cRed + "Gingerbread " + C.cGreen + "Treasure", "Gingerbread Chest", "Gingerbread", RewardType.GINGERBREAD_CHEST, Material.CHEST, TreasureStyle.GINGERBREAD, RewardPool.Type.GINGERBREAD, true, 20000),
|
GINGERBREAD(C.cRed + "Gingerbread " + C.cGreen + "Treasure", "Gingerbread Chest", "Gingerbread", RewardType.GINGERBREAD_CHEST, Material.CHEST, TreasureStyle.GINGERBREAD, RewardPool.Type.GINGERBREAD, true, 20000),
|
||||||
|
|
||||||
MINESTRIKE(C.cGold + "Minestrike Treasure", "Minestrike Chest", "MinestrikeChest", RewardType.MINESTRIKE_CHEST, Material.CHEST, TreasureStyle.MINESTRIKE, RewardPool.Type.MINESTRIKE, true, 10000);
|
MINESTRIKE(C.cGold + "Minestrike Treasure", "Minestrike Chest", "MinestrikeChest", RewardType.MINESTRIKE_CHEST, Material.CHEST, TreasureStyle.MINESTRIKE, RewardPool.Type.MINESTRIKE, true, 10000),
|
||||||
|
|
||||||
|
LOVE_CHEST(C.cRed + "Love Treasure", "Love Chest", "LoveChest", RewardType.LOVE_CHEST, Material.CHEST, TreasureStyle.LOVECHEST, RewardPool.Type.LOVECHEST, true, 20000);
|
||||||
|
|
||||||
private final String _name;
|
private final String _name;
|
||||||
private final RewardType _rewardType;
|
private final RewardType _rewardType;
|
||||||
|
@ -89,6 +89,11 @@ public class BlockChangeAnimation extends Animation
|
|||||||
mat = Material.STAINED_CLAY;
|
mat = Material.STAINED_CLAY;
|
||||||
data = 13;
|
data = 13;
|
||||||
}
|
}
|
||||||
|
else if (getTreasure().getTreasureType() == TreasureType.LOVE_CHEST)
|
||||||
|
{
|
||||||
|
mat = Material.WOOL;
|
||||||
|
data = 6;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -131,6 +136,11 @@ public class BlockChangeAnimation extends Animation
|
|||||||
mat = Material.STAINED_CLAY;
|
mat = Material.STAINED_CLAY;
|
||||||
data = 14;
|
data = 14;
|
||||||
}
|
}
|
||||||
|
else if (getTreasure().getTreasureType() == TreasureType.LOVE_CHEST)
|
||||||
|
{
|
||||||
|
mat = Material.WOOL;
|
||||||
|
data = 14;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -213,6 +223,18 @@ public class BlockChangeAnimation extends Animation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (getTreasure().getTreasureType() == TreasureType.LOVE_CHEST)
|
||||||
|
{
|
||||||
|
for (Block c : _chests)
|
||||||
|
{
|
||||||
|
if (c.equals(b))
|
||||||
|
{
|
||||||
|
_blockInfoList.add(new BlockInfo(b));
|
||||||
|
b.setType(Material.WOOL);
|
||||||
|
b.setData((byte) 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package mineplex.core.treasure.animation;
|
package mineplex.core.treasure.animation;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.server.v1_8_R3.BlockPosition;
|
import net.minecraft.server.v1_8_R3.BlockPosition;
|
||||||
import net.minecraft.server.v1_8_R3.MathHelper;
|
import net.minecraft.server.v1_8_R3.MathHelper;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
||||||
@ -117,7 +117,7 @@ public class ChestSpawnAnimation extends Animation
|
|||||||
_particleLocation.add(_particleDirection);
|
_particleLocation.add(_particleDirection);
|
||||||
|
|
||||||
//Play Particles
|
//Play Particles
|
||||||
if (getTreasure().getTreasureType() == TreasureType.OLD)
|
if (getTreasure().getTreasureType() == TreasureType.OLD || getTreasure().getTreasureType() == TreasureType.LOVE_CHEST)
|
||||||
{
|
{
|
||||||
UtilParticle.PlayParticle(getTreasure().getTreasureType().getStyle().getSecondaryParticle(), _centerLocation, 0.1f, 0.1f, 0.1f, 0, 1,
|
UtilParticle.PlayParticle(getTreasure().getTreasureType().getStyle().getSecondaryParticle(), _centerLocation, 0.1f, 0.1f, 0.1f, 0, 1,
|
||||||
ViewDist.NORMAL, UtilServer.getPlayers());
|
ViewDist.NORMAL, UtilServer.getPlayers());
|
||||||
@ -282,11 +282,16 @@ public class ChestSpawnAnimation extends Animation
|
|||||||
coloredParticle.display(50);
|
coloredParticle.display(50);
|
||||||
}
|
}
|
||||||
else if (getTreasure().getTreasureType() != TreasureType.FREEDOM && getTreasure().getTreasureType() != TreasureType.HAUNTED
|
else if (getTreasure().getTreasureType() != TreasureType.FREEDOM && getTreasure().getTreasureType() != TreasureType.HAUNTED
|
||||||
|| getTreasure().getTreasureType() != TreasureType.GINGERBREAD)
|
&& getTreasure().getTreasureType() != TreasureType.GINGERBREAD && getTreasure().getTreasureType() != TreasureType.LOVE_CHEST)
|
||||||
{
|
{
|
||||||
UtilParticle.PlayParticle(particleType, _centerLocation, 0.2f, 0.2f, 0.2f, 0, 50,
|
UtilParticle.PlayParticle(particleType, _centerLocation, 0.2f, 0.2f, 0.2f, 0, 50,
|
||||||
ViewDist.NORMAL, UtilServer.getPlayers());
|
ViewDist.NORMAL, UtilServer.getPlayers());
|
||||||
}
|
}
|
||||||
|
else if (getTreasure().getTreasureType() == TreasureType.LOVE_CHEST)
|
||||||
|
{
|
||||||
|
UtilParticle.PlayParticle(particleType, _centerLocation, 0.2f, 0.2f, 0.2f, 0, 15,
|
||||||
|
ViewDist.NORMAL, UtilServer.getPlayers());
|
||||||
|
}
|
||||||
else if (getTreasure().getTreasureType() == TreasureType.FREEDOM)
|
else if (getTreasure().getTreasureType() == TreasureType.FREEDOM)
|
||||||
{
|
{
|
||||||
int r = (int) (Math.random() * 3);
|
int r = (int) (Math.random() * 3);
|
||||||
|
@ -70,6 +70,19 @@ public class BuyChestButton implements IButton
|
|||||||
player.sendMessage(F.main("Treasure", "That chest is no longer available for purchase!"));
|
player.sendMessage(F.main("Treasure", "That chest is no longer available for purchase!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (_chestType == TreasureType.LOVE_CHEST)
|
||||||
|
{
|
||||||
|
if (!new File("../../update/files/EnableLoveChest.dat").exists())
|
||||||
|
{
|
||||||
|
player.sendMessage(F.main("Treasure", "That chest is no longer available for purchase!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!_page.getPlugin().hasItemsToGivePlayer(_chestType.getRewardPool(), player))
|
||||||
|
{
|
||||||
|
player.sendMessage(F.main("Treasure", "You seem to have all treasures for this chest unlocked already!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (_chestType == TreasureType.FREEDOM || _chestType == TreasureType.HAUNTED)
|
if (_chestType == TreasureType.FREEDOM || _chestType == TreasureType.HAUNTED)
|
||||||
{
|
{
|
||||||
if (!_page.getPlugin().hasItemsToGivePlayer(_chestType.getRewardPool(), player))
|
if (!_page.getPlugin().hasItemsToGivePlayer(_chestType.getRewardPool(), player))
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package mineplex.core.treasure.gui;
|
package mineplex.core.treasure.gui;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -135,6 +136,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
|||||||
int thankCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.THANKFUL.getItemName());
|
int thankCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.THANKFUL.getItemName());
|
||||||
int gingerbreadCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.GINGERBREAD.getItemName());
|
int gingerbreadCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.GINGERBREAD.getItemName());
|
||||||
int minestrikeCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.MINESTRIKE.getItemName());
|
int minestrikeCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.MINESTRIKE.getItemName());
|
||||||
|
int loveCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.LOVE_CHEST.getItemName());
|
||||||
|
|
||||||
boolean availableChristmas = false;
|
boolean availableChristmas = false;
|
||||||
boolean availableFreedom = false;
|
boolean availableFreedom = false;
|
||||||
@ -142,6 +144,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
|||||||
boolean availableTrick = false;
|
boolean availableTrick = false;
|
||||||
boolean availableThank = false;
|
boolean availableThank = false;
|
||||||
boolean availableGingerbread = false;
|
boolean availableGingerbread = false;
|
||||||
|
boolean availableLove = new File("../../update/files/EnableLoveChest.dat").exists();
|
||||||
|
|
||||||
List<String> shardLore = new ArrayList<>();
|
List<String> shardLore = new ArrayList<>();
|
||||||
shardLore.add(" ");
|
shardLore.add(" ");
|
||||||
@ -380,6 +383,30 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
|||||||
minestrikeLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop");
|
minestrikeLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<String> lovechestLore = Lists.newArrayList();
|
||||||
|
lovechestLore.add(" ");
|
||||||
|
lovechestLore.add(F.value("Love Chests Owned", "" + loveCount));
|
||||||
|
lovechestLore.add(" ");
|
||||||
|
lovechestLore.addAll(UtilText.splitLines(new String[]{C.cGray + "Cupid and his hunters have searched far and wide to collect a whole bunch of lovey dovey items. 6 items, no duplicates."}, LineFormat.LORE));
|
||||||
|
lovechestLore.add(" ");
|
||||||
|
if (loveCount > 0)
|
||||||
|
{
|
||||||
|
lovechestLore.add(C.cGreen + "Click to Open!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!availableLove)
|
||||||
|
{
|
||||||
|
lovechestLore.add(C.cRed + "This item is no longer available");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lovechestLore.add(ChatColor.RESET + "Click to craft for " + C.cAqua + TreasureType.LOVE_CHEST.getPurchasePrice() + " Treasure Shards");
|
||||||
|
lovechestLore.add(" ");
|
||||||
|
lovechestLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ShopItem shards = new ShopItem(Material.PRISMARINE_SHARD, C.cAqua + C.Bold + treasureShards + " Treasure Shards", shardLore.toArray(new String[0]), 0, false);
|
ShopItem shards = new ShopItem(Material.PRISMARINE_SHARD, C.cAqua + C.Bold + treasureShards + " Treasure Shards", shardLore.toArray(new String[0]), 0, false);
|
||||||
|
|
||||||
// Normal chests
|
// Normal chests
|
||||||
@ -397,6 +424,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
|||||||
ItemStack trick = new ShopItem(Material.SKULL_ITEM, C.cGoldB + "Trick or Treat Treasure", trickLore.toArray(new String[0]), 0, false, false);
|
ItemStack trick = new ShopItem(Material.SKULL_ITEM, C.cGoldB + "Trick or Treat Treasure", trickLore.toArray(new String[0]), 0, false, false);
|
||||||
ItemStack thank = new ShopItem(Material.COOKED_CHICKEN, C.cGoldB + "Thankful Treasure", thankLore.toArray(new String[0]), 0, false, false);
|
ItemStack thank = new ShopItem(Material.COOKED_CHICKEN, C.cGoldB + "Thankful Treasure", thankLore.toArray(new String[0]), 0, false, false);
|
||||||
ItemStack gingerbread = SkinData.GINGERBREAD.getSkull(C.cRedB + "Gingerbread" + C.cGreenB + " Treasure", gingerbreadLore);
|
ItemStack gingerbread = SkinData.GINGERBREAD.getSkull(C.cRedB + "Gingerbread" + C.cGreenB + " Treasure", gingerbreadLore);
|
||||||
|
ItemStack lovechest = new ShopItem(Material.WOOL, (byte) 6, C.cRedB + "Love Chest", lovechestLore.toArray(new String[0]), 0, false, false);
|
||||||
|
|
||||||
// Adds shard item
|
// Adds shard item
|
||||||
addItem(49, shards);
|
addItem(49, shards);
|
||||||
@ -418,6 +446,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
|||||||
TreasurePageItem trickTreasureItem = new TreasurePageItem(trick, trickCount, TreasureType.TRICK_OR_TREAT);
|
TreasurePageItem trickTreasureItem = new TreasurePageItem(trick, trickCount, TreasureType.TRICK_OR_TREAT);
|
||||||
TreasurePageItem thankTreasureItem = new TreasurePageItem(thank, thankCount, TreasureType.THANKFUL);
|
TreasurePageItem thankTreasureItem = new TreasurePageItem(thank, thankCount, TreasureType.THANKFUL);
|
||||||
TreasurePageItem gingerbreadTreasureItem = new TreasurePageItem(gingerbread, gingerbreadCount, TreasureType.GINGERBREAD);
|
TreasurePageItem gingerbreadTreasureItem = new TreasurePageItem(gingerbread, gingerbreadCount, TreasureType.GINGERBREAD);
|
||||||
|
TreasurePageItem loveChestItem = new TreasurePageItem(lovechest, loveCount, TreasureType.LOVE_CHEST);
|
||||||
|
|
||||||
_normalTreasures.add(oldTreasureItem);
|
_normalTreasures.add(oldTreasureItem);
|
||||||
_normalTreasures.add(ancientTreasureItem);
|
_normalTreasures.add(ancientTreasureItem);
|
||||||
@ -426,7 +455,10 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
|||||||
_normalTreasures.add(omegaTreasureItem);
|
_normalTreasures.add(omegaTreasureItem);
|
||||||
_normalTreasures.add(minestrikeTreasureItem);
|
_normalTreasures.add(minestrikeTreasureItem);
|
||||||
|
|
||||||
|
if (availableLove)
|
||||||
|
_specialTreasures.add(loveChestItem);
|
||||||
|
else
|
||||||
|
_seasonalTreasures.add(loveChestItem);
|
||||||
|
|
||||||
if (availableChristmas)
|
if (availableChristmas)
|
||||||
_specialTreasures.add(winterTreasureItem);
|
_specialTreasures.add(winterTreasureItem);
|
||||||
|
@ -39,6 +39,7 @@ import mineplex.core.common.util.BukkitFuture;
|
|||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
|
import mineplex.serverdata.commands.TwoFactorResetCommand;
|
||||||
import mineplex.serverdata.database.DBPool;
|
import mineplex.serverdata.database.DBPool;
|
||||||
|
|
||||||
@ReflectivelyCreateMiniPlugin
|
@ReflectivelyCreateMiniPlugin
|
||||||
@ -88,6 +89,10 @@ public class TwoFactorAuth extends MiniClientPlugin<TwoFactorData>
|
|||||||
if (args.length == 1) // Resetting their own 2FA
|
if (args.length == 1) // Resetting their own 2FA
|
||||||
{
|
{
|
||||||
caller.sendMessage(F.main("2FA", "Resetting 2FA.."));
|
caller.sendMessage(F.main("2FA", "Resetting 2FA.."));
|
||||||
|
runAsync(() ->
|
||||||
|
{
|
||||||
|
new TwoFactorResetCommand(caller.getName(), caller.getUniqueId().toString(), caller.getName(), caller.getUniqueId().toString()).publish();
|
||||||
|
});
|
||||||
_repository.deletePlayerData(_clientManager.getAccountId(caller)).whenComplete(BukkitFuture.complete((__, err) ->
|
_repository.deletePlayerData(_clientManager.getAccountId(caller)).whenComplete(BukkitFuture.complete((__, err) ->
|
||||||
{
|
{
|
||||||
if (err != null)
|
if (err != null)
|
||||||
@ -119,6 +124,10 @@ public class TwoFactorAuth extends MiniClientPlugin<TwoFactorData>
|
|||||||
}
|
}
|
||||||
|
|
||||||
caller.sendMessage(F.main("2FA", "Resetting 2FA for \"" + client.getName() + "\""));
|
caller.sendMessage(F.main("2FA", "Resetting 2FA for \"" + client.getName() + "\""));
|
||||||
|
runAsync(() ->
|
||||||
|
{
|
||||||
|
new TwoFactorResetCommand(caller.getName(), caller.getUniqueId().toString(), client.getName(), client.getUniqueId() == null ? "null" : client.getUniqueId().toString()).publish();
|
||||||
|
});
|
||||||
_repository.deletePlayerData(client.getAccountId()).whenComplete(BukkitFuture.complete((__, err) ->
|
_repository.deletePlayerData(client.getAccountId()).whenComplete(BukkitFuture.complete((__, err) ->
|
||||||
{
|
{
|
||||||
if (err != null)
|
if (err != null)
|
||||||
|
@ -1219,6 +1219,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
|||||||
_netherManager.onDisable();
|
_netherManager.onDisable();
|
||||||
_safeLog.onDisable();
|
_safeLog.onDisable();
|
||||||
_restartManager.onDisable();
|
_restartManager.onDisable();
|
||||||
|
_observerManager.onDisable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
|
@ -26,6 +26,7 @@ import mineplex.game.clans.clans.ClanTips.TipType;
|
|||||||
import mineplex.game.clans.clans.ban.ClansBanManager;
|
import mineplex.game.clans.clans.ban.ClansBanManager;
|
||||||
import mineplex.game.clans.clans.ClansManager;
|
import mineplex.game.clans.clans.ClansManager;
|
||||||
import mineplex.game.clans.gameplay.safelog.npc.NPCManager;
|
import mineplex.game.clans.gameplay.safelog.npc.NPCManager;
|
||||||
|
import mineplex.game.clans.restart.RestartManager;
|
||||||
|
|
||||||
public class SafeLog extends MiniPlugin
|
public class SafeLog extends MiniPlugin
|
||||||
{
|
{
|
||||||
@ -69,6 +70,11 @@ public class SafeLog extends MiniPlugin
|
|||||||
isSafeLog = true;
|
isSafeLog = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Managers.get(RestartManager.class).isRestarting())
|
||||||
|
{
|
||||||
|
isSafeLog = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isSafeLog)
|
if (!isSafeLog)
|
||||||
{
|
{
|
||||||
if (!_clansManager.getIncognitoManager().Get(player).Status)
|
if (!_clansManager.getIncognitoManager().Get(player).Status)
|
||||||
@ -156,5 +162,4 @@ public class SafeLog extends MiniPlugin
|
|||||||
{
|
{
|
||||||
onPlayerJoin(event.getPlayer());
|
onPlayerJoin(event.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -239,5 +239,4 @@ public class CombatLogNPC
|
|||||||
{
|
{
|
||||||
_lastDamager = damager;
|
_lastDamager = damager;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -5,8 +5,13 @@ import java.util.LinkedList;
|
|||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.player.PlayerLoginEvent;
|
||||||
|
import org.bukkit.event.player.PlayerLoginEvent.Result;
|
||||||
|
import org.bukkit.event.server.ServerListPingEvent;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import mineplex.core.Managers;
|
||||||
import mineplex.core.MiniPlugin;
|
import mineplex.core.MiniPlugin;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
@ -23,6 +28,7 @@ import mineplex.core.slack.SlackTeam;
|
|||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.game.clans.clans.ClansManager;
|
import mineplex.game.clans.clans.ClansManager;
|
||||||
|
import mineplex.game.clans.gameplay.safelog.npc.NPCManager;
|
||||||
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
||||||
|
|
||||||
public class RestartManager extends MiniPlugin
|
public class RestartManager extends MiniPlugin
|
||||||
@ -104,6 +110,11 @@ public class RestartManager extends MiniPlugin
|
|||||||
return restart;
|
return restart;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isRestarting()
|
||||||
|
{
|
||||||
|
return _restarting;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disable()
|
public void disable()
|
||||||
{
|
{
|
||||||
@ -120,6 +131,24 @@ public class RestartManager extends MiniPlugin
|
|||||||
_restartTime = System.currentTimeMillis() + 120000;
|
_restartTime = System.currentTimeMillis() + 120000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
|
public void reflectMotd(ServerListPingEvent event)
|
||||||
|
{
|
||||||
|
if (_restarting)
|
||||||
|
{
|
||||||
|
event.setMotd("Restarting soon");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void blockLogin(PlayerLoginEvent event)
|
||||||
|
{
|
||||||
|
if (_restarting)
|
||||||
|
{
|
||||||
|
event.disallow(Result.KICK_OTHER, C.cRed + "This server is restarting!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void checkRestart(UpdateEvent event)
|
public void checkRestart(UpdateEvent event)
|
||||||
{
|
{
|
||||||
@ -146,6 +175,7 @@ public class RestartManager extends MiniPlugin
|
|||||||
if (System.currentTimeMillis() >= _restartTime)
|
if (System.currentTimeMillis() >= _restartTime)
|
||||||
{
|
{
|
||||||
_restarting = true;
|
_restarting = true;
|
||||||
|
NPCManager.getInstance().disable();
|
||||||
Portal.getInstance().sendAllPlayersToGenericServer(GenericServer.CLANS_HUB, Intent.KICK);
|
Portal.getInstance().sendAllPlayersToGenericServer(GenericServer.CLANS_HUB, Intent.KICK);
|
||||||
runSyncLater(() ->
|
runSyncLater(() ->
|
||||||
{
|
{
|
||||||
|
@ -6,6 +6,14 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.entity.EntityPortalEnterEvent;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import mineplex.core.MiniDbClientPlugin;
|
import mineplex.core.MiniDbClientPlugin;
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
@ -16,13 +24,10 @@ import mineplex.core.common.util.UtilTime;
|
|||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.npc.event.NpcDamageByEntityEvent;
|
import mineplex.core.npc.event.NpcDamageByEntityEvent;
|
||||||
import mineplex.core.npc.event.NpcInteractEntityEvent;
|
import mineplex.core.npc.event.NpcInteractEntityEvent;
|
||||||
import mineplex.core.party.Lang;
|
|
||||||
import mineplex.core.party.Party;
|
|
||||||
import mineplex.core.party.PartyManager;
|
import mineplex.core.party.PartyManager;
|
||||||
import mineplex.core.portal.Intent;
|
import mineplex.core.portal.Intent;
|
||||||
import mineplex.core.portal.Portal;
|
import mineplex.core.portal.Portal;
|
||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.game.clans.core.repository.tokens.SimpleClanToken;
|
import mineplex.game.clans.core.repository.tokens.SimpleClanToken;
|
||||||
@ -30,14 +35,6 @@ import mineplex.serverdata.Region;
|
|||||||
import mineplex.serverdata.data.MinecraftServer;
|
import mineplex.serverdata.data.MinecraftServer;
|
||||||
import mineplex.serverdata.servers.ServerManager;
|
import mineplex.serverdata.servers.ServerManager;
|
||||||
|
|
||||||
import org.bukkit.Sound;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.entity.EntityPortalEnterEvent;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Server selection controller for clans
|
* Server selection controller for clans
|
||||||
*/
|
*/
|
||||||
@ -93,7 +90,7 @@ public class ClansTransferManager extends MiniDbClientPlugin<SimpleClanToken>
|
|||||||
{
|
{
|
||||||
for (ServerInfo server : _servers.values())
|
for (ServerInfo server : _servers.values())
|
||||||
{
|
{
|
||||||
if (server.Name.equalsIgnoreCase(name))
|
if (server.Name.equalsIgnoreCase(name) && !server.MOTD.equalsIgnoreCase("Restarting soon"))
|
||||||
{
|
{
|
||||||
return server;
|
return server;
|
||||||
}
|
}
|
||||||
@ -112,6 +109,7 @@ public class ClansTransferManager extends MiniDbClientPlugin<SimpleClanToken>
|
|||||||
{
|
{
|
||||||
ServerInfo info = new ServerInfo();
|
ServerInfo info = new ServerInfo();
|
||||||
info.Name = server.getName();
|
info.Name = server.getName();
|
||||||
|
info.MOTD = server.getMotd();
|
||||||
info.CurrentPlayers = server.getPlayerCount();
|
info.CurrentPlayers = server.getPlayerCount();
|
||||||
info.MaxPlayers = server.getMaxPlayerCount();
|
info.MaxPlayers = server.getMaxPlayerCount();
|
||||||
_servers.put(server, info);
|
_servers.put(server, info);
|
||||||
@ -154,7 +152,6 @@ public class ClansTransferManager extends MiniDbClientPlugin<SimpleClanToken>
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void refreshPages(UpdateEvent event)
|
public void refreshPages(UpdateEvent event)
|
||||||
{
|
{
|
||||||
|
@ -6,6 +6,7 @@ package mineplex.clanshub;
|
|||||||
public class ServerInfo
|
public class ServerInfo
|
||||||
{
|
{
|
||||||
public String Name;
|
public String Name;
|
||||||
|
public String MOTD;
|
||||||
public int CurrentPlayers = 0;
|
public int CurrentPlayers = 0;
|
||||||
public int MaxPlayers = 0;
|
public int MaxPlayers = 0;
|
||||||
|
|
||||||
|
@ -487,8 +487,8 @@ public class CombatManager extends MiniPlugin
|
|||||||
if (log.GetAssists() > 0)
|
if (log.GetAssists() > 0)
|
||||||
killPlayer += " + " + log.GetAssists();
|
killPlayer += " + " + log.GetAssists();
|
||||||
|
|
||||||
String weapon = log.GetKiller().GetLastDamageSource();
|
String weapon = (String) log.GetKiller().GetDamage().getFirst().getMetadata().get("customWeapon");
|
||||||
|
weapon = weapon == null ? log.GetKiller().GetLastDamageSource() : weapon;
|
||||||
UtilPlayer.message(
|
UtilPlayer.message(
|
||||||
cur,
|
cur,
|
||||||
F.main("Death",
|
F.main("Death",
|
||||||
|
@ -252,7 +252,6 @@ public class CustomExplosion extends Explosion
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
double d7 = entity.f(this.posX, this.posY, this.posZ) / this._size; // XXX
|
double d7 = entity.f(this.posX, this.posY, this.posZ) / this._size; // XXX
|
||||||
|
|
||||||
if (d7 <= 1.0D)
|
if (d7 <= 1.0D)
|
||||||
{
|
{
|
||||||
double d0 = entity.locX - this.posX;
|
double d0 = entity.locX - this.posX;
|
||||||
|
@ -11,10 +11,12 @@ public class AddPunishCommand extends ServerCommand
|
|||||||
private final long _duration;
|
private final long _duration;
|
||||||
private final String _admin;
|
private final String _admin;
|
||||||
private final String _adminUUID;
|
private final String _adminUUID;
|
||||||
|
private final int _severity;
|
||||||
|
|
||||||
public AddPunishCommand(String finalPlayerName, String category, String sentence, String reason, long duration, String finalCallerName, String uuid)
|
public AddPunishCommand(String finalPlayerName, int severity, String category, String sentence, String reason, long duration, String finalCallerName, String uuid)
|
||||||
{
|
{
|
||||||
this._target = finalPlayerName;
|
this._target = finalPlayerName;
|
||||||
|
this._severity = severity;
|
||||||
this._category = category;
|
this._category = category;
|
||||||
this._sentence = sentence;
|
this._sentence = sentence;
|
||||||
this._reason = reason;
|
this._reason = reason;
|
||||||
|
@ -2,17 +2,19 @@ package mineplex.serverdata.commands;
|
|||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
public class RemovePunishCommand extends ServerCommand
|
public class RemovePunishCommand extends ServerCommand
|
||||||
{
|
{
|
||||||
private final int _punishmentId;
|
private final JsonObject _punishment;
|
||||||
private final String _target;
|
private final String _target;
|
||||||
private final String _admin;
|
private final String _admin;
|
||||||
private final String _adminUUID;
|
private final String _adminUUID;
|
||||||
private final String _reason;
|
private final String _reason;
|
||||||
|
|
||||||
public RemovePunishCommand(int punishmentId, String target, String admin, UUID adminUUID, String reason)
|
public RemovePunishCommand(JsonObject punishment, String target, String admin, UUID adminUUID, String reason)
|
||||||
{
|
{
|
||||||
_punishmentId = punishmentId;
|
_punishment = punishment;
|
||||||
_target = target;
|
_target = target;
|
||||||
_admin = admin;
|
_admin = admin;
|
||||||
_adminUUID = adminUUID.toString();
|
_adminUUID = adminUUID.toString();
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
package mineplex.serverdata.commands;
|
||||||
|
|
||||||
|
public class TwoFactorResetCommand extends ServerCommand
|
||||||
|
{
|
||||||
|
private String _adminName;
|
||||||
|
private String _adminUUID;
|
||||||
|
private String _targetName;
|
||||||
|
private String _targetUUID;
|
||||||
|
|
||||||
|
public TwoFactorResetCommand(String adminName, String adminUUID, String targetName, String targetUUID)
|
||||||
|
{
|
||||||
|
_adminName = adminName;
|
||||||
|
_adminUUID = adminUUID;
|
||||||
|
_targetName = targetName;
|
||||||
|
_targetUUID = targetUUID;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package mineplex.serverdata.commands;
|
||||||
|
|
||||||
|
public class UpdateRankCommand extends ServerCommand
|
||||||
|
{
|
||||||
|
private String _callerName;
|
||||||
|
private String _callerUUID;
|
||||||
|
private String _targetName;
|
||||||
|
private String _targetRankNew;
|
||||||
|
|
||||||
|
public UpdateRankCommand(String callerName, String callerUUID, String targetName, String targetRankNew)
|
||||||
|
{
|
||||||
|
_callerName = callerName;
|
||||||
|
_callerUUID = callerUUID;
|
||||||
|
_targetName = targetName;
|
||||||
|
_targetRankNew = targetRankNew;
|
||||||
|
}
|
||||||
|
}
|
@ -165,6 +165,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
|
|||||||
int thankfulChestsReceived = 0;
|
int thankfulChestsReceived = 0;
|
||||||
int gingerbreadChestsReceived = 0;
|
int gingerbreadChestsReceived = 0;
|
||||||
int minestrikeChestsReceived = 0;
|
int minestrikeChestsReceived = 0;
|
||||||
|
int loveChestsReceived = 0;
|
||||||
|
|
||||||
for (CoinTransactionToken transaction : donor.getCoinTransactions())
|
for (CoinTransactionToken transaction : donor.getCoinTransactions())
|
||||||
{
|
{
|
||||||
@ -308,6 +309,16 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
|
|||||||
minestrikeChestsReceived += 1;
|
minestrikeChestsReceived += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (transaction.SalesPackageName.startsWith("Love Chest"))
|
||||||
|
{
|
||||||
|
if (transaction.Coins == 0 && transaction.Gems == 0)
|
||||||
|
{
|
||||||
|
if (transaction.SalesPackageName.split(" ").length == 3)
|
||||||
|
loveChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
|
||||||
|
else if (transaction.SalesPackageName.split(" ").length == 2)
|
||||||
|
loveChestsReceived += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (transaction.SalesPackageName.startsWith("Valentines Gift"))
|
if (transaction.SalesPackageName.startsWith("Valentines Gift"))
|
||||||
{
|
{
|
||||||
if (transaction.Coins == 0 && transaction.Gems == 0)
|
if (transaction.Coins == 0 && transaction.Gems == 0)
|
||||||
@ -379,6 +390,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
|
|||||||
caller.sendMessage(C.cBlue + "Haunted Chests Received: " + C.cYellow + hauntedChestsReceived + " " + C.cBlue + "Haunted Chests Opened: " + C.cYellow + hauntedChestsOpened);
|
caller.sendMessage(C.cBlue + "Haunted Chests Received: " + C.cYellow + hauntedChestsReceived + " " + C.cBlue + "Haunted Chests Opened: " + C.cYellow + hauntedChestsOpened);
|
||||||
caller.sendMessage(C.cBlue + "Trick or Treat Chests Received: " + C.cYellow + trickOrTreatChestsReceived + " " + C.cBlue + "Thankful Chests Received: " + C.cYellow + thankfulChestsReceived);
|
caller.sendMessage(C.cBlue + "Trick or Treat Chests Received: " + C.cYellow + trickOrTreatChestsReceived + " " + C.cBlue + "Thankful Chests Received: " + C.cYellow + thankfulChestsReceived);
|
||||||
caller.sendMessage(C.cBlue + "Gingerbread Chests Received: " + C.cYellow + gingerbreadChestsReceived + " " + C.cBlue + "Minestrike Chests Received: " + C.cYellow + minestrikeChestsReceived);
|
caller.sendMessage(C.cBlue + "Gingerbread Chests Received: " + C.cYellow + gingerbreadChestsReceived + " " + C.cBlue + "Minestrike Chests Received: " + C.cYellow + minestrikeChestsReceived);
|
||||||
|
caller.sendMessage(C.cBlue + "Love Chests Received: " + C.cYellow + loveChestsReceived);
|
||||||
caller.sendMessage(C.cBlue + "Game Amplifiers Received: " + C.cYellow + boostersReceived);
|
caller.sendMessage(C.cBlue + "Game Amplifiers Received: " + C.cYellow + boostersReceived);
|
||||||
caller.sendMessage(C.cBlue + "Rune Amplifiers (20 min/60 min) Received: " + C.cYellow + runeAmplifier20 + "/" + runeAmplifier60);
|
caller.sendMessage(C.cBlue + "Rune Amplifiers (20 min/60 min) Received: " + C.cYellow + runeAmplifier20 + "/" + runeAmplifier60);
|
||||||
caller.sendMessage(C.cBlue + "Clan Banner Usage: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Usage") + " " + C.cBlue + "Clan Banner Editor: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Editor"));
|
caller.sendMessage(C.cBlue + "Clan Banner Usage: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Usage") + " " + C.cBlue + "Clan Banner Editor: " + getLockedFreedomStr(client.getUniqueId(), "Clan Banner Editor"));
|
||||||
|
@ -30,6 +30,7 @@ import mineplex.staffServer.salespackage.salespackages.LifetimeHero;
|
|||||||
import mineplex.staffServer.salespackage.salespackages.LifetimeLegend;
|
import mineplex.staffServer.salespackage.salespackages.LifetimeLegend;
|
||||||
import mineplex.staffServer.salespackage.salespackages.LifetimeTitan;
|
import mineplex.staffServer.salespackage.salespackages.LifetimeTitan;
|
||||||
import mineplex.staffServer.salespackage.salespackages.LifetimeUltra;
|
import mineplex.staffServer.salespackage.salespackages.LifetimeUltra;
|
||||||
|
import mineplex.staffServer.salespackage.salespackages.LoveChest;
|
||||||
import mineplex.staffServer.salespackage.salespackages.MinestrikeChest;
|
import mineplex.staffServer.salespackage.salespackages.MinestrikeChest;
|
||||||
import mineplex.staffServer.salespackage.salespackages.MythicalChest;
|
import mineplex.staffServer.salespackage.salespackages.MythicalChest;
|
||||||
import mineplex.staffServer.salespackage.salespackages.OldChest;
|
import mineplex.staffServer.salespackage.salespackages.OldChest;
|
||||||
@ -98,6 +99,7 @@ public class SalesPackageManager extends MiniPlugin
|
|||||||
AddSalesPackage(new OmegaChest(this));
|
AddSalesPackage(new OmegaChest(this));
|
||||||
AddSalesPackage(new HauntedChest(this));
|
AddSalesPackage(new HauntedChest(this));
|
||||||
AddSalesPackage(new MinestrikeChest(this));
|
AddSalesPackage(new MinestrikeChest(this));
|
||||||
|
AddSalesPackage(new LoveChest(this));
|
||||||
AddSalesPackage(new TrickOrTreatChest(this));
|
AddSalesPackage(new TrickOrTreatChest(this));
|
||||||
AddSalesPackage(new ThankfulChest(this));
|
AddSalesPackage(new ThankfulChest(this));
|
||||||
|
|
||||||
@ -169,7 +171,7 @@ public class SalesPackageManager extends MiniPlugin
|
|||||||
coinBuilder = coinBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray");
|
coinBuilder = coinBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray");
|
||||||
}
|
}
|
||||||
else if (salesPackage instanceof MythicalChest || salesPackage instanceof AncientChest || salesPackage instanceof OldChest || salesPackage instanceof IlluminatedChest || salesPackage instanceof FreedomChest || salesPackage instanceof HauntedChest || salesPackage instanceof TrickOrTreatChest
|
else if (salesPackage instanceof MythicalChest || salesPackage instanceof AncientChest || salesPackage instanceof OldChest || salesPackage instanceof IlluminatedChest || salesPackage instanceof FreedomChest || salesPackage instanceof HauntedChest || salesPackage instanceof TrickOrTreatChest
|
||||||
|| salesPackage instanceof ThankfulChest || salesPackage instanceof GingerbreadChest || salesPackage instanceof MinestrikeChest)
|
|| salesPackage instanceof ThankfulChest || salesPackage instanceof GingerbreadChest || salesPackage instanceof MinestrikeChest || salesPackage instanceof LoveChest)
|
||||||
{
|
{
|
||||||
chestBuilder = chestBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray");
|
chestBuilder = chestBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray");
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
package mineplex.staffServer.salespackage.salespackages;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.staffServer.salespackage.SalesPackageManager;
|
||||||
|
|
||||||
|
public class LoveChest extends SalesPackageBase
|
||||||
|
{
|
||||||
|
public LoveChest(SalesPackageManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "1 Love Chest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void displayToAgent(Player agent, String playerName)
|
||||||
|
{
|
||||||
|
addButton(agent, "/sales item " + playerName + " 1 Item Love Chest", "Give 1 Love Chest.");
|
||||||
|
agent.sendMessage(" ");
|
||||||
|
addBackButton(agent, playerName);
|
||||||
|
}
|
||||||
|
}
|
@ -935,16 +935,16 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
+ "|" + ((_game == null || _game.WorldData == null) ? "Unknown" : _game.WorldData.MapName);
|
+ "|" + ((_game == null || _game.WorldData == null) ? "Unknown" : _game.WorldData.MapName);
|
||||||
|
|
||||||
if (_gameHostManager.isPrivateServer() && _gameHostManager.hasRank(Rank.TWITCH))
|
if (_gameHostManager.isPrivateServer() && _gameHostManager.hasRank(Rank.TWITCH))
|
||||||
|
{
|
||||||
extrainformation += "|HostRank." + _gameHostManager.getHostRank().toString();
|
extrainformation += "|HostRank." + _gameHostManager.getHostRank().toString();
|
||||||
|
}
|
||||||
//Always Joinable
|
//Always Joinable
|
||||||
// if (_game != null && _game.JoinInProgress)
|
/*if (_game != null && _game.JoinInProgress)
|
||||||
// {
|
{
|
||||||
// event.setMotd(ChatColor.GREEN + "Recruiting" + extrainformation);
|
event.setMotd(ChatColor.GREEN + "Recruiting" + extrainformation);
|
||||||
// }
|
}
|
||||||
|
//Recruiting
|
||||||
//Recruiting
|
else */if (_game == null || _game.GetState() == GameState.Recruit)
|
||||||
else if (_game == null || _game.GetState() == GameState.Recruit)
|
|
||||||
{
|
{
|
||||||
if (_game != null && _game.GetCountdown() != -1)
|
if (_game != null && _game.GetCountdown() != -1)
|
||||||
{
|
{
|
||||||
|
@ -365,7 +365,7 @@ public class Wizards extends SoloGame
|
|||||||
{
|
{
|
||||||
percent = 10;
|
percent = 10;
|
||||||
}
|
}
|
||||||
else if (name.contains("GOLDEN") || name.contains("CHAINMAIL"))
|
else if (name.contains("GOLD") || name.contains("CHAINMAIL"))
|
||||||
{
|
{
|
||||||
percent = 15;
|
percent = 15;
|
||||||
}
|
}
|
||||||
@ -1123,8 +1123,16 @@ public class Wizards extends SoloGame
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onClick(InventoryClickEvent event)
|
public void onClick(InventoryClickEvent event)
|
||||||
{
|
{
|
||||||
if (event.getClickedInventory() == null || !(event.getClickedInventory().getHolder() instanceof BlockState))
|
if (event.getClickedInventory() == null)
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
InventoryHolder holder = event.getClickedInventory().getHolder();
|
||||||
|
// DoubleChests aren't a BlockState as they represent more than one block
|
||||||
|
if (!(holder instanceof BlockState || holder instanceof DoubleChest))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ItemStack item = event.getCurrentItem();
|
ItemStack item = event.getCurrentItem();
|
||||||
|
|
||||||
@ -1277,9 +1285,13 @@ public class Wizards extends SoloGame
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onDropItem(PlayerDropItemEvent event)
|
public void onDropItem(PlayerDropItemEvent event)
|
||||||
{
|
{
|
||||||
if (event.getPlayer().getInventory().getHeldItemSlot() < 5)
|
// Check to see if they item they're dropping is from one of the first five slots(wand slots)
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
if (event.getPlayer().getInventory().getItem(i) == null)
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ public class SpellAnvilDrop extends Spell implements SpellClick
|
|||||||
int spellLevel = entity.getMetadata("SpellLevel").get(0).asInt();
|
int spellLevel = entity.getMetadata("SpellLevel").get(0).asInt();
|
||||||
|
|
||||||
CustomExplosion explosion = new CustomExplosion(Wizards.getArcadeManager().GetDamage(), Wizards.getArcadeManager()
|
CustomExplosion explosion = new CustomExplosion(Wizards.getArcadeManager().GetDamage(), Wizards.getArcadeManager()
|
||||||
.GetExplosion(), entity.getLocation(), 1 + (spellLevel / 2F), "Anvil Drop");
|
.GetExplosion(), entity.getLocation(), 4 + (spellLevel / 2F), "Anvil Drop");
|
||||||
|
|
||||||
explosion.setPlayer((Player) entity.getMetadata("Wizard").get(0).value(), true);
|
explosion.setPlayer((Player) entity.getMetadata("Wizard").get(0).value(), true);
|
||||||
|
|
||||||
@ -98,7 +98,8 @@ public class SpellAnvilDrop extends Spell implements SpellClick
|
|||||||
|
|
||||||
explosion.setDropItems(false);
|
explosion.setDropItems(false);
|
||||||
|
|
||||||
explosion.setMaxDamage(6 + (spellLevel * 4));
|
explosion.setBlockExplosionSize(explosion.getSize() -3);
|
||||||
|
explosion.setExplosionDamage(3 + (spellLevel * 2));
|
||||||
|
|
||||||
explosion.explode();
|
explosion.explode();
|
||||||
|
|
||||||
|
@ -32,17 +32,17 @@ public class SpellFireball extends Spell implements SpellClick
|
|||||||
int spellLevel = projectile.getMetadata("SpellLevel").get(0).asInt();
|
int spellLevel = projectile.getMetadata("SpellLevel").get(0).asInt();
|
||||||
|
|
||||||
CustomExplosion explosion = new CustomExplosion(Wizards.getArcadeManager().GetDamage(), Wizards.getArcadeManager()
|
CustomExplosion explosion = new CustomExplosion(Wizards.getArcadeManager().GetDamage(), Wizards.getArcadeManager()
|
||||||
.GetExplosion(), projectile.getLocation(), (spellLevel * 0.3F) + 1F, "Fireball");
|
.GetExplosion(), projectile.getLocation(), (spellLevel * 0.3F) + 4F, "Fireball");
|
||||||
|
|
||||||
explosion.setPlayer((Player) projectile.getMetadata("FireballSpell").get(0).value(), true);
|
explosion.setPlayer((Player) projectile.getMetadata("FireballSpell").get(0).value(), true);
|
||||||
|
|
||||||
explosion.setFallingBlockExplosion(true);
|
explosion.setFallingBlockExplosion(true);
|
||||||
|
|
||||||
explosion.setBlockExplosionSize(explosion.getSize() + 1);
|
explosion.setBlockExplosionSize(explosion.getSize() - 2);
|
||||||
|
|
||||||
explosion.setDropItems(false);
|
explosion.setDropItems(false);
|
||||||
|
|
||||||
explosion.setMaxDamage(spellLevel + 6);
|
explosion.setExplosionDamage(spellLevel + 6);
|
||||||
|
|
||||||
explosion.explode();
|
explosion.explode();
|
||||||
}
|
}
|
||||||
|
@ -278,10 +278,12 @@ public class SpellRumble extends Spell implements SpellClickBlock, SpellClick
|
|||||||
|
|
||||||
if (entity instanceof Player)
|
if (entity instanceof Player)
|
||||||
{
|
{
|
||||||
|
// Why does Slowing by 2 apply slowness 1? The world may never know.
|
||||||
|
// As such, we subtract one from the spellLevel and ask no more questions
|
||||||
Wizards.getArcadeManager()
|
Wizards.getArcadeManager()
|
||||||
.GetCondition()
|
.GetCondition()
|
||||||
.Factory()
|
.Factory()
|
||||||
.Slow("Rumble", (LivingEntity) entity, player, 3, spellLevel, false, false,
|
.Slow("Rumble", (LivingEntity) entity, player, 3, spellLevel-1, false, false,
|
||||||
false, false);
|
false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,7 @@ public class SpellSummonWolves extends Spell implements SpellClick, SpellClickBl
|
|||||||
if (tamer instanceof Player)
|
if (tamer instanceof Player)
|
||||||
{
|
{
|
||||||
event.SetDamager((Player) tamer);
|
event.SetDamager((Player) tamer);
|
||||||
|
event.setMetadata("customWeapon", "Summon Wolves");
|
||||||
event.setKnockbackOrigin(wolf.getLocation());
|
event.setKnockbackOrigin(wolf.getLocation());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,13 +8,6 @@ import nautilus.game.arcade.ArcadeManager;
|
|||||||
import nautilus.game.arcade.GameType;
|
import nautilus.game.arcade.GameType;
|
||||||
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by WilliamTiger.
|
|
||||||
* All the code and any API's associated with it
|
|
||||||
* are not to be used anywhere else without written
|
|
||||||
* consent of William Burns. 2015.
|
|
||||||
* 08/07/2015
|
|
||||||
*/
|
|
||||||
public class ChooseMapButton implements IButton
|
public class ChooseMapButton implements IButton
|
||||||
{
|
{
|
||||||
private ArcadeManager _arcadeManager;
|
private ArcadeManager _arcadeManager;
|
||||||
@ -34,10 +27,12 @@ public class ChooseMapButton implements IButton
|
|||||||
public void onClick(Player player, ClickType clickType)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
_arcadeManager.GetGameCreationManager().MapSource = _gameType;
|
_arcadeManager.GetGameCreationManager().MapSource = _gameType;
|
||||||
if(_gameType.getMapSource() != null)
|
if (_gameType.getMapSource() != null)
|
||||||
|
{
|
||||||
_arcadeManager.GetGameCreationManager().MapSource = _gameType.getMapSource()[0];
|
_arcadeManager.GetGameCreationManager().MapSource = _gameType.getMapSource()[0];
|
||||||
|
}
|
||||||
|
|
||||||
_arcadeManager.GetGameCreationManager().MapPref = _map;
|
_arcadeManager.GetGameCreationManager().MapPref = _map.replaceAll(" ", "");
|
||||||
_arcadeManager.GetGame().setGame(_gameType, player, true);
|
_arcadeManager.GetGame().setGame(_gameType, player, true);
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
return;
|
return;
|
||||||
|
@ -8,13 +8,6 @@ import nautilus.game.arcade.ArcadeManager;
|
|||||||
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
import nautilus.game.arcade.gui.privateServer.page.GameVotingPage;
|
import nautilus.game.arcade.gui.privateServer.page.GameVotingPage;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by WilliamTiger.
|
|
||||||
* All the code and any API's associated with it
|
|
||||||
* are not to be used anywhere else without written
|
|
||||||
* consent of William Burns. 2015.
|
|
||||||
* 24/07/15
|
|
||||||
*/
|
|
||||||
public class GameVotingButton implements IButton
|
public class GameVotingButton implements IButton
|
||||||
{
|
{
|
||||||
private ArcadeManager _arcadeManager;
|
private ArcadeManager _arcadeManager;
|
||||||
|
@ -11,13 +11,6 @@ import nautilus.game.arcade.ArcadeManager;
|
|||||||
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
import nautilus.game.arcade.gui.privateServer.page.WhitelistedPage;
|
import nautilus.game.arcade.gui.privateServer.page.WhitelistedPage;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by WilliamTiger.
|
|
||||||
* All the code and any API's associated with it
|
|
||||||
* are not to be used anywhere else without written
|
|
||||||
* consent of William Burns. 2015.
|
|
||||||
* 29/07/15
|
|
||||||
*/
|
|
||||||
public class WhitelistButton implements IButton
|
public class WhitelistButton implements IButton
|
||||||
{
|
{
|
||||||
private ArcadeManager _arcadeManager;
|
private ArcadeManager _arcadeManager;
|
||||||
|
@ -9,13 +9,6 @@ import nautilus.game.arcade.GameType;
|
|||||||
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
import nautilus.game.arcade.gui.privateServer.button.ChooseMapButton;
|
import nautilus.game.arcade.gui.privateServer.button.ChooseMapButton;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by WilliamTiger.
|
|
||||||
* All the code and any API's associated with it
|
|
||||||
* are not to be used anywhere else without written
|
|
||||||
* consent of William Burns. 2015.
|
|
||||||
* 08/07/2015
|
|
||||||
*/
|
|
||||||
public class ChooseMapPage extends BasePage
|
public class ChooseMapPage extends BasePage
|
||||||
{
|
{
|
||||||
private GameType _gameType;
|
private GameType _gameType;
|
||||||
|
@ -17,13 +17,6 @@ import nautilus.game.arcade.ArcadeManager;
|
|||||||
import nautilus.game.arcade.GameType;
|
import nautilus.game.arcade.GameType;
|
||||||
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by WilliamTiger.
|
|
||||||
* All the code and any API's associated with it
|
|
||||||
* are not to be used anywhere else without written
|
|
||||||
* consent of William Burns. 2015.
|
|
||||||
* 24/07/15
|
|
||||||
*/
|
|
||||||
public class GameVotingPage extends BasePage
|
public class GameVotingPage extends BasePage
|
||||||
{
|
{
|
||||||
public GameVotingPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
|
public GameVotingPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
|
||||||
|
@ -13,13 +13,6 @@ import mineplex.core.shop.item.IButton;
|
|||||||
import nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
import nautilus.game.arcade.gui.privateServer.PrivateServerShop;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by WilliamTiger.
|
|
||||||
* All the code and any API's associated with it
|
|
||||||
* are not to be used anywhere else without written
|
|
||||||
* consent of William Burns. 2015.
|
|
||||||
* 29/07/15
|
|
||||||
*/
|
|
||||||
public class WhitelistedPage extends BasePage
|
public class WhitelistedPage extends BasePage
|
||||||
{
|
{
|
||||||
public WhitelistedPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
|
public WhitelistedPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package mineplex.mavericks.review;
|
package mineplex.mavericks.review;
|
||||||
|
|
||||||
|
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.spigotmc.SpigotConfig;
|
||||||
|
|
||||||
import mineplex.core.common.Constants;
|
|
||||||
import mineplex.core.CustomTagFix;
|
import mineplex.core.CustomTagFix;
|
||||||
import mineplex.core.FoodDupeFix;
|
import mineplex.core.FoodDupeFix;
|
||||||
import mineplex.core.PacketsInteractionFix;
|
import mineplex.core.PacketsInteractionFix;
|
||||||
@ -14,6 +16,7 @@ import mineplex.core.blockrestore.BlockRestore;
|
|||||||
import mineplex.core.boosters.BoosterManager;
|
import mineplex.core.boosters.BoosterManager;
|
||||||
import mineplex.core.chat.Chat;
|
import mineplex.core.chat.Chat;
|
||||||
import mineplex.core.command.CommandCenter;
|
import mineplex.core.command.CommandCenter;
|
||||||
|
import mineplex.core.common.Constants;
|
||||||
import mineplex.core.cosmetic.CosmeticManager;
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
import mineplex.core.creature.Creature;
|
import mineplex.core.creature.Creature;
|
||||||
import mineplex.core.disguise.DisguiseManager;
|
import mineplex.core.disguise.DisguiseManager;
|
||||||
@ -51,8 +54,6 @@ import mineplex.core.updater.FileUpdater;
|
|||||||
import mineplex.core.updater.Updater;
|
import mineplex.core.updater.Updater;
|
||||||
import mineplex.core.velocity.VelocityFix;
|
import mineplex.core.velocity.VelocityFix;
|
||||||
import mineplex.core.visibility.VisibilityManager;
|
import mineplex.core.visibility.VisibilityManager;
|
||||||
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
|
||||||
import org.spigotmc.SpigotConfig;
|
|
||||||
|
|
||||||
import static mineplex.core.Managers.require;
|
import static mineplex.core.Managers.require;
|
||||||
|
|
||||||
@ -131,7 +132,7 @@ public class Hub extends JavaPlugin
|
|||||||
preferenceManager, disguiseManager, blockRestore, projectileManager, achievementManager, packetHandler, hologramManager, incognito);
|
preferenceManager, disguiseManager, blockRestore, projectileManager, achievementManager, packetHandler, hologramManager, incognito);
|
||||||
ThankManager thankManager = new ThankManager(this, _clientManager, _donationManager);
|
ThankManager thankManager = new ThankManager(this, _clientManager, _donationManager);
|
||||||
BoosterManager boosterManager = new BoosterManager(this, serverConfiguration.getServerGroup().getBoosterGroup(), _clientManager, _donationManager, inventoryManager, thankManager);
|
BoosterManager boosterManager = new BoosterManager(this, serverConfiguration.getServerGroup().getBoosterGroup(), _clientManager, _donationManager, inventoryManager, thankManager);
|
||||||
RewardManager rewardManager = new RewardManager(_clientManager, _donationManager, inventoryManager, petManager, statsManager, gadgetManager);
|
RewardManager rewardManager = new RewardManager(_clientManager, _donationManager, inventoryManager, petManager, gadgetManager);
|
||||||
TreasureManager treasureManager = new TreasureManager(this, _clientManager, serverStatusManager, _donationManager, inventoryManager, petManager, gadgetManager, blockRestore, hologramManager, statsManager, rewardManager);
|
TreasureManager treasureManager = new TreasureManager(this, _clientManager, serverStatusManager, _donationManager, inventoryManager, petManager, gadgetManager, blockRestore, hologramManager, statsManager, rewardManager);
|
||||||
CosmeticManager cosmeticManager = new CosmeticManager(this, _clientManager, _donationManager, inventoryManager, gadgetManager,
|
CosmeticManager cosmeticManager = new CosmeticManager(this, _clientManager, _donationManager, inventoryManager, gadgetManager,
|
||||||
mountManager, petManager, treasureManager, boosterManager);
|
mountManager, petManager, treasureManager, boosterManager);
|
||||||
|
Loading…
Reference in New Issue
Block a user