Merge branch 'update/aprilchest' of github.com:Mineplex-LLC/Minecraft-PC into feature/eastereggs
This commit is contained in:
commit
fe1cda820f
@ -65,6 +65,8 @@ public class SkinData
|
|||||||
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=");
|
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=");
|
||||||
public final static SkinData LEPRECHAUN = new SkinData("eyJ0aW1lc3RhbXAiOjE0ODc4NzI5Mjg1ODIsInByb2ZpbGVJZCI6IjlmY2FlZDhiMTRiNTRmN2ZhNjRjYjYwNDBlNzA1MjcyIiwicHJvZmlsZU5hbWUiOiJMQ2FzdHIxIiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS80ZTBkZjZhZGNiNzkzMzM5ZjFhOGNkM2E0ZGQ2ZThjNGQ2ZWFjYmU5NWMzZDA5OTI4NDMyMWFiZGI5MTgwOSJ9fX0=", "cyIYHTdzvVBOyYoiJZTvNS8Et5pzqBNxuz6GQspE2lBkW2Bj82JNv5oczsf3oxYAG4zxdb96G8+7UKBmoJdvx0x6UD7Dk0dnKrwpXfOhe+jRxtwMGMsdYCb8URWaoIoeKpxdCmAtjgV6FI8zDy2Yzi+MF4O9e4VqH0tMBoD2/CZScQwNEzc4YXf2M2fglKn9uK2+xrgLV+XS+SNdIn7BRiNlQf96u6N2G0lO+eb09LbIfIgAgfnyLiARccWa+VNo6gwlCFyRMnwOlgqxL5XA5Um4kkx2ZReRRCDFQ4NV5eLBktLd5wpECyOuY7v7S3zLqwbhwG47gS8hnXqmtHG5RW0RUQZEryg638Cw7hwr2k09iStfok8WeZUIJ+fuUWgdArvbtN36a2pCXyFdqzp+E8xzSF4E9SQv0K+1lNj+w4L58dh8pddeKK8m5bpjINj4xZ6nf7reWYQAX/imVNYTXTW8JqYnF+++xViBwmfeeM3PmEg+wyTduh+M25nyhGcqn5l+UyQ9aMzzdNs2aEdx12fOm1sOFXjHrHWeo6ciEm7sY1SDjiJ99VVXuGHCJWBtxq/B+c+vC/Cj8itEYOetwe5NKrgI99pZjG+KiRr4L0n8/NA3Px7SbKUUpHse80pNMjGfFW4pAOyFXJaKHrObWT2iL2AnTe+yfdY4sf/JZT4=");
|
public final static SkinData LEPRECHAUN = new SkinData("eyJ0aW1lc3RhbXAiOjE0ODc4NzI5Mjg1ODIsInByb2ZpbGVJZCI6IjlmY2FlZDhiMTRiNTRmN2ZhNjRjYjYwNDBlNzA1MjcyIiwicHJvZmlsZU5hbWUiOiJMQ2FzdHIxIiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS80ZTBkZjZhZGNiNzkzMzM5ZjFhOGNkM2E0ZGQ2ZThjNGQ2ZWFjYmU5NWMzZDA5OTI4NDMyMWFiZGI5MTgwOSJ9fX0=", "cyIYHTdzvVBOyYoiJZTvNS8Et5pzqBNxuz6GQspE2lBkW2Bj82JNv5oczsf3oxYAG4zxdb96G8+7UKBmoJdvx0x6UD7Dk0dnKrwpXfOhe+jRxtwMGMsdYCb8URWaoIoeKpxdCmAtjgV6FI8zDy2Yzi+MF4O9e4VqH0tMBoD2/CZScQwNEzc4YXf2M2fglKn9uK2+xrgLV+XS+SNdIn7BRiNlQf96u6N2G0lO+eb09LbIfIgAgfnyLiARccWa+VNo6gwlCFyRMnwOlgqxL5XA5Um4kkx2ZReRRCDFQ4NV5eLBktLd5wpECyOuY7v7S3zLqwbhwG47gS8hnXqmtHG5RW0RUQZEryg638Cw7hwr2k09iStfok8WeZUIJ+fuUWgdArvbtN36a2pCXyFdqzp+E8xzSF4E9SQv0K+1lNj+w4L58dh8pddeKK8m5bpjINj4xZ6nf7reWYQAX/imVNYTXTW8JqYnF+++xViBwmfeeM3PmEg+wyTduh+M25nyhGcqn5l+UyQ9aMzzdNs2aEdx12fOm1sOFXjHrHWeo6ciEm7sY1SDjiJ99VVXuGHCJWBtxq/B+c+vC/Cj8itEYOetwe5NKrgI99pZjG+KiRr4L0n8/NA3Px7SbKUUpHse80pNMjGfFW4pAOyFXJaKHrObWT2iL2AnTe+yfdY4sf/JZT4=");
|
||||||
|
public final static SkinData BUGS_BUNNY = new SkinData("eyJ0aW1lc3RhbXAiOjE0OTA0NzE5MDU2MTgsInByb2ZpbGVJZCI6IjlmY2FlZDhiMTRiNTRmN2ZhNjRjYjYwNDBlNzA1MjcyIiwicHJvZmlsZU5hbWUiOiJMQ2FzdHIxIiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS84MmUyMjRkMGJkZGJmNjRiODIzMmUxNWRhNGRkN2NjN2NiYTYzM2NiODkyMTFhYjVjNDRhODU0ZjM1NDhlZWRiIn19fQ==", "QtM7YGNpqGcTnlUCTtQsQIEc8VGvL8cxWzAvN4LjYZrY4Fv15ysEVSPWPmRL/FJTRyUFCrJFO/0miVbuIEsGyUnsgHJAr9qkeyMvfD3+pZtKU1FkS58VNQkL/YaPDms7XPy1BPNo+ynQnVevdVCNDOvs2244Px3UljtuReBteKqL8QGMR1K6FFCQuKKvcvYsljdM8RV91r2yuT9UDxnzMRghWyRZuthvCeGL85g1LQxCnzJ0NUqIqCDrTWa8jeuncLnmRooKZYGsQjCAVOSFRk4KytD+fv8xgNK2igqBgVcqAINl5IjrFt7yyPQ2FVBbshETsjewusa6eZSBoy1Lc17G7bcndoOdwGMuztLjHPMzxFpIV1RkbZrngjcSTE/IQdSw79NlzMOEMKjE/34M7xcSnSZA1xwW33g+/xq+pNbqcXu85e7VXkziWDhHREp9ITT4YjrVdrss1yfYBzZgRmmLyaMpVmVsecKB9adpuZkhGzKIVrQHDGYEHoqoRnsRGJREdZQPxaSWp4+DSxpV/0oJXJWDz+XFztbcVbBcjBOD9kpFP0s+R5t1WA2B+jsf9J3LdsUUDbBiWikBwbAXKhHxTWWKv6OZLZovhgvGnW2lXQsHglEKuD7jE/mnFj4SF2qRO2N37AUjaG8AGQtTVhxW5JneIiBA0dbKIk06yoY=");
|
||||||
|
public final static SkinData SLENDERMAN = new SkinData("eyJ0aW1lc3RhbXAiOjE0OTA0NzUyNzk4NTUsInByb2ZpbGVJZCI6IjlmY2FlZDhiMTRiNTRmN2ZhNjRjYjYwNDBlNzA1MjcyIiwicHJvZmlsZU5hbWUiOiJMQ2FzdHIxIiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS9hMWNkOTI5OTFmYTRjZGQ2MGVlZDNhZTM3ZmI5NWRmZjFkNWNkOGNiZmYwYWFjMzE4MmQ0ODU2NDU5NTIzYyJ9fX0=", "OVqWFLCekyZcdGli6kPBKNh8/VYPhKZGNqlAvSOKc3RLgh4pIkI6TDPr/Y+VQdhz1wZozARFYSeoDJJJ4nZTi7gi3rVPG2rL1ZnKo7so5hdT8caEzSTRmgwPKzo03ZhEEsW9AEJo9mpiUxGSJdBlgEb9UgodpYFW1IjRC09CcBUqzRWP8QGZTSFSN5x9emQ97DyiFmt0NFWubHCKHdb7CExhchPRtbahL3hOEzPY8/Y+Irl9OZjx7jONE7O/sYItCuZoXc3FaTgCV0riiXHCgH2eA54s5TQVWumtp3FU7VIcKR6pm/o61+GusvqhNgdFNk9XSHWMUyp+HNU0R8sConZQN/eaVx9laJmUUb4zNZ7hX/hLYV+r9LFU1NXOeIZWJPShD+bYfZgEorIpD+EAL4BHht/f5e6a1IZUDBWb001PFibby2t9WWjoDVKz4McbxZ2Xui7EHKFG1K3biPibhWx6fvnOeJ2xW6UDIZcD+TCXwlW/knkFt44Xpyv3oNHk3UNkyrQgghd6qkc3gZHxP8PQCNvKIyK1I+pHR6JMZvSStp7ZQRDpvsvIUyOJvq+7Bs7lFYs8hcJHMzEB+8PYlH2k7P7iLuA6ZYFUmvOW1LLq0+hvxK96ZdNEsJdmMkVVTZBRw7vsZ4GPbkdp2cMOFH2lHcQj80xKqVbd43IqFDA=");
|
||||||
|
|
||||||
// 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
|
||||||
|
@ -7,6 +7,16 @@ import java.util.HashSet;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import net.minecraft.server.v1_8_R3.BlockPosition;
|
||||||
|
import net.minecraft.server.v1_8_R3.Blocks;
|
||||||
|
import net.minecraft.server.v1_8_R3.IBlockData;
|
||||||
|
import net.minecraft.server.v1_8_R3.Item;
|
||||||
|
import net.minecraft.server.v1_8_R3.MathHelper;
|
||||||
|
import net.minecraft.server.v1_8_R3.MinecraftKey;
|
||||||
|
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
||||||
|
import net.minecraft.server.v1_8_R3.TileEntityFlowerPot;
|
||||||
|
import net.minecraft.server.v1_8_R3.WorldServer;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.SkullType;
|
import org.bukkit.SkullType;
|
||||||
@ -35,15 +45,6 @@ import com.mojang.authlib.GameProfile;
|
|||||||
import mineplex.core.common.Pair;
|
import mineplex.core.common.Pair;
|
||||||
import mineplex.core.common.block.MultiBlockUpdaterAgent;
|
import mineplex.core.common.block.MultiBlockUpdaterAgent;
|
||||||
import mineplex.core.common.skin.SkinData;
|
import mineplex.core.common.skin.SkinData;
|
||||||
import net.minecraft.server.v1_8_R3.BlockPosition;
|
|
||||||
import net.minecraft.server.v1_8_R3.Blocks;
|
|
||||||
import net.minecraft.server.v1_8_R3.IBlockData;
|
|
||||||
import net.minecraft.server.v1_8_R3.Item;
|
|
||||||
import net.minecraft.server.v1_8_R3.MathHelper;
|
|
||||||
import net.minecraft.server.v1_8_R3.MinecraftKey;
|
|
||||||
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
|
||||||
import net.minecraft.server.v1_8_R3.TileEntityFlowerPot;
|
|
||||||
import net.minecraft.server.v1_8_R3.WorldServer;
|
|
||||||
|
|
||||||
public class UtilBlock
|
public class UtilBlock
|
||||||
{
|
{
|
||||||
@ -395,6 +396,16 @@ public class UtilBlock
|
|||||||
return blockUseSet.contains(block);
|
return blockUseSet.contains(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Set<Block> getBlocksInRadius(Location loc, double radius)
|
||||||
|
{
|
||||||
|
return getInRadius(loc, radius).keySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Set<Block> getBlocksInRadius(Location loc, double radius, int maxHeight)
|
||||||
|
{
|
||||||
|
return getInRadius(loc, radius, maxHeight).keySet();
|
||||||
|
}
|
||||||
|
|
||||||
public static HashMap<Block, Double> getInRadius(Location loc, double dR)
|
public static HashMap<Block, Double> getInRadius(Location loc, double dR)
|
||||||
{
|
{
|
||||||
return getInRadius(loc, dR, 9999);
|
return getInRadius(loc, dR, 9999);
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
package mineplex.core.arcadeevents;
|
||||||
|
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
|
import mineplex.core.game.GameDisplay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This event is called when a game starts in arcade
|
||||||
|
* It's called inside Arcade and handled inside Core,
|
||||||
|
* so we can track game events in core
|
||||||
|
*/
|
||||||
|
public class CoreGameStartEvent extends Event
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
|
||||||
|
private GameDisplay _gameDisplay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param gameDisplay the type of the game
|
||||||
|
*/
|
||||||
|
public CoreGameStartEvent(GameDisplay gameDisplay)
|
||||||
|
{
|
||||||
|
_gameDisplay = gameDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GameDisplay getGameDisplay()
|
||||||
|
{
|
||||||
|
return _gameDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HandlerList getHandlers()
|
||||||
|
{
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList()
|
||||||
|
{
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
package mineplex.core.arcadeevents;
|
||||||
|
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
|
import mineplex.core.game.GameDisplay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This event is called when a game stops in arcade
|
||||||
|
* It's called inside Arcade and handled inside Core,
|
||||||
|
* so we can track game events in core
|
||||||
|
*/
|
||||||
|
public class CoreGameStopEvent extends Event
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
|
||||||
|
private GameDisplay _gameDisplay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param gameDisplay the type of the game
|
||||||
|
*/
|
||||||
|
public CoreGameStopEvent(GameDisplay gameDisplay)
|
||||||
|
{
|
||||||
|
_gameDisplay = gameDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GameDisplay getGameDisplay()
|
||||||
|
{
|
||||||
|
return _gameDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HandlerList getHandlers()
|
||||||
|
{
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList()
|
||||||
|
{
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,17 +1,19 @@
|
|||||||
package mineplex.core.cosmetic.ui;
|
package mineplex.core.cosmetic.ui;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.cosmetic.CosmeticManager;
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
import mineplex.core.cosmetic.ui.page.Menu;
|
import mineplex.core.cosmetic.ui.page.Menu;
|
||||||
import mineplex.core.cosmetic.ui.page.PetTagPage;
|
import mineplex.core.cosmetic.ui.page.PetTagPage;
|
||||||
|
import mineplex.core.cosmetic.ui.page.custompet.name.CustomPetTagPage;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.gadget.event.ItemGadgetOutOfAmmoEvent;
|
import mineplex.core.gadget.event.ItemGadgetOutOfAmmoEvent;
|
||||||
import mineplex.core.shop.ShopBase;
|
import mineplex.core.shop.ShopBase;
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
|
||||||
|
|
||||||
public class CosmeticShop extends ShopBase<CosmeticManager> implements PluginMessageListener
|
public class CosmeticShop extends ShopBase<CosmeticManager> implements PluginMessageListener
|
||||||
{
|
{
|
||||||
@ -43,6 +45,16 @@ public class CosmeticShop extends ShopBase<CosmeticManager> implements PluginMes
|
|||||||
((PetTagPage) getPlayerPageMap().get(player.getUniqueId())).SetTagName(tagName);
|
((PetTagPage) getPlayerPageMap().get(player.getUniqueId())).SetTagName(tagName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getPlayerPageMap().containsKey(player.getUniqueId()) && getPlayerPageMap().get(player.getUniqueId()) instanceof CustomPetTagPage)
|
||||||
|
{
|
||||||
|
if (message != null && message.length >= 1)
|
||||||
|
{
|
||||||
|
String tagName = new String(message);
|
||||||
|
|
||||||
|
((CustomPetTagPage) getPlayerPageMap().get(player.getUniqueId())).setTagName(tagName);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -180,6 +180,11 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
itemLore.add(C.cBlack);
|
itemLore.add(C.cBlack);
|
||||||
itemLore.add(C.cBlue + "Found in St Patrick's Chests");
|
itemLore.add(C.cBlue + "Found in St Patrick's Chests");
|
||||||
}
|
}
|
||||||
|
else if (gadget.getCost(GlobalCurrency.TREASURE_SHARD) == -19)
|
||||||
|
{
|
||||||
|
itemLore.add(C.cBlack);
|
||||||
|
itemLore.add(C.cBlue + "Found in Spring Chests");
|
||||||
|
}
|
||||||
|
|
||||||
//Rank Unlocks
|
//Rank Unlocks
|
||||||
else if (gadget.getCost(GlobalCurrency.TREASURE_SHARD) == -10)
|
else if (gadget.getCost(GlobalCurrency.TREASURE_SHARD) == -10)
|
||||||
|
@ -6,7 +6,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Creature;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
@ -142,7 +142,7 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
|
|
||||||
petMax++;
|
petMax++;
|
||||||
}
|
}
|
||||||
Creature petActive = getPlugin().getPetManager().getPet(getPlayer());
|
Entity petActive = getPlugin().getPetManager().getPet(getPlayer());
|
||||||
|
|
||||||
GadgetType type = GadgetType.PARTICLE;
|
GadgetType type = GadgetType.PARTICLE;
|
||||||
String[] lore = getLore(ownedCount.get(type), maxCount.get(type), "Show everyone how cool you are with swirly particles that follow you when you walk!", VISIBILITY_EVERYWHERE, enabled.get(type));
|
String[] lore = getLore(ownedCount.get(type), maxCount.get(type), "Show everyone how cool you are with swirly particles that follow you when you walk!", VISIBILITY_EVERYWHERE, enabled.get(type));
|
||||||
|
@ -21,7 +21,6 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
@ -40,7 +39,6 @@ import mineplex.core.cosmetic.ui.button.deactivate.DeactivatePetButton;
|
|||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.pet.PetExtra;
|
import mineplex.core.pet.PetExtra;
|
||||||
import mineplex.core.pet.PetType;
|
import mineplex.core.pet.PetType;
|
||||||
import mineplex.core.shop.item.IButton;
|
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
import mineplex.core.shop.page.AnvilContainer;
|
import mineplex.core.shop.page.AnvilContainer;
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
@ -63,7 +61,7 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
|
|
||||||
for (PetType pet : pets)
|
for (PetType pet : pets)
|
||||||
{
|
{
|
||||||
List<String> itemLore = new ArrayList<String>();
|
List<String> itemLore = new ArrayList<>();
|
||||||
|
|
||||||
itemLore.add(C.cBlack);
|
itemLore.add(C.cBlack);
|
||||||
if (pet.getLore().isPresent())
|
if (pet.getLore().isPresent())
|
||||||
@ -118,6 +116,11 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
itemLore.add(C.cBlack);
|
itemLore.add(C.cBlack);
|
||||||
itemLore.add(C.cBlue + "Found in St Patrick's Chests");
|
itemLore.add(C.cBlue + "Found in St Patrick's Chests");
|
||||||
}
|
}
|
||||||
|
else if (pet.getPrice() == -19)
|
||||||
|
{
|
||||||
|
itemLore.add(C.cBlack);
|
||||||
|
itemLore.add(C.cBlue + "Found in Spring Chests");
|
||||||
|
}
|
||||||
else if (pet.getPrice() == -14)
|
else if (pet.getPrice() == -14)
|
||||||
{
|
{
|
||||||
itemLore.add(C.cBlack);
|
itemLore.add(C.cBlack);
|
||||||
@ -255,13 +258,13 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
slot++;
|
slot++;
|
||||||
}
|
}
|
||||||
|
|
||||||
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()
|
// Custom pet
|
||||||
{
|
/*addButton(50, new ShopItem(Material.GLASS, C.cGreen + "Custom", new String[]{}, 1, false), (player, clickType) ->
|
||||||
public void onClick(Player player, ClickType clickType)
|
getShop().openPageForPlayer(getPlayer(), new CustomPetBasePage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "Custom Pet", player)));*/
|
||||||
{
|
|
||||||
getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player));
|
|
||||||
}
|
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), (player, clickType) ->
|
||||||
});
|
getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void purchasePet(final Player player, final PetType petType)
|
public void purchasePet(final Player player, final PetType petType)
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
package mineplex.core.cosmetic.ui.page.custompet;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
|
public class ActivateCustomPetButton implements IButton
|
||||||
|
{
|
||||||
|
private GadgetPage _page;
|
||||||
|
|
||||||
|
public ActivateCustomPetButton(GadgetPage page)
|
||||||
|
{
|
||||||
|
_page = page;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
/*_page.playAcceptSound(player);
|
||||||
|
_page.getPlugin().getPetManager().addPetOwner(player, PetType.CUSTOM, player.getLocation());
|
||||||
|
_page.getShop().openPageForPlayer(player, new Menu(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), player));*/
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
package mineplex.core.cosmetic.ui.page.custompet;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
|
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||||
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
|
import mineplex.core.cosmetic.ui.page.Menu;
|
||||||
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.pet.custom.CustomPet;
|
||||||
|
import mineplex.core.shop.item.ShopItem;
|
||||||
|
|
||||||
|
public class CustomPetBasePage extends GadgetPage
|
||||||
|
{
|
||||||
|
|
||||||
|
public CustomPetBasePage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, clientManager, donationManager, name, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildPage()
|
||||||
|
{
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
// EDIT PET
|
||||||
|
// DISABLE PET
|
||||||
|
// RENAME PET
|
||||||
|
// RESET PET
|
||||||
|
|
||||||
|
int slot = 10;
|
||||||
|
|
||||||
|
for (CustomPet.CustomPetType customPetType : CustomPet.CustomPetType.values())
|
||||||
|
{
|
||||||
|
|
||||||
|
addButton(slot, new ShopItem(customPetType.getMaterial(), customPetType.getData(), customPetType.getName(), new String[]{}, 1, false, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
CustomPet customPet = CustomPet.getCustomPet(player);
|
||||||
|
if (customPet == null)
|
||||||
|
{
|
||||||
|
customPet = customPetType.getCustomPet(getPlugin().getPetManager(), player);
|
||||||
|
}
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
slot++;
|
||||||
|
|
||||||
|
if (slot == 17)
|
||||||
|
slot += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player));
|
||||||
|
CustomPet.removeCustomPet(player);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package mineplex.core.cosmetic.ui.page.custompet;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
|
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||||
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.pet.custom.CustomPet;
|
||||||
|
import mineplex.core.shop.item.ShopItem;
|
||||||
|
|
||||||
|
public class CustomPetConfirmPage extends GadgetPage
|
||||||
|
{
|
||||||
|
|
||||||
|
public CustomPetConfirmPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, clientManager, donationManager, name, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildPage()
|
||||||
|
{
|
||||||
|
|
||||||
|
CustomPet customPet = CustomPet.getCustomPet(getPlayer());
|
||||||
|
if (customPet == null)
|
||||||
|
{
|
||||||
|
CustomPet.removeCustomPet(getPlayer());
|
||||||
|
getPlayer().closeInventory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int[] confirm = {19, 20, 21, 28, 29, 30, 37, 38, 39};
|
||||||
|
int[] cancel = {23, 24, 25, 32, 33, 34, 41, 42, 43};
|
||||||
|
|
||||||
|
ShopItem confirmItem = new ShopItem(Material.WOOL, (byte) 5, "Confirm", new String[]{}, 1, false, false);
|
||||||
|
ShopItem cancelItem = new ShopItem(Material.WOOL, (byte) 14, "Cancel", new String[]{}, 1, false, false);
|
||||||
|
|
||||||
|
for (int aConfirm : confirm)
|
||||||
|
{
|
||||||
|
addButton(aConfirm, confirmItem, new ActivateCustomPetButton(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int aCancel : cancel)
|
||||||
|
{
|
||||||
|
addButton(aCancel, cancelItem, (player, clickType) ->
|
||||||
|
{
|
||||||
|
player.closeInventory();
|
||||||
|
CustomPet.removeCustomPet(player);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), (player, clickType) ->
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getPreviousStep(getPlugin(), getShop(), getClientManager(), getDonationManager())));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package mineplex.core.cosmetic.ui.page.custompet.age;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
|
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||||
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.pet.custom.CustomPet;
|
||||||
|
import mineplex.core.pet.custom.CustomPetAgeable;
|
||||||
|
import mineplex.core.shop.item.ShopItem;
|
||||||
|
|
||||||
|
public class CustomPetAgePage extends GadgetPage
|
||||||
|
{
|
||||||
|
|
||||||
|
public CustomPetAgePage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, clientManager, donationManager, name, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildPage()
|
||||||
|
{
|
||||||
|
|
||||||
|
CustomPet customPet = CustomPet.getCustomPet(getPlayer());
|
||||||
|
if (customPet == null)
|
||||||
|
{
|
||||||
|
CustomPet.removeCustomPet(getPlayer());
|
||||||
|
getPlayer().closeInventory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(customPet instanceof CustomPetAgeable))
|
||||||
|
{
|
||||||
|
CustomPet.removeCustomPet(getPlayer());
|
||||||
|
getPlayer().closeInventory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomPetAgeable customPetAgeable = (CustomPetAgeable) customPet;
|
||||||
|
|
||||||
|
addButton(29, new ShopItem(Material.SEEDS, "Baby", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetAgeable.setBaby(true);
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(33, new ShopItem(Material.WHEAT, "Adult", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetAgeable.setBaby(false);
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), (player, clickType) ->
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getPreviousStep(getPlugin(), getShop(), getClientManager(), getDonationManager())));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,89 @@
|
|||||||
|
package mineplex.core.cosmetic.ui.page.custompet.equipment;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
|
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||||
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.pet.custom.CustomPet;
|
||||||
|
import mineplex.core.pet.custom.CustomPetEquipment;
|
||||||
|
import mineplex.core.shop.item.ShopItem;
|
||||||
|
|
||||||
|
public class CustomPetBootsPage extends GadgetPage
|
||||||
|
{
|
||||||
|
|
||||||
|
public CustomPetBootsPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, clientManager, donationManager, name, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildPage()
|
||||||
|
{
|
||||||
|
|
||||||
|
CustomPet customPet = CustomPet.getCustomPet(getPlayer());
|
||||||
|
if (customPet == null)
|
||||||
|
{
|
||||||
|
CustomPet.removeCustomPet(getPlayer());
|
||||||
|
getPlayer().closeInventory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(customPet instanceof CustomPetEquipment))
|
||||||
|
{
|
||||||
|
CustomPet.removeCustomPet(getPlayer());
|
||||||
|
getPlayer().closeInventory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomPetEquipment customPetEquipment = (CustomPetEquipment) customPet;
|
||||||
|
|
||||||
|
// Leather helmet
|
||||||
|
addButton(19, new ShopItem(Material.LEATHER_BOOTS, "Leather", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
// TODO COLORED ARMOR
|
||||||
|
customPetEquipment.setBoots(new ItemStack(Material.LEATHER_BOOTS));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(22, new ShopItem(Material.CHAINMAIL_BOOTS, "Chain", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setBoots(new ItemStack(Material.CHAINMAIL_BOOTS));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(25, new ShopItem(Material.IRON_BOOTS, "Iron", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setBoots(new ItemStack(Material.IRON_HELMET));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(38, new ShopItem(Material.GOLD_BOOTS, "Gold", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setBoots(new ItemStack(Material.GOLD_BOOTS));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(40, new ShopItem(Material.BARRIER, "None", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setBoots(new ItemStack(Material.AIR));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(42, new ShopItem(Material.DIAMOND_BOOTS, "Diamond", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setBoots(new ItemStack(Material.DIAMOND_BOOTS));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), (player, clickType) ->
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getPreviousStep(getPlugin(), getShop(), getClientManager(), getDonationManager())));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
package mineplex.core.cosmetic.ui.page.custompet.equipment;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
|
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||||
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.pet.custom.CustomPet;
|
||||||
|
import mineplex.core.pet.custom.CustomPetEquipment;
|
||||||
|
import mineplex.core.shop.item.ShopItem;
|
||||||
|
|
||||||
|
public class CustomPetChestplatePage extends GadgetPage
|
||||||
|
{
|
||||||
|
|
||||||
|
public CustomPetChestplatePage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, clientManager, donationManager, name, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildPage()
|
||||||
|
{
|
||||||
|
|
||||||
|
CustomPet customPet = CustomPet.getCustomPet(getPlayer());
|
||||||
|
if (customPet == null)
|
||||||
|
{
|
||||||
|
CustomPet.removeCustomPet(getPlayer());
|
||||||
|
getPlayer().closeInventory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(customPet instanceof CustomPetEquipment))
|
||||||
|
{
|
||||||
|
CustomPet.removeCustomPet(getPlayer());
|
||||||
|
getPlayer().closeInventory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomPetEquipment customPetEquipment = (CustomPetEquipment) customPet;
|
||||||
|
|
||||||
|
// Leather helmet
|
||||||
|
addButton(19, new ShopItem(Material.LEATHER_CHESTPLATE, "Leather", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
// TODO COLORED ARMOR
|
||||||
|
customPetEquipment.setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(22, new ShopItem(Material.CHAINMAIL_CHESTPLATE, "Chain", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setChestplate(new ItemStack(Material.CHAINMAIL_CHESTPLATE));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(25, new ShopItem(Material.IRON_CHESTPLATE, "Iron", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setChestplate(new ItemStack(Material.IRON_HELMET));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(38, new ShopItem(Material.GOLD_CHESTPLATE, "Gold", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setChestplate(new ItemStack(Material.GOLD_CHESTPLATE));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(40, new ShopItem(Material.BARRIER, "None", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setChestplate(new ItemStack(Material.AIR));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(42, new ShopItem(Material.DIAMOND_CHESTPLATE, "Diamond", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), (player, clickType) ->
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getPreviousStep(getPlugin(), getShop(), getClientManager(), getDonationManager())));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
package mineplex.core.cosmetic.ui.page.custompet.equipment;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
|
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||||
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.pet.custom.CustomPet;
|
||||||
|
import mineplex.core.pet.custom.CustomPetEquipment;
|
||||||
|
import mineplex.core.shop.item.ShopItem;
|
||||||
|
|
||||||
|
public class CustomPetHelmetPage extends GadgetPage
|
||||||
|
{
|
||||||
|
|
||||||
|
public CustomPetHelmetPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, clientManager, donationManager, name, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildPage()
|
||||||
|
{
|
||||||
|
|
||||||
|
CustomPet customPet = CustomPet.getCustomPet(getPlayer());
|
||||||
|
if (customPet == null)
|
||||||
|
{
|
||||||
|
CustomPet.removeCustomPet(getPlayer());
|
||||||
|
getPlayer().closeInventory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(customPet instanceof CustomPetEquipment))
|
||||||
|
{
|
||||||
|
CustomPet.removeCustomPet(getPlayer());
|
||||||
|
getPlayer().closeInventory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomPetEquipment customPetEquipment = (CustomPetEquipment) customPet;
|
||||||
|
|
||||||
|
// Leather helmet
|
||||||
|
addButton(19, new ShopItem(Material.LEATHER_HELMET, "Leather", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
// TODO COLORED ARMOR
|
||||||
|
customPetEquipment.setHelmet(new ItemStack(Material.LEATHER_HELMET));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(22, new ShopItem(Material.CHAINMAIL_HELMET, "Chain", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setHelmet(new ItemStack(Material.CHAINMAIL_HELMET));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(25, new ShopItem(Material.IRON_HELMET, "Iron", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setHelmet(new ItemStack(Material.IRON_HELMET));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(38, new ShopItem(Material.GOLD_HELMET, "Gold", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setHelmet(new ItemStack(Material.GOLD_HELMET));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(40, new ShopItem(Material.BARRIER, "None", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setHelmet(new ItemStack(Material.AIR));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(42, new ShopItem(Material.DIAMOND_HELMET, "Diamond", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setHelmet(new ItemStack(Material.DIAMOND_HELMET));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), (player, clickType) ->
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getPreviousStep(getPlugin(), getShop(), getClientManager(), getDonationManager())));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
package mineplex.core.cosmetic.ui.page.custompet.equipment;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
|
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||||
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.pet.custom.CustomPet;
|
||||||
|
import mineplex.core.pet.custom.CustomPetEquipment;
|
||||||
|
import mineplex.core.shop.item.ShopItem;
|
||||||
|
|
||||||
|
public class CustomPetLeggingsPage extends GadgetPage
|
||||||
|
{
|
||||||
|
|
||||||
|
public CustomPetLeggingsPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, clientManager, donationManager, name, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildPage()
|
||||||
|
{
|
||||||
|
|
||||||
|
CustomPet customPet = CustomPet.getCustomPet(getPlayer());
|
||||||
|
if (customPet == null)
|
||||||
|
{
|
||||||
|
CustomPet.removeCustomPet(getPlayer());
|
||||||
|
getPlayer().closeInventory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(customPet instanceof CustomPetEquipment))
|
||||||
|
{
|
||||||
|
CustomPet.removeCustomPet(getPlayer());
|
||||||
|
getPlayer().closeInventory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomPetEquipment customPetEquipment = (CustomPetEquipment) customPet;
|
||||||
|
|
||||||
|
// Leather helmet
|
||||||
|
addButton(19, new ShopItem(Material.LEATHER_LEGGINGS, "Leather", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
// TODO COLORED ARMOR
|
||||||
|
customPetEquipment.setLeggings(new ItemStack(Material.LEATHER_LEGGINGS));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(22, new ShopItem(Material.CHAINMAIL_LEGGINGS, "Chain", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(25, new ShopItem(Material.IRON_LEGGINGS, "Iron", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setLeggings(new ItemStack(Material.IRON_HELMET));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(38, new ShopItem(Material.GOLD_LEGGINGS, "Gold", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setLeggings(new ItemStack(Material.GOLD_LEGGINGS));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(40, new ShopItem(Material.BARRIER, "None", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setLeggings(new ItemStack(Material.AIR));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(42, new ShopItem(Material.DIAMOND_LEGGINGS, "Diamond", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetEquipment.setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), (player, clickType) ->
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getPreviousStep(getPlugin(), getShop(), getClientManager(), getDonationManager())));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package mineplex.core.cosmetic.ui.page.custompet.name;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
|
import mineplex.core.pet.custom.CustomPet;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
|
public class CloseCustomPetButton implements IButton
|
||||||
|
{
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
player.closeInventory();
|
||||||
|
CustomPet.removeCustomPet(player);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
package mineplex.core.cosmetic.ui.page.custompet.name;
|
||||||
|
|
||||||
|
import net.minecraft.server.v1_8_R3.Blocks;
|
||||||
|
import net.minecraft.server.v1_8_R3.ChatMessage;
|
||||||
|
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
||||||
|
import net.minecraft.server.v1_8_R3.Items;
|
||||||
|
import net.minecraft.server.v1_8_R3.PacketPlayOutOpenWindow;
|
||||||
|
import net.minecraft.server.v1_8_R3.PacketPlayOutSetSlot;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
|
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||||
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.pet.custom.CustomPet;
|
||||||
|
import mineplex.core.shop.item.ShopItem;
|
||||||
|
import mineplex.core.shop.page.AnvilContainer;
|
||||||
|
|
||||||
|
public class CustomPetNamePage extends GadgetPage
|
||||||
|
{
|
||||||
|
|
||||||
|
public CustomPetNamePage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, clientManager, donationManager, name, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildPage()
|
||||||
|
{
|
||||||
|
|
||||||
|
CustomPet customPet = CustomPet.getCustomPet(getPlayer());
|
||||||
|
if (customPet == null)
|
||||||
|
{
|
||||||
|
CustomPet.removeCustomPet(getPlayer());
|
||||||
|
getPlayer().closeInventory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
addButton(31, new ShopItem(Material.NAME_TAG, "Name", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
CustomPetTagPage customPetTagPage = new CustomPetTagPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "Pet Name", getPlayer());
|
||||||
|
EntityPlayer entityPlayer = ((CraftPlayer) getPlayer()).getHandle();
|
||||||
|
int containerCounter = entityPlayer.nextContainerCounter();
|
||||||
|
UtilPlayer.sendPacket(player, new PacketPlayOutOpenWindow(containerCounter, "minecraft:anvil", new ChatMessage(Blocks.ANVIL.a() + ".name", new Object[0])));
|
||||||
|
entityPlayer.activeContainer = new AnvilContainer(entityPlayer.inventory, customPetTagPage.getInventory());
|
||||||
|
entityPlayer.activeContainer.windowId = containerCounter;
|
||||||
|
entityPlayer.activeContainer.addSlotListener(entityPlayer);
|
||||||
|
UtilPlayer.sendPacket(player, new PacketPlayOutSetSlot(containerCounter, 0, new net.minecraft.server.v1_8_R3.ItemStack(Items.NAME_TAG)));
|
||||||
|
|
||||||
|
getShop().setCurrentPageForPlayer(getPlayer(), customPetTagPage);
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), (player, clickType) ->
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getPreviousStep(getPlugin(), getShop(), getClientManager(), getDonationManager())));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,95 @@
|
|||||||
|
package mineplex.core.cosmetic.ui.page.custompet.name;
|
||||||
|
|
||||||
|
import net.minecraft.server.v1_8_R3.ItemStack;
|
||||||
|
import net.minecraft.server.v1_8_R3.Items;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
|
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||||
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.pet.custom.CustomPet;
|
||||||
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
|
|
||||||
|
public class CustomPetTagPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||||
|
{
|
||||||
|
private String _tagName = "Pet Name";
|
||||||
|
|
||||||
|
public CustomPetTagPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, clientManager, donationManager, name, player, 3);
|
||||||
|
|
||||||
|
buildPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildPage()
|
||||||
|
{
|
||||||
|
inventory.setItem(0, new ItemStack(Items.NAME_TAG));
|
||||||
|
|
||||||
|
getButtonMap().put(0, new CloseCustomPetButton());
|
||||||
|
getButtonMap().put(1, new CloseCustomPetButton());
|
||||||
|
getButtonMap().put(2, new SelectCustomPetTagButton(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void playerClosed()
|
||||||
|
{
|
||||||
|
super.playerClosed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void selectTag()
|
||||||
|
{
|
||||||
|
CustomPet customPet = CustomPet.getCustomPet(_player);
|
||||||
|
if (customPet == null)
|
||||||
|
{
|
||||||
|
_player.closeInventory();
|
||||||
|
CustomPet.removeCustomPet(_player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_tagName = ChatColor.stripColor(_tagName);
|
||||||
|
_tagName = _tagName.replaceAll("[^A-Za-z0-9]", "");
|
||||||
|
System.out.println("Pet name: " + _tagName + ".");
|
||||||
|
if (_tagName.length() == 0)
|
||||||
|
{
|
||||||
|
UtilPlayer.message(getPlayer(), F.main(getPlugin().getName(), ChatColor.RED + "Supplied pet name contains invalid characters."));
|
||||||
|
playDenySound(getPlayer());
|
||||||
|
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getPreviousStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_tagName.length() > 16)
|
||||||
|
{
|
||||||
|
UtilPlayer.message(getPlayer(), F.main(getPlugin().getName(), ChatColor.RED + "Pet name cannot be longer than 16 characters."));
|
||||||
|
playDenySound(getPlayer());
|
||||||
|
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getPreviousStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_tagName.toLowerCase().contains("ultra"))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(getPlayer(), F.main(getPlugin().getName(), ChatColor.RED + _tagName + " is a restricted name."));
|
||||||
|
playDenySound(getPlayer());
|
||||||
|
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getPreviousStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
customPet.setName(_tagName);
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTagName(String tagName)
|
||||||
|
{
|
||||||
|
_tagName = tagName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
|||||||
|
package mineplex.core.cosmetic.ui.page.custompet.name;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
|
|
||||||
|
public class SelectCustomPetTagButton implements IButton
|
||||||
|
{
|
||||||
|
private CustomPetTagPage _page;
|
||||||
|
|
||||||
|
public SelectCustomPetTagButton(CustomPetTagPage page)
|
||||||
|
{
|
||||||
|
_page = page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
_page.selectTag();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package mineplex.core.cosmetic.ui.page.custompet.zombie;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
|
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||||
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.pet.custom.CustomPet;
|
||||||
|
import mineplex.core.pet.custom.CustomPetZombie;
|
||||||
|
import mineplex.core.shop.item.ShopItem;
|
||||||
|
|
||||||
|
public class CustomPetZombieTypePage extends GadgetPage
|
||||||
|
{
|
||||||
|
|
||||||
|
public CustomPetZombieTypePage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
|
||||||
|
{
|
||||||
|
super(plugin, shop, clientManager, donationManager, name, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildPage()
|
||||||
|
{
|
||||||
|
|
||||||
|
CustomPet customPet = CustomPet.getCustomPet(getPlayer());
|
||||||
|
if (customPet == null)
|
||||||
|
{
|
||||||
|
CustomPet.removeCustomPet(getPlayer());
|
||||||
|
getPlayer().closeInventory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(customPet instanceof CustomPetZombie))
|
||||||
|
{
|
||||||
|
CustomPet.removeCustomPet(getPlayer());
|
||||||
|
getPlayer().closeInventory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomPetZombie customPetZombie = (CustomPetZombie) customPet;
|
||||||
|
|
||||||
|
addButton(29, new ShopItem(Material.BARRIER, "Zombie", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetZombie.setVillager(false);
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(33, new ShopItem(Material.WHEAT, "Zombie Villager", 1, false), (player, clickType) ->
|
||||||
|
{
|
||||||
|
customPetZombie.setVillager(true);
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getNextStep(getPlugin(), getShop(), getClientManager(), getDonationManager()));
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), (player, clickType) ->
|
||||||
|
getShop().openPageForPlayer(getPlayer(), customPet.getPreviousStep(getPlugin(), getShop(), getClientManager(), getDonationManager())));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -45,7 +45,7 @@ import mineplex.core.gadget.event.GadgetCollideEntityEvent;
|
|||||||
import mineplex.core.gadget.event.GadgetEnableEvent;
|
import mineplex.core.gadget.event.GadgetEnableEvent;
|
||||||
import mineplex.core.gadget.event.PlayerToggleSwimEvent;
|
import mineplex.core.gadget.event.PlayerToggleSwimEvent;
|
||||||
import mineplex.core.gadget.event.TauntCommandEvent;
|
import mineplex.core.gadget.event.TauntCommandEvent;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailHalloween;
|
import mineplex.core.gadget.gadgets.arrowtrail.halloween.ArrowTrailHalloween;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.candycane.ArrowTrailCandyCane;
|
import mineplex.core.gadget.gadgets.arrowtrail.candycane.ArrowTrailCandyCane;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.cupidslove.ArrowTrailCupid;
|
import mineplex.core.gadget.gadgets.arrowtrail.cupidslove.ArrowTrailCupid;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.emerald.ArrowTrailEmerald;
|
import mineplex.core.gadget.gadgets.arrowtrail.emerald.ArrowTrailEmerald;
|
||||||
@ -55,6 +55,7 @@ import mineplex.core.gadget.gadgets.arrowtrail.howlingwinds.ArrowTrailStorm;
|
|||||||
import mineplex.core.gadget.gadgets.arrowtrail.music.ArrowTrailMusic;
|
import mineplex.core.gadget.gadgets.arrowtrail.music.ArrowTrailMusic;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.party.ArrowTrailConfetti;
|
import mineplex.core.gadget.gadgets.arrowtrail.party.ArrowTrailConfetti;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.shadow.ArrowTrailShadow;
|
import mineplex.core.gadget.gadgets.arrowtrail.shadow.ArrowTrailShadow;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.spring.ArrowTrailSpring;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.titan.ArrowTrailTitan;
|
import mineplex.core.gadget.gadgets.arrowtrail.titan.ArrowTrailTitan;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.vampire.ArrowTrailBlood;
|
import mineplex.core.gadget.gadgets.arrowtrail.vampire.ArrowTrailBlood;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.wisdom.ArrowTrailEnchant;
|
import mineplex.core.gadget.gadgets.arrowtrail.wisdom.ArrowTrailEnchant;
|
||||||
@ -70,10 +71,11 @@ import mineplex.core.gadget.gadgets.death.howlingwinds.DeathStorm;
|
|||||||
import mineplex.core.gadget.gadgets.death.music.DeathMusic;
|
import mineplex.core.gadget.gadgets.death.music.DeathMusic;
|
||||||
import mineplex.core.gadget.gadgets.death.party.DeathPinataBurst;
|
import mineplex.core.gadget.gadgets.death.party.DeathPinataBurst;
|
||||||
import mineplex.core.gadget.gadgets.death.shadow.DeathShadow;
|
import mineplex.core.gadget.gadgets.death.shadow.DeathShadow;
|
||||||
|
import mineplex.core.gadget.gadgets.death.spring.DeathSpring;
|
||||||
import mineplex.core.gadget.gadgets.death.titan.DeathTitan;
|
import mineplex.core.gadget.gadgets.death.titan.DeathTitan;
|
||||||
import mineplex.core.gadget.gadgets.death.vampire.DeathBlood;
|
import mineplex.core.gadget.gadgets.death.vampire.DeathBlood;
|
||||||
import mineplex.core.gadget.gadgets.death.wisdom.DeathEnchant;
|
import mineplex.core.gadget.gadgets.death.wisdom.DeathEnchant;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpHalloween;
|
import mineplex.core.gadget.gadgets.doublejump.halloween.DoubleJumpHalloween;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.candycane.DoubleJumpCandyCane;
|
import mineplex.core.gadget.gadgets.doublejump.candycane.DoubleJumpCandyCane;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.cupidslove.DoubleJumpCupidsWings;
|
import mineplex.core.gadget.gadgets.doublejump.cupidslove.DoubleJumpCupidsWings;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.emerald.DoubleJumpEmerald;
|
import mineplex.core.gadget.gadgets.doublejump.emerald.DoubleJumpEmerald;
|
||||||
@ -83,6 +85,7 @@ import mineplex.core.gadget.gadgets.doublejump.howlingwinds.DoubleJumpStorm;
|
|||||||
import mineplex.core.gadget.gadgets.doublejump.music.DoubleJumpMusic;
|
import mineplex.core.gadget.gadgets.doublejump.music.DoubleJumpMusic;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.party.DoubleJumpFirecracker;
|
import mineplex.core.gadget.gadgets.doublejump.party.DoubleJumpFirecracker;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.shadow.DoubleJumpShadow;
|
import mineplex.core.gadget.gadgets.doublejump.shadow.DoubleJumpShadow;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.spring.DoubleJumpSpring;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.titan.DoubleJumpTitan;
|
import mineplex.core.gadget.gadgets.doublejump.titan.DoubleJumpTitan;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.vampire.DoubleJumpBlood;
|
import mineplex.core.gadget.gadgets.doublejump.vampire.DoubleJumpBlood;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.wisdom.DoubleJumpEnchant;
|
import mineplex.core.gadget.gadgets.doublejump.wisdom.DoubleJumpEnchant;
|
||||||
@ -113,6 +116,7 @@ import mineplex.core.gadget.gadgets.item.ItemPaintbrush;
|
|||||||
import mineplex.core.gadget.gadgets.item.ItemPartyPopper;
|
import mineplex.core.gadget.gadgets.item.ItemPartyPopper;
|
||||||
import mineplex.core.gadget.gadgets.item.ItemSnowball;
|
import mineplex.core.gadget.gadgets.item.ItemSnowball;
|
||||||
import mineplex.core.gadget.gadgets.item.ItemTNT;
|
import mineplex.core.gadget.gadgets.item.ItemTNT;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphAwkwardRabbit;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphBat;
|
import mineplex.core.gadget.gadgets.morph.MorphBat;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphBlaze;
|
import mineplex.core.gadget.gadgets.morph.MorphBlaze;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphBlock;
|
import mineplex.core.gadget.gadgets.morph.MorphBlock;
|
||||||
@ -164,6 +168,7 @@ import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes;
|
|||||||
import mineplex.core.gadget.gadgets.particle.ParticleFairy;
|
import mineplex.core.gadget.gadgets.particle.ParticleFairy;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleFireRings;
|
import mineplex.core.gadget.gadgets.particle.ParticleFireRings;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleLegend;
|
import mineplex.core.gadget.gadgets.particle.ParticleLegend;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.spring.ParticleSpringHalo;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel;
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsBee;
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsBee;
|
||||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsDemons;
|
import mineplex.core.gadget.gadgets.particle.ParticleWingsDemons;
|
||||||
@ -207,6 +212,7 @@ import mineplex.core.gadget.set.SetHowlingWinds;
|
|||||||
import mineplex.core.gadget.set.SetMusic;
|
import mineplex.core.gadget.set.SetMusic;
|
||||||
import mineplex.core.gadget.set.SetParty;
|
import mineplex.core.gadget.set.SetParty;
|
||||||
import mineplex.core.gadget.set.SetShadow;
|
import mineplex.core.gadget.set.SetShadow;
|
||||||
|
import mineplex.core.gadget.set.SetSpring;
|
||||||
import mineplex.core.gadget.set.SetTitan;
|
import mineplex.core.gadget.set.SetTitan;
|
||||||
import mineplex.core.gadget.set.SetVampire;
|
import mineplex.core.gadget.set.SetVampire;
|
||||||
import mineplex.core.gadget.set.SetWisdom;
|
import mineplex.core.gadget.set.SetWisdom;
|
||||||
@ -238,6 +244,7 @@ import mineplex.core.mount.MountManager;
|
|||||||
import mineplex.core.mount.event.MountActivateEvent;
|
import mineplex.core.mount.event.MountActivateEvent;
|
||||||
import mineplex.core.packethandler.PacketHandler;
|
import mineplex.core.packethandler.PacketHandler;
|
||||||
import mineplex.core.pet.PetManager;
|
import mineplex.core.pet.PetManager;
|
||||||
|
import mineplex.core.pet.custom.CustomPet;
|
||||||
import mineplex.core.preferences.PreferencesManager;
|
import mineplex.core.preferences.PreferencesManager;
|
||||||
import mineplex.core.projectile.ProjectileManager;
|
import mineplex.core.projectile.ProjectileManager;
|
||||||
import mineplex.core.treasure.TreasureManager;
|
import mineplex.core.treasure.TreasureManager;
|
||||||
@ -337,6 +344,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addSet(new SetVampire(this));
|
addSet(new SetVampire(this));
|
||||||
addSet(new SetMusic(this));
|
addSet(new SetMusic(this));
|
||||||
addSet(new SetFreedom(this));
|
addSet(new SetFreedom(this));
|
||||||
|
addSet(new SetSpring(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createGadgets()
|
private void createGadgets()
|
||||||
@ -425,6 +433,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new MorphDinnerbone(this));
|
addGadget(new MorphDinnerbone(this));
|
||||||
addGadget(new MorphLoveDoctor(this));
|
addGadget(new MorphLoveDoctor(this));
|
||||||
addGadget(new MorphGoldPot(this));
|
addGadget(new MorphGoldPot(this));
|
||||||
|
addGadget(new MorphAwkwardRabbit(this));
|
||||||
|
|
||||||
// Particles
|
// Particles
|
||||||
addGadget(new ParticleFoot(this));
|
addGadget(new ParticleFoot(this));
|
||||||
@ -450,6 +459,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new ParticleFreedom(this));
|
addGadget(new ParticleFreedom(this));
|
||||||
addGadget(new ParticleChristmasTree(this));
|
addGadget(new ParticleChristmasTree(this));
|
||||||
addGadget(new ParticleWingsLove(this));
|
addGadget(new ParticleWingsLove(this));
|
||||||
|
addGadget(new ParticleSpringHalo(this));
|
||||||
addGadget(new ParticleWingsBee(this));
|
addGadget(new ParticleWingsBee(this));
|
||||||
|
|
||||||
// Arrow Trails
|
// Arrow Trails
|
||||||
@ -466,6 +476,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new ArrowTrailMusic(this));
|
addGadget(new ArrowTrailMusic(this));
|
||||||
addGadget(new ArrowTrailFreedom(this));
|
addGadget(new ArrowTrailFreedom(this));
|
||||||
addGadget(new ArrowTrailHalloween(this));
|
addGadget(new ArrowTrailHalloween(this));
|
||||||
|
addGadget(new ArrowTrailSpring(this));
|
||||||
|
|
||||||
// Death Effect
|
// Death Effect
|
||||||
addGadget(new DeathFrostLord(this));
|
addGadget(new DeathFrostLord(this));
|
||||||
@ -481,6 +492,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new DeathMusic(this));
|
addGadget(new DeathMusic(this));
|
||||||
addGadget(new DeathFreedom(this));
|
addGadget(new DeathFreedom(this));
|
||||||
addGadget(new DeathPresentDanger(this));
|
addGadget(new DeathPresentDanger(this));
|
||||||
|
addGadget(new DeathSpring(this));
|
||||||
|
|
||||||
// Double Jump
|
// Double Jump
|
||||||
addGadget(new DoubleJumpFrostLord(this));
|
addGadget(new DoubleJumpFrostLord(this));
|
||||||
@ -496,6 +508,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new DoubleJumpMusic(this));
|
addGadget(new DoubleJumpMusic(this));
|
||||||
addGadget(new DoubleJumpFreedom(this));
|
addGadget(new DoubleJumpFreedom(this));
|
||||||
addGadget(new DoubleJumpHalloween(this));
|
addGadget(new DoubleJumpHalloween(this));
|
||||||
|
addGadget(new DoubleJumpSpring(this));
|
||||||
|
|
||||||
// Hat
|
// Hat
|
||||||
for (HatType hatType : HatType.values())
|
for (HatType hatType : HatType.values())
|
||||||
@ -1004,6 +1017,9 @@ public class GadgetManager extends MiniPlugin
|
|||||||
event.getPlayer().setWalkSpeed(0.2f);
|
event.getPlayer().setWalkSpeed(0.2f);
|
||||||
event.getPlayer().setFlySpeed(0.1f);
|
event.getPlayer().setFlySpeed(0.1f);
|
||||||
_soulManager.giveSoul(event.getPlayer());
|
_soulManager.giveSoul(event.getPlayer());
|
||||||
|
|
||||||
|
// Removes custom pet
|
||||||
|
CustomPet.removeCustomPet(event.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -1369,7 +1385,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
if (!event.isGameInProgress() && event.getState().equals(TauntCommandEvent.TauntState.NONE))
|
if (!event.isGameInProgress() && event.getState().equals(TauntCommandEvent.TauntState.NONE))
|
||||||
event.setState(TauntCommandEvent.TauntState.NOT_IN_GAME);
|
event.setState(TauntCommandEvent.TauntState.NOT_IN_GAME);
|
||||||
|
|
||||||
if (taunt.isGameDisabled(event.getGameType()) && event.getState().equals(TauntCommandEvent.TauntState.NONE))
|
if (taunt.isGameDisabled(event.getGameDisplay()) && event.getState().equals(TauntCommandEvent.TauntState.NONE))
|
||||||
event.setState(TauntCommandEvent.TauntState.GAME_DISABLED);
|
event.setState(TauntCommandEvent.TauntState.GAME_DISABLED);
|
||||||
|
|
||||||
if (!event.isAlive() && event.getState().equals(TauntCommandEvent.TauntState.NONE))
|
if (!event.isAlive() && event.getState().equals(TauntCommandEvent.TauntState.NONE))
|
||||||
|
@ -5,7 +5,7 @@ import org.bukkit.event.Event;
|
|||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
import mineplex.core.gadget.gadgets.taunts.GameType;
|
import mineplex.core.game.GameDisplay;
|
||||||
|
|
||||||
public class TauntCommandEvent extends Event
|
public class TauntCommandEvent extends Event
|
||||||
{
|
{
|
||||||
@ -18,16 +18,16 @@ public class TauntCommandEvent extends Event
|
|||||||
private boolean _spectator;
|
private boolean _spectator;
|
||||||
private long _lastPvp;
|
private long _lastPvp;
|
||||||
private TauntState _state = TauntState.NONE;
|
private TauntState _state = TauntState.NONE;
|
||||||
private GameType _gameType;
|
private GameDisplay _gameDisplay;
|
||||||
|
|
||||||
public TauntCommandEvent(Player player, boolean gameInProgress, boolean alive, boolean spectator, long lastPvp, GameType gameType)
|
public TauntCommandEvent(Player player, boolean gameInProgress, boolean alive, boolean spectator, long lastPvp, GameDisplay gameDisplay)
|
||||||
{
|
{
|
||||||
_player = player;
|
_player = player;
|
||||||
_gameInProgress = gameInProgress;
|
_gameInProgress = gameInProgress;
|
||||||
_alive = alive;
|
_alive = alive;
|
||||||
_spectator = spectator;
|
_spectator = spectator;
|
||||||
_lastPvp = lastPvp;
|
_lastPvp = lastPvp;
|
||||||
_gameType = gameType;
|
_gameDisplay = gameDisplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player getPlayer()
|
public Player getPlayer()
|
||||||
@ -60,9 +60,9 @@ public class TauntCommandEvent extends Event
|
|||||||
return _state;
|
return _state;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GameType getGameType()
|
public GameDisplay getGameDisplay()
|
||||||
{
|
{
|
||||||
return _gameType;
|
return _gameDisplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setState(TauntState state)
|
public void setState(TauntState state)
|
||||||
|
@ -27,7 +27,6 @@ public class ArrowTrailCupid extends ArrowEffectGadget
|
|||||||
@Override
|
@Override
|
||||||
public void doTrail(Arrow arrow)
|
public void doTrail(Arrow arrow)
|
||||||
{
|
{
|
||||||
arrow.setCritical(false);
|
|
||||||
Vector color = arrow.getTicksLived()%2 == 0? UtilColor.colorToVector(Color.RED) : UtilColor.colorToVector(Color.fromRGB(16738740));
|
Vector color = arrow.getTicksLived()%2 == 0? UtilColor.colorToVector(Color.RED) : UtilColor.colorToVector(Color.fromRGB(16738740));
|
||||||
UtilParticle.PlayParticleToAll(ParticleType.RED_DUST, arrow.getLocation(), color, 1, 0, ViewDist.LONG);
|
UtilParticle.PlayParticleToAll(ParticleType.RED_DUST, arrow.getLocation(), color, 1, 0, ViewDist.LONG);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package mineplex.core.gadget.gadgets.arrowtrail;
|
package mineplex.core.gadget.gadgets.arrowtrail.halloween;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
@ -0,0 +1,73 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.arrowtrail.spring;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Arrow;
|
||||||
|
import org.bukkit.entity.Item;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.LineFormat;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.types.ArrowEffectGadget;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
|
public class ArrowTrailSpring extends ArrowEffectGadget
|
||||||
|
{
|
||||||
|
|
||||||
|
private List<Item> _items = new ArrayList<>();
|
||||||
|
|
||||||
|
public ArrowTrailSpring(GadgetManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Flower Arrows", UtilText.splitLineToArray(C.cGray + "Send the power of Spring flying at your foes!", LineFormat.LORE),
|
||||||
|
-19, Material.YELLOW_FLOWER, (byte) 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doTrail(Arrow arrow)
|
||||||
|
{
|
||||||
|
Item sunflower = arrow.getWorld().dropItem(arrow.getLocation(), new ItemStack(Material.DOUBLE_PLANT));
|
||||||
|
_items.add(sunflower);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doHitEffect(Arrow arrow)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPickup(PlayerPickupItemEvent event)
|
||||||
|
{
|
||||||
|
if (_items.contains(event.getItem()))
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void removeFlowers(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Iterator<Item> iterator = _items.iterator();
|
||||||
|
while (iterator.hasNext())
|
||||||
|
{
|
||||||
|
Item item = iterator.next();
|
||||||
|
if (item.getTicksLived() >= 20)
|
||||||
|
{
|
||||||
|
item.remove();
|
||||||
|
iterator.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -68,7 +68,10 @@ public class BalloonItem extends BalloonGadget
|
|||||||
|
|
||||||
Entity entity = player.getWorld().spawnEntity(player.getLocation(), _balloonType.getEntityType());
|
Entity entity = player.getWorld().spawnEntity(player.getLocation(), _balloonType.getEntityType());
|
||||||
if (_balloonType.isBaby() && entity instanceof Ageable)
|
if (_balloonType.isBaby() && entity instanceof Ageable)
|
||||||
|
{
|
||||||
((Ageable) entity).setBaby();
|
((Ageable) entity).setBaby();
|
||||||
|
((Ageable) entity).setAgeLock(true);
|
||||||
|
}
|
||||||
UtilEnt.vegetate(entity);
|
UtilEnt.vegetate(entity);
|
||||||
UtilEnt.silence(entity, true);
|
UtilEnt.silence(entity, true);
|
||||||
addEntity(player, entity);
|
addEntity(player, entity);
|
||||||
|
@ -0,0 +1,103 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.death.spring;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Item;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.blood.BloodEvent;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.LineFormat;
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.types.DeathEffectGadget;
|
||||||
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
|
public class DeathSpring extends DeathEffectGadget
|
||||||
|
{
|
||||||
|
|
||||||
|
private List<Item> _items = new ArrayList<>();
|
||||||
|
|
||||||
|
public DeathSpring(GadgetManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Funeral Bouquet",
|
||||||
|
UtilText.splitLineToArray(C.cGray + "Leave a rose to pay respects", LineFormat.LORE),
|
||||||
|
-19,
|
||||||
|
Material.YELLOW_FLOWER, (byte) 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBlood(Player player, BloodEvent event)
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
|
||||||
|
final Location location = event.getLocation();
|
||||||
|
while (location.getBlock().getType() != Material.AIR
|
||||||
|
&& location.clone().add(0, 1, 0).getBlock().getType() != Material.AIR)
|
||||||
|
{
|
||||||
|
location.add(0, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
location.getBlock().setType(Material.DOUBLE_PLANT);
|
||||||
|
location.getBlock().setData((byte) 4);
|
||||||
|
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
location.getBlock().setType(Material.AIR);
|
||||||
|
|
||||||
|
// Creates red rose explosion
|
||||||
|
for (int i = 50; i < 60; i++)
|
||||||
|
{
|
||||||
|
Item rose = location.getWorld().dropItem(location.add(0.5, 1.5, 0.5), ItemStackFactory.Instance.CreateStack(Material.RED_ROSE, (byte) 0, 1, " " + i));
|
||||||
|
_items.add(rose);
|
||||||
|
|
||||||
|
Vector vel = new Vector(Math.sin(i * 9/5d), 0, Math.cos(i * 9/5d));
|
||||||
|
UtilAction.velocity(rose, vel, Math.abs(Math.sin(i * 12/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i * 12/3000d))*0.6, 1, false);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 60L);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPickup(PlayerPickupItemEvent event)
|
||||||
|
{
|
||||||
|
if (_items.contains(event.getItem()))
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void removeFlowers(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Iterator<Item> iterator = _items.iterator();
|
||||||
|
while (iterator.hasNext())
|
||||||
|
{
|
||||||
|
Item item = iterator.next();
|
||||||
|
if (item.getTicksLived() >= 20)
|
||||||
|
{
|
||||||
|
item.remove();
|
||||||
|
iterator.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package mineplex.core.gadget.gadgets.doublejump;
|
package mineplex.core.gadget.gadgets.doublejump.halloween;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
@ -0,0 +1,77 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.doublejump.spring;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Item;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.LineFormat;
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.types.DoubleJumpEffectGadget;
|
||||||
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
|
public class DoubleJumpSpring extends DoubleJumpEffectGadget
|
||||||
|
{
|
||||||
|
|
||||||
|
private List<Item> _items = new ArrayList<>();
|
||||||
|
|
||||||
|
public DoubleJumpSpring(GadgetManager manager)
|
||||||
|
{
|
||||||
|
// TODO NAME LORE ICON
|
||||||
|
super(manager, "Flower Power", UtilText.splitLineToArray(C.cGray + "Be like a bouncing bee and pollinate everywhere you go!", LineFormat.LORE), -19,
|
||||||
|
Material.YELLOW_FLOWER, (byte) 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doEffect(Player player)
|
||||||
|
{
|
||||||
|
for (int i = 50; i < 60; i++)
|
||||||
|
{
|
||||||
|
Item sunflower = player.getWorld().dropItem(player.getLocation().add(0.5, 1.5, 0.5), ItemStackFactory.Instance.CreateStack(Material.DOUBLE_PLANT, (byte) 0, 1, " " + i));
|
||||||
|
_items.add(sunflower);
|
||||||
|
|
||||||
|
Vector vel = new Vector(Math.sin(i * 9/5d), 0, Math.cos(i * 9/5d));
|
||||||
|
UtilAction.velocity(sunflower, vel, Math.abs(Math.sin(i * 12/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i * 12/3000d))*0.6, 1, false);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPickup(PlayerPickupItemEvent event)
|
||||||
|
{
|
||||||
|
if (_items.contains(event.getItem()))
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void removeFlowers(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Iterator<Item> iterator = _items.iterator();
|
||||||
|
while (iterator.hasNext())
|
||||||
|
{
|
||||||
|
Item item = iterator.next();
|
||||||
|
if (item.getTicksLived() >= 20)
|
||||||
|
{
|
||||||
|
item.remove();
|
||||||
|
iterator.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,105 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.morph;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
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.LineFormat;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
|
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.managers.UtilMorph;
|
||||||
|
import mineplex.core.gadget.types.MorphGadget;
|
||||||
|
import mineplex.core.hologram.Hologram;
|
||||||
|
import mineplex.core.recharge.Recharge;
|
||||||
|
import mineplex.core.utils.UtilGameProfile;
|
||||||
|
|
||||||
|
public class MorphAwkwardRabbit extends MorphGadget
|
||||||
|
{
|
||||||
|
|
||||||
|
private List<String> _quotes = new ArrayList<>();
|
||||||
|
|
||||||
|
private static final long COOLDOWN = 10000;
|
||||||
|
private static final long HOLOGRAM_TIME = 3000;
|
||||||
|
|
||||||
|
public MorphAwkwardRabbit(GadgetManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Wascally Wabbit Morph",
|
||||||
|
UtilText.splitLinesToArray(new String[]{C.cGray + "Be absolutely silent my friends we are searching for rabbits currently!"}, LineFormat.LORE),
|
||||||
|
-19, Material.SKULL_ITEM, (byte) 0);
|
||||||
|
_quotes.addAll(Arrays.asList(
|
||||||
|
"Eh, what's up, doc?",
|
||||||
|
"That's all, folks.",
|
||||||
|
"Gee, ain't I a stinker?",
|
||||||
|
"Carrots are devine...",
|
||||||
|
"I know this defies the\n law of gravity,\n but I never studied law!",
|
||||||
|
"I don’t ask questions,\n I just have fun",
|
||||||
|
"Hey, just a minute you!\n Them’s fightin’ words!"));
|
||||||
|
setDisplayItem(SkinData.BUGS_BUNNY.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.BUGS_BUNNY.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 spawnHolograms(PlayerToggleSneakEvent event)
|
||||||
|
{
|
||||||
|
if (!isActive(event.getPlayer()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.isSneaking())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!Recharge.Instance.use(event.getPlayer(), getName(), COOLDOWN, true, false, "Cosmetics"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Location randomLoc = event.getPlayer().getLocation().clone();
|
||||||
|
int[] rPos = new int[]{-2, -1, 0, 1, 2};
|
||||||
|
int rX = rPos[UtilMath.random.nextInt(rPos.length)], rZ = rPos[UtilMath.random.nextInt(rPos.length)];
|
||||||
|
|
||||||
|
randomLoc.add(rX, 1, rZ);
|
||||||
|
|
||||||
|
String quote = _quotes.get(UtilMath.random.nextInt(_quotes.size()));
|
||||||
|
Hologram hologram;
|
||||||
|
if (quote.contains("\n"))
|
||||||
|
{
|
||||||
|
String[] lines = quote.split("\n");
|
||||||
|
hologram = new Hologram(Manager.getHologramManager(), randomLoc, true, HOLOGRAM_TIME, lines);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hologram = new Hologram(Manager.getHologramManager(), randomLoc, true, HOLOGRAM_TIME, quote);
|
||||||
|
}
|
||||||
|
hologram.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,184 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.particle.spring;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import mineplex.core.arcadeevents.CoreGameStartEvent;
|
||||||
|
import mineplex.core.arcadeevents.CoreGameStopEvent;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.LineFormat;
|
||||||
|
import mineplex.core.common.util.RGBData;
|
||||||
|
import mineplex.core.common.util.UtilColor;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilText;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.types.GadgetType;
|
||||||
|
import mineplex.core.gadget.types.OutfitGadget;
|
||||||
|
import mineplex.core.gadget.types.ParticleGadget;
|
||||||
|
import mineplex.core.particleeffects.ColoredCircleEffect;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
|
public class ParticleSpringHalo extends ParticleGadget
|
||||||
|
{
|
||||||
|
|
||||||
|
private Map<Player, ColoredCircleEffect> _effects = new HashMap<>();
|
||||||
|
private List<SpringHaloData> _springHaloData = new ArrayList<>();
|
||||||
|
private Map<Player, List<SpringHaloData>> _playerSpringHaloData = new HashMap<>();
|
||||||
|
private boolean _enableTrail = true;
|
||||||
|
|
||||||
|
public ParticleSpringHalo(GadgetManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Spring Halo", UtilText.splitLinesToArray(new String[]{C.cGray + "Spring is everywhere, if you look hard enough."}, LineFormat.LORE),
|
||||||
|
-19, Material.YELLOW_FLOWER, (byte) 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enableCustom(Player player, boolean message)
|
||||||
|
{
|
||||||
|
super.enableCustom(player, message);
|
||||||
|
Manager.removeGadgetType(player, GadgetType.MORPH, this);
|
||||||
|
Manager.removeOutfit(player, OutfitGadget.ArmorSlot.HELMET);
|
||||||
|
ColoredCircleEffect circleEffect = new ColoredCircleEffect(Manager.getPlugin(), player, 0.7d, false);
|
||||||
|
RGBData colorA = UtilColor.hexToRgb(0x5a92ed);
|
||||||
|
RGBData colorB = UtilColor.hexToRgb(0xdb5aed);
|
||||||
|
RGBData colorC = UtilColor.hexToRgb(0xd2cdf2);
|
||||||
|
RGBData colorD = UtilColor.hexToRgb(0x7c6df2);
|
||||||
|
RGBData colorE = UtilColor.hexToRgb(0xedeb97);
|
||||||
|
RGBData colorF = UtilColor.hexToRgb(0xeac07c);
|
||||||
|
circleEffect.addColors(colorA, colorB, colorC, colorD, colorE, colorF);
|
||||||
|
circleEffect.setYOffset(2.3d);
|
||||||
|
circleEffect.start();
|
||||||
|
_effects.put(player, circleEffect);
|
||||||
|
player.getEquipment().setHelmet(new ItemStack(Material.RED_ROSE, 1, (byte) 8));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disableCustom(Player player, boolean message)
|
||||||
|
{
|
||||||
|
super.disableCustom(player, message);
|
||||||
|
if (_effects.containsKey(player))
|
||||||
|
{
|
||||||
|
ColoredCircleEffect circleEffect = _effects.get(player);
|
||||||
|
if (circleEffect != null)
|
||||||
|
{
|
||||||
|
circleEffect.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_effects.remove(player);
|
||||||
|
player.getInventory().setHelmet(null);
|
||||||
|
if (_playerSpringHaloData.containsKey(player))
|
||||||
|
{
|
||||||
|
Iterator<SpringHaloData> iterator = _playerSpringHaloData.get(player).iterator();
|
||||||
|
while (iterator.hasNext())
|
||||||
|
{
|
||||||
|
SpringHaloData springHaloData = iterator.next();
|
||||||
|
springHaloData.getBlock().setType(Material.AIR);
|
||||||
|
springHaloData.getBlock().setData((byte) 0);
|
||||||
|
iterator.remove();
|
||||||
|
}
|
||||||
|
_playerSpringHaloData.get(player).clear();
|
||||||
|
_playerSpringHaloData.remove(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void playParticle(Player player, UpdateEvent event)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void spawnFlowers(PlayerMoveEvent event)
|
||||||
|
{
|
||||||
|
if (!isActive(event.getPlayer()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!_enableTrail)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
Block block = event.getFrom().getBlock();
|
||||||
|
if (block.getType() != Material.AIR)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (block.getLocation().subtract(0, 1, 0).getBlock().getType() != Material.GRASS
|
||||||
|
&& block.getLocation().subtract(0, 1, 0).getBlock().getType() != Material.DIRT)
|
||||||
|
return;
|
||||||
|
|
||||||
|
block.setType(Material.RED_ROSE);
|
||||||
|
block.setData((byte) UtilMath.random.nextInt(8));
|
||||||
|
SpringHaloData springHaloData = new SpringHaloData(player, block, System.currentTimeMillis());
|
||||||
|
addFlower(player, springHaloData);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onUpdate(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Iterator<SpringHaloData> iterator = _springHaloData.iterator();
|
||||||
|
while (iterator.hasNext())
|
||||||
|
{
|
||||||
|
SpringHaloData springHaloData = iterator.next();
|
||||||
|
if (UtilTime.elapsed(springHaloData.getSpawned(), 1500))
|
||||||
|
{
|
||||||
|
springHaloData.getBlock().setType(Material.AIR);
|
||||||
|
springHaloData.getBlock().setData((byte) 0);
|
||||||
|
removeSpringHalo(springHaloData);
|
||||||
|
iterator.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addFlower(Player player, SpringHaloData springHaloData)
|
||||||
|
{
|
||||||
|
_springHaloData.add(springHaloData);
|
||||||
|
if (_playerSpringHaloData.containsKey(player))
|
||||||
|
{
|
||||||
|
List<SpringHaloData> list = _playerSpringHaloData.get(player);
|
||||||
|
list.add(springHaloData);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
List<SpringHaloData> list = new ArrayList<>();
|
||||||
|
list.add(springHaloData);
|
||||||
|
_playerSpringHaloData.put(player, list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void removeSpringHalo(SpringHaloData springHaloData)
|
||||||
|
{
|
||||||
|
Player player = springHaloData.getPlayer();
|
||||||
|
List<SpringHaloData> list = _playerSpringHaloData.get(player);
|
||||||
|
if (list != null)
|
||||||
|
{
|
||||||
|
list.remove(springHaloData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onGameStart(CoreGameStartEvent event)
|
||||||
|
{
|
||||||
|
_enableTrail = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onGameEnd(CoreGameStopEvent event)
|
||||||
|
{
|
||||||
|
_enableTrail = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package mineplex.core.gadget.gadgets.particle.spring;
|
||||||
|
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class SpringHaloData
|
||||||
|
{
|
||||||
|
|
||||||
|
private Player _player;
|
||||||
|
private Block _block;
|
||||||
|
private long _spawned;
|
||||||
|
|
||||||
|
public SpringHaloData(Player player, Block block, long spawned)
|
||||||
|
{
|
||||||
|
_player = player;
|
||||||
|
_block = block;
|
||||||
|
_spawned = spawned;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Player getPlayer()
|
||||||
|
{
|
||||||
|
return _player;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Block getBlock()
|
||||||
|
{
|
||||||
|
return _block;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getSpawned()
|
||||||
|
{
|
||||||
|
return _spawned;
|
||||||
|
}
|
||||||
|
}
|
@ -30,6 +30,7 @@ import mineplex.core.events.EnableArcadeSpawnEvent;
|
|||||||
import mineplex.core.gadget.GadgetManager;
|
import mineplex.core.gadget.GadgetManager;
|
||||||
import mineplex.core.gadget.gadgets.morph.managers.UtilMorph;
|
import mineplex.core.gadget.gadgets.morph.managers.UtilMorph;
|
||||||
import mineplex.core.gadget.types.TauntGadget;
|
import mineplex.core.gadget.types.TauntGadget;
|
||||||
|
import mineplex.core.game.GameDisplay;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
@ -53,7 +54,7 @@ public class EternalTaunt extends TauntGadget
|
|||||||
setPvpCooldown(PVP_COOLDOWN);
|
setPvpCooldown(PVP_COOLDOWN);
|
||||||
setShouldPlay(true);
|
setShouldPlay(true);
|
||||||
setEventType(UpdateType.FAST);
|
setEventType(UpdateType.FAST);
|
||||||
addDisabledGames(GameType.SMASH, GameType.SMASHTEAMS, GameType.SMASHDOMINATION);
|
addDisabledGames(GameDisplay.Smash, GameDisplay.SmashTeams, GameDisplay.SmashDomination);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,84 +0,0 @@
|
|||||||
package mineplex.core.gadget.gadgets.taunts;
|
|
||||||
|
|
||||||
public enum GameType
|
|
||||||
{
|
|
||||||
|
|
||||||
BACONBRAWL,
|
|
||||||
BARBARIANS,
|
|
||||||
BASKETBALL,
|
|
||||||
BOSSBATTLES,
|
|
||||||
BRIDGE,
|
|
||||||
CASTLESIEGE,
|
|
||||||
CHAMPIONSCTF,
|
|
||||||
CHAMPIONSDOMINATE,
|
|
||||||
CHAMPIONSTDM,
|
|
||||||
CHRISTMAS,
|
|
||||||
DEATHTAG,
|
|
||||||
DRAGONESCAPE,
|
|
||||||
DRAGONESCAPETEAMS,
|
|
||||||
DRAGONRIDERS,
|
|
||||||
DRAGONS,
|
|
||||||
DRAGONSTEAMS,
|
|
||||||
DRAW,
|
|
||||||
ELYTRARINGS,
|
|
||||||
EVOLUTION,
|
|
||||||
GRAVITY,
|
|
||||||
HALLOWEEN,
|
|
||||||
HALLOWEEN2016,
|
|
||||||
HIDESEEK,
|
|
||||||
HOLEINTHEWALL,
|
|
||||||
HORSE,
|
|
||||||
LOBBERS,
|
|
||||||
MICRO,
|
|
||||||
MILKCOW,
|
|
||||||
MINESTRIKE,
|
|
||||||
BAWKBAWKBATTLES,
|
|
||||||
MINECRAFTLEAGUE,
|
|
||||||
OLDMINEWARE,
|
|
||||||
PAINTBALL,
|
|
||||||
QUIVER,
|
|
||||||
QUIVERPAYLOAD,
|
|
||||||
QUIVERTEAMS,
|
|
||||||
RUNNER,
|
|
||||||
SEARCHANDDESTROY,
|
|
||||||
SHEEP,
|
|
||||||
TYPEWARS,
|
|
||||||
SMASH,
|
|
||||||
SMASHDOMINATION,
|
|
||||||
SMASHTEAMS,
|
|
||||||
SNAKE,
|
|
||||||
SNEAKYASSASSINS,
|
|
||||||
SNOWFIGHT,
|
|
||||||
SPEEDBUILDERS,
|
|
||||||
SPLEEF,
|
|
||||||
SPLEEFTEAMS,
|
|
||||||
SQUIDSHOOTER,
|
|
||||||
STACKER,
|
|
||||||
SURVIVALGAMES,
|
|
||||||
SURVIVALGAMESTEAMS,
|
|
||||||
TUG,
|
|
||||||
TURFWARS,
|
|
||||||
UHC,
|
|
||||||
UHCSOLO,
|
|
||||||
UHCSOLOSPEED,
|
|
||||||
UHCTEAMSSPEED,
|
|
||||||
WITHERASSAULT,
|
|
||||||
WIZARDS,
|
|
||||||
ZOMBIESURVIVAL,
|
|
||||||
BUILD,
|
|
||||||
BUILDMAVERICKS,
|
|
||||||
CARDS,
|
|
||||||
SKYWARS,
|
|
||||||
SKYWARSTEAMS,
|
|
||||||
MONSTERMAZE,
|
|
||||||
MONSTERLEAGUE,
|
|
||||||
GLADIATORS,
|
|
||||||
SKYFALL,
|
|
||||||
SKYFALLTEAMS,
|
|
||||||
BOUNCYBALLS,
|
|
||||||
VALENTINES,
|
|
||||||
EVENT,
|
|
||||||
BRAWL,
|
|
||||||
NONE
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,23 @@
|
|||||||
|
package mineplex.core.gadget.set;
|
||||||
|
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.spring.ArrowTrailSpring;
|
||||||
|
import mineplex.core.gadget.gadgets.death.spring.DeathSpring;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.spring.DoubleJumpSpring;
|
||||||
|
import mineplex.core.gadget.gadgets.particle.spring.ParticleSpringHalo;
|
||||||
|
import mineplex.core.gadget.types.GadgetSet;
|
||||||
|
|
||||||
|
public class SetSpring extends GadgetSet
|
||||||
|
{
|
||||||
|
|
||||||
|
public SetSpring(GadgetManager manager)
|
||||||
|
{
|
||||||
|
// TODO LORE
|
||||||
|
super(manager, "Spring", "2x Holiday Points while active (Titles)",
|
||||||
|
manager.getGadget(ArrowTrailSpring.class),
|
||||||
|
manager.getGadget(DeathSpring.class),
|
||||||
|
manager.getGadget(DoubleJumpSpring.class),
|
||||||
|
manager.getGadget(ParticleSpringHalo.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -10,6 +10,7 @@ import org.bukkit.entity.Entity;
|
|||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
|
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
@ -114,6 +115,19 @@ public abstract class BalloonGadget extends Gadget
|
|||||||
{
|
{
|
||||||
Map.Entry<UUID, Map<EntityType, BalloonData>> entry = iterator.next();
|
Map.Entry<UUID, Map<EntityType, BalloonData>> entry = iterator.next();
|
||||||
for (BalloonData balloonData : entry.getValue().values())
|
for (BalloonData balloonData : entry.getValue().values())
|
||||||
|
{
|
||||||
|
balloonData.teleport();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerMove(PlayerMoveEvent event)
|
||||||
|
{
|
||||||
|
if (PLAYER_BALLOONS.containsKey(event.getPlayer().getUniqueId()))
|
||||||
|
{
|
||||||
|
Map<EntityType, BalloonData> balloons = PLAYER_BALLOONS.get(event.getPlayer().getUniqueId());
|
||||||
|
for (BalloonData balloonData : balloons.values())
|
||||||
{
|
{
|
||||||
balloonData.update();
|
balloonData.update();
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ public abstract class ParticleGadget extends Gadget
|
|||||||
super(manager, GadgetType.PARTICLE, name, desc, cost, mat, data, 1, altNames);
|
super(manager, GadgetType.PARTICLE, name, desc, cost, mat, data, 1, altNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ParticleGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data, YearMonth yearMonth, String...altNames)
|
public ParticleGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data, YearMonth yearMonth, String... altNames)
|
||||||
{
|
{
|
||||||
super(manager, GadgetType.PARTICLE, name, desc, cost, mat, data, yearMonth, 1, altNames);
|
super(manager, GadgetType.PARTICLE, name, desc, cost, mat, data, yearMonth, 1, altNames);
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
|
||||||
import mineplex.core.gadget.GadgetManager;
|
import mineplex.core.gadget.GadgetManager;
|
||||||
import mineplex.core.gadget.gadgets.taunts.GameType;
|
import mineplex.core.game.GameDisplay;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ public abstract class TauntGadget extends Gadget
|
|||||||
/** Sets when the taunt will run, if set above */
|
/** Sets when the taunt will run, if set above */
|
||||||
private UpdateType _updateType = UpdateType.TICK;
|
private UpdateType _updateType = UpdateType.TICK;
|
||||||
/** List of games where this item is disabled */
|
/** List of games where this item is disabled */
|
||||||
private List<GameType> _disabledGames = new ArrayList<>();
|
private List<GameDisplay> _disabledGames = new ArrayList<>();
|
||||||
/** The ticks that passed since the player started the effect */
|
/** The ticks that passed since the player started the effect */
|
||||||
private Map<UUID, Integer> _ticksPerPlayer = new HashMap<>();
|
private Map<UUID, Integer> _ticksPerPlayer = new HashMap<>();
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ public abstract class TauntGadget extends Gadget
|
|||||||
_updateType = updateType;
|
_updateType = updateType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addDisabledGames(GameType... disabledGames)
|
public void addDisabledGames(GameDisplay... disabledGames)
|
||||||
{
|
{
|
||||||
_disabledGames.addAll(Arrays.asList(disabledGames));
|
_disabledGames.addAll(Arrays.asList(disabledGames));
|
||||||
}
|
}
|
||||||
@ -129,9 +129,9 @@ public abstract class TauntGadget extends Gadget
|
|||||||
return _canPlayWithPvp;
|
return _canPlayWithPvp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isGameDisabled(GameType gameType)
|
public boolean isGameDisabled(GameDisplay gameDisplay)
|
||||||
{
|
{
|
||||||
return _disabledGames.contains(gameType);
|
return _disabledGames.contains(gameDisplay);
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getPvpCooldown()
|
public long getPvpCooldown()
|
||||||
|
@ -50,6 +50,12 @@ public class BalloonData
|
|||||||
((LivingEntity) _balloon).setLeashHolder(_player);
|
((LivingEntity) _balloon).setLeashHolder(_player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void teleport()
|
||||||
|
{
|
||||||
|
_balloon.teleport(_balloonLoc);
|
||||||
|
_balloon.setVelocity(new Vector(0, 3, 0));
|
||||||
|
}
|
||||||
|
|
||||||
public void update()
|
public void update()
|
||||||
{
|
{
|
||||||
if (_leash == null)
|
if (_leash == null)
|
||||||
|
@ -5,6 +5,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
@ -23,6 +24,7 @@ public class CircleEffect extends Effect
|
|||||||
private List<Color> _randomColors = new ArrayList<>();
|
private List<Color> _randomColors = new ArrayList<>();
|
||||||
private int _maxCircles = -1;
|
private int _maxCircles = -1;
|
||||||
private int _totalCircles = 0;
|
private int _totalCircles = 0;
|
||||||
|
private double _yOffset = 0.0;
|
||||||
|
|
||||||
private static final double RANDOM_COLOR_CHANCE = 0.5;
|
private static final double RANDOM_COLOR_CHANCE = 0.5;
|
||||||
private static final int PARTICLES_PER_CIRCLE = 20;
|
private static final int PARTICLES_PER_CIRCLE = 20;
|
||||||
@ -40,6 +42,14 @@ public class CircleEffect extends Effect
|
|||||||
_instantly = instantly;
|
_instantly = instantly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CircleEffect(JavaPlugin plugin, Entity entity, double radius, Color color, boolean instantly)
|
||||||
|
{
|
||||||
|
super(-1, new EffectLocation(entity), plugin);
|
||||||
|
_radius = radius;
|
||||||
|
_color = color;
|
||||||
|
_instantly = instantly;
|
||||||
|
}
|
||||||
|
|
||||||
public void addRandomColor(Color color)
|
public void addRandomColor(Color color)
|
||||||
{
|
{
|
||||||
_randomColors.add(color);
|
_randomColors.add(color);
|
||||||
@ -50,6 +60,11 @@ public class CircleEffect extends Effect
|
|||||||
_maxCircles = circles;
|
_maxCircles = circles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setYOffset(double yOffset)
|
||||||
|
{
|
||||||
|
_yOffset = yOffset;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runEffect()
|
public void runEffect()
|
||||||
{
|
{
|
||||||
@ -57,7 +72,7 @@ public class CircleEffect extends Effect
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < PARTICLES_PER_CIRCLE; i++)
|
for (int i = 0; i < PARTICLES_PER_CIRCLE; i++)
|
||||||
{
|
{
|
||||||
Location location = getEffectLocation().getFixedLocation();
|
Location location = getEffectLocation().getLocation().add(0, _yOffset, 0);
|
||||||
double increment = (2 * Math.PI) / PARTICLES_PER_CIRCLE;
|
double increment = (2 * Math.PI) / PARTICLES_PER_CIRCLE;
|
||||||
double angle = _steps * increment;
|
double angle = _steps * increment;
|
||||||
Vector vector = new Vector(Math.cos(angle) * _radius, 0, Math.sin(angle) * _radius);
|
Vector vector = new Vector(Math.cos(angle) * _radius, 0, Math.sin(angle) * _radius);
|
||||||
@ -86,7 +101,7 @@ public class CircleEffect extends Effect
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Location location = getEffectLocation().getFixedLocation();
|
Location location = getEffectLocation().getLocation().add(0, _yOffset, 0);
|
||||||
double increment = (2 * Math.PI) / PARTICLES_PER_CIRCLE;
|
double increment = (2 * Math.PI) / PARTICLES_PER_CIRCLE;
|
||||||
double angle = _steps * increment;
|
double angle = _steps * increment;
|
||||||
Vector vector = new Vector(Math.cos(angle) * _radius, 0, Math.sin(angle) * _radius);
|
Vector vector = new Vector(Math.cos(angle) * _radius, 0, Math.sin(angle) * _radius);
|
||||||
|
@ -0,0 +1,122 @@
|
|||||||
|
package mineplex.core.particleeffects;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.RGBData;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.particles.ColoredParticle;
|
||||||
|
import mineplex.core.common.util.particles.DustSpellColor;
|
||||||
|
|
||||||
|
public class ColoredCircleEffect extends Effect
|
||||||
|
{
|
||||||
|
|
||||||
|
private double _radius;
|
||||||
|
private List<Color> _colors;
|
||||||
|
private int _steps = 0;
|
||||||
|
private boolean _instantly = true;
|
||||||
|
private int _maxCircles = -1;
|
||||||
|
private int _totalCircles = 0;
|
||||||
|
private double _yOffset = 0.0;
|
||||||
|
|
||||||
|
private static final int PARTICLES_PER_CIRCLE = 20;
|
||||||
|
|
||||||
|
public ColoredCircleEffect(JavaPlugin plugin, Entity entity, double radius, boolean instantly, Color... colors)
|
||||||
|
{
|
||||||
|
super(-1, new EffectLocation(entity), plugin);
|
||||||
|
_radius = radius;
|
||||||
|
_colors = new ArrayList<>();
|
||||||
|
_instantly = instantly;
|
||||||
|
Collections.addAll(_colors, colors);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxCircles(int circles)
|
||||||
|
{
|
||||||
|
_maxCircles = circles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setYOffset(double yOffset)
|
||||||
|
{
|
||||||
|
_yOffset = yOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addColor(Color color)
|
||||||
|
{
|
||||||
|
_colors.add(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addColors(Color... colors)
|
||||||
|
{
|
||||||
|
Collections.addAll(_colors, colors);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addColor(RGBData rgbData)
|
||||||
|
{
|
||||||
|
_colors.add(new Color(rgbData.getFullRed(), rgbData.getFullGreen(), rgbData.getFullBlue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addColors(RGBData... rgbDatas)
|
||||||
|
{
|
||||||
|
for (RGBData rgbData : rgbDatas)
|
||||||
|
{
|
||||||
|
addColor(rgbData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runEffect()
|
||||||
|
{
|
||||||
|
if (_instantly)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < PARTICLES_PER_CIRCLE; i++)
|
||||||
|
{
|
||||||
|
Location location = getEffectLocation().getLocation().add(0, _yOffset, 0);
|
||||||
|
double increment = (2 * Math.PI) / PARTICLES_PER_CIRCLE;
|
||||||
|
double angle = _steps * increment;
|
||||||
|
Vector vector = new Vector(Math.cos(angle) * _radius, 0, Math.sin(angle) * _radius);
|
||||||
|
ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST, new DustSpellColor(getNextColor()), location.add(vector));
|
||||||
|
coloredParticle.display();
|
||||||
|
_steps++;
|
||||||
|
}
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (_maxCircles != -1)
|
||||||
|
{
|
||||||
|
if (_totalCircles >= _maxCircles)
|
||||||
|
{
|
||||||
|
stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Location location = getEffectLocation().getLocation().add(0, _yOffset, 0);
|
||||||
|
double increment = (2 * Math.PI) / PARTICLES_PER_CIRCLE;
|
||||||
|
double angle = _steps * increment;
|
||||||
|
Vector vector = new Vector(Math.cos(angle) * _radius, 0, Math.sin(angle) * _radius);
|
||||||
|
ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST, new DustSpellColor(getNextColor()), location.add(vector));
|
||||||
|
coloredParticle.display();
|
||||||
|
_steps++;
|
||||||
|
if (_steps >= PARTICLES_PER_CIRCLE)
|
||||||
|
{
|
||||||
|
_totalCircles++;
|
||||||
|
_steps = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Color getNextColor()
|
||||||
|
{
|
||||||
|
int r = UtilMath.random.nextInt(_colors.size());
|
||||||
|
return _colors.get(r);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
package mineplex.core.pet;
|
package mineplex.core.pet;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Creature;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
@ -17,13 +17,13 @@ public class FlyingPetManager
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
private Player _player;
|
private Player _player;
|
||||||
private Creature _pet;
|
private Entity _pet;
|
||||||
private Location _grimReaperLoc, _target;
|
private Location _grimReaperLoc, _target;
|
||||||
private Vector _direction;
|
private Vector _direction;
|
||||||
private double _speed;
|
private double _speed;
|
||||||
private long _idleTime;
|
private long _idleTime;
|
||||||
|
|
||||||
public FlyingPetManager(Player player, Creature pet)
|
public FlyingPetManager(Player player, Entity pet)
|
||||||
{
|
{
|
||||||
_player = player;
|
_player = player;
|
||||||
_pet = pet;
|
_pet = pet;
|
||||||
|
@ -22,6 +22,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPigZombie;
|
|||||||
import org.bukkit.entity.Ageable;
|
import org.bukkit.entity.Ageable;
|
||||||
import org.bukkit.entity.Blaze;
|
import org.bukkit.entity.Blaze;
|
||||||
import org.bukkit.entity.Creature;
|
import org.bukkit.entity.Creature;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.PigZombie;
|
import org.bukkit.entity.PigZombie;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -54,7 +55,6 @@ import mineplex.core.common.Rank;
|
|||||||
import mineplex.core.common.shape.ShapeWings;
|
import mineplex.core.common.shape.ShapeWings;
|
||||||
import mineplex.core.common.skin.SkinData;
|
import mineplex.core.common.skin.SkinData;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.NautHashMap;
|
|
||||||
import mineplex.core.common.util.UtilAction;
|
import mineplex.core.common.util.UtilAction;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilEnt;
|
import mineplex.core.common.util.UtilEnt;
|
||||||
@ -88,17 +88,17 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
private BlockRestore _blockRestore;
|
private BlockRestore _blockRestore;
|
||||||
|
|
||||||
private Map<String, PetType> _activePetOwnerTypes = new HashMap<>();
|
private Map<String, PetType> _activePetOwnerTypes = new HashMap<>();
|
||||||
private NautHashMap<String, Creature> _activePetOwners;
|
private Map<String, Entity> _activePetOwners;
|
||||||
private NautHashMap<String, Integer> _failedAttempts;
|
private Map<String, Integer> _failedAttempts;
|
||||||
|
|
||||||
private Map<String, PetType> _petOwnerQueue = new HashMap<>();
|
private Map<String, PetType> _petOwnerQueue = new HashMap<>();
|
||||||
private NautHashMap<String, String> _petRenameQueue = new NautHashMap<String, String>();
|
private Map<String, String> _petRenameQueue = new HashMap<>();
|
||||||
private DonationManager _donationManager;
|
private DonationManager _donationManager;
|
||||||
private CoreClientManager _clientManager;
|
private CoreClientManager _clientManager;
|
||||||
private InventoryManager _inventoryManager;
|
private InventoryManager _inventoryManager;
|
||||||
|
|
||||||
private Map<Creature, FlyingPetManager> _flyingPets = new HashMap<>();
|
private Map<Entity, FlyingPetManager> _flyingPets = new HashMap<>();
|
||||||
private Map<Creature, TrueLoveData> _trueLovePets = new HashMap<>();
|
private Map<Entity, TrueLoveData> _trueLovePets = new HashMap<>();
|
||||||
|
|
||||||
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 _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 _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 _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);
|
||||||
@ -120,8 +120,8 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
_clientManager = clientManager;
|
_clientManager = clientManager;
|
||||||
_inventoryManager = inventoryManager;
|
_inventoryManager = inventoryManager;
|
||||||
|
|
||||||
_activePetOwners = new NautHashMap<String, Creature>();
|
_activePetOwners = new HashMap<>();
|
||||||
_failedAttempts = new NautHashMap<String, Integer>();
|
_failedAttempts = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addPetOwnerToQueue(String playerName, PetType petType)
|
public void addPetOwnerToQueue(String playerName, PetType petType)
|
||||||
@ -169,7 +169,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
|
|
||||||
if (player != null && player.isOnline())
|
if (player != null && player.isOnline())
|
||||||
{
|
{
|
||||||
Creature activePet = getActivePet(playerName);
|
Entity activePet = getActivePet(playerName);
|
||||||
if (activePet != null)
|
if (activePet != null)
|
||||||
{
|
{
|
||||||
activePet.setCustomNameVisible(true);
|
activePet.setCustomNameVisible(true);
|
||||||
@ -213,7 +213,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Creature pet;
|
Entity pet;
|
||||||
EntityType entityType = petType.getEntityType();
|
EntityType entityType = petType.getEntityType();
|
||||||
|
|
||||||
//Wither Spawn
|
//Wither Spawn
|
||||||
@ -221,7 +221,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
{
|
{
|
||||||
_creatureModule.SetForce(true);
|
_creatureModule.SetForce(true);
|
||||||
|
|
||||||
pet = (Creature) location.getWorld().spawnEntity(location, EntityType.SILVERFISH);
|
pet = location.getWorld().spawnEntity(location, EntityType.SILVERFISH);
|
||||||
UtilEnt.silence(pet, true);
|
UtilEnt.silence(pet, true);
|
||||||
|
|
||||||
DisguiseWither witherDisguise = new DisguiseWither(pet);
|
DisguiseWither witherDisguise = new DisguiseWither(pet);
|
||||||
@ -258,33 +258,35 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pet = (Creature)_creatureModule.SpawnEntity(location, petType.getEntityType());
|
pet = _creatureModule.SpawnEntity(location, petType.getEntityType());
|
||||||
}
|
}
|
||||||
//Default Spawn
|
//Default Spawn
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pet = (Creature)_creatureModule.SpawnEntity(location, petType.getEntityType());
|
pet = _creatureModule.SpawnEntity(location, petType.getEntityType());
|
||||||
}
|
}
|
||||||
|
|
||||||
//Named Pet
|
//Named Pet
|
||||||
if (Get(player).getPets().get(petType) != null && Get(player).getPets().get(petType).length() > 0)
|
if (Get(player).getPets().get(petType) != null && Get(player).getPets().get(petType).length() > 0)
|
||||||
{
|
{
|
||||||
//pet.setCustomNameVisible(true);
|
pet.setCustomNameVisible(true);
|
||||||
pet.setCustomName(Get(player).getPets().get(petType));
|
pet.setCustomName(Get(player).getPets().get(petType));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (petType.equals(PetType.ZOMBIE))
|
if (petType.equals(PetType.ZOMBIE))
|
||||||
{
|
{
|
||||||
((Zombie) pet).setBaby(true);
|
Zombie zombie = (Zombie) pet;
|
||||||
pet.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN));
|
zombie.setBaby(true);
|
||||||
pet.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 99999999, 0));
|
zombie.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN));
|
||||||
|
zombie.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 99999999, 0));
|
||||||
UtilEnt.silence(pet, true);
|
UtilEnt.silence(pet, true);
|
||||||
}
|
}
|
||||||
if (pet instanceof PigZombie)
|
if (pet instanceof PigZombie)
|
||||||
{
|
{
|
||||||
((PigZombie)pet).setBaby(true);
|
PigZombie pigZombie = (PigZombie) pet;
|
||||||
pet.getEquipment().setHelmet(new ItemStack(Material.SKULL_ITEM, 1, (short)0, (byte) 1));
|
pigZombie.setBaby(true);
|
||||||
pet.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 99999999, 0));
|
pigZombie.getEquipment().setHelmet(new ItemStack(Material.SKULL_ITEM, 1, (short)0, (byte) 1));
|
||||||
|
pigZombie.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 99999999, 0));
|
||||||
}
|
}
|
||||||
else if (pet instanceof Villager)
|
else if (pet instanceof Villager)
|
||||||
{
|
{
|
||||||
@ -293,10 +295,11 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
}
|
}
|
||||||
else if (pet instanceof Skeleton)
|
else if (pet instanceof Skeleton)
|
||||||
{
|
{
|
||||||
pet.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN)); //stop burning
|
Skeleton skeleton = (Skeleton) pet;
|
||||||
|
skeleton.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN)); //stop burning
|
||||||
UtilEnt.silence(pet, true);
|
UtilEnt.silence(pet, true);
|
||||||
|
|
||||||
DisguiseGuardian disguise = new DisguiseGuardian(pet);
|
DisguiseGuardian disguise = new DisguiseGuardian(skeleton);
|
||||||
|
|
||||||
if (Get(player).getPets().get(petType) != null && Get(player).getPets().get(petType).length() > 0)
|
if (Get(player).getPets().get(petType) != null && Get(player).getPets().get(petType).length() > 0)
|
||||||
{
|
{
|
||||||
@ -306,7 +309,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
|
|
||||||
_disguiseManager.disguise(disguise);
|
_disguiseManager.disguise(disguise);
|
||||||
}
|
}
|
||||||
else if (pet instanceof Rabbit)
|
else if (petType.equals(PetType.RABBIT))
|
||||||
{
|
{
|
||||||
UtilEnt.silence(pet, true);
|
UtilEnt.silence(pet, true);
|
||||||
DisguiseChicken disguise = new DisguiseChicken(pet);
|
DisguiseChicken disguise = new DisguiseChicken(pet);
|
||||||
@ -410,6 +413,12 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
zombie.getEquipment().setLeggings(ItemStackFactory.Instance.createColoredLeatherArmor(2, org.bukkit.Color.fromRGB(0, 153, 0)));
|
zombie.getEquipment().setLeggings(ItemStackFactory.Instance.createColoredLeatherArmor(2, org.bukkit.Color.fromRGB(0, 153, 0)));
|
||||||
zombie.getEquipment().setBoots(ItemStackFactory.Instance.createColoredLeatherArmor(3, org.bukkit.Color.fromRGB(0, 153, 0)));
|
zombie.getEquipment().setBoots(ItemStackFactory.Instance.createColoredLeatherArmor(3, org.bukkit.Color.fromRGB(0, 153, 0)));
|
||||||
}
|
}
|
||||||
|
else if (petType.equals(PetType.KILLER_BUNNY))
|
||||||
|
{
|
||||||
|
Rabbit rabbit = (Rabbit) pet;
|
||||||
|
rabbit.setAdult();
|
||||||
|
rabbit.setRabbitType(Rabbit.Type.THE_KILLER_BUNNY);
|
||||||
|
}
|
||||||
|
|
||||||
_activePetOwnerTypes.put(player.getName(), petType);
|
_activePetOwnerTypes.put(player.getName(), petType);
|
||||||
_activePetOwners.put(player.getName(), pet);
|
_activePetOwners.put(player.getName(), pet);
|
||||||
@ -424,7 +433,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
UtilEnt.vegetate(pet);
|
UtilEnt.vegetate(pet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Creature getPet(Player player)
|
public Entity getPet(Player player)
|
||||||
{
|
{
|
||||||
return _activePetOwners.get(player.getName());
|
return _activePetOwners.get(player.getName());
|
||||||
}
|
}
|
||||||
@ -433,7 +442,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
{
|
{
|
||||||
if (_activePetOwners.containsKey(player.getName()))
|
if (_activePetOwners.containsKey(player.getName()))
|
||||||
{
|
{
|
||||||
final Creature pet = _activePetOwners.get(player.getName());
|
final Entity pet = _activePetOwners.get(player.getName());
|
||||||
|
|
||||||
//Wither Silverfish
|
//Wither Silverfish
|
||||||
if (pet.getPassenger() != null)
|
if (pet.getPassenger() != null)
|
||||||
@ -494,7 +503,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
{
|
{
|
||||||
String playerName = null;
|
String playerName = null;
|
||||||
|
|
||||||
for (Entry<String,Creature> entry : _activePetOwners.entrySet())
|
for (Entry<String, Entity> entry : _activePetOwners.entrySet())
|
||||||
{
|
{
|
||||||
if (entry.getValue() == event.getEntity())
|
if (entry.getValue() == event.getEntity())
|
||||||
playerName = entry.getKey();
|
playerName = entry.getKey();
|
||||||
@ -518,28 +527,28 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
public void onUpdate(UpdateEvent event)
|
public void onUpdate(UpdateEvent event)
|
||||||
{
|
{
|
||||||
|
|
||||||
for (Entry<String, Creature> entry : _activePetOwners.entrySet())
|
for (Entry<String, Entity> entry : _activePetOwners.entrySet())
|
||||||
{
|
{
|
||||||
String playerName = entry.getKey();
|
String playerName = entry.getKey();
|
||||||
Creature creature = entry.getValue();
|
Entity entity = entry.getValue();
|
||||||
|
|
||||||
if (event.getType() == UpdateType.TICK)
|
if (event.getType() == UpdateType.TICK)
|
||||||
{
|
{
|
||||||
if (creature instanceof PigZombie)
|
if (entity instanceof PigZombie)
|
||||||
{
|
{
|
||||||
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, creature.getLocation(), 0.2f, 0.0f, 0.2f, 0.0f, 4, ViewDist.NORMAL);
|
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, entity.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(event.getTick() % 3 == 0) entity.getWorld().playSound(entity.getLocation(), Sound.BLAZE_BREATH, 0.03f, 0f);
|
||||||
if(!((CraftPigZombie) creature).getHandle().isSilent())
|
if(!((CraftPigZombie) entity).getHandle().isSilent())
|
||||||
{
|
{
|
||||||
((CraftPigZombie) creature).getHandle().setSilent(true);
|
((CraftPigZombie) entity).getHandle().setSilent(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event.getType() == UpdateType.FAST)
|
else if (event.getType() == UpdateType.FAST)
|
||||||
{
|
{
|
||||||
if (creature instanceof Blaze)
|
if (entity instanceof Blaze)
|
||||||
{
|
{
|
||||||
Location loc = creature.getLocation().clone().add(0, .5, 0).add(creature.getLocation().getDirection().multiply(-0.2));
|
Location loc = entity.getLocation().clone().add(0, .5, 0).add(entity.getLocation().getDirection().multiply(-0.2));
|
||||||
_grimReaperWings.display(loc);
|
_grimReaperWings.display(loc);
|
||||||
_grimReaperWingsEdge.display(loc);
|
_grimReaperWingsEdge.display(loc);
|
||||||
}
|
}
|
||||||
@ -548,7 +557,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
PetType petType = getActivePetType(playerName);
|
PetType petType = getActivePetType(playerName);
|
||||||
if (petType == PetType.CUPID_PET)
|
if (petType == PetType.CUPID_PET)
|
||||||
{
|
{
|
||||||
Location loc = creature.getLocation().clone().add(0, .5, 0).add(creature.getLocation().getDirection().multiply(-0.2));
|
Location loc = entity.getLocation().clone().add(0, .5, 0).add(entity.getLocation().getDirection().multiply(-0.2));
|
||||||
|
|
||||||
_cupidWings.displayColored(loc, Color.PINK);
|
_cupidWings.displayColored(loc, Color.PINK);
|
||||||
_cupidWingsWhite.displayColored(loc, Color.WHITE);
|
_cupidWingsWhite.displayColored(loc, Color.WHITE);
|
||||||
@ -561,7 +570,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
PetType petType = getActivePetType(playerName);
|
PetType petType = getActivePetType(playerName);
|
||||||
if (petType == PetType.CUPID_PET)
|
if (petType == PetType.CUPID_PET)
|
||||||
{
|
{
|
||||||
Location loc = creature.getLocation().clone().add(0, .5, 0);
|
Location loc = entity.getLocation().clone().add(0, .5, 0);
|
||||||
UtilParticle.PlayParticle(ParticleType.HEART, loc, 0.25f, 0.25f, 0.25f, 0.25f, 3, ViewDist.NORMAL);
|
UtilParticle.PlayParticle(ParticleType.HEART, loc, 0.25f, 0.25f, 0.25f, 0.25f, 3, ViewDist.NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -581,7 +590,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
String playerName = ownerIterator.next();
|
String playerName = ownerIterator.next();
|
||||||
Player owner = Bukkit.getPlayer(playerName);
|
Player owner = Bukkit.getPlayer(playerName);
|
||||||
|
|
||||||
Creature pet = _activePetOwners.get(playerName);
|
Entity pet = _activePetOwners.get(playerName);
|
||||||
Location petSpot = pet.getLocation();
|
Location petSpot = pet.getLocation();
|
||||||
Location ownerSpot = owner.getLocation();
|
Location ownerSpot = owner.getLocation();
|
||||||
xDiff = Math.abs(petSpot.getBlockX() - ownerSpot.getBlockX());
|
xDiff = Math.abs(petSpot.getBlockX() - ownerSpot.getBlockX());
|
||||||
@ -657,7 +666,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void grimReaperFly(UpdateEvent event)
|
public void grimReaperFly(UpdateEvent event)
|
||||||
{
|
{
|
||||||
for (Entry<Creature, FlyingPetManager> entry : _flyingPets.entrySet())
|
for (Entry<Entity, FlyingPetManager> entry : _flyingPets.entrySet())
|
||||||
{
|
{
|
||||||
FlyingPetManager flyingPetManager = entry.getValue();
|
FlyingPetManager flyingPetManager = entry.getValue();
|
||||||
flyingPetManager.update();
|
flyingPetManager.update();
|
||||||
@ -670,11 +679,11 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
if (event.getType() != UpdateType.FASTEST)
|
if (event.getType() != UpdateType.FASTEST)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Iterator<Entry<Creature, TrueLoveData>> iterator = _trueLovePets.entrySet().iterator();
|
Iterator<Entry<Entity, TrueLoveData>> iterator = _trueLovePets.entrySet().iterator();
|
||||||
while (iterator.hasNext())
|
while (iterator.hasNext())
|
||||||
{
|
{
|
||||||
Entry<Creature, TrueLoveData> entry = iterator.next();
|
Entry<Entity, TrueLoveData> entry = iterator.next();
|
||||||
Creature zombie = entry.getKey();
|
Entity zombie = entry.getKey();
|
||||||
UtilParticle.PlayParticle(ParticleType.HEART, zombie.getLocation().add(0, 0.25, 0), 0.25f, 0.25f, 0.25f, 0, 1, ViewDist.NORMAL);
|
UtilParticle.PlayParticle(ParticleType.HEART, zombie.getLocation().add(0, 0.25, 0), 0.25f, 0.25f, 0.25f, 0, 1, ViewDist.NORMAL);
|
||||||
TrueLoveData trueLoveData = entry.getValue();
|
TrueLoveData trueLoveData = entry.getValue();
|
||||||
trueLoveData.update();
|
trueLoveData.update();
|
||||||
@ -690,7 +699,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
{
|
{
|
||||||
if (event.getEntity() instanceof Zombie)
|
if (event.getEntity() instanceof Zombie)
|
||||||
{
|
{
|
||||||
if (_activePetOwners.containsValue((Creature) event.getEntity()))
|
if (_activePetOwners.containsValue(event.getEntity()))
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -718,7 +727,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
return _activePetOwnerTypes.get(name);
|
return _activePetOwnerTypes.get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Creature getActivePet(String name)
|
public Entity getActivePet(String name)
|
||||||
{
|
{
|
||||||
return _activePetOwners.get(name);
|
return _activePetOwners.get(name);
|
||||||
}
|
}
|
||||||
@ -734,7 +743,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
removePet(player, true);
|
removePet(player, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<Creature> getPets()
|
public Collection<Entity> getPets()
|
||||||
{
|
{
|
||||||
return _activePetOwners.values();
|
return _activePetOwners.values();
|
||||||
}
|
}
|
||||||
@ -744,4 +753,9 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
return _creatureModule;
|
return _creatureModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DisguiseManager getDisguiseManager()
|
||||||
|
{
|
||||||
|
return _disguiseManager;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,8 @@ public enum PetType
|
|||||||
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),
|
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)),
|
||||||
LEPRECHAUN("Leprechaun", EntityType.ZOMBIE, -18, "Apparently this little guy lost his Pot of Gold in the war.", SkinData.LEPRECHAUN.getSkull())
|
LEPRECHAUN("Leprechaun", EntityType.ZOMBIE, -18, "Apparently this little guy lost his Pot of Gold in the war.", SkinData.LEPRECHAUN.getSkull()),
|
||||||
|
KILLER_BUNNY("Killer Bunny", EntityType.RABBIT, -19, "The Easter Bunny's less talked about brother Devin was a bit less fun to hang out with.", Material.RABBIT_FOOT, (byte) 0)
|
||||||
// TODO CHECK IF LOBBY IS 1.9+
|
// TODO CHECK IF LOBBY IS 1.9+
|
||||||
// Not in this update
|
// Not in this update
|
||||||
//SHULKER("Shulker Pet", EntityType.BAT, 0, "Is it a turtle or an alien? Either way its shot can be really UPLIFTING.")
|
//SHULKER("Shulker Pet", EntityType.BAT, 0, "Is it a turtle or an alien? Either way its shot can be really UPLIFTING.")
|
||||||
|
@ -0,0 +1,168 @@
|
|||||||
|
package mineplex.core.pet.custom;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
|
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||||
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.pet.PetManager;
|
||||||
|
|
||||||
|
public abstract class CustomPet
|
||||||
|
{
|
||||||
|
|
||||||
|
private static Map<Player, CustomPet> _customPet = new HashMap<>();
|
||||||
|
|
||||||
|
protected PetManager _petManager;
|
||||||
|
protected Player _player;
|
||||||
|
protected EntityType _entityType;
|
||||||
|
protected int _step = 0;
|
||||||
|
private String _name;
|
||||||
|
private List<String> _lines = new ArrayList<>();
|
||||||
|
|
||||||
|
public CustomPet(PetManager petManager, Player player, EntityType entityType)
|
||||||
|
{
|
||||||
|
_petManager = petManager;
|
||||||
|
_player = player;
|
||||||
|
_entityType = entityType;
|
||||||
|
_customPet.put(player, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void spawn(Entity entity)
|
||||||
|
{
|
||||||
|
UtilEnt.silence(entity, true);
|
||||||
|
onSpawn(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void onSpawn(Entity entity);
|
||||||
|
|
||||||
|
public abstract GadgetPage getNextStep(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager);
|
||||||
|
|
||||||
|
public abstract GadgetPage getPreviousStep(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager);
|
||||||
|
|
||||||
|
public void setName(String name)
|
||||||
|
{
|
||||||
|
_name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return _name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addLine(String lineKey, String lineValue)
|
||||||
|
{
|
||||||
|
_lines.add(C.cGray + lineKey + ": " + F.name(lineValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addLine(String lineKey, String lineValue, int i)
|
||||||
|
{
|
||||||
|
_lines.add(i, C.cGray + lineKey + ": " + F.name(lineValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addTypeLine(String type)
|
||||||
|
{
|
||||||
|
addLine("Type", type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getLines()
|
||||||
|
{
|
||||||
|
return _lines;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getCustomPetDescription()
|
||||||
|
{
|
||||||
|
ItemStack itemStack = new ItemStack(Material.PAPER);
|
||||||
|
ItemMeta meta = itemStack.getItemMeta();
|
||||||
|
if (_name != null)
|
||||||
|
{
|
||||||
|
meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', _name));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
meta.setDisplayName("Custom Pet");
|
||||||
|
}
|
||||||
|
meta.setLore(_lines);
|
||||||
|
itemStack.setItemMeta(meta);
|
||||||
|
return itemStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CustomPet getCustomPet(Player player)
|
||||||
|
{
|
||||||
|
if (_customPet.containsKey(player))
|
||||||
|
{
|
||||||
|
return _customPet.get(player);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void removeCustomPet(Player player)
|
||||||
|
{
|
||||||
|
if (_customPet.containsKey(player))
|
||||||
|
{
|
||||||
|
_customPet.remove(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum CustomPetType
|
||||||
|
{
|
||||||
|
ZOMBIE("Zombie", Material.GLASS);
|
||||||
|
|
||||||
|
private String _name;
|
||||||
|
private Material _material;
|
||||||
|
private byte _data;
|
||||||
|
|
||||||
|
CustomPetType(String name, Material material, byte data)
|
||||||
|
{
|
||||||
|
_name = name;
|
||||||
|
_material = material;
|
||||||
|
_data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomPetType(String name, Material material)
|
||||||
|
{
|
||||||
|
this(name, material, (byte) 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return _name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Material getMaterial()
|
||||||
|
{
|
||||||
|
return _material;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getData()
|
||||||
|
{
|
||||||
|
return _data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomPet getCustomPet(PetManager petManager, Player player)
|
||||||
|
{
|
||||||
|
switch (this)
|
||||||
|
{
|
||||||
|
case ZOMBIE:
|
||||||
|
return new CustomPetZombie(petManager, player);
|
||||||
|
default:
|
||||||
|
return new CustomPetZombie(petManager, player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package mineplex.core.pet.custom;
|
||||||
|
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.pet.PetManager;
|
||||||
|
|
||||||
|
public abstract class CustomPetAgeable extends CustomPet
|
||||||
|
{
|
||||||
|
|
||||||
|
private boolean _baby = false;
|
||||||
|
|
||||||
|
public CustomPetAgeable(PetManager petManager, Player player, EntityType entityType)
|
||||||
|
{
|
||||||
|
super(petManager, player, entityType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBaby(boolean baby)
|
||||||
|
{
|
||||||
|
_baby = baby;
|
||||||
|
addLine("Age", (baby) ? "Baby" : "Adult");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isBaby()
|
||||||
|
{
|
||||||
|
return _baby;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package mineplex.core.pet.custom;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import mineplex.core.pet.PetManager;
|
||||||
|
|
||||||
|
public abstract class CustomPetEquipment extends CustomPetAgeable
|
||||||
|
{
|
||||||
|
|
||||||
|
private ItemStack _helmet;
|
||||||
|
private ItemStack _chestplate;
|
||||||
|
private ItemStack _leggings;
|
||||||
|
private ItemStack _boots;
|
||||||
|
|
||||||
|
public CustomPetEquipment(PetManager petManager, Player player, EntityType entityType)
|
||||||
|
{
|
||||||
|
super(petManager, player, entityType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHelmet(ItemStack helmet)
|
||||||
|
{
|
||||||
|
_helmet = helmet;
|
||||||
|
addLine("Helmet", (helmet.getType() == Material.AIR) ? "None" : helmet.getItemMeta().getDisplayName());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChestplate(ItemStack chestplate)
|
||||||
|
{
|
||||||
|
_chestplate = chestplate;
|
||||||
|
addLine("Chestplate", (chestplate.getType() == Material.AIR) ? "None" : chestplate.getItemMeta().getDisplayName());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLeggings(ItemStack leggings)
|
||||||
|
{
|
||||||
|
_leggings = leggings;
|
||||||
|
addLine("Leggings", (leggings.getType() == Material.AIR) ? "None" : leggings.getItemMeta().getDisplayName());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBoots(ItemStack boots)
|
||||||
|
{
|
||||||
|
_boots = boots;
|
||||||
|
addLine("Boots", (boots.getType() == Material.AIR) ? "None" : boots.getItemMeta().getDisplayName());
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getHelmet()
|
||||||
|
{
|
||||||
|
return _helmet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getChestplate()
|
||||||
|
{
|
||||||
|
return _chestplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getLeggings()
|
||||||
|
{
|
||||||
|
return _leggings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getBoots()
|
||||||
|
{
|
||||||
|
return _boots;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,149 @@
|
|||||||
|
package mineplex.core.pet.custom;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
|
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||||
|
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||||
|
import mineplex.core.cosmetic.ui.page.custompet.CustomPetBasePage;
|
||||||
|
import mineplex.core.cosmetic.ui.page.custompet.CustomPetConfirmPage;
|
||||||
|
import mineplex.core.cosmetic.ui.page.custompet.age.CustomPetAgePage;
|
||||||
|
import mineplex.core.cosmetic.ui.page.custompet.equipment.CustomPetBootsPage;
|
||||||
|
import mineplex.core.cosmetic.ui.page.custompet.equipment.CustomPetChestplatePage;
|
||||||
|
import mineplex.core.cosmetic.ui.page.custompet.equipment.CustomPetHelmetPage;
|
||||||
|
import mineplex.core.cosmetic.ui.page.custompet.equipment.CustomPetLeggingsPage;
|
||||||
|
import mineplex.core.cosmetic.ui.page.custompet.name.CustomPetNamePage;
|
||||||
|
import mineplex.core.cosmetic.ui.page.custompet.zombie.CustomPetZombieTypePage;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseZombie;
|
||||||
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.pet.PetManager;
|
||||||
|
|
||||||
|
public class CustomPetZombie extends CustomPetEquipment
|
||||||
|
{
|
||||||
|
|
||||||
|
private boolean _villager = false;
|
||||||
|
|
||||||
|
public CustomPetZombie(PetManager petManager, Player player)
|
||||||
|
{
|
||||||
|
super(petManager, player, EntityType.ZOMBIE);
|
||||||
|
addTypeLine("Zombie");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSpawn(Entity entity)
|
||||||
|
{
|
||||||
|
DisguiseZombie disguiseZombie = new DisguiseZombie(entity);
|
||||||
|
disguiseZombie.setBaby(isBaby());
|
||||||
|
disguiseZombie.setVillager(_villager);
|
||||||
|
if (getHelmet() != null)
|
||||||
|
{
|
||||||
|
disguiseZombie.setHelmet(getHelmet());
|
||||||
|
}
|
||||||
|
if (getChestplate() != null)
|
||||||
|
{
|
||||||
|
disguiseZombie.setChestplate(getChestplate());
|
||||||
|
}
|
||||||
|
if (getLeggings() != null)
|
||||||
|
{
|
||||||
|
disguiseZombie.setLeggings(getLeggings());
|
||||||
|
}
|
||||||
|
if (getBoots() != null)
|
||||||
|
{
|
||||||
|
disguiseZombie.setBoots(getBoots());
|
||||||
|
}
|
||||||
|
if (getName() != null)
|
||||||
|
{
|
||||||
|
disguiseZombie.setCustomNameVisible(true);
|
||||||
|
disguiseZombie.setName(ChatColor.translateAlternateColorCodes('&', getName()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
disguiseZombie.setCustomNameVisible(false);
|
||||||
|
}
|
||||||
|
_petManager.getDisguiseManager().disguise(disguiseZombie);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GadgetPage getNextStep(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager)
|
||||||
|
{
|
||||||
|
switch (_step)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
_step++;
|
||||||
|
return new CustomPetNamePage(plugin, shop, clientManager, donationManager, "Zombie Name", _player);
|
||||||
|
case 1:
|
||||||
|
_step++;
|
||||||
|
return new CustomPetAgePage(plugin, shop, clientManager, donationManager, "Zombie Age", _player);
|
||||||
|
case 2:
|
||||||
|
_step++;
|
||||||
|
return new CustomPetHelmetPage(plugin, shop, clientManager, donationManager, "Zombie Helmet", _player);
|
||||||
|
case 3:
|
||||||
|
_step++;
|
||||||
|
return new CustomPetChestplatePage(plugin, shop, clientManager, donationManager, "Zombie Chestplate", _player);
|
||||||
|
case 4:
|
||||||
|
_step++;
|
||||||
|
return new CustomPetLeggingsPage(plugin, shop, clientManager, donationManager, "Zombie Leggings", _player);
|
||||||
|
case 5:
|
||||||
|
_step++;
|
||||||
|
return new CustomPetBootsPage(plugin, shop, clientManager, donationManager, "Zombie Boots", _player);
|
||||||
|
case 6:
|
||||||
|
_step++;
|
||||||
|
return new CustomPetZombieTypePage(plugin, shop, clientManager, donationManager, "Zombie Type", _player);
|
||||||
|
case 7:
|
||||||
|
_step++;
|
||||||
|
return new CustomPetConfirmPage(plugin, shop, clientManager, donationManager, "Confirm", _player);
|
||||||
|
default:
|
||||||
|
_step++;
|
||||||
|
return new CustomPetAgePage(plugin, shop, clientManager, donationManager, "Zombie Age", _player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GadgetPage getPreviousStep(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager)
|
||||||
|
{
|
||||||
|
switch (_step)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
_step--;
|
||||||
|
return new CustomPetBasePage(plugin, shop, clientManager, donationManager, "Custom Pet", _player);
|
||||||
|
case 2:
|
||||||
|
_step--;
|
||||||
|
return new CustomPetNamePage(plugin, shop, clientManager, donationManager, "Zombie Name", _player);
|
||||||
|
case 3:
|
||||||
|
_step--;
|
||||||
|
return new CustomPetAgePage(plugin, shop, clientManager, donationManager, "Zombie Age", _player);
|
||||||
|
case 4:
|
||||||
|
_step--;
|
||||||
|
return new CustomPetHelmetPage(plugin, shop, clientManager, donationManager, "Zombie Helmet", _player);
|
||||||
|
case 5:
|
||||||
|
_step--;
|
||||||
|
return new CustomPetChestplatePage(plugin, shop, clientManager, donationManager, "Zombie Chestplate", _player);
|
||||||
|
case 6:
|
||||||
|
_step--;
|
||||||
|
return new CustomPetLeggingsPage(plugin, shop, clientManager, donationManager, "Zombie Leggings", _player);
|
||||||
|
case 7:
|
||||||
|
_step--;
|
||||||
|
return new CustomPetBootsPage(plugin, shop, clientManager, donationManager, "Zombie Boots", _player);
|
||||||
|
case 8:
|
||||||
|
_step--;
|
||||||
|
return new CustomPetZombieTypePage(plugin, shop, clientManager, donationManager, "Zombie Type", _player);
|
||||||
|
default:
|
||||||
|
_step--;
|
||||||
|
return new CustomPetBasePage(plugin, shop, clientManager, donationManager, "Custom Pet", _player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVillager(boolean villager)
|
||||||
|
{
|
||||||
|
_villager = villager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isVillager()
|
||||||
|
{
|
||||||
|
return _villager;
|
||||||
|
}
|
||||||
|
}
|
@ -15,7 +15,7 @@ import mineplex.core.common.Rank;
|
|||||||
import mineplex.core.common.util.banner.CountryFlag;
|
import mineplex.core.common.util.banner.CountryFlag;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.gadget.GadgetManager;
|
import mineplex.core.gadget.GadgetManager;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailHalloween;
|
import mineplex.core.gadget.gadgets.arrowtrail.halloween.ArrowTrailHalloween;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.candycane.ArrowTrailCandyCane;
|
import mineplex.core.gadget.gadgets.arrowtrail.candycane.ArrowTrailCandyCane;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.cupidslove.ArrowTrailCupid;
|
import mineplex.core.gadget.gadgets.arrowtrail.cupidslove.ArrowTrailCupid;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.emerald.ArrowTrailEmerald;
|
import mineplex.core.gadget.gadgets.arrowtrail.emerald.ArrowTrailEmerald;
|
||||||
@ -25,6 +25,7 @@ import mineplex.core.gadget.gadgets.arrowtrail.howlingwinds.ArrowTrailStorm;
|
|||||||
import mineplex.core.gadget.gadgets.arrowtrail.music.ArrowTrailMusic;
|
import mineplex.core.gadget.gadgets.arrowtrail.music.ArrowTrailMusic;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.party.ArrowTrailConfetti;
|
import mineplex.core.gadget.gadgets.arrowtrail.party.ArrowTrailConfetti;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.shadow.ArrowTrailShadow;
|
import mineplex.core.gadget.gadgets.arrowtrail.shadow.ArrowTrailShadow;
|
||||||
|
import mineplex.core.gadget.gadgets.arrowtrail.spring.ArrowTrailSpring;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.vampire.ArrowTrailBlood;
|
import mineplex.core.gadget.gadgets.arrowtrail.vampire.ArrowTrailBlood;
|
||||||
import mineplex.core.gadget.gadgets.arrowtrail.wisdom.ArrowTrailEnchant;
|
import mineplex.core.gadget.gadgets.arrowtrail.wisdom.ArrowTrailEnchant;
|
||||||
import mineplex.core.gadget.gadgets.balloons.BalloonType;
|
import mineplex.core.gadget.gadgets.balloons.BalloonType;
|
||||||
@ -38,9 +39,10 @@ import mineplex.core.gadget.gadgets.death.howlingwinds.DeathStorm;
|
|||||||
import mineplex.core.gadget.gadgets.death.music.DeathMusic;
|
import mineplex.core.gadget.gadgets.death.music.DeathMusic;
|
||||||
import mineplex.core.gadget.gadgets.death.party.DeathPinataBurst;
|
import mineplex.core.gadget.gadgets.death.party.DeathPinataBurst;
|
||||||
import mineplex.core.gadget.gadgets.death.shadow.DeathShadow;
|
import mineplex.core.gadget.gadgets.death.shadow.DeathShadow;
|
||||||
|
import mineplex.core.gadget.gadgets.death.spring.DeathSpring;
|
||||||
import mineplex.core.gadget.gadgets.death.vampire.DeathBlood;
|
import mineplex.core.gadget.gadgets.death.vampire.DeathBlood;
|
||||||
import mineplex.core.gadget.gadgets.death.wisdom.DeathEnchant;
|
import mineplex.core.gadget.gadgets.death.wisdom.DeathEnchant;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpHalloween;
|
import mineplex.core.gadget.gadgets.doublejump.halloween.DoubleJumpHalloween;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.candycane.DoubleJumpCandyCane;
|
import mineplex.core.gadget.gadgets.doublejump.candycane.DoubleJumpCandyCane;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.cupidslove.DoubleJumpCupidsWings;
|
import mineplex.core.gadget.gadgets.doublejump.cupidslove.DoubleJumpCupidsWings;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.emerald.DoubleJumpEmerald;
|
import mineplex.core.gadget.gadgets.doublejump.emerald.DoubleJumpEmerald;
|
||||||
@ -50,6 +52,7 @@ import mineplex.core.gadget.gadgets.doublejump.howlingwinds.DoubleJumpStorm;
|
|||||||
import mineplex.core.gadget.gadgets.doublejump.music.DoubleJumpMusic;
|
import mineplex.core.gadget.gadgets.doublejump.music.DoubleJumpMusic;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.party.DoubleJumpFirecracker;
|
import mineplex.core.gadget.gadgets.doublejump.party.DoubleJumpFirecracker;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.shadow.DoubleJumpShadow;
|
import mineplex.core.gadget.gadgets.doublejump.shadow.DoubleJumpShadow;
|
||||||
|
import mineplex.core.gadget.gadgets.doublejump.spring.DoubleJumpSpring;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.vampire.DoubleJumpBlood;
|
import mineplex.core.gadget.gadgets.doublejump.vampire.DoubleJumpBlood;
|
||||||
import mineplex.core.gadget.gadgets.doublejump.wisdom.DoubleJumpEnchant;
|
import mineplex.core.gadget.gadgets.doublejump.wisdom.DoubleJumpEnchant;
|
||||||
import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.MineStrikeSkin;
|
import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.MineStrikeSkin;
|
||||||
@ -67,6 +70,7 @@ import mineplex.core.gadget.gadgets.item.ItemPaintballGun;
|
|||||||
import mineplex.core.gadget.gadgets.item.ItemPartyPopper;
|
import mineplex.core.gadget.gadgets.item.ItemPartyPopper;
|
||||||
import mineplex.core.gadget.gadgets.item.ItemSnowball;
|
import mineplex.core.gadget.gadgets.item.ItemSnowball;
|
||||||
import mineplex.core.gadget.gadgets.item.ItemTNT;
|
import mineplex.core.gadget.gadgets.item.ItemTNT;
|
||||||
|
import mineplex.core.gadget.gadgets.morph.MorphAwkwardRabbit;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphBat;
|
import mineplex.core.gadget.gadgets.morph.MorphBat;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphBlock;
|
import mineplex.core.gadget.gadgets.morph.MorphBlock;
|
||||||
import mineplex.core.gadget.gadgets.morph.MorphBunny;
|
import mineplex.core.gadget.gadgets.morph.MorphBunny;
|
||||||
@ -115,6 +119,7 @@ import mineplex.core.gadget.gadgets.particle.howlingwinds.ParticleRain;
|
|||||||
import mineplex.core.gadget.gadgets.particle.music.ParticleMusic;
|
import mineplex.core.gadget.gadgets.particle.music.ParticleMusic;
|
||||||
import mineplex.core.gadget.gadgets.particle.party.ParticlePartyTime;
|
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.spring.ParticleSpringHalo;
|
||||||
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.BlowAKissTaunt;
|
||||||
@ -599,6 +604,11 @@ public class RewardManager
|
|||||||
addGadget(Type.STPATRICKS, getGadget(OutfitStPatricksChestplate.class), rarity, 50);
|
addGadget(Type.STPATRICKS, getGadget(OutfitStPatricksChestplate.class), rarity, 50);
|
||||||
addGadget(Type.STPATRICKS, getGadget(OutfitStPatricksLeggings.class), rarity, 50);
|
addGadget(Type.STPATRICKS, getGadget(OutfitStPatricksLeggings.class), rarity, 50);
|
||||||
addGadget(Type.STPATRICKS, getGadget(OutfitStPatricksBoots.class), rarity, 50);
|
addGadget(Type.STPATRICKS, getGadget(OutfitStPatricksBoots.class), rarity, 50);
|
||||||
|
|
||||||
|
// SPRING
|
||||||
|
addGadget(Type.SPRING, getGadget(ArrowTrailSpring.class), rarity, 100);
|
||||||
|
addGadget(Type.SPRING, getGadget(DeathSpring.class), rarity, 100);
|
||||||
|
addGadget(Type.SPRING, getGadget(DoubleJumpSpring.class), rarity, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addLegendary()
|
public void addLegendary()
|
||||||
@ -856,6 +866,12 @@ public class RewardManager
|
|||||||
addPetReward(Type.STPATRICKS, PetType.LEPRECHAUN, rarity, 30);
|
addPetReward(Type.STPATRICKS, PetType.LEPRECHAUN, rarity, 30);
|
||||||
|
|
||||||
addMount(Type.STPATRICKS, getMount(MountStPatricksHorse.class), rarity, 30);
|
addMount(Type.STPATRICKS, getMount(MountStPatricksHorse.class), rarity, 30);
|
||||||
|
|
||||||
|
// SPRING
|
||||||
|
addGadget(Type.SPRING, getGadget(ParticleSpringHalo.class), rarity, 100);
|
||||||
|
addGadget(Type.SPRING, getGadget(MorphAwkwardRabbit.class), rarity, 25);
|
||||||
|
|
||||||
|
addPetReward(Type.SPRING, PetType.KILLER_BUNNY, rarity, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
public UnknownPackageReward addMount(Type type, Mount<?> mount, RewardRarity rarity, int weight)
|
public UnknownPackageReward addMount(Type type, Mount<?> mount, RewardRarity rarity, int weight)
|
||||||
|
@ -65,6 +65,7 @@ public class RewardPool
|
|||||||
MINESTRIKE(true, 2),
|
MINESTRIKE(true, 2),
|
||||||
LOVECHEST(false, 1),
|
LOVECHEST(false, 1),
|
||||||
STPATRICKS(false, 1),
|
STPATRICKS(false, 1),
|
||||||
|
SPRING(false, 1),
|
||||||
CARL_SPINNER(true);
|
CARL_SPINNER(true);
|
||||||
|
|
||||||
private boolean _useDuplicates;
|
private boolean _useDuplicates;
|
||||||
|
@ -22,6 +22,7 @@ public enum RewardType
|
|||||||
LOVE_CHEST( 0, 6, 18, 0),
|
LOVE_CHEST( 0, 6, 18, 0),
|
||||||
VALENTINES_GIFT( 0, 7, 20, 20),
|
VALENTINES_GIFT( 0, 7, 20, 20),
|
||||||
ST_PATRICKS( 0, 6, 18, 0),
|
ST_PATRICKS( 0, 6, 18, 0),
|
||||||
|
SPRING( 0, 6, 18, 0),
|
||||||
|
|
||||||
SPINNER_FILLER( 0.1, 1, 4, 20),
|
SPINNER_FILLER( 0.1, 1, 4, 20),
|
||||||
SPINNER_REAL( 0.000001, 0.05, 0.4, 5);
|
SPINNER_REAL( 0.000001, 0.05, 0.4, 5);
|
||||||
|
@ -22,6 +22,7 @@ import mineplex.core.gadget.gadgets.item.ItemSnowball;
|
|||||||
import mineplex.core.gadget.set.SetCupidsLove;
|
import mineplex.core.gadget.set.SetCupidsLove;
|
||||||
import mineplex.core.gadget.set.SetFreedom;
|
import mineplex.core.gadget.set.SetFreedom;
|
||||||
import mineplex.core.gadget.set.SetFrostLord;
|
import mineplex.core.gadget.set.SetFrostLord;
|
||||||
|
import mineplex.core.gadget.set.SetSpring;
|
||||||
import mineplex.core.gadget.types.Gadget;
|
import mineplex.core.gadget.types.Gadget;
|
||||||
import mineplex.core.gadget.types.GadgetSet;
|
import mineplex.core.gadget.types.GadgetSet;
|
||||||
import mineplex.core.titles.tracks.Track;
|
import mineplex.core.titles.tracks.Track;
|
||||||
@ -56,6 +57,7 @@ public class HolidayCheerTrack extends Track
|
|||||||
HOLIDAY_SETS.add(SetFreedom.class);
|
HOLIDAY_SETS.add(SetFreedom.class);
|
||||||
HOLIDAY_SETS.add(SetCupidsLove.class);
|
HOLIDAY_SETS.add(SetCupidsLove.class);
|
||||||
HOLIDAY_SETS.add(SetFrostLord.class);
|
HOLIDAY_SETS.add(SetFrostLord.class);
|
||||||
|
HOLIDAY_SETS.add(SetSpring.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final GadgetManager _gadgetManager = Managers.require(GadgetManager.class);
|
private final GadgetManager _gadgetManager = Managers.require(GadgetManager.class);
|
||||||
|
@ -224,6 +224,15 @@ 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.SPRING)
|
||||||
|
{
|
||||||
|
int r = (int) (Math.random() * 2);
|
||||||
|
double rX = Math.random() * 2 - 1, rZ = Math.random() * 2 - 1;
|
||||||
|
ColoredParticle coloredParticle = new ColoredParticle(UtilParticle.ParticleType.RED_DUST,
|
||||||
|
new DustSpellColor((r == 0) ? Color.RED : Color.YELLOW),
|
||||||
|
block.getLocation().add(.5 + rX, .7, .5 + rZ));
|
||||||
|
coloredParticle.display();
|
||||||
|
}
|
||||||
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,
|
||||||
|
@ -97,6 +97,13 @@ public enum TreasureStyle
|
|||||||
ParticleType.HAPPY_VILLAGER,
|
ParticleType.HAPPY_VILLAGER,
|
||||||
Sound.VILLAGER_YES,
|
Sound.VILLAGER_YES,
|
||||||
Sound.VILLAGER_YES
|
Sound.VILLAGER_YES
|
||||||
|
),
|
||||||
|
SPRING(
|
||||||
|
ParticleType.RED_DUST,
|
||||||
|
ParticleType.RED_DUST,
|
||||||
|
ParticleType.RED_DUST,
|
||||||
|
Sound.STEP_GRASS,
|
||||||
|
Sound.STEP_GRASS
|
||||||
);
|
);
|
||||||
|
|
||||||
private ParticleType _secondaryParticle;
|
private ParticleType _secondaryParticle;
|
||||||
|
@ -34,7 +34,9 @@ public enum TreasureType
|
|||||||
|
|
||||||
LOVE_CHEST(C.cRed + "Love Treasure", "Love Chest", "LoveChest", RewardType.LOVE_CHEST, Material.CHEST, TreasureStyle.LOVECHEST, RewardPool.Type.LOVECHEST, true, 20000),
|
LOVE_CHEST(C.cRed + "Love Treasure", "Love Chest", "LoveChest", RewardType.LOVE_CHEST, Material.CHEST, TreasureStyle.LOVECHEST, RewardPool.Type.LOVECHEST, true, 20000),
|
||||||
|
|
||||||
ST_PATRICKS(C.cGreen + "St Patrick's Treasure", "St Patricks Chest", "StPatricksChest", RewardType.ST_PATRICKS, Material.CHEST, TreasureStyle.STPATRICKS,RewardPool.Type.STPATRICKS, true, 20000);
|
ST_PATRICKS(C.cGreen + "St Patrick's Treasure", "St Patricks Chest", "StPatricksChest", RewardType.ST_PATRICKS, Material.CHEST, TreasureStyle.STPATRICKS,RewardPool.Type.STPATRICKS, true, 20000),
|
||||||
|
|
||||||
|
SPRING(C.cGreen + "Spring Treasure", "Spring Chest", "SpringChest", RewardType.SPRING, Material.CHEST, TreasureStyle.SPRING, RewardPool.Type.SPRING, true, 20000);
|
||||||
|
|
||||||
private final String _name;
|
private final String _name;
|
||||||
private final RewardType _rewardType;
|
private final RewardType _rewardType;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package mineplex.core.treasure.animation;
|
package mineplex.core.treasure.animation;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -7,8 +8,10 @@ import org.bukkit.block.Block;
|
|||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.block.Skull;
|
import org.bukkit.block.Skull;
|
||||||
|
|
||||||
|
import mineplex.core.common.MaterialData;
|
||||||
import mineplex.core.common.skin.SkinData;
|
import mineplex.core.common.skin.SkinData;
|
||||||
import mineplex.core.common.util.UtilBlock;
|
import mineplex.core.common.util.UtilBlock;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
import mineplex.core.treasure.BlockInfo;
|
import mineplex.core.treasure.BlockInfo;
|
||||||
import mineplex.core.treasure.Treasure;
|
import mineplex.core.treasure.Treasure;
|
||||||
import mineplex.core.treasure.TreasureType;
|
import mineplex.core.treasure.TreasureType;
|
||||||
@ -99,6 +102,10 @@ public class BlockChangeAnimation extends Animation
|
|||||||
mat = Material.WOOL;
|
mat = Material.WOOL;
|
||||||
data = 13;
|
data = 13;
|
||||||
}
|
}
|
||||||
|
else if (getTreasure().getTreasureType() == TreasureType.SPRING)
|
||||||
|
{
|
||||||
|
mat = Material.GRASS;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -151,6 +158,11 @@ public class BlockChangeAnimation extends Animation
|
|||||||
mat = Material.GOLD_BLOCK;
|
mat = Material.GOLD_BLOCK;
|
||||||
data = 0;
|
data = 0;
|
||||||
}
|
}
|
||||||
|
else if (getTreasure().getTreasureType() == TreasureType.SPRING)
|
||||||
|
{
|
||||||
|
mat = Material.DIRT;
|
||||||
|
data = 2;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -245,6 +257,27 @@ public class BlockChangeAnimation extends Animation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (getTreasure().getTreasureType() == TreasureType.SPRING)
|
||||||
|
{
|
||||||
|
List<MaterialData> materials = new ArrayList<>();
|
||||||
|
materials.add(MaterialData.of(Material.LEAVES, (byte) 0));
|
||||||
|
materials.add(MaterialData.of(Material.LEAVES, (byte) 1));
|
||||||
|
materials.add(MaterialData.of(Material.LEAVES, (byte) 2));
|
||||||
|
materials.add(MaterialData.of(Material.LEAVES, (byte) 3));
|
||||||
|
materials.add(MaterialData.of(Material.LEAVES_2, (byte) 0));
|
||||||
|
materials.add(MaterialData.of(Material.LEAVES_2, (byte) 1));
|
||||||
|
for (Block c : _chests)
|
||||||
|
{
|
||||||
|
if (c.equals(b))
|
||||||
|
{
|
||||||
|
_blockInfoList.add(new BlockInfo(b));
|
||||||
|
int r = UtilMath.random.nextInt(materials.size());
|
||||||
|
MaterialData materialData = materials.get(r);
|
||||||
|
b.setType(materialData.getMaterial());
|
||||||
|
b.setData(materialData.getData());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -256,7 +289,6 @@ public class BlockChangeAnimation extends Animation
|
|||||||
@Override
|
@Override
|
||||||
protected void onFinish()
|
protected void onFinish()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte getDirection(Block block)
|
private byte getDirection(Block block)
|
||||||
|
@ -1,22 +1,32 @@
|
|||||||
package mineplex.core.treasure.animation;
|
package mineplex.core.treasure.animation;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
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.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
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;
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Item;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import mineplex.core.Managers;
|
import mineplex.core.Managers;
|
||||||
|
import mineplex.core.common.MaterialData;
|
||||||
import mineplex.core.common.util.UtilAction;
|
import mineplex.core.common.util.UtilAction;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilBlock;
|
import mineplex.core.common.util.UtilBlock;
|
||||||
@ -30,13 +40,14 @@ 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.DisguiseManager;
|
import mineplex.core.disguise.DisguiseManager;
|
||||||
import mineplex.core.disguise.disguises.DisguiseBat;
|
import mineplex.core.disguise.disguises.DisguiseBat;
|
||||||
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import mineplex.core.particleeffects.BabyFireworkEffect;
|
import mineplex.core.particleeffects.BabyFireworkEffect;
|
||||||
import mineplex.core.particleeffects.CircleEffect;
|
import mineplex.core.particleeffects.CircleEffect;
|
||||||
import mineplex.core.treasure.BlockInfo;
|
import mineplex.core.treasure.BlockInfo;
|
||||||
import mineplex.core.treasure.Treasure;
|
import mineplex.core.treasure.Treasure;
|
||||||
import mineplex.core.treasure.TreasureType;
|
import mineplex.core.treasure.TreasureType;
|
||||||
|
|
||||||
public class ChestSpawnAnimation extends Animation
|
public class ChestSpawnAnimation extends Animation implements Listener
|
||||||
{
|
{
|
||||||
private static final int ANIMATION_DURATION = 80;
|
private static final int ANIMATION_DURATION = 80;
|
||||||
|
|
||||||
@ -47,6 +58,8 @@ public class ChestSpawnAnimation extends Animation
|
|||||||
private Location _particleLocation;
|
private Location _particleLocation;
|
||||||
private Vector _particleDirection;
|
private Vector _particleDirection;
|
||||||
|
|
||||||
|
private Location _openingCenter;
|
||||||
|
|
||||||
private List<BlockInfo> _chestBlockInfo;
|
private List<BlockInfo> _chestBlockInfo;
|
||||||
|
|
||||||
private double _radialOffset;
|
private double _radialOffset;
|
||||||
@ -58,6 +71,8 @@ public class ChestSpawnAnimation extends Animation
|
|||||||
private int _currentHauntedColor = 0;
|
private int _currentHauntedColor = 0;
|
||||||
|
|
||||||
private List<ArmorStand> _bats = Lists.newArrayList();
|
private List<ArmorStand> _bats = Lists.newArrayList();
|
||||||
|
private List<MaterialData> _flowers = new ArrayList<>();
|
||||||
|
private List<Item> _droppedFlowers = new ArrayList<>();
|
||||||
|
|
||||||
public ChestSpawnAnimation(Treasure treasure, Block block, List<BlockInfo> chestBlockInfo, Block openingCenter, double radialOffset, JavaPlugin javaPlugin)
|
public ChestSpawnAnimation(Treasure treasure, Block block, List<BlockInfo> chestBlockInfo, Block openingCenter, double radialOffset, JavaPlugin javaPlugin)
|
||||||
{
|
{
|
||||||
@ -83,7 +98,9 @@ public class ChestSpawnAnimation extends Animation
|
|||||||
_centerLocation = block.getLocation().clone().add(0.5, 0.5, 0.5);
|
_centerLocation = block.getLocation().clone().add(0.5, 0.5, 0.5);
|
||||||
_chestBlockInfo = chestBlockInfo;
|
_chestBlockInfo = chestBlockInfo;
|
||||||
|
|
||||||
_particleLocation = openingCenter.getLocation().add(0.5, 4, 0.5);
|
_particleLocation = openingCenter.getLocation().clone().add(0.5, 4, 0.5);
|
||||||
|
|
||||||
|
_openingCenter = openingCenter.getLocation();
|
||||||
|
|
||||||
_particleDirection = UtilAlg.getTrajectory(_particleLocation, _centerLocation);
|
_particleDirection = UtilAlg.getTrajectory(_particleLocation, _centerLocation);
|
||||||
_particleDirection.multiply(UtilMath.offset(_particleLocation, _centerLocation) / (double)ANIMATION_DURATION);
|
_particleDirection.multiply(UtilMath.offset(_particleLocation, _centerLocation) / (double)ANIMATION_DURATION);
|
||||||
@ -103,6 +120,8 @@ public class ChestSpawnAnimation extends Animation
|
|||||||
_radialOffset = radialOffset;
|
_radialOffset = radialOffset;
|
||||||
|
|
||||||
_javaPlugin = javaPlugin;
|
_javaPlugin = javaPlugin;
|
||||||
|
|
||||||
|
Bukkit.getPluginManager().registerEvents(this, javaPlugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -113,6 +132,17 @@ public class ChestSpawnAnimation extends Animation
|
|||||||
//Move Particle Forwards
|
//Move Particle Forwards
|
||||||
_particleLocation.add(_particleDirection);
|
_particleLocation.add(_particleDirection);
|
||||||
|
|
||||||
|
Iterator<Item> droppedFlowersIterator = _droppedFlowers.iterator();
|
||||||
|
while (droppedFlowersIterator.hasNext())
|
||||||
|
{
|
||||||
|
Item flower = droppedFlowersIterator.next();
|
||||||
|
if (flower.getTicksLived() >= 20)
|
||||||
|
{
|
||||||
|
flower.remove();
|
||||||
|
droppedFlowersIterator.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Play Particles
|
//Play Particles
|
||||||
if (getTreasure().getTreasureType() == TreasureType.OLD || getTreasure().getTreasureType() == TreasureType.LOVE_CHEST)
|
if (getTreasure().getTreasureType() == TreasureType.OLD || getTreasure().getTreasureType() == TreasureType.LOVE_CHEST)
|
||||||
{
|
{
|
||||||
@ -246,10 +276,20 @@ public class ChestSpawnAnimation extends Animation
|
|||||||
doBats(true, _centerLocation.clone().add(0, 6, 0), _bats);
|
doBats(true, _centerLocation.clone().add(0, 6, 0), _bats);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (getTreasure().getTreasureType() == TreasureType.ST_PATRICKS)
|
else if (getTreasure().getTreasureType() == TreasureType.SPRING)
|
||||||
{
|
{
|
||||||
Location location = _centerLocation.clone().add(0, 5, 0);
|
if (getTicks() % 5 == 0)
|
||||||
|
{
|
||||||
|
if (_flowers.size() == 0)
|
||||||
|
generateFlowerList();
|
||||||
|
|
||||||
|
int r = UtilMath.random.nextInt(_flowers.size());
|
||||||
|
MaterialData materialData = _flowers.get(r);
|
||||||
|
Item flower = _openingCenter.getWorld().dropItem(_openingCenter.clone().add(0.5, 0, 0.5), ItemStackFactory.Instance.CreateStack(materialData.getMaterial(), materialData.getData(), 1, "Flower" + getTicks()));
|
||||||
|
Vector vel = new Vector(_openingCenter.getX() - _centerLocation.getX(), 0, _openingCenter.getZ() - _centerLocation.getZ());
|
||||||
|
UtilAction.velocity(flower, vel, 0.1, false, 0, 0.2 + 1 * 0.4, 1, false);
|
||||||
|
_droppedFlowers.add(flower);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Spawn Chest
|
//Spawn Chest
|
||||||
@ -338,7 +378,12 @@ public class ChestSpawnAnimation extends Animation
|
|||||||
@Override
|
@Override
|
||||||
protected void onFinish()
|
protected void onFinish()
|
||||||
{
|
{
|
||||||
|
HandlerList.unregisterAll(this);
|
||||||
|
for (Item item : _droppedFlowers)
|
||||||
|
{
|
||||||
|
item.remove();
|
||||||
|
}
|
||||||
|
_droppedFlowers.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doBats(boolean initial, Location center, List<ArmorStand> bats)
|
private void doBats(boolean initial, Location center, List<ArmorStand> bats)
|
||||||
@ -372,4 +417,34 @@ public class ChestSpawnAnimation extends Animation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void generateFlowerList()
|
||||||
|
{
|
||||||
|
_flowers.add(MaterialData.of(Material.LONG_GRASS, (byte) 1));
|
||||||
|
_flowers.add(MaterialData.of(Material.LONG_GRASS, (byte) 2));
|
||||||
|
_flowers.add(MaterialData.of(Material.DEAD_BUSH, (byte) 0));
|
||||||
|
_flowers.add(MaterialData.of(Material.YELLOW_FLOWER, (byte) 0));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 0));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 1));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 2));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 3));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 4));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 5));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 6));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 7));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 8));
|
||||||
|
_flowers.add(MaterialData.of(Material.DOUBLE_PLANT, (byte) 0));
|
||||||
|
_flowers.add(MaterialData.of(Material.DOUBLE_PLANT, (byte) 1));
|
||||||
|
_flowers.add(MaterialData.of(Material.DOUBLE_PLANT, (byte) 2));
|
||||||
|
_flowers.add(MaterialData.of(Material.DOUBLE_PLANT, (byte) 3));
|
||||||
|
_flowers.add(MaterialData.of(Material.DOUBLE_PLANT, (byte) 4));
|
||||||
|
_flowers.add(MaterialData.of(Material.DOUBLE_PLANT, (byte) 5));
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPickup(PlayerPickupItemEvent event)
|
||||||
|
{
|
||||||
|
if (_droppedFlowers.contains(event.getItem()))
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package mineplex.core.treasure.animation;
|
package mineplex.core.treasure.animation;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@ -9,7 +10,9 @@ import org.bukkit.entity.Item;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.common.MaterialData;
|
||||||
import mineplex.core.common.util.UtilAction;
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import mineplex.core.treasure.BlockInfo;
|
import mineplex.core.treasure.BlockInfo;
|
||||||
import mineplex.core.treasure.Treasure;
|
import mineplex.core.treasure.Treasure;
|
||||||
@ -20,6 +23,7 @@ public class TreasureRemoveAnimation extends Animation
|
|||||||
private Random _random = new Random();
|
private Random _random = new Random();
|
||||||
private List<BlockInfo> _otherChests;
|
private List<BlockInfo> _otherChests;
|
||||||
private int _count = 0;
|
private int _count = 0;
|
||||||
|
private List<MaterialData> _flowers = new ArrayList<>();
|
||||||
|
|
||||||
public TreasureRemoveAnimation(Treasure treasure, List<BlockInfo> otherChests)
|
public TreasureRemoveAnimation(Treasure treasure, List<BlockInfo> otherChests)
|
||||||
{
|
{
|
||||||
@ -42,6 +46,19 @@ public class TreasureRemoveAnimation extends Animation
|
|||||||
dropItem(ItemStackFactory.Instance.CreateStack(Material.GOLD_NUGGET, (byte) 0, 1, "DroppedNugget" + _count), info);
|
dropItem(ItemStackFactory.Instance.CreateStack(Material.GOLD_NUGGET, (byte) 0, 1, "DroppedNugget" + _count), info);
|
||||||
_count++;
|
_count++;
|
||||||
}
|
}
|
||||||
|
else if (getTreasure().getTreasureType() == TreasureType.SPRING)
|
||||||
|
{
|
||||||
|
// Drops random flower
|
||||||
|
if (_flowers.size() == 0)
|
||||||
|
generateFlowerList();
|
||||||
|
|
||||||
|
int r = UtilMath.random.nextInt(_flowers.size());
|
||||||
|
MaterialData materialData = _flowers.get(r);
|
||||||
|
dropItem(ItemStackFactory.Instance.CreateStack(materialData.getMaterial(), materialData.getData(), 1, "Flower" + _count), info);
|
||||||
|
_count++;
|
||||||
|
info.getBlock().setType(Material.AIR);
|
||||||
|
info.getBlock().setData((byte) 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -60,6 +77,29 @@ public class TreasureRemoveAnimation extends Animation
|
|||||||
getTreasure().getTreasureManager().addItem(item);
|
getTreasure().getTreasureManager().addItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void generateFlowerList()
|
||||||
|
{
|
||||||
|
_flowers.add(MaterialData.of(Material.LONG_GRASS, (byte) 1));
|
||||||
|
_flowers.add(MaterialData.of(Material.LONG_GRASS, (byte) 2));
|
||||||
|
_flowers.add(MaterialData.of(Material.DEAD_BUSH, (byte) 0));
|
||||||
|
_flowers.add(MaterialData.of(Material.YELLOW_FLOWER, (byte) 0));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 0));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 1));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 2));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 3));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 4));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 5));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 6));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 7));
|
||||||
|
_flowers.add(MaterialData.of(Material.RED_ROSE, (byte) 8));
|
||||||
|
_flowers.add(MaterialData.of(Material.DOUBLE_PLANT, (byte) 0));
|
||||||
|
_flowers.add(MaterialData.of(Material.DOUBLE_PLANT, (byte) 1));
|
||||||
|
_flowers.add(MaterialData.of(Material.DOUBLE_PLANT, (byte) 2));
|
||||||
|
_flowers.add(MaterialData.of(Material.DOUBLE_PLANT, (byte) 3));
|
||||||
|
_flowers.add(MaterialData.of(Material.DOUBLE_PLANT, (byte) 4));
|
||||||
|
_flowers.add(MaterialData.of(Material.DOUBLE_PLANT, (byte) 5));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onFinish()
|
protected void onFinish()
|
||||||
{
|
{
|
||||||
|
@ -83,6 +83,19 @@ public class BuyChestButton implements IButton
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (_chestType == TreasureType.SPRING)
|
||||||
|
{
|
||||||
|
if (!new File("../../update/files/EnableSpringChest.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))
|
||||||
|
@ -138,6 +138,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
|||||||
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());
|
int loveCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.LOVE_CHEST.getItemName());
|
||||||
int stpatricksCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.ST_PATRICKS.getItemName());
|
int stpatricksCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.ST_PATRICKS.getItemName());
|
||||||
|
int springCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.SPRING.getItemName());
|
||||||
|
|
||||||
boolean availableChristmas = false;
|
boolean availableChristmas = false;
|
||||||
boolean availableFreedom = false;
|
boolean availableFreedom = false;
|
||||||
@ -147,6 +148,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
|||||||
boolean availableGingerbread = false;
|
boolean availableGingerbread = false;
|
||||||
boolean availableLove = false;
|
boolean availableLove = false;
|
||||||
boolean availableStPatricks = new File("../../update/files/EnableStPatricksChest.dat").exists();
|
boolean availableStPatricks = new File("../../update/files/EnableStPatricksChest.dat").exists();
|
||||||
|
boolean availableSpring = new File("../../update/files/EnableSpringChest.dat").exists();
|
||||||
|
|
||||||
List<String> shardLore = new ArrayList<>();
|
List<String> shardLore = new ArrayList<>();
|
||||||
shardLore.add(" ");
|
shardLore.add(" ");
|
||||||
@ -427,12 +429,36 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stpatricksLore.add(ChatColor.RESET + "Click to craft for " + C.cAqua + TreasureType.LOVE_CHEST.getPurchasePrice() + " Treasure Shards");
|
stpatricksLore.add(ChatColor.RESET + "Click to craft for " + C.cAqua + TreasureType.ST_PATRICKS.getPurchasePrice() + " Treasure Shards");
|
||||||
stpatricksLore.add(" ");
|
stpatricksLore.add(" ");
|
||||||
stpatricksLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop");
|
stpatricksLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<String> springLore = Lists.newArrayList();
|
||||||
|
springLore.add(" ");
|
||||||
|
springLore.add(F.value("Spring Chests Owned", "" + springCount));
|
||||||
|
springLore.add(" ");
|
||||||
|
springLore.addAll(UtilText.splitLines(new String[]{C.cGray + "Spring is here! Find 6 limited edition Spring Cosmetics in the Spring Chest! Only available for a limited time. Guaranteed no Duplicate items!"}, LineFormat.LORE));
|
||||||
|
springLore.add(" ");
|
||||||
|
if (springCount > 0)
|
||||||
|
{
|
||||||
|
springLore.add(C.cGreen + "Click to Open!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!availableSpring)
|
||||||
|
{
|
||||||
|
springLore.add(C.cRed + "This item is no longer available");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
springLore.add(ChatColor.RESET + "Click to craft for " + C.cAqua + TreasureType.SPRING.getPurchasePrice() + " Treasure Shards");
|
||||||
|
springLore.add(" ");
|
||||||
|
springLore.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
|
||||||
@ -452,6 +478,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
|||||||
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);
|
ItemStack lovechest = new ShopItem(Material.WOOL, (byte) 6, C.cRedB + "Love Chest", lovechestLore.toArray(new String[0]), 0, false, false);
|
||||||
ItemStack stpatricks = SkinData.LEPRECHAUN.getSkull(C.cGreenB + "St Patrick's Treasure", stpatricksLore);
|
ItemStack stpatricks = SkinData.LEPRECHAUN.getSkull(C.cGreenB + "St Patrick's Treasure", stpatricksLore);
|
||||||
|
ItemStack spring = new ShopItem(Material.DOUBLE_PLANT, (byte) 4, C.cGreenB + "Spring Treasure", springLore.toArray(new String[0]), 1, false, false);
|
||||||
|
|
||||||
// Adds shard item
|
// Adds shard item
|
||||||
addItem(49, shards);
|
addItem(49, shards);
|
||||||
@ -475,6 +502,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
|||||||
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);
|
TreasurePageItem loveChestItem = new TreasurePageItem(lovechest, loveCount, TreasureType.LOVE_CHEST);
|
||||||
TreasurePageItem stPatricksItem = new TreasurePageItem(stpatricks, stpatricksCount, TreasureType.ST_PATRICKS);
|
TreasurePageItem stPatricksItem = new TreasurePageItem(stpatricks, stpatricksCount, TreasureType.ST_PATRICKS);
|
||||||
|
TreasurePageItem springItem = new TreasurePageItem(spring, springCount, TreasureType.SPRING);
|
||||||
|
|
||||||
_normalTreasures.add(oldTreasureItem);
|
_normalTreasures.add(oldTreasureItem);
|
||||||
_normalTreasures.add(ancientTreasureItem);
|
_normalTreasures.add(ancientTreasureItem);
|
||||||
@ -483,6 +511,12 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
|||||||
_normalTreasures.add(omegaTreasureItem);
|
_normalTreasures.add(omegaTreasureItem);
|
||||||
_normalTreasures.add(minestrikeTreasureItem);
|
_normalTreasures.add(minestrikeTreasureItem);
|
||||||
|
|
||||||
|
|
||||||
|
if (availableSpring)
|
||||||
|
_specialTreasures.add(springItem);
|
||||||
|
else
|
||||||
|
_seasonalTreasures.add(springItem);
|
||||||
|
|
||||||
if (availableStPatricks)
|
if (availableStPatricks)
|
||||||
_specialTreasures.add(stPatricksItem);
|
_specialTreasures.add(stPatricksItem);
|
||||||
else
|
else
|
||||||
|
@ -19,9 +19,9 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
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;
|
||||||
import org.bukkit.entity.Creature;
|
|
||||||
import org.bukkit.entity.Egg;
|
import org.bukkit.entity.Egg;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
@ -1005,9 +1005,11 @@ public class HubManager extends MiniPlugin implements IChatMessageFormatter
|
|||||||
UtilTextTop.display(text, UtilServer.getPlayers());
|
UtilTextTop.display(text, UtilServer.getPlayers());
|
||||||
|
|
||||||
//Fix Entity Names
|
//Fix Entity Names
|
||||||
for (Creature pet : _petManager.getPets())
|
for (Entity pet : _petManager.getPets())
|
||||||
{
|
{
|
||||||
DisguiseBase disguise = _disguiseManager.getDisguise(pet);
|
if (pet instanceof LivingEntity)
|
||||||
|
{
|
||||||
|
DisguiseBase disguise = _disguiseManager.getDisguise((LivingEntity) pet);
|
||||||
|
|
||||||
if (disguise instanceof DisguiseWither)
|
if (disguise instanceof DisguiseWither)
|
||||||
{
|
{
|
||||||
@ -1015,6 +1017,7 @@ public class HubManager extends MiniPlugin implements IChatMessageFormatter
|
|||||||
disguise.resendMetadata();
|
disguise.resendMetadata();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (Mount mount : _mountManager.getMounts())
|
for (Mount mount : _mountManager.getMounts())
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,14 @@ package mineplex.hub.modules;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
import mineplex.core.MiniPlugin;
|
import mineplex.core.MiniPlugin;
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
@ -26,13 +34,6 @@ import mineplex.hub.HubManager;
|
|||||||
import mineplex.hub.HubRepository;
|
import mineplex.hub.HubRepository;
|
||||||
import mineplex.hub.HubType;
|
import mineplex.hub.HubType;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.entity.Creature;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
|
||||||
|
|
||||||
public class NewsManager extends MiniPlugin
|
public class NewsManager extends MiniPlugin
|
||||||
{
|
{
|
||||||
public HubManager Manager;
|
public HubManager Manager;
|
||||||
@ -347,9 +348,11 @@ public class NewsManager extends MiniPlugin
|
|||||||
UtilTextTop.display(text, UtilServer.getPlayers());
|
UtilTextTop.display(text, UtilServer.getPlayers());
|
||||||
|
|
||||||
//Fix Entity Names
|
//Fix Entity Names
|
||||||
for (Creature pet : Manager.getPetManager().getPets())
|
for (Entity pet : Manager.getPetManager().getPets())
|
||||||
{
|
{
|
||||||
DisguiseBase disguise = Manager.GetDisguise().getDisguise(pet);
|
if (pet instanceof LivingEntity)
|
||||||
|
{
|
||||||
|
DisguiseBase disguise = Manager.GetDisguise().getDisguise((LivingEntity) pet);
|
||||||
|
|
||||||
if (disguise instanceof DisguiseWither)
|
if (disguise instanceof DisguiseWither)
|
||||||
{
|
{
|
||||||
@ -357,6 +360,7 @@ public class NewsManager extends MiniPlugin
|
|||||||
disguise.resendMetadata();
|
disguise.resendMetadata();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (Mount mount : Manager.GetMount().getMounts())
|
for (Mount mount : Manager.GetMount().getMounts())
|
||||||
{
|
{
|
||||||
|
@ -167,6 +167,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
|
|||||||
int minestrikeChestsReceived = 0;
|
int minestrikeChestsReceived = 0;
|
||||||
int loveChestsReceived = 0;
|
int loveChestsReceived = 0;
|
||||||
int stPatricksChestReceived = 0;
|
int stPatricksChestReceived = 0;
|
||||||
|
int springChestsReceived = 0;
|
||||||
|
|
||||||
for (CoinTransactionToken transaction : donor.getCoinTransactions())
|
for (CoinTransactionToken transaction : donor.getCoinTransactions())
|
||||||
{
|
{
|
||||||
@ -330,6 +331,16 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
|
|||||||
stPatricksChestReceived += 1;
|
stPatricksChestReceived += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (transaction.SalesPackageName.startsWith("Spring Chest"))
|
||||||
|
{
|
||||||
|
if (transaction.Coins == 0 && transaction.Gems == 0)
|
||||||
|
{
|
||||||
|
if (transaction.SalesPackageName.split(" ").length == 3)
|
||||||
|
springChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
|
||||||
|
else if (transaction.SalesPackageName.split(" ").length == 2)
|
||||||
|
springChestsReceived += 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)
|
||||||
|
@ -39,6 +39,7 @@ import mineplex.staffServer.salespackage.salespackages.Pet;
|
|||||||
import mineplex.staffServer.salespackage.salespackages.PowerPlayClub;
|
import mineplex.staffServer.salespackage.salespackages.PowerPlayClub;
|
||||||
import mineplex.staffServer.salespackage.salespackages.RuneAmplifier;
|
import mineplex.staffServer.salespackage.salespackages.RuneAmplifier;
|
||||||
import mineplex.staffServer.salespackage.salespackages.SalesPackageBase;
|
import mineplex.staffServer.salespackage.salespackages.SalesPackageBase;
|
||||||
|
import mineplex.staffServer.salespackage.salespackages.SpringChest;
|
||||||
import mineplex.staffServer.salespackage.salespackages.StPatricksChest;
|
import mineplex.staffServer.salespackage.salespackages.StPatricksChest;
|
||||||
import mineplex.staffServer.salespackage.salespackages.ThankfulChest;
|
import mineplex.staffServer.salespackage.salespackages.ThankfulChest;
|
||||||
import mineplex.staffServer.salespackage.salespackages.TrickOrTreatChest;
|
import mineplex.staffServer.salespackage.salespackages.TrickOrTreatChest;
|
||||||
@ -102,6 +103,7 @@ public class SalesPackageManager extends MiniPlugin
|
|||||||
AddSalesPackage(new MinestrikeChest(this));
|
AddSalesPackage(new MinestrikeChest(this));
|
||||||
AddSalesPackage(new LoveChest(this));
|
AddSalesPackage(new LoveChest(this));
|
||||||
AddSalesPackage(new StPatricksChest(this));
|
AddSalesPackage(new StPatricksChest(this));
|
||||||
|
AddSalesPackage(new SpringChest(this));
|
||||||
AddSalesPackage(new TrickOrTreatChest(this));
|
AddSalesPackage(new TrickOrTreatChest(this));
|
||||||
AddSalesPackage(new ThankfulChest(this));
|
AddSalesPackage(new ThankfulChest(this));
|
||||||
|
|
||||||
@ -173,7 +175,8 @@ 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 LoveChest || salesPackage instanceof StPatricksChest)
|
|| salesPackage instanceof ThankfulChest || salesPackage instanceof GingerbreadChest || salesPackage instanceof MinestrikeChest || salesPackage instanceof LoveChest || salesPackage instanceof StPatricksChest
|
||||||
|
|| salesPackage instanceof SpringChest)
|
||||||
{
|
{
|
||||||
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,21 @@
|
|||||||
|
package mineplex.staffServer.salespackage.salespackages;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.staffServer.salespackage.SalesPackageManager;
|
||||||
|
|
||||||
|
public class SpringChest extends SalesPackageBase
|
||||||
|
{
|
||||||
|
public SpringChest(SalesPackageManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "1 Spring Chest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void displayToAgent(Player agent, String playerName)
|
||||||
|
{
|
||||||
|
addButton(agent, "/sales item " + playerName + " 1 Item Spring Chest", "Give 1 Spring Chest.");
|
||||||
|
agent.sendMessage(" ");
|
||||||
|
addBackButton(agent, playerName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -7,9 +7,8 @@ import mineplex.core.Managers;
|
|||||||
import mineplex.core.command.CommandBase;
|
import mineplex.core.command.CommandBase;
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilTime;
|
|
||||||
import mineplex.core.gadget.event.TauntCommandEvent;
|
import mineplex.core.gadget.event.TauntCommandEvent;
|
||||||
import mineplex.core.gadget.gadgets.taunts.GameType;
|
import mineplex.core.game.GameDisplay;
|
||||||
import mineplex.minecraft.game.core.combat.CombatManager;
|
import mineplex.minecraft.game.core.combat.CombatManager;
|
||||||
|
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
@ -29,21 +28,16 @@ public class TauntCommand extends CommandBase<ArcadeManager>
|
|||||||
@Override
|
@Override
|
||||||
public void Execute(Player player, String[] args)
|
public void Execute(Player player, String[] args)
|
||||||
{
|
{
|
||||||
boolean pvp = false;
|
|
||||||
CombatManager combatManager = Managers.get(CombatManager.class);
|
CombatManager combatManager = Managers.get(CombatManager.class);
|
||||||
if (combatManager != null)
|
|
||||||
{
|
|
||||||
pvp = UtilTime.elapsed(combatManager.Get(player).GetLastCombatEngaged(), 5000 * 60);
|
|
||||||
}
|
|
||||||
Game game = _arcadeManager.GetGame();
|
Game game = _arcadeManager.GetGame();
|
||||||
GameType gameType = GameType.NONE;
|
GameDisplay gameDisplay = null;
|
||||||
if (game != null)
|
if (game != null)
|
||||||
{
|
{
|
||||||
gameType = GameType.valueOf(game.GetType().toString().toUpperCase());
|
gameDisplay = game.GetType().getDisplay();
|
||||||
}
|
}
|
||||||
TauntCommandEvent event = new TauntCommandEvent(player, _arcadeManager.isGameInProgress(),
|
TauntCommandEvent event = new TauntCommandEvent(player, _arcadeManager.isGameInProgress(),
|
||||||
_arcadeManager.GetGame().IsAlive(player), UtilPlayer.isSpectator(player), combatManager.Get(player).GetLastCombatEngaged(),
|
_arcadeManager.GetGame().IsAlive(player), UtilPlayer.isSpectator(player), combatManager.Get(player).GetLastCombatEngaged(),
|
||||||
gameType);
|
gameDisplay);
|
||||||
Bukkit.getPluginManager().callEvent(event);
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@ import java.util.Optional;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mineplex.core.lifetimes.Lifetimed;
|
import net.minecraft.server.v1_8_R3.EntityItem;
|
||||||
import mineplex.core.lifetimes.ListenerComponent;
|
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
|
||||||
import mineplex.core.lifetimes.PhasedLifetime;
|
|
||||||
import org.apache.commons.lang3.tuple.Triple;
|
import org.apache.commons.lang3.tuple.Triple;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@ -33,7 +33,6 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
||||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||||
@ -52,6 +51,8 @@ import com.mojang.authlib.GameProfile;
|
|||||||
|
|
||||||
import mineplex.core.Managers;
|
import mineplex.core.Managers;
|
||||||
import mineplex.core.antihack.AntiHack;
|
import mineplex.core.antihack.AntiHack;
|
||||||
|
import mineplex.core.arcadeevents.CoreGameStartEvent;
|
||||||
|
import mineplex.core.arcadeevents.CoreGameStopEvent;
|
||||||
import mineplex.core.command.CommandCenter;
|
import mineplex.core.command.CommandCenter;
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
@ -68,8 +69,10 @@ import mineplex.core.common.util.UtilTime;
|
|||||||
import mineplex.core.disguise.disguises.DisguisePlayer;
|
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||||
import mineplex.core.elo.EloPlayer;
|
import mineplex.core.elo.EloPlayer;
|
||||||
import mineplex.core.elo.EloTeam;
|
import mineplex.core.elo.EloTeam;
|
||||||
import mineplex.core.gadget.types.GadgetType;
|
|
||||||
import mineplex.core.itemstack.ItemBuilder;
|
import mineplex.core.itemstack.ItemBuilder;
|
||||||
|
import mineplex.core.lifetimes.Lifetimed;
|
||||||
|
import mineplex.core.lifetimes.ListenerComponent;
|
||||||
|
import mineplex.core.lifetimes.PhasedLifetime;
|
||||||
import mineplex.core.packethandler.IPacketHandler;
|
import mineplex.core.packethandler.IPacketHandler;
|
||||||
import mineplex.core.packethandler.PacketInfo;
|
import mineplex.core.packethandler.PacketInfo;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
@ -91,7 +94,6 @@ import nautilus.game.arcade.game.games.draw.Draw;
|
|||||||
import nautilus.game.arcade.game.games.speedbuilders.SpeedBuilders;
|
import nautilus.game.arcade.game.games.speedbuilders.SpeedBuilders;
|
||||||
import nautilus.game.arcade.game.modules.AntiExpOrbModule;
|
import nautilus.game.arcade.game.modules.AntiExpOrbModule;
|
||||||
import nautilus.game.arcade.game.modules.Module;
|
import nautilus.game.arcade.game.modules.Module;
|
||||||
import nautilus.game.arcade.game.modules.compass.CompassModule;
|
|
||||||
import nautilus.game.arcade.kit.ChampionsKit;
|
import nautilus.game.arcade.kit.ChampionsKit;
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
import nautilus.game.arcade.kit.KitAvailability;
|
import nautilus.game.arcade.kit.KitAvailability;
|
||||||
@ -112,8 +114,6 @@ import nautilus.game.arcade.stats.StatTracker;
|
|||||||
import nautilus.game.arcade.stats.WinStatTracker;
|
import nautilus.game.arcade.stats.WinStatTracker;
|
||||||
import nautilus.game.arcade.wineffect.WinEffectManager;
|
import nautilus.game.arcade.wineffect.WinEffectManager;
|
||||||
import nautilus.game.arcade.world.WorldData;
|
import nautilus.game.arcade.world.WorldData;
|
||||||
import net.minecraft.server.v1_8_R3.EntityItem;
|
|
||||||
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
|
|
||||||
|
|
||||||
public abstract class Game extends ListenerComponent implements Lifetimed
|
public abstract class Game extends ListenerComponent implements Lifetimed
|
||||||
{
|
{
|
||||||
@ -750,6 +750,17 @@ public abstract class Game extends ListenerComponent implements Lifetimed
|
|||||||
UtilServer.getServer().getPluginManager().callEvent(stateEvent);
|
UtilServer.getServer().getPluginManager().callEvent(stateEvent);
|
||||||
|
|
||||||
System.out.println(GetName() + " state set to " + state.toString());
|
System.out.println(GetName() + " state set to " + state.toString());
|
||||||
|
|
||||||
|
if (state.equals(GameState.Prepare))
|
||||||
|
{
|
||||||
|
CoreGameStartEvent coreGameStartEvent = new CoreGameStartEvent(GetType().getDisplay());
|
||||||
|
UtilServer.getServer().getPluginManager().callEvent(coreGameStartEvent);
|
||||||
|
}
|
||||||
|
else if (state.equals(GameState.End))
|
||||||
|
{
|
||||||
|
CoreGameStopEvent coreGameStopEvent = new CoreGameStopEvent(GetType().getDisplay());
|
||||||
|
UtilServer.getServer().getPluginManager().callEvent(coreGameStopEvent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetStateTime(long time)
|
public void SetStateTime(long time)
|
||||||
|
@ -9,7 +9,8 @@ import org.bukkit.Color;
|
|||||||
import org.bukkit.FireworkEffect.Type;
|
import org.bukkit.FireworkEffect.Type;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Creature;
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
@ -94,9 +95,11 @@ public class GameManager implements Listener
|
|||||||
//Display IP
|
//Display IP
|
||||||
UtilTextTop.displayProgress(text, health, UtilServer.getPlayers());
|
UtilTextTop.displayProgress(text, health, UtilServer.getPlayers());
|
||||||
|
|
||||||
for (Creature pet : Manager.getCosmeticManager().getPetManager().getPets())
|
for (Entity pet : Manager.getCosmeticManager().getPetManager().getPets())
|
||||||
{
|
{
|
||||||
DisguiseBase disguise = Manager.GetDisguise().getDisguise(pet);
|
if (pet instanceof LivingEntity)
|
||||||
|
{
|
||||||
|
DisguiseBase disguise = Manager.GetDisguise().getDisguise((LivingEntity) pet);
|
||||||
|
|
||||||
if (disguise instanceof DisguiseWither)
|
if (disguise instanceof DisguiseWither)
|
||||||
{
|
{
|
||||||
@ -106,6 +109,7 @@ public class GameManager implements Listener
|
|||||||
disguise.resendMetadata();
|
disguise.resendMetadata();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Name Dragons Appropriately
|
//Name Dragons Appropriately
|
||||||
for (Mount mount : Manager.getCosmeticManager().getMountManager().getMounts())
|
for (Mount mount : Manager.getCosmeticManager().getMountManager().getMounts())
|
||||||
|
Loading…
Reference in New Issue
Block a user