From 6fc986a547a325877cdc27c3576cf64427462ccf Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 1 Aug 2016 17:45:30 -0400 Subject: [PATCH 001/263] Initial commit --- .gitignore | 12 + LICENSE | 674 +++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 + 3 files changed, 688 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..32858aa --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9cecc1d --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..23e0aaf --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# AliPresents +Something for IIe From 7452825503d8b7c7b60a9ce125217c4017378a0b Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 5 Aug 2016 05:05:39 -0400 Subject: [PATCH 002/263] AliShulker Addition --- .classpath | 8 +++++++ .gitignore | 1 + .project | 17 ++++++++++++++ plugin.yml | 7 ++++++ src/alisolarflare/AliShulker.java | 39 +++++++++++++++++++++++++++++++ src/alisolarflare/MainPlugin.java | 12 ++++++++++ 6 files changed, 84 insertions(+) create mode 100644 .classpath create mode 100644 .project create mode 100644 plugin.yml create mode 100644 src/alisolarflare/AliShulker.java create mode 100644 src/alisolarflare/MainPlugin.java diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..cefbd63 --- /dev/null +++ b/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.gitignore b/.gitignore index 32858aa..a031ac2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* +/bin/ diff --git a/.project b/.project new file mode 100644 index 0000000..6fcc3e1 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + AliPresents + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/plugin.yml b/plugin.yml new file mode 100644 index 0000000..868d3a2 --- /dev/null +++ b/plugin.yml @@ -0,0 +1,7 @@ +main: alisolarflare.MainPlugin +name: AliPresents +version: 1.0.0 + +commands: + alishulker: + description: Spawns a shulker at player location. /Alishulker \ No newline at end of file diff --git a/src/alisolarflare/AliShulker.java b/src/alisolarflare/AliShulker.java new file mode 100644 index 0000000..91efc03 --- /dev/null +++ b/src/alisolarflare/AliShulker.java @@ -0,0 +1,39 @@ +package alisolarflare; + +import org.bukkit.Location; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.entity.Shulker; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +public class AliShulker implements CommandExecutor { + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + return false; + } + Player player = (Player) sender; + if(!(player.getName().equals("iie"))){ + return false; + } + Location location = player.getLocation(); + Entity entity = player.getWorld().spawnEntity(location, EntityType.SHULKER); + Shulker shulker = (Shulker) entity; + shulker.setHealth(10); + + shulker.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 1728000, 5, false)); + shulker.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 1728000, 5, false)); + shulker.setAI(false); + shulker.setGlowing(true); + + return false; + } + +} diff --git a/src/alisolarflare/MainPlugin.java b/src/alisolarflare/MainPlugin.java new file mode 100644 index 0000000..bd92fca --- /dev/null +++ b/src/alisolarflare/MainPlugin.java @@ -0,0 +1,12 @@ +package alisolarflare; + +import org.bukkit.plugin.java.JavaPlugin; + +public class MainPlugin extends JavaPlugin{ + public void onEnable(){ + registerCommands(); + } + public void registerCommands(){ + getCommand("alishulker").setExecutor(new AliShulker()); + } +} From 8421e2799f315bf9292c98a15212f1e54d0e0ae9 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 5 Aug 2016 05:24:28 -0400 Subject: [PATCH 003/263] Shoved AliLinks into AliPresents --- plugin.yml | 6 +++- src/alisolarflare/MainPlugin.java | 8 +++++ src/alisolarflare/links/AliLinkSubPlugin.java | 20 +++++++++++ src/alisolarflare/links/Link.java | 20 +++++++++++ src/alisolarflare/links/PressAliLink.java | 28 +++++++++++++++ src/alisolarflare/links/SetAliLink.java | 34 +++++++++++++++++++ src/alisolarflare/links/UnpressTask.java | 20 +++++++++++ .../{ => shulker}/AliShulker.java | 2 +- 8 files changed, 136 insertions(+), 2 deletions(-) create mode 100644 src/alisolarflare/links/AliLinkSubPlugin.java create mode 100644 src/alisolarflare/links/Link.java create mode 100644 src/alisolarflare/links/PressAliLink.java create mode 100644 src/alisolarflare/links/SetAliLink.java create mode 100644 src/alisolarflare/links/UnpressTask.java rename src/alisolarflare/{ => shulker}/AliShulker.java (97%) diff --git a/plugin.yml b/plugin.yml index 868d3a2..d48f733 100644 --- a/plugin.yml +++ b/plugin.yml @@ -4,4 +4,8 @@ version: 1.0.0 commands: alishulker: - description: Spawns a shulker at player location. /Alishulker \ No newline at end of file + description: Spawns a shulker at player location. /Alishulker + pressalilink: + description: Presses an Ali Link. /pressalilink |frequency| + setalilink: + description: Creates an Ali Link. /setalilink |frequency| \ No newline at end of file diff --git a/src/alisolarflare/MainPlugin.java b/src/alisolarflare/MainPlugin.java index bd92fca..e6b0f8a 100644 --- a/src/alisolarflare/MainPlugin.java +++ b/src/alisolarflare/MainPlugin.java @@ -2,10 +2,18 @@ package alisolarflare; import org.bukkit.plugin.java.JavaPlugin; +import alisolarflare.links.AliLinkSubPlugin; +import alisolarflare.shulker.AliShulker; + public class MainPlugin extends JavaPlugin{ public void onEnable(){ + registerSubPlugins(); registerCommands(); } + public void registerSubPlugins(){ + AliLinkSubPlugin alilinksubplugin = new AliLinkSubPlugin(this); + alilinksubplugin.register(); + } public void registerCommands(){ getCommand("alishulker").setExecutor(new AliShulker()); } diff --git a/src/alisolarflare/links/AliLinkSubPlugin.java b/src/alisolarflare/links/AliLinkSubPlugin.java new file mode 100644 index 0000000..cf38cf9 --- /dev/null +++ b/src/alisolarflare/links/AliLinkSubPlugin.java @@ -0,0 +1,20 @@ +package alisolarflare.links; + +import java.util.ArrayList; +import java.util.List; + +import alisolarflare.MainPlugin; + +public class AliLinkSubPlugin{ + public List linkList = new ArrayList(); + public MainPlugin plugin; + public AliLinkSubPlugin(MainPlugin plugin){ + this.plugin = plugin; + } + public void register(){ + plugin.getCommand("pressalilink").setExecutor(new PressAliLink(this)); + plugin.getCommand("setalilink").setExecutor(new SetAliLink(this)); + + } + +} diff --git a/src/alisolarflare/links/Link.java b/src/alisolarflare/links/Link.java new file mode 100644 index 0000000..16ae533 --- /dev/null +++ b/src/alisolarflare/links/Link.java @@ -0,0 +1,20 @@ +package alisolarflare.links; + +import org.bukkit.Location; +import org.bukkit.Material; + +public class Link { + static AliLinkSubPlugin plugin; + String frequency; + Location location; + + public Link(AliLinkSubPlugin plugin, String frequency, Location location){ + this.frequency = frequency; + this.location = location; + } + public void press() { + location.getBlock().setType(Material.REDSTONE_BLOCK); + UnpressTask unPressTask = new UnpressTask(location); + unPressTask.runTaskTimer(plugin.plugin, 2, 1); + } +} diff --git a/src/alisolarflare/links/PressAliLink.java b/src/alisolarflare/links/PressAliLink.java new file mode 100644 index 0000000..40261dd --- /dev/null +++ b/src/alisolarflare/links/PressAliLink.java @@ -0,0 +1,28 @@ +package alisolarflare.links; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +public class PressAliLink implements CommandExecutor{ + private AliLinkSubPlugin subplugin; + public PressAliLink(AliLinkSubPlugin subplugin){ + this.subplugin = subplugin; + } + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (args == null){ + sender.sendMessage("You must specify a link frequency"); + sender.sendMessage("/pressalilink [frequency]"); + } + for (Link link: subplugin.linkList){ + for (String inputlink: args){ + if(inputlink.equals(link.frequency)){ + link.press(); + } + } + } + return false; + } + +} diff --git a/src/alisolarflare/links/SetAliLink.java b/src/alisolarflare/links/SetAliLink.java new file mode 100644 index 0000000..cb59fb0 --- /dev/null +++ b/src/alisolarflare/links/SetAliLink.java @@ -0,0 +1,34 @@ +package alisolarflare.links; + +import org.apache.commons.lang3.StringUtils; +import org.bukkit.Location; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class SetAliLink implements CommandExecutor{ + AliLinkSubPlugin subplugin; + public SetAliLink(AliLinkSubPlugin plugin){ + this.subplugin = plugin; + } + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (args == null){ + sender.sendMessage("You must specify a link frequency"); + sender.sendMessage("/pressalilink [name]"); + } + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + } + Player player = (Player) sender; + if (args[1] == null || args[2] == null || args[3] == null){ + subplugin.linkList.add(new Link(subplugin, args[0], player.getLocation())); + } + if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) && StringUtils.isNumericSpace(args[3])){ + subplugin.linkList.add(new Link(subplugin, args[0],new Location(player.getWorld(), Double.parseDouble(args[1]), Double.parseDouble(args[2]), Double.parseDouble(args[3])))); + } + return false; + } + +} diff --git a/src/alisolarflare/links/UnpressTask.java b/src/alisolarflare/links/UnpressTask.java new file mode 100644 index 0000000..4794ef6 --- /dev/null +++ b/src/alisolarflare/links/UnpressTask.java @@ -0,0 +1,20 @@ +package alisolarflare.links; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.scheduler.BukkitRunnable; + +public class UnpressTask extends BukkitRunnable { + private Location location; + public UnpressTask(Location location){ + this.location = location; + } + + @SuppressWarnings("deprecation") + @Override + public void run() { + location.getBlock().setType(Material.STAINED_CLAY); + location.getBlock().setData((byte) 14); + } + +} diff --git a/src/alisolarflare/AliShulker.java b/src/alisolarflare/shulker/AliShulker.java similarity index 97% rename from src/alisolarflare/AliShulker.java rename to src/alisolarflare/shulker/AliShulker.java index 91efc03..5e8ee83 100644 --- a/src/alisolarflare/AliShulker.java +++ b/src/alisolarflare/shulker/AliShulker.java @@ -1,4 +1,4 @@ -package alisolarflare; +package alisolarflare.shulker; import org.bukkit.Location; import org.bukkit.command.Command; From 8967e39084fce3623ad88853f7e3785449306e5b Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 21 Aug 2016 13:23:59 -0400 Subject: [PATCH 004/263] Coded File IO --- .classpath | 1 + plugin.yml | 10 +++--- src/alisolarflare/AliPresents.java | 32 +++++++++++++++++ src/alisolarflare/MainPlugin.java | 20 ----------- src/alisolarflare/links/AliLinkSubPlug.java | 31 +++++++++++++++++ src/alisolarflare/links/AliLinkSubPlugin.java | 20 ----------- src/alisolarflare/links/Deserializer.java | 34 +++++++++++++++++++ src/alisolarflare/links/Link.java | 16 ++++++--- src/alisolarflare/links/PressAliLink.java | 4 +-- src/alisolarflare/links/Serializer.java | 31 +++++++++++++++++ src/alisolarflare/links/SetAliLink.java | 10 ++++-- src/alisolarflare/links/UnpressTask.java | 1 + 12 files changed, 156 insertions(+), 54 deletions(-) create mode 100644 src/alisolarflare/AliPresents.java delete mode 100644 src/alisolarflare/MainPlugin.java create mode 100644 src/alisolarflare/links/AliLinkSubPlug.java delete mode 100644 src/alisolarflare/links/AliLinkSubPlugin.java create mode 100644 src/alisolarflare/links/Deserializer.java create mode 100644 src/alisolarflare/links/Serializer.java diff --git a/.classpath b/.classpath index cefbd63..a8e4705 100644 --- a/.classpath +++ b/.classpath @@ -4,5 +4,6 @@ + diff --git a/plugin.yml b/plugin.yml index d48f733..e2d472c 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,11 +1,11 @@ -main: alisolarflare.MainPlugin +main: alisolarflare.AliPresents name: AliPresents -version: 1.0.0 +version: 2.0.0 commands: alishulker: - description: Spawns a shulker at player location. /Alishulker + description: Spawns a shulker at player location Alishulker health withereffect invisibility true experiencedrops pressalilink: - description: Presses an Ali Link. /pressalilink |frequency| + description: Presses an Ali Link pressalilink frequency setalilink: - description: Creates an Ali Link. /setalilink |frequency| \ No newline at end of file + description: Creates an Ali Link setalilink frequency \ No newline at end of file diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java new file mode 100644 index 0000000..e8764f5 --- /dev/null +++ b/src/alisolarflare/AliPresents.java @@ -0,0 +1,32 @@ +package alisolarflare; + +import java.util.logging.Logger; + +import org.bukkit.plugin.PluginDescriptionFile; +import alisolarflare.links.AliLinkSubPlug; +import org.bukkit.plugin.java.JavaPlugin; +import alisolarflare.shulker.AliShulker; + +public class AliPresents extends JavaPlugin{ + public void onEnable(){ + PluginDescriptionFile pdfFile = getDescription(); + Logger logger = getLogger(); + + + logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); + + registerSubPlugins(); + registerCommands(); + + logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); + + + } + public void registerSubPlugins(){ + AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this); + alilinksubplugin.register(); + } + public void registerCommands(){ + getCommand("alishulker").setExecutor(new AliShulker()); + } +} diff --git a/src/alisolarflare/MainPlugin.java b/src/alisolarflare/MainPlugin.java deleted file mode 100644 index e6b0f8a..0000000 --- a/src/alisolarflare/MainPlugin.java +++ /dev/null @@ -1,20 +0,0 @@ -package alisolarflare; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.links.AliLinkSubPlugin; -import alisolarflare.shulker.AliShulker; - -public class MainPlugin extends JavaPlugin{ - public void onEnable(){ - registerSubPlugins(); - registerCommands(); - } - public void registerSubPlugins(){ - AliLinkSubPlugin alilinksubplugin = new AliLinkSubPlugin(this); - alilinksubplugin.register(); - } - public void registerCommands(){ - getCommand("alishulker").setExecutor(new AliShulker()); - } -} diff --git a/src/alisolarflare/links/AliLinkSubPlug.java b/src/alisolarflare/links/AliLinkSubPlug.java new file mode 100644 index 0000000..1b8c533 --- /dev/null +++ b/src/alisolarflare/links/AliLinkSubPlug.java @@ -0,0 +1,31 @@ +package alisolarflare.links; + +import java.util.ArrayList; +import java.util.List; + +import alisolarflare.AliPresents; + +public class AliLinkSubPlug{ + public List linkList; + public AliPresents plugin; + public Serializer serializer; + public Deserializer deserializer; + + public AliLinkSubPlug(AliPresents plugin){ + this.plugin = plugin; + this.serializer = new Serializer(); + this.deserializer = new Deserializer(); + try{ + this.linkList = deserializer.loadLinkList(); + }catch(Exception e){ + linkList = new ArrayList(); + } + + } + public void register(){ + plugin.getCommand("pressalilink").setExecutor(new PressAliLink(this)); + plugin.getCommand("setalilink").setExecutor(new SetAliLink(this)); + + } + +} diff --git a/src/alisolarflare/links/AliLinkSubPlugin.java b/src/alisolarflare/links/AliLinkSubPlugin.java deleted file mode 100644 index cf38cf9..0000000 --- a/src/alisolarflare/links/AliLinkSubPlugin.java +++ /dev/null @@ -1,20 +0,0 @@ -package alisolarflare.links; - -import java.util.ArrayList; -import java.util.List; - -import alisolarflare.MainPlugin; - -public class AliLinkSubPlugin{ - public List linkList = new ArrayList(); - public MainPlugin plugin; - public AliLinkSubPlugin(MainPlugin plugin){ - this.plugin = plugin; - } - public void register(){ - plugin.getCommand("pressalilink").setExecutor(new PressAliLink(this)); - plugin.getCommand("setalilink").setExecutor(new SetAliLink(this)); - - } - -} diff --git a/src/alisolarflare/links/Deserializer.java b/src/alisolarflare/links/Deserializer.java new file mode 100644 index 0000000..437b16e --- /dev/null +++ b/src/alisolarflare/links/Deserializer.java @@ -0,0 +1,34 @@ +package alisolarflare.links; + + +import java.io.FileInputStream; +import java.io.ObjectInputStream; +import java.util.List; + +public class Deserializer{ + + public static void main (String args[]) { + + //Deserializer deserializer = new Deserializer(); + //List aliLink = deserializer.loadLink(aliLink); + //System.out.println(aliLink); + } + + @SuppressWarnings("unchecked") + public List loadLinkList(){ + List aliLinkList; + try{ + + FileInputStream fin = new FileInputStream("AliLinkList.ser"); + ObjectInputStream ois = new ObjectInputStream(fin); + aliLinkList = (List) ois.readObject(); + ois.close(); + + return aliLinkList; + + }catch(Exception ex){ + ex.printStackTrace(); + return null; + } + } +} diff --git a/src/alisolarflare/links/Link.java b/src/alisolarflare/links/Link.java index 16ae533..3f24142 100644 --- a/src/alisolarflare/links/Link.java +++ b/src/alisolarflare/links/Link.java @@ -1,20 +1,28 @@ package alisolarflare.links; +import java.io.Serializable; + import org.bukkit.Location; import org.bukkit.Material; -public class Link { - static AliLinkSubPlugin plugin; +public class Link implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + AliLinkSubPlug subplugin; String frequency; Location location; - public Link(AliLinkSubPlugin plugin, String frequency, Location location){ + public Link(AliLinkSubPlug plugin, String frequency, Location location){ this.frequency = frequency; this.location = location; + this.subplugin = plugin; + plugin.plugin.getConfig().set("frequency", 10); } public void press() { location.getBlock().setType(Material.REDSTONE_BLOCK); UnpressTask unPressTask = new UnpressTask(location); - unPressTask.runTaskTimer(plugin.plugin, 2, 1); + unPressTask.runTaskTimer(subplugin.plugin, 2, 1); } } diff --git a/src/alisolarflare/links/PressAliLink.java b/src/alisolarflare/links/PressAliLink.java index 40261dd..994857d 100644 --- a/src/alisolarflare/links/PressAliLink.java +++ b/src/alisolarflare/links/PressAliLink.java @@ -5,8 +5,8 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; public class PressAliLink implements CommandExecutor{ - private AliLinkSubPlugin subplugin; - public PressAliLink(AliLinkSubPlugin subplugin){ + private AliLinkSubPlug subplugin; + public PressAliLink(AliLinkSubPlug subplugin){ this.subplugin = subplugin; } @Override diff --git a/src/alisolarflare/links/Serializer.java b/src/alisolarflare/links/Serializer.java new file mode 100644 index 0000000..1b1172e --- /dev/null +++ b/src/alisolarflare/links/Serializer.java @@ -0,0 +1,31 @@ +package alisolarflare.links; + + +import java.io.FileOutputStream; +import java.io.ObjectOutputStream; +import java.util.List; + +public class Serializer { + + public static void main (String args[]) { + + //Serializer serializer = new Serializer(); + //serializer.saveLink(plugin, frequency, location) + } + + public void saveLinkList(List aliLinkList){ + //saves link + + try{ + + FileOutputStream fout = new FileOutputStream("AliLinkList.ser"); + ObjectOutputStream oos = new ObjectOutputStream(fout); + oos.writeObject(aliLinkList); + oos.close(); + System.out.println("Done"); + + }catch(Exception ex){ + ex.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/src/alisolarflare/links/SetAliLink.java b/src/alisolarflare/links/SetAliLink.java index cb59fb0..4c535e1 100644 --- a/src/alisolarflare/links/SetAliLink.java +++ b/src/alisolarflare/links/SetAliLink.java @@ -8,8 +8,8 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class SetAliLink implements CommandExecutor{ - AliLinkSubPlugin subplugin; - public SetAliLink(AliLinkSubPlugin plugin){ + AliLinkSubPlug subplugin; + public SetAliLink(AliLinkSubPlug plugin){ this.subplugin = plugin; } @Override @@ -22,11 +22,15 @@ public class SetAliLink implements CommandExecutor{ sender.sendMessage("You must be a player to use this command!"); } Player player = (Player) sender; - if (args[1] == null || args[2] == null || args[3] == null){ + if (args.length < 4){ subplugin.linkList.add(new Link(subplugin, args[0], player.getLocation())); + return false; } if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) && StringUtils.isNumericSpace(args[3])){ subplugin.linkList.add(new Link(subplugin, args[0],new Location(player.getWorld(), Double.parseDouble(args[1]), Double.parseDouble(args[2]), Double.parseDouble(args[3])))); + }else{ + subplugin.linkList.add(new Link(subplugin, args[0], player.getLocation())); + return false; } return false; } diff --git a/src/alisolarflare/links/UnpressTask.java b/src/alisolarflare/links/UnpressTask.java index 4794ef6..946c2c7 100644 --- a/src/alisolarflare/links/UnpressTask.java +++ b/src/alisolarflare/links/UnpressTask.java @@ -15,6 +15,7 @@ public class UnpressTask extends BukkitRunnable { public void run() { location.getBlock().setType(Material.STAINED_CLAY); location.getBlock().setData((byte) 14); + this.cancel(); } } From 79a18d02ddda3ad0332891f8f7ef1bfebe4a5402 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 21 Aug 2016 14:27:04 -0400 Subject: [PATCH 005/263] Made AliLinks save, added Jar file --- .gitignore | 1 - AliPresents.jar | Bin 0 -> 22926 bytes src/alisolarflare/links/AliLinkSubPlug.java | 5 +++++ src/alisolarflare/links/SetAliLink.java | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 AliPresents.jar diff --git a/.gitignore b/.gitignore index a031ac2..84c1d8d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ .mtj.tmp/ # Package Files # -*.jar *.war *.ear diff --git a/AliPresents.jar b/AliPresents.jar new file mode 100644 index 0000000000000000000000000000000000000000..f138d866d5979f346b01d8fc3d8fd1b3b8dd13b3 GIT binary patch literal 22926 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 literal 0 HcmV?d00001 diff --git a/src/alisolarflare/links/AliLinkSubPlug.java b/src/alisolarflare/links/AliLinkSubPlug.java index 1b8c533..5c946a1 100644 --- a/src/alisolarflare/links/AliLinkSubPlug.java +++ b/src/alisolarflare/links/AliLinkSubPlug.java @@ -17,8 +17,13 @@ public class AliLinkSubPlug{ this.deserializer = new Deserializer(); try{ this.linkList = deserializer.loadLinkList(); + if(this.linkList == null){ + this.linkList = new ArrayList(); + serializer.saveLinkList(this.linkList); + } }catch(Exception e){ linkList = new ArrayList(); + serializer.saveLinkList(this.linkList); } } diff --git a/src/alisolarflare/links/SetAliLink.java b/src/alisolarflare/links/SetAliLink.java index 4c535e1..4cf52bd 100644 --- a/src/alisolarflare/links/SetAliLink.java +++ b/src/alisolarflare/links/SetAliLink.java @@ -24,12 +24,15 @@ public class SetAliLink implements CommandExecutor{ Player player = (Player) sender; if (args.length < 4){ subplugin.linkList.add(new Link(subplugin, args[0], player.getLocation())); + subplugin.serializer.saveLinkList(subplugin.linkList); return false; } if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) && StringUtils.isNumericSpace(args[3])){ subplugin.linkList.add(new Link(subplugin, args[0],new Location(player.getWorld(), Double.parseDouble(args[1]), Double.parseDouble(args[2]), Double.parseDouble(args[3])))); + subplugin.serializer.saveLinkList(subplugin.linkList); }else{ subplugin.linkList.add(new Link(subplugin, args[0], player.getLocation())); + subplugin.serializer.saveLinkList(subplugin.linkList); return false; } return false; From 828a57a21fe841f8beb47943086ff612550096e2 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 21 Aug 2016 21:11:02 -0400 Subject: [PATCH 006/263] Started work on FlairDoors --- plugin.yml | 4 +- .../flairdoors/FlairDoorsSubPlug.java | 25 +++++++++++ .../flairdoors/PortalLightListener.java | 44 +++++++++++++++++++ .../flairdoors/SetFlairDoorColour.java | 44 +++++++++++++++++++ src/alisolarflare/links/AliLinkSubPlug.java | 7 +++ src/alisolarflare/links/Link.java | 5 +++ src/alisolarflare/links/Serializer.java | 2 +- 7 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 src/alisolarflare/flairdoors/FlairDoorsSubPlug.java create mode 100644 src/alisolarflare/flairdoors/PortalLightListener.java create mode 100644 src/alisolarflare/flairdoors/SetFlairDoorColour.java diff --git a/plugin.yml b/plugin.yml index e2d472c..6d46464 100644 --- a/plugin.yml +++ b/plugin.yml @@ -8,4 +8,6 @@ commands: pressalilink: description: Presses an Ali Link pressalilink frequency setalilink: - description: Creates an Ali Link setalilink frequency \ No newline at end of file + description: Creates an Ali Link setalilink frequency + setFlairDoorColour: + description: Sets the flair door colour mode, when lighting portals \ No newline at end of file diff --git a/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java b/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java new file mode 100644 index 0000000..70ac438 --- /dev/null +++ b/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java @@ -0,0 +1,25 @@ +package alisolarflare.flairdoors; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.AliPresents; + +public class FlairDoorsSubPlug{ + private AliPresents plugin; + public FlairDoorsSubPlug(AliPresents plugin){ + this.plugin = plugin; + } + public void register(){ + registerCommands(); + registerEvents(); + } + private void registerCommands() { + plugin.getCommand("SetFlairDoorColour").setExecutor(new SetFlairDoorColour()); + + } + private void registerEvents() { + // TODO Auto-generated method stub + plugin.getServer().getPluginManager().registerEvents(new PortalLightListener(), plugin); + + } +} diff --git a/src/alisolarflare/flairdoors/PortalLightListener.java b/src/alisolarflare/flairdoors/PortalLightListener.java new file mode 100644 index 0000000..abb087e --- /dev/null +++ b/src/alisolarflare/flairdoors/PortalLightListener.java @@ -0,0 +1,44 @@ +package alisolarflare.flairdoors; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityCreatePortalEvent; +import org.bukkit.event.entity.EntityPortalEvent; + +public class PortalLightListener implements Listener{ + + //TODO: CREATE - LIST OF PORTALS (only x-z values) + + + @EventHandler + public void onPortalLight(EntityCreatePortalEvent event){ + + //SANITATION - entity > player + if(!(event.getEntity() instanceof Player)){return;} + Player player = (Player) event.getEntity(); + + //SANITIATION - player > alisolarflare + if(!(player.getName() == "alisolarflare")){return;} + + //TODO: MARK PORTAL + if (SetFlairDoorColour.FlairDoorColorMode == "null"){ + player.sendMessage("Your Colour mode is set to Null, use /SetFlairDoorColour [Color] to specify a colour for this portal"); + return; + } + //TODO: SAVE PORTAL + } + + @EventHandler + public void onPortalEnter(EntityPortalEvent event){ + event.setCancelled(false); + + //TODO: IF PLAYER LOCATION IS INSIDE A COLOUR PORTAL + //TODO: IF PLAYER NOT FLAIRED + //TODO: IF PLAYERSTATE IS TRUE + //TODO: CHANGE CUSTOM DISPLAY NAME + //TODO: TELEPORT TO SPAWN + //TODO: MARK PLAYER AS COLOURED + + } +} diff --git a/src/alisolarflare/flairdoors/SetFlairDoorColour.java b/src/alisolarflare/flairdoors/SetFlairDoorColour.java new file mode 100644 index 0000000..69df081 --- /dev/null +++ b/src/alisolarflare/flairdoors/SetFlairDoorColour.java @@ -0,0 +1,44 @@ +package alisolarflare.flairdoors; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +public class SetFlairDoorColour implements CommandExecutor { + public static String FlairDoorColorMode = "null"; + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (args.length > 1){ + sender.sendMessage("You must specify and argument, Red-Purple or Null."); + } + + String firstCommand = args[0]; + firstCommand = firstCommand.toLowerCase(); + if(firstCommand.startsWith("e")|| firstCommand.startsWith("gra")|| firstCommand.startsWith("grey")){ + sender.sendMessage("Flair Door Colour Mode set to grey"); + FlairDoorColorMode = "gray"; + }else if(firstCommand.startsWith("r")){ + sender.sendMessage("Flair Door Colour Mode set to Red"); + FlairDoorColorMode = "red"; + }else if(firstCommand.startsWith("o")){ + sender.sendMessage("Flair Door Colour Mode set to Orange"); + FlairDoorColorMode = "orange"; + }else if(firstCommand.startsWith("y")){ + sender.sendMessage("Flair Door Colour Mode set to Yellow"); + FlairDoorColorMode = "yellow"; + }else if(firstCommand.startsWith("g")){ + sender.sendMessage("Flair Door Colour Mode set to Green (use E for grey)"); + FlairDoorColorMode = "green"; + }else if(firstCommand.startsWith("b") || firstCommand.startsWith("i")){ + sender.sendMessage("Flair Door Colour Mode set to Blue"); + FlairDoorColorMode = "blue"; + }else if(firstCommand.startsWith("v") || firstCommand.startsWith("p")){ + sender.sendMessage("Flair Door Colour Mode set to Purple"); + FlairDoorColorMode = "purple"; + }else if(firstCommand.startsWith("n")){ + sender.sendMessage("Flair Door Colour Mode set to Null"); + FlairDoorColorMode = "null"; + } + return false; + } +} diff --git a/src/alisolarflare/links/AliLinkSubPlug.java b/src/alisolarflare/links/AliLinkSubPlug.java index 5c946a1..738bb52 100644 --- a/src/alisolarflare/links/AliLinkSubPlug.java +++ b/src/alisolarflare/links/AliLinkSubPlug.java @@ -32,5 +32,12 @@ public class AliLinkSubPlug{ plugin.getCommand("setalilink").setExecutor(new SetAliLink(this)); } + public void saveLinkList(){ + plugin.getConfig().set("aliLinkList", linkList); + } + @SuppressWarnings("unchecked") + public List loadLinkList(){ + return (List) plugin.getConfig().getList("aliLinkList"); + } } diff --git a/src/alisolarflare/links/Link.java b/src/alisolarflare/links/Link.java index 3f24142..9e1f973 100644 --- a/src/alisolarflare/links/Link.java +++ b/src/alisolarflare/links/Link.java @@ -12,7 +12,12 @@ public class Link implements Serializable{ private static final long serialVersionUID = 1L; AliLinkSubPlug subplugin; String frequency; + String world; Location location; + int x; + int y; + int z; + public Link(AliLinkSubPlug plugin, String frequency, Location location){ this.frequency = frequency; diff --git a/src/alisolarflare/links/Serializer.java b/src/alisolarflare/links/Serializer.java index 1b1172e..51cb0ac 100644 --- a/src/alisolarflare/links/Serializer.java +++ b/src/alisolarflare/links/Serializer.java @@ -15,7 +15,7 @@ public class Serializer { public void saveLinkList(List aliLinkList){ //saves link - + try{ FileOutputStream fout = new FileOutputStream("AliLinkList.ser"); From bcd18f7d39caed919c7f59248aa714257ba86a96 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 25 Aug 2016 01:21:19 -0400 Subject: [PATCH 007/263] Added a portal Listener class --- AliPresents.jar | Bin 22926 -> 16697 bytes plugin.yml | 2 +- .../flairdoors/FlairDoorsSubPlug.java | 4 +- .../flairdoors/PortalLightListener.java | 44 ------------ .../flairdoors/PortalListener.java | 68 ++++++++++++++++++ .../flairdoors/SetFlairDoorColour.java | 6 +- 6 files changed, 75 insertions(+), 49 deletions(-) delete mode 100644 src/alisolarflare/flairdoors/PortalLightListener.java create mode 100644 src/alisolarflare/flairdoors/PortalListener.java diff --git a/AliPresents.jar b/AliPresents.jar index f138d866d5979f346b01d8fc3d8fd1b3b8dd13b3..0a43358fab4dc3fe4cb564114b46bae3b3d1ade0 100644 GIT binary patch delta 4136 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 diff --git a/plugin.yml b/plugin.yml index 6d46464..a1932dd 100644 --- a/plugin.yml +++ b/plugin.yml @@ -10,4 +10,4 @@ commands: setalilink: description: Creates an Ali Link setalilink frequency setFlairDoorColour: - description: Sets the flair door colour mode, when lighting portals \ No newline at end of file + description: Sets the flair door colour mode, when lighting portals \ No newline at end of file diff --git a/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java b/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java index 70ac438..9e3bfce 100644 --- a/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java +++ b/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java @@ -1,7 +1,5 @@ package alisolarflare.flairdoors; -import org.bukkit.plugin.java.JavaPlugin; - import alisolarflare.AliPresents; public class FlairDoorsSubPlug{ @@ -19,7 +17,7 @@ public class FlairDoorsSubPlug{ } private void registerEvents() { // TODO Auto-generated method stub - plugin.getServer().getPluginManager().registerEvents(new PortalLightListener(), plugin); + plugin.getServer().getPluginManager().registerEvents(new PortalListener(plugin), plugin); } } diff --git a/src/alisolarflare/flairdoors/PortalLightListener.java b/src/alisolarflare/flairdoors/PortalLightListener.java deleted file mode 100644 index abb087e..0000000 --- a/src/alisolarflare/flairdoors/PortalLightListener.java +++ /dev/null @@ -1,44 +0,0 @@ -package alisolarflare.flairdoors; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityCreatePortalEvent; -import org.bukkit.event.entity.EntityPortalEvent; - -public class PortalLightListener implements Listener{ - - //TODO: CREATE - LIST OF PORTALS (only x-z values) - - - @EventHandler - public void onPortalLight(EntityCreatePortalEvent event){ - - //SANITATION - entity > player - if(!(event.getEntity() instanceof Player)){return;} - Player player = (Player) event.getEntity(); - - //SANITIATION - player > alisolarflare - if(!(player.getName() == "alisolarflare")){return;} - - //TODO: MARK PORTAL - if (SetFlairDoorColour.FlairDoorColorMode == "null"){ - player.sendMessage("Your Colour mode is set to Null, use /SetFlairDoorColour [Color] to specify a colour for this portal"); - return; - } - //TODO: SAVE PORTAL - } - - @EventHandler - public void onPortalEnter(EntityPortalEvent event){ - event.setCancelled(false); - - //TODO: IF PLAYER LOCATION IS INSIDE A COLOUR PORTAL - //TODO: IF PLAYER NOT FLAIRED - //TODO: IF PLAYERSTATE IS TRUE - //TODO: CHANGE CUSTOM DISPLAY NAME - //TODO: TELEPORT TO SPAWN - //TODO: MARK PLAYER AS COLOURED - - } -} diff --git a/src/alisolarflare/flairdoors/PortalListener.java b/src/alisolarflare/flairdoors/PortalListener.java new file mode 100644 index 0000000..1b51c9e --- /dev/null +++ b/src/alisolarflare/flairdoors/PortalListener.java @@ -0,0 +1,68 @@ +package alisolarflare.flairdoors; + +import java.util.AbstractMap; +import java.util.HashMap; + +import org.bukkit.Location; +import org.bukkit.block.BlockState; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityCreatePortalEvent; + +import alisolarflare.AliPresents; + +public class PortalListener implements Listener{ + AbstractMap portalMap = new HashMap(); + private AliPresents plugin; + + //TODO: CREATE - LIST OF PORTALS (only x-z values) + + + public PortalListener(AliPresents plugin) { + this.plugin = plugin; + } + + @EventHandler + public void onPortalLight(EntityCreatePortalEvent event){ + plugin.getServer().broadcastMessage("PORTAL LIT WHOOP WHOOP"); + plugin.getServer().broadcastMessage(event.getEntity().getName()); + //SANITATION - entity > player + if(!(event.getEntity() instanceof Player)){return;} + Player player = (Player) event.getEntity(); + event.getEntity().getServer().broadcastMessage(player.getName()); + + //SANITIATION - player > alisolarflare + if(!(player.getName() == "alisolarflare")){return;} + event.getEntity().getServer().broadcastMessage(SetFlairDoorColour.FlairDoorColorMode); + //SANITATION - FlairDoorColourMode + if (SetFlairDoorColour.FlairDoorColorMode == "null"){ + player.sendMessage("Your Colour mode is set to Null, use /SetFlairDoorColour [Color] to specify a colour for this portal"); + return; + } + + //INIT - colourMode, portalLocation + String colourMode = SetFlairDoorColour.FlairDoorColorMode; + Location portalLocation = event.getBlocks().get(0).getBlock().getLocation(); + event.getEntity().getServer().broadcastMessage(portalLocation.toString()); + //SAVE - Portal + if(SetFlairDoorColour.COLOURMODES.contains(colourMode)){ + for (BlockState blockstate : event.getBlocks()){ + player.sendMessage(blockstate.getBlock().getLocation().toString()); + } + portalMap.put(colourMode, portalLocation); + } + } + /* + @EventHandler + public void onPortalEnter(EntityPortalEvent event){ + //TODO: IF PLAYER LOCATION IS INSIDE A COLOUR PORTAL + //TODO: IF PLAYER NOT FLAIRED + //TODO: IF PLAYERSTATE IS TRUE + //TODO: CHANGE CUSTOM DISPLAY NAME + //TODO: TELEPORT TO SPAWN + //TODO: MARK PLAYER AS COLOURED + + } + */ +} diff --git a/src/alisolarflare/flairdoors/SetFlairDoorColour.java b/src/alisolarflare/flairdoors/SetFlairDoorColour.java index 69df081..d3d349d 100644 --- a/src/alisolarflare/flairdoors/SetFlairDoorColour.java +++ b/src/alisolarflare/flairdoors/SetFlairDoorColour.java @@ -1,11 +1,15 @@ package alisolarflare.flairdoors; +import java.util.Arrays; +import java.util.List; + import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; public class SetFlairDoorColour implements CommandExecutor { public static String FlairDoorColorMode = "null"; + public static final List COLOURMODES = Arrays.asList("red", "orange", "yellow", "green", "blue", "purple", "gray"); @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (args.length > 1){ @@ -15,7 +19,7 @@ public class SetFlairDoorColour implements CommandExecutor { String firstCommand = args[0]; firstCommand = firstCommand.toLowerCase(); if(firstCommand.startsWith("e")|| firstCommand.startsWith("gra")|| firstCommand.startsWith("grey")){ - sender.sendMessage("Flair Door Colour Mode set to grey"); + sender.sendMessage("Flair Door Colour Mode set to gray"); FlairDoorColorMode = "gray"; }else if(firstCommand.startsWith("r")){ sender.sendMessage("Flair Door Colour Mode set to Red"); From 1053249962d93ddb4edf475d30796f82e0856cf8 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 25 Aug 2016 03:47:18 -0400 Subject: [PATCH 008/263] Fixed bullshit. Made an error with the type of listener --- src/alisolarflare/AliPresents.java | 18 +++++++++--- .../flairdoors/FlairDoorsSubPlug.java | 10 +++---- .../flairdoors/PortalListener.java | 29 ++++++++++++++++--- 3 files changed, 43 insertions(+), 14 deletions(-) diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index e8764f5..b9b2484 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -3,7 +3,10 @@ package alisolarflare; import java.util.logging.Logger; import org.bukkit.plugin.PluginDescriptionFile; -import alisolarflare.links.AliLinkSubPlug; + +import alisolarflare.flairdoors.PortalListener; +import alisolarflare.flairdoors.SetFlairDoorColour; +//import alisolarflare.links.AliLinkSubPlug; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.shulker.AliShulker; @@ -15,18 +18,25 @@ public class AliPresents extends JavaPlugin{ logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); - registerSubPlugins(); + //registerSubPlugins(); registerCommands(); + registerEvents(); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); + } + private void registerEvents() { + getServer().getPluginManager().registerEvents(new PortalListener(this), this); + } public void registerSubPlugins(){ - AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this); - alilinksubplugin.register(); + //AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this); + //alilinksubplugin.register(); } public void registerCommands(){ getCommand("alishulker").setExecutor(new AliShulker()); + getCommand("SetFlairDoorColour").setExecutor(new SetFlairDoorColour()); + } } diff --git a/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java b/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java index 9e3bfce..e9d89a0 100644 --- a/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java +++ b/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java @@ -1,23 +1,21 @@ package alisolarflare.flairdoors; -import alisolarflare.AliPresents; +//import alisolarflare.AliPresents; public class FlairDoorsSubPlug{ - private AliPresents plugin; - public FlairDoorsSubPlug(AliPresents plugin){ - this.plugin = plugin; + //private AliPresents plugin; + public FlairDoorsSubPlug(/*AliPresents plugin*/){ + //this.plugin = plugin; } public void register(){ registerCommands(); registerEvents(); } private void registerCommands() { - plugin.getCommand("SetFlairDoorColour").setExecutor(new SetFlairDoorColour()); } private void registerEvents() { // TODO Auto-generated method stub - plugin.getServer().getPluginManager().registerEvents(new PortalListener(plugin), plugin); } } diff --git a/src/alisolarflare/flairdoors/PortalListener.java b/src/alisolarflare/flairdoors/PortalListener.java index 1b51c9e..ed7da82 100644 --- a/src/alisolarflare/flairdoors/PortalListener.java +++ b/src/alisolarflare/flairdoors/PortalListener.java @@ -4,11 +4,11 @@ import java.util.AbstractMap; import java.util.HashMap; import org.bukkit.Location; -import org.bukkit.block.BlockState; -import org.bukkit.entity.Player; +import org.bukkit.Material; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityCreatePortalEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.world.PortalCreateEvent; import alisolarflare.AliPresents; @@ -22,7 +22,28 @@ public class PortalListener implements Listener{ public PortalListener(AliPresents plugin) { this.plugin = plugin; } - + @EventHandler + public void onAliRightClick(PlayerInteractEvent event){ + if (event.getPlayer().getName() != "alisolarflare"){ + return; + } + if (event.getClickedBlock().getType() != Material.OBSIDIAN){ + return; + } + if(event.getItem().getType() != Material.FLINT_AND_STEEL && event.getItem().getType() != Material.FIREBALL){ + return; + } + plugin.getServer().broadcastMessage("RIIIIGHTCLICK"); + } + + @EventHandler + public void onPortalLight(PortalCreateEvent event){ + plugin.getServer().broadcastMessage("PORTAL LIIIIIT"); + } + /* + * NOTE: WRONG ENTITY EVENT ALLTOGETHER. + * ENTITY CREATE PORTAL EVENT ONLY TRIGGERS WHEN AN ENDERDRAGON DIES + * @EventHandler public void onPortalLight(EntityCreatePortalEvent event){ plugin.getServer().broadcastMessage("PORTAL LIT WHOOP WHOOP"); From b9c0c59371b962816560f7da4007ecc323a6b1d8 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 2 Sep 2016 20:22:34 -0400 Subject: [PATCH 009/263] Turned Links into pure Strings --- AliPresents.jar | Bin 16697 -> 42955 bytes config.yml | 0 src/alisolarflare/AliPresents.java | 8 ++- .../flairdoors/PortalListener.java | 5 ++ src/alisolarflare/links/AliLinkSubPlug.java | 21 ++---- src/alisolarflare/links/Link.java | 33 --------- src/alisolarflare/links/SetAliLink.java | 41 ----------- .../links/{ => commands}/PressAliLink.java | 12 +++- .../links/commands/SetAliLink.java | 67 ++++++++++++++++++ src/alisolarflare/links/entities/Link.java | 37 ++++++++++ .../links/{ => serializer}/Deserializer.java | 4 +- .../links/{ => serializer}/Serializer.java | 4 +- .../links/{ => tasks}/UnpressTask.java | 2 +- 13 files changed, 137 insertions(+), 97 deletions(-) create mode 100644 config.yml delete mode 100644 src/alisolarflare/links/Link.java delete mode 100644 src/alisolarflare/links/SetAliLink.java rename src/alisolarflare/links/{ => commands}/PressAliLink.java (71%) create mode 100644 src/alisolarflare/links/commands/SetAliLink.java create mode 100644 src/alisolarflare/links/entities/Link.java rename src/alisolarflare/links/{ => serializer}/Deserializer.java (89%) rename src/alisolarflare/links/{ => serializer}/Serializer.java (87%) rename src/alisolarflare/links/{ => tasks}/UnpressTask.java (92%) diff --git a/AliPresents.jar b/AliPresents.jar index 0a43358fab4dc3fe4cb564114b46bae3b3d1ade0..432ac49eb7c8412331653323a36694d2c2ec24fe 100644 GIT binary patch delta 30549 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 Ccsg$Y delta 4160 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 diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..e69de29 diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index b9b2484..b22456d 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -6,6 +6,8 @@ import org.bukkit.plugin.PluginDescriptionFile; import alisolarflare.flairdoors.PortalListener; import alisolarflare.flairdoors.SetFlairDoorColour; +import alisolarflare.links.AliLinkSubPlug; + //import alisolarflare.links.AliLinkSubPlug; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.shulker.AliShulker; @@ -18,7 +20,7 @@ public class AliPresents extends JavaPlugin{ logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); - //registerSubPlugins(); + registerSubPlugins(); registerCommands(); registerEvents(); @@ -31,8 +33,8 @@ public class AliPresents extends JavaPlugin{ } public void registerSubPlugins(){ - //AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this); - //alilinksubplugin.register(); + AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this); + alilinksubplugin.register(); } public void registerCommands(){ getCommand("alishulker").setExecutor(new AliShulker()); diff --git a/src/alisolarflare/flairdoors/PortalListener.java b/src/alisolarflare/flairdoors/PortalListener.java index ed7da82..a4bdea4 100644 --- a/src/alisolarflare/flairdoors/PortalListener.java +++ b/src/alisolarflare/flairdoors/PortalListener.java @@ -7,6 +7,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.world.PortalCreateEvent; @@ -22,6 +23,7 @@ public class PortalListener implements Listener{ public PortalListener(AliPresents plugin) { this.plugin = plugin; } + @EventHandler public void onAliRightClick(PlayerInteractEvent event){ if (event.getPlayer().getName() != "alisolarflare"){ @@ -33,6 +35,9 @@ public class PortalListener implements Listener{ if(event.getItem().getType() != Material.FLINT_AND_STEEL && event.getItem().getType() != Material.FIREBALL){ return; } + if(event.getAction() != Action.RIGHT_CLICK_BLOCK){ + return; + } plugin.getServer().broadcastMessage("RIIIIGHTCLICK"); } diff --git a/src/alisolarflare/links/AliLinkSubPlug.java b/src/alisolarflare/links/AliLinkSubPlug.java index 738bb52..08be881 100644 --- a/src/alisolarflare/links/AliLinkSubPlug.java +++ b/src/alisolarflare/links/AliLinkSubPlug.java @@ -1,29 +1,22 @@ package alisolarflare.links; - import java.util.ArrayList; import java.util.List; import alisolarflare.AliPresents; +import alisolarflare.links.commands.PressAliLink; +import alisolarflare.links.commands.SetAliLink; +import alisolarflare.links.entities.Link; public class AliLinkSubPlug{ - public List linkList; + public List linkList = new ArrayList(); public AliPresents plugin; - public Serializer serializer; - public Deserializer deserializer; + @SuppressWarnings("unchecked") public AliLinkSubPlug(AliPresents plugin){ this.plugin = plugin; - this.serializer = new Serializer(); - this.deserializer = new Deserializer(); - try{ - this.linkList = deserializer.loadLinkList(); - if(this.linkList == null){ - this.linkList = new ArrayList(); - serializer.saveLinkList(this.linkList); - } - }catch(Exception e){ + linkList = (List) plugin.getConfig().getList("aliLinkList"); + if(linkList == null || linkList.isEmpty()){ linkList = new ArrayList(); - serializer.saveLinkList(this.linkList); } } diff --git a/src/alisolarflare/links/Link.java b/src/alisolarflare/links/Link.java deleted file mode 100644 index 9e1f973..0000000 --- a/src/alisolarflare/links/Link.java +++ /dev/null @@ -1,33 +0,0 @@ -package alisolarflare.links; - -import java.io.Serializable; - -import org.bukkit.Location; -import org.bukkit.Material; - -public class Link implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - AliLinkSubPlug subplugin; - String frequency; - String world; - Location location; - int x; - int y; - int z; - - - public Link(AliLinkSubPlug plugin, String frequency, Location location){ - this.frequency = frequency; - this.location = location; - this.subplugin = plugin; - plugin.plugin.getConfig().set("frequency", 10); - } - public void press() { - location.getBlock().setType(Material.REDSTONE_BLOCK); - UnpressTask unPressTask = new UnpressTask(location); - unPressTask.runTaskTimer(subplugin.plugin, 2, 1); - } -} diff --git a/src/alisolarflare/links/SetAliLink.java b/src/alisolarflare/links/SetAliLink.java deleted file mode 100644 index 4cf52bd..0000000 --- a/src/alisolarflare/links/SetAliLink.java +++ /dev/null @@ -1,41 +0,0 @@ -package alisolarflare.links; - -import org.apache.commons.lang3.StringUtils; -import org.bukkit.Location; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -public class SetAliLink implements CommandExecutor{ - AliLinkSubPlug subplugin; - public SetAliLink(AliLinkSubPlug plugin){ - this.subplugin = plugin; - } - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (args == null){ - sender.sendMessage("You must specify a link frequency"); - sender.sendMessage("/pressalilink [name]"); - } - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - } - Player player = (Player) sender; - if (args.length < 4){ - subplugin.linkList.add(new Link(subplugin, args[0], player.getLocation())); - subplugin.serializer.saveLinkList(subplugin.linkList); - return false; - } - if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) && StringUtils.isNumericSpace(args[3])){ - subplugin.linkList.add(new Link(subplugin, args[0],new Location(player.getWorld(), Double.parseDouble(args[1]), Double.parseDouble(args[2]), Double.parseDouble(args[3])))); - subplugin.serializer.saveLinkList(subplugin.linkList); - }else{ - subplugin.linkList.add(new Link(subplugin, args[0], player.getLocation())); - subplugin.serializer.saveLinkList(subplugin.linkList); - return false; - } - return false; - } - -} diff --git a/src/alisolarflare/links/PressAliLink.java b/src/alisolarflare/links/commands/PressAliLink.java similarity index 71% rename from src/alisolarflare/links/PressAliLink.java rename to src/alisolarflare/links/commands/PressAliLink.java index 994857d..ba39b6e 100644 --- a/src/alisolarflare/links/PressAliLink.java +++ b/src/alisolarflare/links/commands/PressAliLink.java @@ -1,9 +1,12 @@ -package alisolarflare.links; +package alisolarflare.links.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; +import alisolarflare.links.AliLinkSubPlug; +import alisolarflare.links.entities.Link; + public class PressAliLink implements CommandExecutor{ private AliLinkSubPlug subplugin; public PressAliLink(AliLinkSubPlug subplugin){ @@ -11,14 +14,17 @@ public class PressAliLink implements CommandExecutor{ } @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (args == null){ + + subplugin.plugin.getServer().broadcastMessage(subplugin.linkList.toString() + "over."); + + if (args.length < 1){ sender.sendMessage("You must specify a link frequency"); sender.sendMessage("/pressalilink [frequency]"); } for (Link link: subplugin.linkList){ for (String inputlink: args){ if(inputlink.equals(link.frequency)){ - link.press(); + link.press(subplugin); } } } diff --git a/src/alisolarflare/links/commands/SetAliLink.java b/src/alisolarflare/links/commands/SetAliLink.java new file mode 100644 index 0000000..f44e364 --- /dev/null +++ b/src/alisolarflare/links/commands/SetAliLink.java @@ -0,0 +1,67 @@ +package alisolarflare.links.commands; + +import java.io.IOException; + +import org.apache.commons.lang3.StringUtils; +import org.bukkit.Location; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.links.AliLinkSubPlug; +import alisolarflare.links.entities.Link; + +public class SetAliLink implements CommandExecutor{ + AliLinkSubPlug subplugin; + public SetAliLink(AliLinkSubPlug plugin){ + this.subplugin = plugin; + } + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + sender.sendMessage("you pressed shit"); + if (args == null || args.length < 1){ + sender.sendMessage("You must specify a link frequency"); + sender.sendMessage("/pressalilink [name]"); + return false; + } + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + } + Player player = (Player) sender; + if (args.length < 4){ + player.sendMessage("short"); + subplugin.linkList.add(new Link(args[0], player.getLocation())); + save(player); + player.sendMessage("end"); + return false; + } + if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) && StringUtils.isNumericSpace(args[3])){ + player.sendMessage("CUUUSTOM"); + subplugin.linkList.add(new Link(args[0],new Location(player.getWorld(), Double.parseDouble(args[1]), Double.parseDouble(args[2]), Double.parseDouble(args[3])))); + save(player); + player.sendMessage("FINISHED"); + }else{ + player.sendMessage("UNCUSTOOM"); + subplugin.linkList.add(new Link(args[0], player.getLocation())); + save(player); + player.sendMessage("UNFINISHED"); + return false; + } + return false; + } + private void save(Player player){ + player.sendMessage("SAAAVING"); + subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); + try { + player.sendMessage("SAVIN"); + subplugin.plugin.getConfig().save("aliLinkList"); + player.sendMessage("GOOD SAVE"); + } catch (IOException e) { + player.sendMessage("YOU FUCKED STUFF UP"); + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +} diff --git a/src/alisolarflare/links/entities/Link.java b/src/alisolarflare/links/entities/Link.java new file mode 100644 index 0000000..f8c2e1d --- /dev/null +++ b/src/alisolarflare/links/entities/Link.java @@ -0,0 +1,37 @@ +package alisolarflare.links.entities; + +import java.io.Serializable; + +import org.bukkit.Location; +import org.bukkit.Material; + +import alisolarflare.links.AliLinkSubPlug; +import alisolarflare.links.tasks.UnpressTask; + +public class Link implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + public String frequency; + String world; + String x; + String y; + String z; + + + public Link(String frequency, Location location){ + this.frequency = frequency; + this.world = location.getWorld().getName(); + this.x = "" + location.getBlockX(); + this.y = "" + location.getBlockY(); + this.z = "" + location.getBlockZ(); + //plugin.plugin.getConfig().set("frequency", 10); + } + public void press(AliLinkSubPlug plugin) { + Location location = new Location(plugin.plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); + location.getBlock().setType(Material.REDSTONE_BLOCK); + UnpressTask unPressTask = new UnpressTask(location); + unPressTask.runTaskTimer(plugin.plugin, 2, 1); + } +} diff --git a/src/alisolarflare/links/Deserializer.java b/src/alisolarflare/links/serializer/Deserializer.java similarity index 89% rename from src/alisolarflare/links/Deserializer.java rename to src/alisolarflare/links/serializer/Deserializer.java index 437b16e..db5da86 100644 --- a/src/alisolarflare/links/Deserializer.java +++ b/src/alisolarflare/links/serializer/Deserializer.java @@ -1,10 +1,12 @@ -package alisolarflare.links; +package alisolarflare.links.serializer; import java.io.FileInputStream; import java.io.ObjectInputStream; import java.util.List; +import alisolarflare.links.entities.Link; + public class Deserializer{ public static void main (String args[]) { diff --git a/src/alisolarflare/links/Serializer.java b/src/alisolarflare/links/serializer/Serializer.java similarity index 87% rename from src/alisolarflare/links/Serializer.java rename to src/alisolarflare/links/serializer/Serializer.java index 51cb0ac..f05ab1b 100644 --- a/src/alisolarflare/links/Serializer.java +++ b/src/alisolarflare/links/serializer/Serializer.java @@ -1,10 +1,12 @@ -package alisolarflare.links; +package alisolarflare.links.serializer; import java.io.FileOutputStream; import java.io.ObjectOutputStream; import java.util.List; +import alisolarflare.links.entities.Link; + public class Serializer { public static void main (String args[]) { diff --git a/src/alisolarflare/links/UnpressTask.java b/src/alisolarflare/links/tasks/UnpressTask.java similarity index 92% rename from src/alisolarflare/links/UnpressTask.java rename to src/alisolarflare/links/tasks/UnpressTask.java index 946c2c7..c65c76f 100644 --- a/src/alisolarflare/links/UnpressTask.java +++ b/src/alisolarflare/links/tasks/UnpressTask.java @@ -1,4 +1,4 @@ -package alisolarflare.links; +package alisolarflare.links.tasks; import org.bukkit.Location; import org.bukkit.Material; From 38007dae2d51f02b5d123d93ec77fab3650405ba Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Sep 2016 16:51:06 -0400 Subject: [PATCH 010/263] Added pom.xml --- .classpath | 20 ++++++- .gitignore | 1 + .project | 6 ++ .settings/org.eclipse.jdt.core.prefs | 5 ++ .settings/org.eclipse.m2e.core.prefs | 4 ++ pom.xml | 21 +++++++ .../flairdoors/PortalListener.java | 58 ++++++++++++++----- .../links/commands/SetAliLink.java | 5 +- src/alisolarflare/links/entities/Link.java | 8 +-- 9 files changed, 102 insertions(+), 26 deletions(-) create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 .settings/org.eclipse.m2e.core.prefs create mode 100644 pom.xml diff --git a/.classpath b/.classpath index a8e4705..4ddb94c 100644 --- a/.classpath +++ b/.classpath @@ -1,9 +1,23 @@ - - + + + + + + + + + + + - + + + + + + diff --git a/.gitignore b/.gitignore index 84c1d8d..f8a6805 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* /bin/ +/target/ diff --git a/.project b/.project index 6fcc3e1..10a212f 100644 --- a/.project +++ b/.project @@ -10,8 +10,14 @@ + + org.eclipse.m2e.core.maven2Builder + + + + org.eclipse.m2e.core.maven2Nature org.eclipse.jdt.core.javanature diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..abec6ca --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..946cc7f --- /dev/null +++ b/pom.xml @@ -0,0 +1,21 @@ + + 4.0.0 + com.github.tbmcplugins + AliPresents + 0.0.1-SNAPSHOT + AliPresents + A bucket of aaall the stuff Ali makes. It's a bit smelly. + + src + + + maven-compiler-plugin + 3.5.1 + + + + + + + + \ No newline at end of file diff --git a/src/alisolarflare/flairdoors/PortalListener.java b/src/alisolarflare/flairdoors/PortalListener.java index a4bdea4..97a3faa 100644 --- a/src/alisolarflare/flairdoors/PortalListener.java +++ b/src/alisolarflare/flairdoors/PortalListener.java @@ -1,20 +1,23 @@ package alisolarflare.flairdoors; import java.util.AbstractMap; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.event.world.PortalCreateEvent; +import org.bukkit.event.entity.EntityPortalEvent; import alisolarflare.AliPresents; public class PortalListener implements Listener{ AbstractMap portalMap = new HashMap(); + public List playersToBeFlaired = new ArrayList(); private AliPresents plugin; //TODO: CREATE - LIST OF PORTALS (only x-z values) @@ -23,7 +26,38 @@ public class PortalListener implements Listener{ public PortalListener(AliPresents plugin) { this.plugin = plugin; } - + @EventHandler + public void onPortalEnter(EntityPortalEvent event){ + if(!(event.getEntity() instanceof Player)){ + return; + } + Player player = (Player) event.getEntity(); + if(!(playersToBeFlaired.contains(player.getName()))){ + return; + } + + int x = player.getLocation().getBlockX(); + int y = player.getLocation().getBlockY(); + int z = player.getLocation().getBlockZ(); + + Material blockTopper = player.getWorld().getBlockAt(x,y-1,z).getType(); + Material blockMiddle = player.getWorld().getBlockAt(x,y-2,z).getType(); + Material blockBottom = player.getWorld().getBlockAt(x,y-3,z).getType(); + + if(blockTopper == Material.STONE){ + + }else if(blockTopper == Material.WOOL){ + + } + //TODO: IF PLAYER LOCATION IS INSIDE A COLOUR PORTAL + //TODO: IF PLAYER NOT FLAIRED + //TODO: IF PLAYERSTATE IS TRUE + //TODO: CHANGE CUSTOM DISPLAY NAME + //TODO: TELEPORT TO SPAWN + //TODO: MARK PLAYER AS COLOURED + + } + /* @EventHandler public void onAliRightClick(PlayerInteractEvent event){ if (event.getPlayer().getName() != "alisolarflare"){ @@ -48,7 +82,8 @@ public class PortalListener implements Listener{ /* * NOTE: WRONG ENTITY EVENT ALLTOGETHER. * ENTITY CREATE PORTAL EVENT ONLY TRIGGERS WHEN AN ENDERDRAGON DIES - * + */ + /* @EventHandler public void onPortalLight(EntityCreatePortalEvent event){ plugin.getServer().broadcastMessage("PORTAL LIT WHOOP WHOOP"); @@ -79,16 +114,7 @@ public class PortalListener implements Listener{ portalMap.put(colourMode, portalLocation); } } - /* - @EventHandler - public void onPortalEnter(EntityPortalEvent event){ - //TODO: IF PLAYER LOCATION IS INSIDE A COLOUR PORTAL - //TODO: IF PLAYER NOT FLAIRED - //TODO: IF PLAYERSTATE IS TRUE - //TODO: CHANGE CUSTOM DISPLAY NAME - //TODO: TELEPORT TO SPAWN - //TODO: MARK PLAYER AS COLOURED - - } */ + + } diff --git a/src/alisolarflare/links/commands/SetAliLink.java b/src/alisolarflare/links/commands/SetAliLink.java index f44e364..e36201f 100644 --- a/src/alisolarflare/links/commands/SetAliLink.java +++ b/src/alisolarflare/links/commands/SetAliLink.java @@ -1,6 +1,5 @@ package alisolarflare.links.commands; -import java.io.IOException; import org.apache.commons.lang3.StringUtils; import org.bukkit.Location; @@ -55,9 +54,9 @@ public class SetAliLink implements CommandExecutor{ subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); try { player.sendMessage("SAVIN"); - subplugin.plugin.getConfig().save("aliLinkList"); + subplugin.plugin.saveConfig(); player.sendMessage("GOOD SAVE"); - } catch (IOException e) { + } catch (Exception e) { player.sendMessage("YOU FUCKED STUFF UP"); // TODO Auto-generated catch block e.printStackTrace(); diff --git a/src/alisolarflare/links/entities/Link.java b/src/alisolarflare/links/entities/Link.java index f8c2e1d..a0a7449 100644 --- a/src/alisolarflare/links/entities/Link.java +++ b/src/alisolarflare/links/entities/Link.java @@ -14,10 +14,10 @@ public class Link implements Serializable{ */ private static final long serialVersionUID = 1L; public String frequency; - String world; - String x; - String y; - String z; + public String world; + public String x; + public String y; + public String z; public Link(String frequency, Location location){ From f2a567680cd185eca6fb405cec422fa964d37a0c Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Sep 2016 16:59:37 -0400 Subject: [PATCH 011/263] Added Tags --- pom.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pom.xml b/pom.xml index 946cc7f..03e9b2f 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,24 @@ A bucket of aaall the stuff Ali makes. It's a bit smelly. src + + + src + + **/*.java + + + + src/main/resources + + *.properties + *.yml + *.csv + *.txt + + true + + maven-compiler-plugin From 51f5d8ba86ba66a34ae5041024c417043bbf5e5e Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Sep 2016 17:23:53 -0400 Subject: [PATCH 012/263] Added a toon of tags --- .classpath | 4 +-- .settings/org.eclipse.jdt.core.prefs | 6 ++-- pom.xml | 50 ++++++++++++++++++---------- 3 files changed, 38 insertions(+), 22 deletions(-) diff --git a/.classpath b/.classpath index 4ddb94c..1b90f09 100644 --- a/.classpath +++ b/.classpath @@ -1,12 +1,12 @@ - + - + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index abec6ca..714351a 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,5 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/pom.xml b/pom.xml index 03e9b2f..5ec02d0 100644 --- a/pom.xml +++ b/pom.xml @@ -14,26 +14,42 @@ **/*.java - - src/main/resources - - *.properties - *.yml - *.csv - *.txt - - true - - maven-compiler-plugin - 3.5.1 - - - - - + maven-compiler-plugin + 3.3 + + 1.8 + 1.8 + + + + UTF-8 + + + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + jcenter + http://jcenter.bintray.com + + + jitpack.io + https://jitpack.io + + + + + + org.spigotmc + spigot-api + 1.9.2-R0.1-SNAPSHOT + + \ No newline at end of file From 8b13b1b2c1e551e42d19e27f050afde794954da1 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Sep 2016 17:43:58 -0400 Subject: [PATCH 013/263] NORBI PLS --- .settings/org.eclipse.core.resources.prefs | 3 +++ src/alisolarflare/flairdoors/PortalListener.java | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .settings/org.eclipse.core.resources.prefs diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..7a53139 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 +encoding/src=UTF-8 diff --git a/src/alisolarflare/flairdoors/PortalListener.java b/src/alisolarflare/flairdoors/PortalListener.java index 97a3faa..f11141b 100644 --- a/src/alisolarflare/flairdoors/PortalListener.java +++ b/src/alisolarflare/flairdoors/PortalListener.java @@ -7,7 +7,6 @@ import java.util.List; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; From 66e704e1030b06821656b1d4ddf411d41e8f8230 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 17 Sep 2016 23:48:08 +0200 Subject: [PATCH 014/263] Delete .classpath --- .classpath | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .classpath diff --git a/.classpath b/.classpath deleted file mode 100644 index 1b90f09..0000000 --- a/.classpath +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - From de2106abc119b6c305a602e9bd61d6959b86f08f Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 6 Oct 2016 19:06:34 +0200 Subject: [PATCH 015/263] Added dependency for StringUtils --- pom.xml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 5ec02d0..8b7e90e 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,13 @@ org.spigotmc spigot-api - 1.9.2-R0.1-SNAPSHOT - + 1.9.2-R0.1-SNAPSHOT + + + + org.apache.commons + commons-lang3 + 3.4 + - \ No newline at end of file + From 05d89b087ae4c56db196bf8eb8e8c10ab29d08ae Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 7 Oct 2016 22:13:00 +0200 Subject: [PATCH 016/263] Told Maven to add YML files --- pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pom.xml b/pom.xml index 8b7e90e..5965524 100644 --- a/pom.xml +++ b/pom.xml @@ -14,6 +14,12 @@ **/*.java + + . + + *.yml + + From fbf9e8ec4a395ebf2558f2dfe9275888dfc3e0a1 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 7 Oct 2016 22:15:10 +0200 Subject: [PATCH 017/263] Rephrased it to addYML files, not remove them --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 5965524..b788546 100644 --- a/pom.xml +++ b/pom.xml @@ -16,9 +16,9 @@ . - - *.yml - + + *.yml + From 09c5f6ffc1d8a7e39e16530be049e09c46a6b20f Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 7 Oct 2016 19:20:37 -0400 Subject: [PATCH 018/263] Worked more on Flairdoors --- .../flairdoors/PortalListener.java | 119 ++++++++---------- 1 file changed, 50 insertions(+), 69 deletions(-) diff --git a/src/alisolarflare/flairdoors/PortalListener.java b/src/alisolarflare/flairdoors/PortalListener.java index f11141b..c362482 100644 --- a/src/alisolarflare/flairdoors/PortalListener.java +++ b/src/alisolarflare/flairdoors/PortalListener.java @@ -5,19 +5,22 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import org.bukkit.DyeColor; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityPortalEvent; +import org.bukkit.material.Wool; import alisolarflare.AliPresents; public class PortalListener implements Listener{ AbstractMap portalMap = new HashMap(); public List playersToBeFlaired = new ArrayList(); - private AliPresents plugin; + public AliPresents plugin; //TODO: CREATE - LIST OF PORTALS (only x-z values) @@ -27,93 +30,71 @@ public class PortalListener implements Listener{ } @EventHandler public void onPortalEnter(EntityPortalEvent event){ + //SANITATION - Player if(!(event.getEntity() instanceof Player)){ return; } + + //INIT - Player Player player = (Player) event.getEntity(); + + //SANITATION - PlayersToBeFlaired if(!(playersToBeFlaired.contains(player.getName()))){ return; } + //INIT - x,y,z int x = player.getLocation().getBlockX(); int y = player.getLocation().getBlockY(); int z = player.getLocation().getBlockZ(); - Material blockTopper = player.getWorld().getBlockAt(x,y-1,z).getType(); - Material blockMiddle = player.getWorld().getBlockAt(x,y-2,z).getType(); - Material blockBottom = player.getWorld().getBlockAt(x,y-3,z).getType(); + //INIT - Blocks Under Portal + Block blockTopper = player.getWorld().getBlockAt(x,y-1,z); + Block blockMiddle = player.getWorld().getBlockAt(x,y-2,z); + Block blockBottom = player.getWorld().getBlockAt(x,y-3,z); - if(blockTopper == Material.STONE){ - - }else if(blockTopper == Material.WOOL){ + //RECOLOUR PLAYER + if(blockTopper.getType() == Material.STONE){ + recolourPlayer(player, DyeColor.GRAY); + //TOP BLOCK IS WOOL? + }else if(blockTopper.getType() == Material.WOOL){ + Wool wool = (Wool) blockTopper; + recolourPlayer(player, wool.getColor()); + + //MIDDLE BLOCK IS WOOL? + }else if(blockMiddle.getType() == Material.WOOL){ + Wool wool = (Wool) blockMiddle; + recolourPlayer(player, wool.getColor()); + + //BOTTOM BLOCK IS WOOL? + }else if (blockBottom.getType() == Material.WOOL){ + Wool wool = (Wool) blockBottom; + recolourPlayer(player, wool.getColor()); } - //TODO: IF PLAYER LOCATION IS INSIDE A COLOUR PORTAL - //TODO: IF PLAYER NOT FLAIRED - //TODO: IF PLAYERSTATE IS TRUE - //TODO: CHANGE CUSTOM DISPLAY NAME - //TODO: TELEPORT TO SPAWN - //TODO: MARK PLAYER AS COLOURED } - /* - @EventHandler - public void onAliRightClick(PlayerInteractEvent event){ - if (event.getPlayer().getName() != "alisolarflare"){ - return; - } - if (event.getClickedBlock().getType() != Material.OBSIDIAN){ - return; - } - if(event.getItem().getType() != Material.FLINT_AND_STEEL && event.getItem().getType() != Material.FIREBALL){ - return; - } - if(event.getAction() != Action.RIGHT_CLICK_BLOCK){ - return; - } - plugin.getServer().broadcastMessage("RIIIIGHTCLICK"); - } - - @EventHandler - public void onPortalLight(PortalCreateEvent event){ - plugin.getServer().broadcastMessage("PORTAL LIIIIIT"); - } - /* - * NOTE: WRONG ENTITY EVENT ALLTOGETHER. - * ENTITY CREATE PORTAL EVENT ONLY TRIGGERS WHEN AN ENDERDRAGON DIES - */ - /* - @EventHandler - public void onPortalLight(EntityCreatePortalEvent event){ - plugin.getServer().broadcastMessage("PORTAL LIT WHOOP WHOOP"); - plugin.getServer().broadcastMessage(event.getEntity().getName()); - //SANITATION - entity > player - if(!(event.getEntity() instanceof Player)){return;} - Player player = (Player) event.getEntity(); - event.getEntity().getServer().broadcastMessage(player.getName()); - - //SANITIATION - player > alisolarflare - if(!(player.getName() == "alisolarflare")){return;} - event.getEntity().getServer().broadcastMessage(SetFlairDoorColour.FlairDoorColorMode); - //SANITATION - FlairDoorColourMode - if (SetFlairDoorColour.FlairDoorColorMode == "null"){ - player.sendMessage("Your Colour mode is set to Null, use /SetFlairDoorColour [Color] to specify a colour for this portal"); - return; - } + public void recolourPlayer(Player player, DyeColor dyecolour){ - //INIT - colourMode, portalLocation - String colourMode = SetFlairDoorColour.FlairDoorColorMode; - Location portalLocation = event.getBlocks().get(0).getBlock().getLocation(); - event.getEntity().getServer().broadcastMessage(portalLocation.toString()); - //SAVE - Portal - if(SetFlairDoorColour.COLOURMODES.contains(colourMode)){ - for (BlockState blockstate : event.getBlocks()){ - player.sendMessage(blockstate.getBlock().getLocation().toString()); + String name = player.getDisplayName(); + for(int i = 0; i < name.length(); i++){ + if (name.charAt(i) == '&'){ + //TODO: Remove all &* symbols + name = name.substring(0, i) + name.substring(i + 1, name.length()); + } - portalMap.put(colourMode, portalLocation); } + + if(dyecolour == DyeColor.GRAY){ + }else if(dyecolour == DyeColor.RED){ + }else if(dyecolour == DyeColor.ORANGE){ + }else if(dyecolour == DyeColor.YELLOW){ + }else if(dyecolour == DyeColor.GREEN){ + }else if(dyecolour == DyeColor.BLUE){ + }else if(dyecolour == DyeColor.PURPLE){ + }else{ + return; + } + playersToBeFlaired.remove(player.getName()); } - */ - - } From 89d609a3b866656493e8bac52278a7eb9dfdd58d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 7 Oct 2016 19:23:13 -0400 Subject: [PATCH 019/263] Added the FlairMe class --- src/alisolarflare/flairdoors/FlairMe.java | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/alisolarflare/flairdoors/FlairMe.java diff --git a/src/alisolarflare/flairdoors/FlairMe.java b/src/alisolarflare/flairdoors/FlairMe.java new file mode 100644 index 0000000..969f3eb --- /dev/null +++ b/src/alisolarflare/flairdoors/FlairMe.java @@ -0,0 +1,5 @@ +package alisolarflare.flairdoors; + +public class FlairMe { + +} From df96b4102b5a1b8978778f546d55672c1573f13f Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 7 Oct 2016 19:40:45 -0400 Subject: [PATCH 020/263] Finished Flairdoors for testing, added debug messages --- .classpath | 8 ++++ .../flairdoors/PortalListener.java | 42 ++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 .classpath diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..cefbd63 --- /dev/null +++ b/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/alisolarflare/flairdoors/PortalListener.java b/src/alisolarflare/flairdoors/PortalListener.java index c362482..bebcc49 100644 --- a/src/alisolarflare/flairdoors/PortalListener.java +++ b/src/alisolarflare/flairdoors/PortalListener.java @@ -19,7 +19,7 @@ import alisolarflare.AliPresents; public class PortalListener implements Listener{ AbstractMap portalMap = new HashMap(); - public List playersToBeFlaired = new ArrayList(); + public static List playersToBeFlaired = new ArrayList(); public AliPresents plugin; //TODO: CREATE - LIST OF PORTALS (only x-z values) @@ -42,6 +42,9 @@ public class PortalListener implements Listener{ if(!(playersToBeFlaired.contains(player.getName()))){ return; } + player.sendMessage("MAY THE FLAIRING COMMENCE"); + player.sendMessage("Deactivating regular portal behaviour..."); + event.setCancelled(true); //INIT - x,y,z int x = player.getLocation().getBlockX(); @@ -53,30 +56,41 @@ public class PortalListener implements Listener{ Block blockMiddle = player.getWorld().getBlockAt(x,y-2,z); Block blockBottom = player.getWorld().getBlockAt(x,y-3,z); + player.sendMessage("Blocks being inspected:"); + player.sendMessage(blockTopper.toString()); + player.sendMessage(blockMiddle.toString()); + player.sendMessage(blockBottom.toString()); + //RECOLOUR PLAYER if(blockTopper.getType() == Material.STONE){ + player.sendMessage("STONE DETECTED"); recolourPlayer(player, DyeColor.GRAY); //TOP BLOCK IS WOOL? }else if(blockTopper.getType() == Material.WOOL){ + player.sendMessage("WOOL DETECTED T"); Wool wool = (Wool) blockTopper; recolourPlayer(player, wool.getColor()); //MIDDLE BLOCK IS WOOL? }else if(blockMiddle.getType() == Material.WOOL){ + + player.sendMessage("WOOL DETECTED M"); Wool wool = (Wool) blockMiddle; recolourPlayer(player, wool.getColor()); //BOTTOM BLOCK IS WOOL? }else if (blockBottom.getType() == Material.WOOL){ + player.sendMessage("WOOL DETECTED B"); Wool wool = (Wool) blockBottom; recolourPlayer(player, wool.getColor()); } } public void recolourPlayer(Player player, DyeColor dyecolour){ - + player.sendMessage("Recolouring Player as..." + dyecolour.toString()); String name = player.getDisplayName(); + player.sendMessage("name:" + name); for(int i = 0; i < name.length(); i++){ if (name.charAt(i) == '&'){ //TODO: Remove all &* symbols @@ -84,17 +98,41 @@ public class PortalListener implements Listener{ } } + player.sendMessage("Adjusted Name: " + name); if(dyecolour == DyeColor.GRAY){ + player.sendMessage("Adding GRAY"); + player.setDisplayName("&7" + name); + }else if(dyecolour == DyeColor.RED){ + player.sendMessage("Adding RED"); + player.setDisplayName("&4" + name); + }else if(dyecolour == DyeColor.ORANGE){ + player.sendMessage("Adding ORANGE"); + player.setDisplayName("&6" + name); + }else if(dyecolour == DyeColor.YELLOW){ + player.sendMessage("Adding YELLOW"); + player.setDisplayName("&e" + name); + }else if(dyecolour == DyeColor.GREEN){ + player.sendMessage("Adding GREEN"); + player.setDisplayName("&a" + name); + }else if(dyecolour == DyeColor.BLUE){ + player.sendMessage("Adding BLUE"); + player.setDisplayName("&9" + name); + }else if(dyecolour == DyeColor.PURPLE){ + player.sendMessage("Adding PURPLE"); + player.setDisplayName("&5" + name); + }else{ + player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); return; } + player.sendMessage("Your name is now: " + player.getDisplayName() +"! Removing you from playersToBeFlaired..."); playersToBeFlaired.remove(player.getName()); } } From cb68e52102e8661d20b5ef4c7ca9fecabc407a0f Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 7 Oct 2016 19:46:28 -0400 Subject: [PATCH 021/263] added the FlairMe Command to the set I forgot to do the thing, and now I'm doing the thing --- plugin.yml | 4 +++- src/alisolarflare/flairdoors/FlairMe.java | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/plugin.yml b/plugin.yml index a1932dd..5891eea 100644 --- a/plugin.yml +++ b/plugin.yml @@ -10,4 +10,6 @@ commands: setalilink: description: Creates an Ali Link setalilink frequency setFlairDoorColour: - description: Sets the flair door colour mode, when lighting portals \ No newline at end of file + description: Sets the flair door colour mode, when lighting portals + flairme: + description: Activates the Flair Me Command. Ask Ali, she was fucking tired when writing this description \ No newline at end of file diff --git a/src/alisolarflare/flairdoors/FlairMe.java b/src/alisolarflare/flairdoors/FlairMe.java index 969f3eb..789524d 100644 --- a/src/alisolarflare/flairdoors/FlairMe.java +++ b/src/alisolarflare/flairdoors/FlairMe.java @@ -1,5 +1,18 @@ package alisolarflare.flairdoors; -public class FlairMe { +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +public class FlairMe implements CommandExecutor{ + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + sender.sendMessage("Flairing..." + sender.getName()); + PortalListener.playersToBeFlaired.add(sender.getName()); + sender.sendMessage("Finished Preparation! Walk through a portal to get your flair"); + + return false; + } } From b5caff2047a4622a181856ff8a51e0708610b913 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 7 Oct 2016 19:49:52 -0400 Subject: [PATCH 022/263] Test commit pls ignore --- plugin.yml | 2 +- src/alisolarflare/flairdoors/SetFlairDoorColour.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.yml b/plugin.yml index 5891eea..b27b6cd 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,6 +1,6 @@ main: alisolarflare.AliPresents name: AliPresents -version: 2.0.0 +version: 2.0.1 commands: alishulker: diff --git a/src/alisolarflare/flairdoors/SetFlairDoorColour.java b/src/alisolarflare/flairdoors/SetFlairDoorColour.java index d3d349d..f76e163 100644 --- a/src/alisolarflare/flairdoors/SetFlairDoorColour.java +++ b/src/alisolarflare/flairdoors/SetFlairDoorColour.java @@ -13,7 +13,7 @@ public class SetFlairDoorColour implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (args.length > 1){ - sender.sendMessage("You must specify and argument, Red-Purple or Null."); + sender.sendMessage("You must specify and argument, Red-Purple or Null.HHAHHAHAHAHHAHAHAHHA"); } String firstCommand = args[0]; From cd7fca19ae6ee5c5ac34814a9a57bef09f1d05fd Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 14 Oct 2016 12:42:06 -0400 Subject: [PATCH 023/263] Disabled AliLink Saving --- src/alisolarflare/flairdoors/FlairDoorsSubPlug.java | 10 +++++----- src/alisolarflare/links/commands/SetAliLink.java | 5 +++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java b/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java index e9d89a0..9e6d05b 100644 --- a/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java +++ b/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java @@ -1,18 +1,18 @@ package alisolarflare.flairdoors; -//import alisolarflare.AliPresents; +import alisolarflare.AliPresents; public class FlairDoorsSubPlug{ - //private AliPresents plugin; - public FlairDoorsSubPlug(/*AliPresents plugin*/){ - //this.plugin = plugin; + private AliPresents plugin; + public FlairDoorsSubPlug(AliPresents plugin){ + this.plugin = plugin; } public void register(){ registerCommands(); registerEvents(); } private void registerCommands() { - + plugin.getCommand("FlairMe").setExecutor(new FlairMe()); } private void registerEvents() { // TODO Auto-generated method stub diff --git a/src/alisolarflare/links/commands/SetAliLink.java b/src/alisolarflare/links/commands/SetAliLink.java index e36201f..1df6d82 100644 --- a/src/alisolarflare/links/commands/SetAliLink.java +++ b/src/alisolarflare/links/commands/SetAliLink.java @@ -51,6 +51,10 @@ public class SetAliLink implements CommandExecutor{ } private void save(Player player){ player.sendMessage("SAAAVING"); + player.sendMessage("SAVE FAILED: TELL ALI TO FIX THE SAVE AND UN-COMMENT THE PARAGRAPH SHE COMMENTED"); + player.sendMessage("Link will only last until next server restart"); + return; + /* subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); try { player.sendMessage("SAVIN"); @@ -61,6 +65,7 @@ public class SetAliLink implements CommandExecutor{ // TODO Auto-generated catch block e.printStackTrace(); } + */ } } From 03e431e08521ea20c3509239e043f272205b6772 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 17 Oct 2016 13:25:37 -0400 Subject: [PATCH 024/263] Updated jar file --- AliPresents.jar | Bin 42955 -> 44290 bytes src/alisolarflare/AliPresents.java | 2 ++ .../flairdoors/FlairDoorsSubPlug.java | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/AliPresents.jar b/AliPresents.jar index 432ac49eb7c8412331653323a36694d2c2ec24fe..723f4ae2a37a9c60a7a87492eb8a91bf3e12d292 100644 GIT binary patch delta 21940 zcmeFZRdAd=w)g9pnVFfHV`gS%$IR@Q?KU$rGjq%oGc!A8W@bC4&zaf#+w;!sb9d^@ z#TivSUAmB}TWaaAwX}ZE8k++4Ujc?wkOl!o1%iZx1QN1TjDynyc%+L<0{ugQ_^jL8 z+0eV$SZAqf+pQ9!`s6fxbpK|iiYK!8U8_2-RAi%7LY?ToI(ys03cj)G$#=`KZ z<^nidw+(TXp5o4#!q~e!p8(Mr*Cb8)F5~c}xw4}HzhfrzYuN%$WFFPv200t1JAUx3 z=IcA25bILd@H?bYkI-3A;vM6ZR1|&0Dd_>%P?>XvW6(PFp{QE%7BgAZT0)wG<3vlq ztt$CtRISigLa>%Y8yuJ<;fSN{!-coLn0A1;R8yYGfa8q%E)s)u;Jz5Ts^bn#1NC#g zy+jR?5$#y)Dx|S)s~$;9wBrLUt=Q5E~Dpmc8IH!g#HhrfQ zi0aY-qIMq@mOmVZ*B$UG(0L6CtUZJD@A3q{S$y>~cQtbH-yt_{>?AC&{Y{ba=-7Z6 zG4gpu=Iu+I-R>F@qJ?8hYC3MKW4lxpiFb9g z_@|YMH_UXX$wowkFh4z}O-&5t`x^o6o2W}+Di*IV*Pfu&S$obd!uRXLXe&}j4SqB5 z1TKV0lGZS3mKdtI=6MFK<`#7=D~0H47L6yC9+Pj>s)qV2)cWv?NKg|f6&eN{E1E)* zMFpE4B=3QG#J`Ecr+3A)RPxN}9(#!`Y@l-R&UE%*l?9Tu{g4$QlOP9rXu|>dafmsb zEfnKrSA=cBLF!6=4n1{Tp?(VjvMWg`dd>^JipoAS{8_+IFGgSCKNhV8Ny1b=ds9>9w%rJ+^SU< zQr~e*WQxYx*rMmAVY+I*r3NxHK4o9TJq6&oUKdM%lve9BLvDTWD@a2?D!$a3-2npu zSwR5-{m-r$^OlRVWd>Neu8JW3%t)~o4V<^pvoX(XkhLxegG@xW*IGIF0($rbp8h~F z_Pnt`BQ6r(0w$Rgtyvvof?c!63Bcs%&vv94ea@BQJt6=pR*?WKh_w2kZwu^U~!8cKk z?~nAtcEo8$N7{{2I${j@(7&0wuS~@_o|{}XwjQ$87&(P$jnLRgN|xJV`v&-2^<6Qm zjoXN&SVU-@)=^(f7-4Bzd@=hJg4(Uts8&2C7U+anb0kc;{2<&`*=>)&w^JW|u8zo=5=c16CO>_ne18HEL zYM_LAv|C0A6`yR*V;vpJkUA!~iK2|edRdVGnk8G<)d>M46IV}iX$I^wrd`UMTcRA^ z#bZq4;mi|Ek)&MrBRZgxN&}B<6na~0k=)g$?H#D{d+30m>kj`6ja>X`OE%kNO!Uc{ z*&nE;)O1Qk)Nb0fDPi8xtML1z{;rrF@jijt&>JWxp;ll`%o{@x$jMlP?F-^PA^wUv zw#jsgn`mIJA{2wxdNX(_tC}^4sJ%!hF{o=OC)>du3tT+&lyO7zhwl$wFQSvTfIqT#N=GP zYcuit;rUW($L#Zj%eG*Q!#KV|0ohm-AB1#0grlI^<_lkuH9j5BNfp?p(2lvx>yEjw zk&wh2h711)3CW-9G;B$C8^Dr30KaDIOuB;WoBs+x6tU zq5EK;L&MF*&J3vif@PcIp1DGa7LY|$G94}DG>mwum2Rp6qKL)z3)!de?XXpKtJ?(A zxuqTO9*DuaMEvd)R=*X99%b_`>L{`XTIfAh>InT@2x3@@Ts8`x!;DXY-81FvQonZZ zP=getI#$c$cn!0DudC^TJ?s`tnKwM^8V6D0)Kc|~E?UhbJ8%^AbU%l|YrrZ+TE@!q zBb`fZ58?NbpUkdr7iXj(cG5SH3A<^T6tOwLlil63TtpccZz!wITARE7k5?}|6oBCg zCWm1dml7%cEUI>XUbO3Ji>z|`yDQbvTMFIcWP`b2hG5_z=9e~!8_MqtOW>6tOoV0we0OHVxHg$|v zHgq^9iXBg+PKSXE>}VJzRPYNh4Lw!WGJ0nUgwak9!d3|LWbzKTB|A&jp`BUN6hn+W zP;_mEZ;!%Z^c`~yaws!q;SZR9p+!>{MW(}@ikudIa9yL}I!&_(nRhFHMg^X;f=n0Z8w zP?AejFJuSYyXrTHG#4Tjo~^%*MK#ho>N5=mg7n!DV2}*h)HbQP6#l}ZuRUMeHAU@#o-Fe$dq28ur3p5%~z zg=gulk88Kyhij{c4lnNkIhS8J{Z_G@AtN=acRj1gFrJ&oaPeBV+-Dgw04|IuRg?B? z`>lGEEE3Sp>kVpEbyjRR`>iXo?fAyA=$JRg1v)S($(gx2kI5-j2SV=D*(G+X_l#GC zzVD&@Ur*_Nsi@&|v4R}4;uryEDLW;#O5fHynH9_0Vk!4_JB*ZH{R#`_(~|NO z6z&pONeDFW%(zKEZ`+`Q^8{6bvsjgddpT-62qrzFFd$2$q2C9YXD@6_9w5RU*|PV< z`Tig&**}#RiY!aZ?}6bbJYbbHB+RGg!9zT=E$;X$xKf~VhxPn+8{jyRj8T}-tGGLO6;xWE0jYkqwHeG?J~$XYHt#8q=FoFyJmH z#ZpX;P66bPA|fjKCV0ZjQ1ripxCuDUH367myzO$oUo9QagCN;Y1$2N@JmR z*g~`~iY~@8Z()qXqFcj$?kybiMawu+frzokH`$dc7B= zO_Z?tNP=JEat3g2`fVY_v?^&)HkQqOuZ?$CB%(8ljt{%F-$#!L>RtJ0i?`1zUO(>r zXfUrj!4bl-pUrv*-tuN%B~IinbH4pT;BxfU|H4w}lC470J4I9W7{rvV3L$+VvU91@ zvduuPefD?kGYR}g&(-7TzGAfI2zdkTFQz*YNFn@Sd;H)OO zO7&Chm<3hrjw3OQufO>f`Y~+0DXtasSasM{WW$=oH1bSoxI~1$F^-0bIX4y|Ol5Vr z5fe*AA__3PdTQq0Jn_SDQg0xQP)YyrmyI0B0cJRhK)<5IQfMbCiDD=6CZh@z+NkQ; zcBdpSES}F4f%*>u-DXcKf&idpwZZS{&K@xCw|~5izw01by8Uw7Cq7fi(_5 zn>&O)`xI9kxPzCR{`^l9FDPWMK?ZUCp~KsyzeY4+#mh26=jNnzN$KXg6yigYO0g+_ zPW4JtO7@y9-*0^ZK2d_SP!XX2KnP|zntZ&a+Jkx4Ytv9|bUfAnBX3b*tpkmpM-K8| zj+{U07D`2s;0*%<5VJP0aFjKnH?lTxatcyeRYDO&VCLj_Dgeo{M{50ae zR1?iILY=oKwrUvrv8mPZzO_Im7>*-1HYwsN8S8h^re9BOMnz_nqw-U!H`U{Q~*R3$z*KkRY;2-VPVWvecRQ`n9Mz}=>opQXz|S- zvJJ8`?6jrl+q`JYWQI!lj85lj5xhlOYA>r|uQpv?1dFTI8NDh+#IFGx6j$d470T5V z?4!uAOgS=?*d;b3&<^_FOc9>o(6B6K%uPh9!#~4u0D-+r?&En9XU#l5getXUDWW>e zf&w9{x%t!g);9W+TYLv_Jl`;1KL-1S6HAv{b~8(D+8x3wQ1Mx4tCh6D;kGq!q#9aw z@@U?utU^3r)P5;2mvhkCHW~)1QPP!He=#8wC-QqkV2^`#Qp9rg+7Oj)yg`L|Ya4g73$Aq(gLU@g9 za2>Rhcykf2PwrbutT$?fC*Ma@5*dR4IEr(6k!a{Gsu|(C;6Nw0!~F$R_MnE8TkzqX z*5#;1?);rClJs8Kw&>aOzTKbIZ1X(zlKgp2AAYXrzn;~4F#G^@7%y!Tv=4yAN=8#k zPu+KIKS5vKS#}$|L?WxSLYp?#*}`I7@k2!0jP?gx3)|M#<1?TjCQzg+HZ%glTv$Z` z_S^zkBt$f%>o57lTQK^ec3#(aAL|(nlFF|JE2M|nmmgV9owvW`@ZHa|Uw|4QV}N72 zE$K{*#}iF$cC`U^2PFn%vU8)XkLk%(MfqZbi*s#7-8A<7E;d3|au&yN2T#*3-oMlo zh!m`}NG61r@wj2zHFKutT%3Fo1om4KH4VQ#iH8hSQ`F&hw{$X05G2_o@N;cd!UB zbTr(Nx(3OzO6Z7MkpU&z!eDkYBeEkIv;_q)_!w*p-ef$S*(x6!O3|UGeJo{=bd%vj z+}qTxkJ>VTZ7#HlM*fzDUr;@{^*nRIojF=`4|3U!8yd7%yjGs!7xhtfEt(umHH zy{%&emN|Nc_$HIB4F8$COQYoHUIu(Q1 z4W*n|R$!>%krqaglZMc=l4X`1Xs4)|)U~;sZz>J>QSPkP#WoYMht*JGhiW=j>*xfj zhK;=2Jpvzt61gWb&Ge&eoI`r%NE2P7n=PcH-UzF5rfdV_I`z)H0?@lFBa;H6;Rc) z{e`Z9e|B*}kIX`vl8z@(fuK@9pU2{ye@ENLHA#6g^1Y6=xePN7YqwsO19yS3R=CH- zkL-3#C9XF$!|*L(*CR~blT|GzuSko=U`GdRcR+7~p`y0?mHP5DW{6lO(p~f^)+Cw> z5G!C-$Ui$na9r6hCqwP#`s3H6b7BG5+Yy6IsUOMm8 z@ydPlxbCnXcj#$d>nwGxbzhz%QEHd5TQ`oOT}6V2T5l=K!4rWl|3@_SOO1=f$f~sR zUa}UMfft9?45H{Wa2h5Se4&k*Dm$@d{;$&9}JZ5o+xO(II%X+qprNJz1 zi5|1#iq@@Hgv7YdswKWwvulgWmoxpBi&{?cb%YME78 z^W(PYyDBvu;d%sbKjk9zks1(Oo4AM{8C?!kNVZgX@I}TUd&Nf!v1d5_E+lPo|HSU6 zdfRyS%&}RrQ&E?oT6lLC%6rlW0+6Y-cl1n7v1KMisHflRTf*$NXQtw%8Ji5LfpJsI zBG$c-c9y3*NI-g{682gU&i|GD&Q|J9to1HM6X&L~OY&}n zuYhlWw;?Gbh#w?^sF+U*$TZV1NA9ppf%C z?g9BbDEiIvR0(+Xi26MdEjCYRI(MygSN*nxj~XH6gqK!$0l*1|L$PRYVV z=C?3sa65?WcFXVJcKhB+Nd9}jjE>U0hkcFluXmK}q(y`VSV;yVbeJm9}+nqyNy$?T#c>`4s+R#-O<1cx`by*S)T z5Q&1%ouGM7Z&fz6>;T!g8rpL4kH2oPYdAEO`J(DOG}M{;XmYlxSUSS7vKjUWT+kNP zWCW+;Mrn`75*pFwFwr=D@Azn;o^3)j3AlX2s4@X4lNp*__5{&z&kU0`Z3HQm6_p4J zYI5635UHiA;l2d+eo|1i)r%Z3JY0KSvtYjufK2*FGedQwcLC4tJU_jGSkEReDOavRxvp5- zu7JfyFn+|b&Crd0WnCmBPjx=i4{=Ro zI!KJv6LO7oAO$GVh>S60IFE^t@`_AMQTr)o^-#w=>xQ4xy)a(9?uML0T4cX3crdb1 z8JOZeDZk57S_tP}P9eXIO%0o${~OH%-Ad2QUzHjWTF498KXCgU1x-gXgY&Ruf7?AX zeazy#9xlZGJolq5poNGvXi9#2kZSGhV2`zv647bNZXe)b)ML1;bt%i)`Xku=WuHV% zH)H{ML4!Q!vJGbrd4h*GM7vWcx}B+Mh{m!b{`=c0Lc8H*4vE^qGGC?n75`ECmM=av zsCQo<%rn|f=l&KxT{o|qzo&o8<=2)W7<+!&o^_$M7~C~wu$B^Od(TkM#h$l(pvMa2 zHMJd|^DTgny02#^=#tPH4E)6uSW8#();##fCSJD>#x(-*+7;r#hq@ogvL&`-)d4@g zb@r!QtwFa{6Rl+}3S?$L2heKRwmxVN#w&Cc8cNFicr;8*Gf|j^UmLrACyLyrf^VEM z$Xsx!zOt`VHDD>I&&TH$g(bAwF@Gvizx9kp;^u`hPa{(d6LIZwkGlZ1l!xUH%tg=OW+tLI96h+TrC-WARc z)*L}TC4HoI-r?3ddpWp-=#uJ;hDw=y0%L!iNy4{kP9(~8v zeZ2)A1s@`6Bw-~07B@2~)9%qOXMA-Pt7z~>e5D6ZI7p9u=egVHF{-LtTx21n4O%;= zEGDlNs-6dIfepNfJrN?2d*G>jOUM-Q3bS_%uBj4>b_;2 zjq8AN-Dq_+V`KFOE_gRm?RP*L=4Mr08AE>I@Fg523btrraCqilA7LijjM0pk z{iPd?eP7M$D~c#%^%_&{E{&mwVmV@sj_i1UD0GANjM)2pr}LNrz+tdG_QY+n!~6s~Y2uFp7OAqPb#OmhL|w>y>kX=omwwEDQQLa7xI1(D6LD%r~2 zB?Lyb?+-eHU{Z}4zhA4Xw>J0N=NUE8vCStx_~W+)>(6wP1$$8>!@W$a(IMbu%Ib(H z!Y!fp{djOVOV#z6>1VCRPBq}X;^0Czb%+8dMxA*D&?ttH@J~B%J+bllq$y^SRx8U6 zH!4zta11}klqHGG%UI*jL(%Lp3@mDP7;V$zp73p3Qm=-eHSpv8rq-&SO36HciJ!2^ z;0YeF83lNM9gin~K+C%TT0dV5&ryl(&*YpFPR-@lwbg?ADIG7Op1EfmuT*P(Ua+oR zCpY~8ur$DX3xb2?(HzUGc> za_(mxkeo^HLFDDw9iE-z3B`il17$Bgk$5HC4g6v{J#F=7F}wK8 zH}~qtbB#HfUADajPR~bllVa79|J_N8qsEy7Ao-|QQWJWA+IvPWL^5okg7V|!8yqog zbGo1DuvQivrGhSak~>^8#~0bG0X|2pRbcjM(DslQW5t>e5IC-~7vMWK!Lp{ybYI@z z_Fga=`Y6_d+Ptq&f3_c{d^?je2oTT_`2V{7{=NrAiLeu7P;dci+RECW7pE?e%dNP% zfwS1*>~xK?xnwIa)MX3F=n=sY#Y*(~XQUbSTlR7u^pG{tcAZ~$13EdMW-;_Ldm4^l zck8=)06UQ_50c%;LJrJ_b&qX;)78_xDS*!^m_14c?w8;OM&}{sz@H*1BxBA-;ziLxMANS&Gj(HW{>^RW?JrGfaVxhy z!L%OLCM+VjH401}b+*hpqiitR2#Jr-%7rN=kn4-G>p%PK$?gHLvvaULNEM_7pP`6g z$Q3LtrQ>5rN+&p6gJAf&Sd61WwG+racn%O=MMML+4w#@5U3B2*We>Ty#rC)tYuQ*&_s zf=Tw8eQ1C}%wFpA%!`)!TCLXX3LLD)1XbPhB}U(h!b2@K0@xC&9i(shnEg1oX~L0J zBdi@^r?6hSnAw>+hAo++Y;|0#^Ckqg)Jp40s_e%D&X{&g4O%K!xk^6beT=9PqD91L zWYui-Ty?7A12IbkeRv&H*Z9JRNGfb=1H9C=-?RbwDyY%ia>l48?lK-m25V+5j8^U= zY*P*ia-!(>MH7V*)Z+=#O0Z^fi0;+h!L+NUb5g^bA4eEJ$B`%B$y24=06XUR zDjne1XJah(vmUoTP^i9MC~{F(mkaB=A#rL?NAOgwz$@RdK3qhx&WlhVG3b3dYS1=o z!?zq2C&e4Bc?F@w&>f?~QO#L}L1slqO->Y_1J;Iv;k4ZX8S$4rMWMxkx0$(@x>g}S zIK^1-Jkm2}la&SI>R1JX-svUhPsTxNf)}t}>1I2TPj?xOA{1%lZqPU_%)L@J<7l@|+lk9LRgd&FImREb}JCOEPWZW!1Zlv-PeuTFrZO=Q3dB z9fCQFHZ-%{-{)Zf$FI(C<+kJAml&E zRDvE1L4q$H_@_QWC44JH1SF}hI-#gyeq@m!lUtY*p-TCVqEqh~h9y>j&ZHKy#up~( zUN7kQ~Y-`8`;KYIdYbtfD1l5&L#t9P}-7>nat#J78wk1 ztaBV{?t9UAX(m{G#qSH9QhZ_`V}2S@JsC{tJdg+vfr#Cd0TkF3U;^18ggsM?Viay8 z7E7&~iYM4+kQkA{`G5sfWwhJ({3Sg_y5L^|?I6=g8@8etjCVeFuwyg56+Ki=KSw6! ztw@!EQhZZvlozzixZ6_t4^RtGj?!Q0%1o;F#!CPbvq?iUl3Kt5ueoMy7Rel9n5;~AxA;Fb10svK#kP@z{3 zg*aniKn){S{Q=5NmWVjy`9IE~HdZ9S9KcgRB{z*i5r90l@-%EfsX7?8q5F>HYr=I@2QhCkPEpaLavaQMeLG<%?+glcHxe zw&@dK*Bz@e&tG)O0F{V*gWqoy8cSze%GgJpeJk;nF92$$qD*7Fb@nN}qN5_kT2;w3 zFrrW}urCk-gud^jfjE>2tY5t67}=oRyeLL5s0DQfWT6`IylJdBRkn%NdXbCD3sTW9 z>3;fOE)z<%kRabv{a|lfm1568lkgUMAK#aLzVV_z9m1FgFE5G=HOV^?&mz*Gv$0XG zsa-24i3fDH@-j+9Rk=9cegElyBA|StgF5KLg`HHLX4lf_Tp) zRR0xr1_X2$2XX*q)9{RGBDglDvw#%lEGWhFOW^Sr_=mzD1iQZ6Tmo8Hybw$?b0hDA z_^^OE{%lBsmHurakq&+$%xk_|zJ5Ou4VNY4?cIybTgq#a;;umnVz0X9Ymj1w7YQwo zP#PqC&bF{8#2tCY2hgw*&U(~q4^xs(*-VpP-2<{Z_`MTu{mp&|l3b@!p7^328_SoB zk3i?4OG`Lx#2eci=3$^P0rPyK7LuiU#zz3E(mOeI4{;itmY=J8y6STr)%7_a3}#84 z_1WUKdY}gtoHF`;$AUs`z~T;}Z33Va$37W(%kFI*N}OU*vV-48FR7yo0#J_P=haE? zfl96r6<_@^eME7)i2M$nR;I@Xw2c&XLe;Y;~DIv-S0}ca7m@(Tm zi15$L^QmKkx%XLoKc&fIf@%Kp5?7aiSn-&NukEf68{C_32a_BLT_4Z43_u*$LV}^& zb*4wrCgu-Zyh3cwPGgEe$0ybFxNO2X(7mu(87t9%V(fHHB@F0{{3B{}gQM%8ZAGR* zRVdTSRo@_`TwbR-YVp>YQ|73^*~g~&Y|^4D(rooucxEEEhA>waZLWt=OdV44xSf=! zPFLDAr5IWHo2-qZ6tbs!dAvR##?q**kyu^-kX4EK(z2_{Y2@*%S`Z1B~bFslO3V6LtFJ9>+xIgN&@K>NBX zMxvH?H{;5dJ!`BrsQwlWm_G8Xq{oW0s3b9O|I++^ohi4!SG+99bi>-KKaZ+t@VmKp zlnOQ4*cfTgk7y>J}abtdv2>yD-A z#R-sF+-Pxb3(+s<7o5HDf{h=VaW}U;!EHT@MTU=8mB3uf$srt-F}xE}v#L&V0m^HL zR@p?>Y{%TB&{+XAAL8$@W;{;Usl0gU!3ihHlDEW~WAza`+4NKP8T}nZK|+s2x)OJ+ z1z;cw(^9+atr{ZcB9GOt1hJ12=$Xz8SbYMIPQDb{SreS_0XCNVs+1=mW3s}OCu5?sl)Ikqjz=#Og&_Tet=}8`n>P9)!eIu=6SK{qXDn_VsbaC;}2g?z`(b{3*I}sJ`YAVG6mQwf~+h%7#fgO>V+OU(< zT@zrASybYqqgEwsLb2Z=&X@;|LRE8ThU9#D8)fO@JA{FE7uf5tg^UrlZlm_HXUZ;_ zGDEX&K1j4MYrg|DWcHPCm2d+r3V*i5ZUSDx|H!oha@o(T&w0T53j+m#jrR|7 z4FvROri|=tO)bpm-EFKvJ|nOYpR*4H^x5gNBrxRS)`Qq{GJ=o>GbPY6-~oPEf-=E^ zc?Nt4+RN5~!YCEXhX(}E%rbD*)IAL7VM%{Iyseim_Zxz>gZ>d)?z)k+Mck}|$tN1# zo8rtl7qE5w>fsJ}pjT;!sDS&}rx~!*!s2@n+1^`61-}RJ+ET!8T}41EMOEIwG^CJK zFkZk=FqJSphjWNTx_D6zRpN-_&@r|aHSg&!B6_6vmNQ)G@3o`bAj^9EZtI@b(WkvJ zou{b3JpK0N&p;gDDLTtPhcWYKAZ7sEV5Yx}{m($@?H%nbO^lqY;>MtR84*R7px*SQ;~ElDe^G9&A)YQ)q_}W~-<=b-93)CMI09cbNrz6VM7!w0}iW72>4nE3N6k z`Ct;v^=o5`#5lw*Rad;wNgO8Tj4O6d1KzJ>k5vnjEt{<-q=Wi0U4x|Ke^hsEjlzbF zjrmj2XD6J@Sw~PScI=#gc;*;mE4Rr(`@D_&+9ufO=!zt8QogKba8J9qhWEiedwYi9 z&s4BocA$SE@IXK;e_0N7+2RRlxwwEhLAk!q(LcsHhI|!3`!aS>POL^qcXzxqXX-Z&cQ#NOYS@Sj=naihe(~yF zwi&U-oV&l-K~6`-#1x-&p~PQivOnsti;MnquAL1W%}ksb{zl=LI5ETlhyYgFIHIUN z5WpF*fSsr;)W~WK_DNox3z{kre0np=ByFY%ggK%m!9c+o1elO}f~`0|CopE{#~&db!#W?WctKkuZN>QisL0 zETC&V3$K8dQ<&LK9afPQS2??2EVbFH4Ho4Y25TR4r>W6W(i;s{7&|!57_-vJE~p)C z$l9Y=Hu7LD?NxJ!Xp??`P5CMlw5{9#bO{p~G_m>g`vv0~VI-l-CV(Y~{%En`#Dj8z z3eyM^uD>_;)c-K{F3c{R+Eqno2o4Md*2zvnsE<3qatP#e7cpn9GeyYWSwdN)n9D*?gIi4PeZVWeA7cP2l(vCbE zPy9|^liTvfCP$?up;x|vCN#uq?*hnjghS=*6{vgJvrvajBVfS5wiJEBQg$(Ud%`pB zhBE)5-N)fpQcd4-*ofrp7qBaQ;mGhvHA0OO$gf^?=q9Y-DM&W2DBuBELZUplK4##@ zW<3_cIApjUj`N>2Q zb4%r$VV>ISv56zW%n^O~w1@&ZUIsK*@0nOALq@iJt+tSSi$zhcfXY_{U3EuL% zh_%qTjvH9qGk8T_5q{5rBrU#g-9UqzF9?CHZ02VLcNx8M7=AG)Tg~TZ*V@=;MjkY$@jGjE`Fcv~PH|w4QQWTJ&4skqb$3#Y}rj zUJ?)1hC0w10Gr5wHz*S|hPn{2oniBl>`+TR;p!u5#dwY9D=bo?VjW;UYXgF0gGtU3 zL-mayUb ztAo&ywEW%Fdjha|Pqxs9<$h<5l3UT8;R`0h8#I11OYpJxkvmLr<~yg3A~FvB?S*k& z27j#&a=!Tv@kiaiU5Iqcd|FPZe{s$JS(5mHfDr##lM?J;u^V_ zM(0#gL9wO)(?ryf+Rs4F({!3pm^qqkCb;KBq82f$&BXZ(uz=a-(6O0x++|(!j!_jy z8u`F+FnEuBSDIs8(yQCgK2EB?sQg-k%nTFxma2*)C5TD7MkHDjWtFeFv<$U@}Ll zE9&}@b+AAUJe({xJ&ZGMMeN}SFPbN+w`!{(9^Et=YvC^L3g`;#7*h)M>esok(aZ_# z<_gE$>QrYYQuKv#ljd9Ke7@p*=luQ`DklAn~mHb27 zpgS9<1!`?r!$Aifem8M&X15i!+!n$tf7wUH$SpRw0@&xItP@P(_%}7yH){DUM_RqZ zqZU)CzEj{7xq5YfaH}59jrp%qb};6wt)$JGLvq+W3*vNc5SJEi>RUSAQ-I@CP@3gL zS3G?!>dWd>2gh-x>zC1`7p`Il>D-`BOSq{YtR$oZ)~cyRS+DJ;LZ__}o(k?Wf> zHrp_q4Ya7dOO5iPo2yF+j-Ohhu>%`QjiAONbLQEW>R}dMW4^+cj(?ySv##yqX73#j z?iWvm$7#drjy;&Q7)!#Vb`AMyTcGlDCCVv~^zEI%%+UlFBE;9|CyO9cc76GMiCn z75P_<%0Za=$!3R94&WNSAvsVi1riaP$B{Nh`*cydy$p4>*5xV%Ccu4aNcD0_u3_4i z^tWdDJRl#C&Nhbx42=oYv%%BV-CgH!rUMY~SEv2--oaZ}tHCZzG2{$=rdG)hb_Fi z0S6R9Y>d1}{wq715dG5kVurK%um92`T_{@c!h0c_ct*2 z_(r^Zzo@y!F5nqHsHYvXnYtzvut%b@WQqgFv^={oh1<1GbOJ~YAuP*(^OTx;s^m~G zUZ>t4b#qV}2B3W!RWKQMDMI+#fkF*#2<&-`=NrB3q*g7`G4MoDd|KPcmO^3ZcDX`nA!Zr4g7C;!ugb?zZHSc z&wnzo{)kz^Wj%SE+08D@UTLA-rGspkufWd!n=06)5V+=|Ai!|X}h9)a#L~{F0;<&L=A~RK~(ecFpLWHz-1D$ zTBU^;vdXlfT$1v07IQMGX@qE(t^@7zf5Q@L(UoZElRvQpz}1NQ(#}GobJk-kG_z zbGlS2EtM@J4Q?A9#yfw-@zcI#i)<&fc^2#DvyN=Ksqxf{{Nn7ZPHznN>N72N;Q-~y zWa#}4P2(dORqh5yg|YzK};_wD}M-u2sUc$>3#*A=twqS z9`(HLsc9K(uTq|j&v!!radh^<-$qBVf|&Z)2RiDGoJwRuh?MTvsE;7+Fbb?{!;_A% z$ot9`dL(amK$~|FVna(VzGS=D)ThSe=(eJM-4zcN%B&yN8aasWqhK`~b;kLDbq?Lc zXpZ0{G@xc}WbSOvE`c7&<2Q|6?YNjqfCr1W>%3^a?7&vi?{u&S$TT$v#e6fEVBJ08SCYgH{^O{dDvnd33m%>01L)Za^>g8nJhf!VS>Vs!7B~ zQK7p~V7#!hW4x*ku=2>8QDI>(%!jJfKS%|>Pgm?vk%n$XJNPNBbw=ilArmRDi=&4j zf646j^-oY~6I!FhYNeu2Ge*O6AAJws#JU+$yk?b)3n>;(0u0))q>zJg+1x5MBP$1I zJq-7f1wl}ugvpR6;N#(|Fpk%DLW2SynW^wZuu7s#m(aBfd}*c?*Q`eF$I4V=Y^t;) zt72Ad`Mi6TE2GA0>ib!w`jid(4bn_BKbvAPSUo#lh8#?ZA(sCQL>S~a!CR7FFP}XY zODa?&7~*Z1834*G9I-l2gRA*nWHzK30-UV*ms}H1sk#ClY9uW~XmS%V{Ai28VOddC z&8&d&E%H~hUkzLYn2UwFBpfW}iN+~+efg<#KY#u-0uiPV+0Ig*fo86I?rf4&`0VOzU*Gnyz?jHO$hLV{uW&+T56v| z2v)zz7Xx-ftD$j=5(J27Q*U%+@Vw0IjQFZ|llda^ z%Z5IVq8cDGQ%ZLl1*KF{ZmvKNVo_mz*b?26H*M8m}zNn#)VD)3m&EkRMh2S zMSNv{7*^(E5dwF62o_4j8dJ$Ktb4lC^ml+*j{juW7A`qiTP8K=OB^a#6u4o}4zj%z z$2RC8wZM9Rk;YZke*0y=|0k@c%Z&-+LpjuLyR&<0>_!8hfRI9y`W=Z|aQMkV;=*|w z@?obm@i3|*pVT>DDsNxmPFnq76NyV0es-tGHE3FBy|Mur{jtlZQ zHK5`86P&Pv`A2%~pN|pt{|6H|_%oNre~60z5EcI+D*k^_pB`W?|c?AAdc?_&A zob0R(98EtT6NUu6B9i)I(lX$Gxl{Y!{C0&Rf_h7$$A4|i^{?NP@M$R5yHddaYh$*5 zZCsy5B?k)k1sE0R|0c~#7|at^{gXBC9}|TA$(r{+#o)90Upe#?r2nV$XYMe`&*VM- zH+K)g|Md8*g@eR-6D3IH!xDaG@{#<%`D8vLzKnlqCkdHg0FILomrp|YiKj^ZV`hf` zGeZ=G5?nxq#yZF@0BJzp{H}(gL5Ck?vL(t%4(Pg(H&5xJ=oS+KyUTB}0@z*1+dMQ- z6k5wnPE;40%q1W)c?Hn7AU8o)TSIz1`Y4K@$WL}$B0o7)SO~)-$cqC}ow8m9sL2{^ zGV%f+brh4swZP5*)^!*r_qH|YoCOAa8n6aMb4f|dhKHe4#r#AF2IDo)N{ zDhC#t02KOQ0yI{4@~x#jV4;^lAvN>K(=|0F>n-C+0j(NBUL^xs3xfa?tdZ9cAqPEd z4GqvyV1TM`2e3bgSWz=saJiQAC!mmzr?abHuq(1Tz%@0Vh$SkJwKxd-t#X0(r)QRA zrsw4srA~HRu2nCS$G{Ne>geL@s+XIBY!YZ?3vh)8e1Qje2@l+;a-cTYIu~SJz{MY) z$cq_J{n3#R%r`lu>6v+;l|dkVmavQmDnO8@96@Ux5a4+M##r9OdU;T0G6ZSdayWU7 zEp+(=a7Gdd^p|321dr$ga~D`A^27kB(~SU@<=AxU+9LZFWVcY+hJ$N?Qw#rq0px(t z4rKkT#%2O&HbDh!H*yXFO(Y6 zvQAv4fQBAqz-~a!bf7jS0x(X%t{a#OG2F2KneF<1V1oY*3_S;g5kS_&DVU}NEVTvO zjhuH;{ogkon=bjuS&9M}b~EluFTV>+Fh^!nxObnOkvs%1Gi%J5xsn8J zf=tbUz$?juf}sIHK|ukLV&Esj8-UuQV<)GBvH*?NH1q6|L$?w%l+Ku z?fUtCy&(i@JD|cc$zYZ{*epF*KAU@nEM0eRpQ4{rM>3V#QqX7o{QMkT$|^O)OzXA4 z!vcJm>a>FXHh!wD5Anz|=1Qh#9@e;`(PWNch9|``=h8*O*n7e?zu{w_q_B`eyNWVS zgOilv=85s@8Z>X$!-}AqLu#vGm))!~%2;+pfDVh~dDZC9brM@b<+RDGt1|I=V9JQU&e(sUKc98?FlqWNl87-H8e1A+`Yf2_e7 z@-3YLRCSNh8uU7hlbx7nVPKWA^nBP-$I(@&bcJQnxY(EI%{lTJ$eYW^E_x{s!2`C7 zv6(XE?bWgEU!oUX(3n%x)y{G3Coa@0dx!DUxgw8T!U}8?4qC$)OL%TJ3hJWj?plJ( z!_I~OF5JadQ&CiB(trAB4)JqGCL`3rt{u%r?O0-ItfWplu=`S`qS_sA2I94H5iDLq z!PLE%zDritAVgC(X02q}5)6$Y;sTJ(B_7?Z?p&qS_H5pOceFaL;&*4W2(=^(dI7O0*RAM( zojv7p{-&17gKR&~_(f(Pw1jao4HCzM1s^EvY2V0bLem%dCK4`a7)#}l5y_B8Qnfav zF_#vG>4Up9{wQg|gZRK5F}$w&pQ7(IRYb%7_ID(SZ`F2;mM<(E?{VAcRkz-YvfC8! z1NpP%Y!vQ;ug1nC!G?a`F$fsC&%3&~Ng{)@GI7Ov;1p4OLe5twmM+VgSlT8&1S}3A zsp&`t53ypEsl&os3X1aXOvXJLMt}<&p6WbF7aV_$#*&hGVCZJN<7y(@Tahe@#0`^g zqU0?s4r0=87tkw0-{!UY&#!%8t?DJb&;|Y`d*|yZVOX?ajWnO$M+f`@ZLdI50rLQ3 ztPfHLsXoMBtyf44`?Ez(W1J(Ca4fG{E9r1gI)t2ih16lA4P!;_(ba2!6#E-4;V5o~1^ zl@Kz_twK#4S6yJ-M}s)JxB zBeD=C*OtR3CsbfHY5I&TcCF@Q5*rPxI!^C(r54 zP8HzW?~yYg+>yPRSj1!N%Yh>iijmqJ>QKXwI!AQ)qivx07kt? zGhR6qoJon5+q|0D#$bvGqR6w7@~ojZMgJ(&sbC$r?S{ABQt66iuQPMC*t&feqKM>I z!oi4-O~)iRtyh%3ZW3X(6BSX2?}X2P2C%TqleV?OGK(+_(m(h{0FE^Qx@SPr$H(DW zv6YkLbPdZO$4{)fP7l%iL!LGMLc9Hf@mj3I$w4|0_k@kI>O%mp9NB?jJUexvkkDf8 z6@M@g<94itVCzrDXG-e(TY*T;K0SrXj61E4J8&CQcQGA|?3&9Si6XUM&fpmX2T4A zw5=mL#_6dRuExhhBt<$iyUJA}25{zG2}SE&VVYx_7pXP{-eY#HwSYM({5{JI*YZ>t zQS4@xP&38`+A!zX#$D>F_N{+Au5>8UA1Q?<8#T_NA92Z!K8ucD8icCbI<4o#o1?qU zfR>&{N3OeK9IBK)^QA&zrwyZ`Fvi1i5uU?P)o7COv1c59tTLykAF7fh2~ZXdJa}n| z;^7b`$D7Mi)QsBFo|>+;x2S%;vYuMBgFzmNf0G_^=>)pH0^#u=Wpuj&KftdP!M7eY z*ef0Uh=rkbSd0${;p)8SmBHaE=qju$ih+4vNjiOy`TaSNdFN+!xgdL{T>NFW2LRa`=TDt@-`mjhl}yow8NV>N`z{@iut%YXDZindt_R)7 zDjf^i-X6GU^ZsggqgEQsjF5|Dmg+LIcuiAIF0N$}BF3{yrpH1xys~$B(W2gj&%CT@ zj7CfGla@33nQK3;?k>UQZv*q~)uCKE7|ARxKLSnm)YPdR*7 z;S_+yu1yKeNF zTM`{Y@us2T>u`=)z<=^XViH$O2L=S>^uOe%78O5P3Xd0HqlhYu#t)iGKLujvMMVS^ zv4~-&ZeW5u4D(@JL`Kd&s<_2c4LZfJ0eNp>Rmi?DOt>Gw`2d@UmU_n46F0V>j0k>!gW$3K6dfg%A%AF6P zWs*@aRSQeczTkvviX(wN{WHws2zvyFW3F~Pswty2;Dd}}IhC7}hXx`Ku}$nrK*l^{gqLVd3@+nPVLvNGzzWxy zbbAMwe{si7(>d``06(^}uX3^+MrYeL9dDVeJRr<$v@#}@#BX9U-@0X$GsH_tTlq7| zLtr92#5eS|x5!){L2hj|UNnQ)jU(xw@2NA)PNJ|KK^ZAo3?0f*ym*%pR7Y1cT=dJB zmPz_@Uf_gsiOj-#rk~w)yu;ht2z1VJGg25p?j~)2dHAfcHsa{#vu3^fAlEvAMsLXS zeR;hq>yM|_k!=yy`?xtLEhVRfe*M&7T|}8GQdPQ})Le8a^9gp{X*9nn@4)N2Dlzx{ zrTO&7qL+wYRn+iTc~~N6p4uO<8tf>LcglHDD(a_1^CY_9XRYl~w0!rZ;DuWRuN7>- zF0}+v`cI7Oi9P(rZHAw$s|!1yQmeVSZelCQhJuxk8ui~NT%j}plBC7*V0J2OjV!Ut zKlF2pC~D}!S(NP6c_0@wd&Dr<0-$O3LFo6{d>2u6H1p;qWGlO1O z6zgdZ-uJlw5rUF!^`Alk0SQ0=0sUXzeFPLY`JPZ1peE~rD~|LnQMZx0>TV(#xrRkT z8F&V4P#+Af5vUmh#}Kf?59ss#2I*&K<3@oaUupoIWBzN0Gw5jRLCHi{x5T_t)35a` zj#`!@s%2iT?XOYicZBaLQUP zynMl0HOH80;Q_(C#Rae*{uwZ*)o zY+6LRNxQSD>rk%x8FM9lvTM`d;`3MARAQQ7YPt~*RX_^~&8MaF`IH`@lPV6iGxWuT zUh_^GLM!FoHKNK6lNrkLj3&mMxBorJx+Nyr%Qft!DjX=x*_i}>NbTO?wg0G#p6(b5 zIATE`Ki^ooKS#4T_?bZaTMik7B?DCP@6Ut9+GTV zV0Y>duWmLa`=vYrAGevfdNIZ33sU(P09TQva3_NR5g>!B{otlLM6Z2$&V|Y{E)Jh} zga8V#grIfeTZY6nql<8n!{+Yck>1*@J2_uVrQvp;PIHXlU2;HOj3h3R5t%?6Ixe7h z3lZFqY2At)>>ZUNWvj_CZ^C`07+Zr=r5rjaXEnn$_@jGROYif3b-1+u$`A$nhb`O>VE;hm`MQm25-5$`X3H0lQ>RZ{-E{b^?cIJV`2XCNT>`xv$$}Gv z<#$Y0r-f(npw`YVv1ji96bq=5=^z7~ z6?)NWn`i@z#d_>Q_-l^wxI1^|PK+kK=v-rxBpq&UZ3BW+jV}hu!-_5FIi56ShS9lY zMsdYYGXRs$6BvqvN4U__R zn6#}HVI%{%rxPhbzX2W^8UJuXFQflj@Pd+)YcskNp7Q)uy|)*eFy08N8tTW}8~$16 zikuvbQq2?iJsFA`SgU|2+nLtrfw_@1&r`BQp*+wSbNN14Y8zLr=F=cqx-IKeYjb1W ziAUU5L$D_d<%B3;sMPvTn(}xOkoH#da?NnDy}7=Klk_982yNojaU3L*6~FvkfRi1jA6Q3~} z_6t2^J5f5ID(z1QhjB_fhfv+{;&D46Bl2*ku2rD~h$na*wP&iZkC47_cN}LqhV9Kb zZB?({;GUQ5J4DqI9ke#c0xwKwx%G zynb@u>V4A9)Jk|&-03Gny1S^$Im$x_+o}X7$wC%@$pngN&{zco3Ya00jYbU!=0M`v zHLQI+SDeBHg8b9lSzx=;IsFMel3!8kFVMSrL@3ue(sle#U^`9AlL65u19=N!QbrN7 z1qFwF<5#wsRS@UqxaOqz=BC}1iEr|WUmrJdp&WEZMUcj~4wmtuYTS{btsQ%Y^Uv@) zrUm$bn1X!hv5*gAl14R_Lu)Lj5y=y$ z&fP2RifbQk|AWAsRT~9P{j~XrWRXKSTLcb}ybRxI%xQwCTF^kXQ^34Pvd?z`(gH;p z3xkDeR)9>Y$mgs!T$~RQ3ztpG^R!Q)O^;ktN-pn<2AtwK}{ocozdv-I2S8j!EB=WI|v8`yodwlpo`Y<<|1oRSDhU|PaL0yx!x&^ z+pip;@I^CN9Z|}lMLT?5@Ism(D4f)4XK}g0n)URVjEqe1Fz@5Sz<2wwqXT8f@4?-Z zxjldcZPq}LoxO&V;y^Ii(V&}tD$Mp-Y8@N9NDepMvKbDn8Tx*_?a1Rm-6Wfi+6TKw zin{@ZdN@PHaj%Z*L!Tk0KIfI5iDyy$`@g;t^7&Kkl&_I~Ij45JNyQ=qViehZMVNjl zK|u2YVfoRbA{?pHl^TMtYbM=NRB2ZaDd~~fymNBWj$N}j+Bk1N2M^8?QBh7%v&@ZB z%na?F>_zcqwN{lV@D$I`L227ZYNo6V4_^Q~WM&XeyGbglIjN)f=o;*55c)d}r0l^E z_Cq9cySm!7oRv1Ti0ReV?=OMc>*@^n131<=m3l#cEFo?V3DTobH#}QMJOoo^T~i#a zEs-#iSWq^Im)sP|3kPuV-Pn$Wwgt}|_U^6(FsUp4)&$<(@ee?mD0*9RDT)cTGaCW6 zaY33&wXEFSh=Pqj6W1g3kuzjvhiv#)NgpM~|EmOL|Fo zVYG9Ph`%M7!r<6Sed!#4bExCne1VS7s=DN#xdnlu2*;WaDL;HA?$LC!hp9`Ox<6C@ zBC;A%b&HkOx5u)EPHk~%QrVO0`UV2t@&7EHqaq?%YPF&ym$Z=dBq_nIR4;aK!mr$p!~u~m5hyqy>!?JGC$%XVtx&+|q-rXvCU@k9h6C7je2OvP-nx>rsvMRIh} zkR0y0AEhYjzyKu(%uQ^IlzOgb8EPx}YsH&E1wFjXr8UB)(P^MVWq<6IG$&voXAk|c zY-6Y}dzay4L~#eMvS8~BrdW3js39hW+-f*h9cCc95!ihr+$a(~e?C;g zx4-1vhRi7*Y;(fRi2SXeU|<9{62Iu9btEC~4V&;W*7e7fZO_>5$F-97ETHm@Zp$10 z_&g);>zCc<{Ijv6rWCIeMK4kB8t;Fb8=#qq4FU`Vl=3gj{U3j<;)0$mX@?JBwi#kV zlJE%p9uiJlM#DF|+C>Ny3cER>GbAlZQanSW6%^$7P2k%-#>tf@wSr@V;Fw5F5oVZJ zd`F2s+l+!YS2pz;&d$)*Wz(^*+ne-LhC4KuMuk_6tyk6=>~S@TW8?^;r6`%w;XM`|8Oaox`#+-O9OdM+UMxB%2?4!=8h>16W!KY%sz zL~00~4+00=F3Eer0WCye6GJ^t#<$$AuVKXhkhfL*bPWE(75p!R|ATy`8U24DNBp-! z*w#wP+1$n4-qnS{+Soa^%QS&VzrJ>>)$aeT*Ed#MtIc+=u8RM4yC1LpW;Y%I*Qg$Q zy2$TkG`rKO+78Q=&qvA$5D>z^0RaI(TDBsoU~iWqz(BwW=<3MDsVS&M>F6oRXsGHM z1GiKQi3p{b=MnVA{(Y9?AnyWHEnU?55f5aE`0ke!3y$smu4R9|@@ zZ0JHiG(gXkXVdihbTijiIdal~BJ6@sETrLF@ZJxASb_A*^hMC=?bVq)|GFjlc`O{l z-{$yC#3-K|9BWvj#YS5MnZH(Y`vXAVpgY}mob|Q57Iu0GI9}UgGAEJ#J}+&g!n*Qe z@p{Jzay*|Ped2xCIn4M1aD!J>q`yH=^6%n|=mN*%nu|MH+@8Gv`w6B1)G6;9ZiKK` zZt_UBvPX2p&f-}xUM;t>sdpWx9=|2reL=q#NyvcHzuM1dKkJx(@{~}}(Gt;1n%I>! zTr#jiu?y16N_coeGBeXk@bP~qXp|)+mn0YFEgTy}*2&}5_W6Z&2t$$ZWF!pCx*E&?MS?(STuEX z%JA!$5l4NT;u|zVA!I7h(ua0}BwrzF^Kj%t1X}eZHjxW?M(vUT{FkDnem8U^733bG zX6B%jxnBA?w(=kXHD%&|JUzU6>YA~f_YYtH0mjzID|FFHl8j(-rv}N8qSENppA2ZRI#>L`992K|w8IQ(a18Q|b4i z>HhG-0dY<<_~rQoxbT*6N2d-Pb^Zn7pQ{lS^K_AMkBYi)5d%BT3efw=BlwH28b0+( zS+?Kzs|Vo)pvm6a#@fX8Q$}+Kp!(@ReCo^nNk>tKyD((v|3nSrNSl4(2vhh47)&u( zonKTq5aeZQWp;H(kWOjM!xX~$mSAw(o`R#Vuv1AWj4(|Ecme}4stiQxfx3&RHIl{7 zSR19rS*;v002bz{gGB}r0}!Ph!cxV=OYYfRJb0~p4Bt0)o}nEp)4>kuM(u^uM5;c&9n3ma|ousV_wV0~JB3PX4MK?6W2s_)nt+7M%M285j*)k5%QIV8D+JS5= zowj;taRXt_`wH!rEtC@cFCB&$!0zhLq!Qasnbp93l#u&mPdkxJOnev8c5c6a>5YNNh z8`F)a%d?v_phe(Sjq{ck41XnfwA0T$L85bOpr13s?PK=)mw?G>gy{%Yn)rcZBKe$@ zAy^XNsK4~$W4gymb}it3(8DoK4W4C|*KQ<`*!AKrMgM-?&wU(9A)Y~Llep~lJFo%NoV`vPe?xhN|PbM6>A}=>0FE6tUEI*eg03A|s z{6%~pj_Cy z$pks!mJY6r3XdUAGDA#r2uMrC1b92*go&@h*?Swn-~9%I_uiU>-iy)j=HR5{wQ28h z`R_I7Exk zMdw0pE~WtEA$}`9)Qt5Ge0qe(NcC`j-bv#?!ecb_6~R1XyAw`)kHzVv-l#!IeMCC+ z?^-km?IN0_zAC)g>if7JInKr`8{2MKp_(azJ7bBZFq2>GF}L|JVPKcoH$#SeS||48 z3cu%=**d*OO4?=9of2^SaPD7OcnuZ6Q5x0t797jwbM+$v_|vN-mZtT>f^$sCdskZ*8^=9s5$mfXDxRunHdEs`dY0gV1k;8A?_&Rb8YQ8cw;J&V zTqGcI9jU;)itOsqOmU8Aq(1@vmD>5?j&5O$eq4^l&%$Z30Pc5{aR|ED_Hqp%qY1Hy zzj?)Ol4a8p$Xpm(v8;K2J>meAxP^&*1>>2QWHGVCYD1ci)tu#KmD^R6Z)t+v4KhCR z3POmAfAa>Ym|&mAuxm=^({E zr1$xCC_j4q)q?JTz|5&NNze4XRo4N zC}PPLjrSR^F04*rG!LIy^a|)w3vUW&|}R$U%_b%~B$mBhVH|+DH@%Pt+5U zl^Y&FGIJj3p5sPL7NWBNWNONKh36wo0WB*`xUS?dWCUF@%HTV4;1IewGFN+9T*XQM zgygvFb)iaZN<$z@EdAn9HB4c`6q*^=SG_S`?(YHFFW;|nNl=PUe_|BFyrH#o8MM_f zq=$Te)0DHMzw=C#dx-DczwHM`fpPt$<(nJwq#F0qEWCFFOuf$lWQJ@*V+fmR1}Dim z7-+vU9edVz?Z$7Q*=o>U??1#^^X#&Z+}da&%qbp6stjaJrKwFOT4_W3$og2!G83;q zojr`>?o(u)OL3_*piIwSE6)2o|JL!vgt#X(c}OUg>AAjdht)mkYfAh(Oxu*V6^EQQ?q#uEt z=pMNt+tP0aT%;vO>i2@{su`~vu?cwTQE0b=Lcwg(QGNzAr9W9tvpq^+8)hD5;_dE+ zTUhl=GrE!-+IY=PGiunE4+;`YX+(L24qaV_`bfW${jts#(le=u0iKCzDhvpx)7`$W;v5Z?vgpsYHq}1mW!~ah z?G!JraW;Tj)tqtvtq>1r$N}`_#I`}$#fPB~Uop1~izrT<>vy*LABZxoZNhs_xpj%m z>%UQeLJiJ26c0RhHVBvn)}u}N0LYv`zQW>#4b1s8j-{bHAF?p74<@=Z=r=m~Tt5Fg z!yz$|MWe}I$dJrY{3`~1w31x*wz&&M4VRO(M=w0_XJHyzvl!dB*9b1Pa7MKL{(Q*C zMcGN~G0TnF%Ul^#SJobSSDW6yQ$FOn8ZJ1zsL+vDAy_<(_Y_xTW?cZ_9b2_9|T?44rKP8)LJ5cu{&Fr6TbISrK721;l4UlTalAJghGXR2 z?)}()LNwzN}&Pe_oAG1z+4DMKPnL#kH-BB)|+VFntSXH)tNv^sRK% zmT8t|^cI!5UsY_KtppNp_n!L{#2ggi;9FlD;*D&U0FRae19!*h6qAT7nXqtx2ATD^ zMnMJwGR38lL1Ek~5is$KpukH}rS1ww!cVvTP;HEtJ3gi|4u?|!7F)q4V$h(=x|qw#vuH!YU;3;Gp;{u%6=@7%nq zgUX{}CfbWj_Cd?>@|tyDUC&>oU(QcuS2OdPgz-BIMK?u#Uw`>J-rrYmxO;agv)nW>HI7ag z2Rr5aW~N;8KJwc7{Cvf(nl_qjTi!i$H6#tG`#N?l+7~%CX!^LW-SQro=OStq1?hDs z7pFD5-tz?F7i+tk^=WYdvc873Z}ch#$T1 zOj1_u_T!9nVV*@Ez;K@C{W-D^>ptAj%r94Bs|QeRe&Si&<4NfBC~NNFBV{#q&m_0R zXv_AuU>GP;*YDqQ?AcJCm7K+AzfkRe*RKXY>~W4T#ll4aQnSnxMHa`FW)8$pOo~1s zq7i|@^Ca(YNtf;28ben}e)9QfXM8poQ&J%qpK4m5KGD*7$9`o*2xjS;$ze%u# zMAQhzZ)6W8m`GncyWvbgN^A0PM8&hF@%uX6xJ~CcOBej$?crUbjY1W&+`#8U>zGeJ zAH&(`O`i7wUqa!S)C~}Hjy-)4?^W%Ta?jP1cHUZeqcQ=y`}f;zEK}WE#;ZaNV2b4j zp4c(p8}{hljftm+;uBGPensarAY@Jug>?ABJu|eG&Wx7D2XWIzjYHqDe=Vu^TGtX@ z%FGzj8}f-hHGulzg=ZF`N6vL>C8WNh>^!g6eLzzIuM%L1uPx_B+NBF^OZ!1!u_7$b z)69O5Y)J#KH)sqjP!g7U?-N!1o}Vv&O{Ik!1eAc?t+R=+1~Cb4P$&(7zkLpE_ayDz z+-o5jMG|)OuhMatW|gYlt&A$)oiD}e8(+6z!4n-F zBr1XcX`xzo{kDzvz2c$)fiDh9x3&bAsve}mSx?FbJThPn2?*JL zuV^Se&&gd$Y9vZiS*;PMwarz`xFWC)w&JI-X!e zy>*Kie(-oz-l$jkAtDp|naZ6@;Dl<3(NOEqwCJ>a-m=PV#eztw%?ThlDZQBi z&5)LibQy;!yNbS!Q>_cO#OB$UP|;Fg4A)AVwEe6N_R1N)_8$Cs@eZ*be7>(5a>>M? zPVY!9>7n7Lac|wIiZjDt!UVv5Acr8dshS6*>m73FqFs?{YnN>^C@;C0N=hVFZYDZ> z%Q5*&)e%vcP9TdkPRVBh=f5r@({0fJIpk)Bkzc722TNSB{s*GU5AtXAU&Ewx6AZ|=r2$nq6MWhD6#o7 z^2ADt6k8}84#gZ@rgWo{{bMP>COtP}0!w#eiQf(ej^Kwj(u!}*Xvk!e)}1T(3dmD4 z{~B1r$B~6}C&=4g;vm#?5Giy8o>VrekTZBT0TJ7bP3amVYjZ-ZrN=5raHRiT2_#nJ z^}a+xmBPTE^?gf`7EgPIWspe%EG0M%YwR3NL5r zI|*r@xYDo5&6js}t2Fl=Pebl+ycOnlPpz59=SZ*3f=ce)2b;41dj+VD-G>(9(%svF zNw?9mmiDDASmmwP#YkEY?!s1#stHIk9ST| z9A)4eNLx9ZQQ9sr#@1OtMFRpAZ1S){^!76HD<)H>?NZuTuL&0_IG7YA&V1>(3+lLm z2KbYmyV%@xf-UQS*JYrdMBO2r^ceS4_#R}853+|Dcurco;2#G$Q|`vfOK%dt56Z#& z4ZgKCQFrH;$XKa}UY;IEInpN)iG5Y_iwIc~`p>V*fse=8r z@;~C)I&PW{UhKfDla!UiX>VgALkRLm;gs!r7c4QW=E&aUO;J^WPj%_U`_AVWuTU-CMW#?+OV5Q~3NA~8{Uo^0aA9;m-ndgn z8zFSy+90J!rmemkg|+M0^oy_eLkISwf+VOY=!Q{6ekA-JB{HU@Pb|xcF>{37Q2z)t zN?)Z#)!>SSw^!j9P^L{WA;+?*#CBa9C|+nh@&bT`Q{qLZ~fieJJ>(CT6W?D}~4v`*lU(f^K4jf;^M86B#}M z;E1*TlFg~EjbMvotYqv^?JTJ&=xipDm8YtSDgNuTu_^-8>R5Msauu`nD52Z9g_>&D zEv!FXM50N6uYJyhFrnD)I%|1CMyHmq)Y8(_Ra-u2Omr|?;hLx36|A$q*K8T2-kGX= z&dB`%LXd>MI5pbSw{@c2u_rQ=20e*E%+(StV_xa7lz~W$8Ky3S_@GW^iRJT3xfHHz`VPCI0vA1!h1= zT(o2y;I^En)yMwUK$c3KI=DXucL+6X=I~6$RI^! z%$`7Gt+rn!`E*$cP z<#YZ8nKCy+9}`|L10^9txlBTTW{MbM0s5mascuKvYolVs*oZ|Zd~r7fWW17)5iBPI zFe+ngK4uLU>IhP+X{*0+E?IkX%_P7S91G{N*Jl6TQm+?!8d5^?Z>fNKZ{y;Z-3kHX zrEE#H;K3;&+U|7zO>eOXwJQ7^pk(fE&AOoQaJsgN z+E%={C6D;*+ylXdLXnXgwgk1+bB}IbK&26Bj@XAY%?*rT<&6?y{@xCk31H*^P(5bd zXhSh;ypc#2%*Df3WceY}uaOU< zVQ@fKPaj;<{{%#jnfKd`Fv($Sz#}(~2vLq|85g7&ckIBUMyscQJJeZEVc^(qosIsgUD)n* z%YDFE++Up{k_c{BpGpw~QX1cM^?*N}V(sw^r&c%i=E|L(kbG-^>;}wf6nYKLCsKQ} zSolk3aMs(2e4klw0D;W0{>fOH9_f6}_7wev(o4ieG&Ea3kMr?c(XRVFP?62} zHF^sJB>Nw_u77|0E`QVnjE`{Bz6~I5OBMnva0gLQ#DS7nupUE~*~A!2W_D<)WjW_; z26pIXke&$qm3uDYn+JPSf!69ivAB10?~PatC12&+4$;Qr*o({?h)4pDJv+DAfoz}| z{PX^$9(4a~cR`mXG469eKpt*mEtT9Nj4FFiLn2=hP#nw*V!Hwc@R$@47``Lou;4Ci z2nX?+8Nr%G{~}5rI<&}yhk3msB@t_Ld4CmbWTNBEu*{{Atq#F^f)Vm!>e+XqN@{Buo*Qas`h%^X-8px>YRh)ff-mWoN}pAs9Z zQ+pRO5dZOpF^M`1)(kh%oikyizA3DzAaBejt;L8C;U#iRD*){I_3e|hy`=Wt`0MYz zfJVu_k;nx|M|0eu6rtKorED-W!H49U`LHX*Z`%ZH9E*w4OG*!TxrVuHV2`6w`*XG; zD(qduAdEBv6eo&oitWq-&kd8>i@X&bLC6{j^c&K>Ak~p=$nTvx0)sPXI*o=oNN!yY+ygIsrRiJvJFB(@lU+^o&tc(06czjwihQBY zSN9J1K)?=ujgn0jM zXl$S=(!v8Rf%rnno~;2;RVWgu3!Ls5yULk6_un|i;D(s1h25ljN<1^d62a9L7Ppim z82MB23h%D~j2AW2pw?j|Y{=S5OKQ(Yg&!+G>#8k(7un%RrKsui5>(?4>4pYlP-(mZ zs8yYK;=pf#L%SNN^GLVIq?LTB)J#;rbk00Ro~+|Hf%EsShemispzG3&SAJY4PVpi% z9?N28%3$H6_3RGghM#2MmBDc++KSwf{a)fX>ShOAXu4nq_k@4l;DwOG_!h z(+?BU7wjxl+9YpWip0PX%$%;SXt~=)-qZ*SapGU16I>kgmxKlR7qqF0EgMpgR3n@k zqj-p)v|N*#{7UOYMun~g(clQveZu~uMN5=C zJFIufIul~AI_py<5zNDs8M85SqDl<__90H?(Wf1{_$(1V((bbLe3(4jvUAiQpE-Y2 z{4=@k0ar^334%q*!iwy3#@u%0gdje^TURRa-5CKjvC*n(1l3kXWJ(=Yd9{>u3sA_*;s&TgL`c;vi7qulq4MO9t%FL_|BiAactr4&3R$~)5 zS({b?<9s|ud@=g~@`n?);buGh zb{!a%vi)9ENdg1h8Ujle4&q~Wg3PE&o}_7W4#s*`As$*svL@mUbav)?V1K`(`*L0e z)I@5r9A`Oer7%gU81v13E+VPe=J}0e>-{^7>IRVw3!!h3C;cQ6+c{E;B=Q#GYkAjx zlfy_(G!WDswH!e8x;7agx|}gisl-(GqTR_Sk%O%ga`z~VW)hXk(A6C4a64t}P6XBG zHf>0Wz|bnA<>$DKdI6714J~d{xv@Enn7hTmg|!(IzhXji-Am0*TB0u>^`!Vys>%W+ z(|@)1O*DwMqkG)`KoX43@V;bNKQcE}F(M6f@q}l0TV#NZ+jbdX4n=x&iH~;4IO`^& z>LPIgW%c5;RO7AZEV$XB7|92MF0wip4NE#rb#yS)=HUfWMSd#gaW5IxmAIEV@s%}X z0viy8(Bj(uTEkP}Elgodw#`qr8B$X#=Pq-voL#<3!-?hN)0DR(5N{!!WJ9)pzVf6h z`C+QbG7pccfl&-VN*M?-KwYo2m?Z0z+LNkp$SFgrlyO6?LnsK&8Q-L%cFS@MdAO6J zmIJ4PQ~GNKLN>HBkl;*4NhTFY42JOLM{+rtIS`JV$nUC;v=XE&kq%v8Ip*nTeeAtH zS3H10X951b)`y7flr_rFPCYSXuu{@{gGEAov`!lIF`NW&xkZ)xlY6_HDz6M=i=}>{ zNEWkuLL-@Ef)ZYZ#`~K{k#JwjlH1`7kG#Dsv=%Dg*r}U?E3K=xG0pI4%I!wINMwec z_}5~l_?>jQ;+BCJ_U5?wdx=_%k#xEg2ia9y2kJ+8x>QdytGI53$&jcPRn(tuX|DX* z;Gt_DK&Uc6Ntind`so?wEwLY++`|8srjJza|LNi`qvBY?bphi9cY?dSOK|sKA-D|g z?$)^b5Zv9}-QAr836LNmSRl9@vd_JDXW#nO)9bCSTHmVb)$^mC+hHipq!5UtujiN! z;rX7lMEvcEX>?9uc@XE0I#uFu|UB(oxW^F+}5fAW?^67!MTp{Q_mvNS9}N~%_;g^_AT_X-jlmmK_%ri$ zCDnj?;o6PSGJbgAV5!e7vP+BoKC2t!k%#+;qir_&vQ@>Y_ol_;8Q{(;;Abu@_Cht~>bVyXt zU^nDDI4ZUB?n43H`-*&%g@D5W?jvTH;$SfEN>nCWd4`@hgrxNO`ZMz!(c(LnFR7^L zkO@qonMOYB*ZhH1H(>f&2zX?haL-n3FTQ1~brQ#{_w#&>a!qz6wOE%+;xxQm7 z`<-~n&|I@Jk^dgaOnOADOW>}lN!t-M_<{@(-NZ(Fa~BPzf?x*vltvuY#ZI zDz>ud#m(I}0P?74^S!8L1?Fl-8Tmjh1@mYtyn|Kg?*v~{Ty~skw9$+EFjmKgSD&)4 zh&}h3_`*(qtC_*R@znclj3*L?3mS+Wqj0GBX{mU%*i&^Vx|8aTTaF#=E%m9c zKrB`1qf+vHHXTB@#G$O@T;qu<<=7XJvCtd?W2D$^Zy@cy53B5c0!E(nxoKIk0hv$( zJr~t6X3KLiy{qKk7_b4IBK4I-2S@@{{5Wk;})E6 zn#Sq(V4x}Kx&jeIRr-N)P~4P)obIH+?jC-z$X7=jLq=MJNY9EVOLZl!=7WaHfY+IFJ?OxY^6>REvXlH&GAEy6)I8HTV(x|ArYgq^#LM*77k`wTO61v+?T-z{-5Ig zNiK<{u!=5b_>)aQjkx24Q8g+}%5H}af%B6_CB~W86>q0br59lPsn+4zsf(soXV#IE z5E!E-=`XFuaykE;k@wDW^Zg?$H@%8_*H?nx)*!6NvZ%LSqbY;i3cr4De2fmkD9?#lz!>LWI+{ zc+w{~KwaxIW|%}hMtC1F?AuHI`oODMGtaX#B+;p9JG9DpO!?hPiWz}(Le<~nTM9La zT_f3Hd(J7|c}<6q6o_=$Iz7Rx2OHyLM6nlj+o%zK?hM6m%Av}W+fY2wO`gOa7={4V z5Mw>3tpoh!s)+D#I@N|_ugbbZ^MPIO&JXGSIHX0rOy$;n9zOymv;`>Ck?e9 zqR-=~`3ls^P!vRq!jL^5_K-&8yW<0=B&-M+{lbh;d6->G8=?qM;ydp{Og!bwS;H4^ zbTH{q2~aXhG8^=uM$ zXF&Rk(_zj5G8}|fSX39#vKEs4;VG$_4eOf`@>A9E4(N9w>8mo~L_7GpuPToD)|Ag^aF7;Vf*|&1Fgez^NY{_;&w7tGF(z+8wo|_D| z4nyd?KfQ9bvgtAzS`EIR*g^xg7|nAQCYhw)8N6qIdf*`7?Igz$(_<`jSZGv8Ve&>& zX#HBAnQlZwd@~?sP&mkyVSybMW8hIv#j=<@WL)Z&VC*K!7w(uWz zh!*Gg)wMt+u9imRs=ojckF_1FYB>4O4#e!|ZZl2We#OZhhy0_gw2S9V^q;PRy$I-= zOs-9)RZW)+a*M@xEFUp96ymtdQ&V`29;hiq__Vkz`)KvWmAurS3Xdy|%#6&#x;z5a z#4v(zy<0ZF92%n=S|EEQhc`^M2XpG{k`*3p)_C1kbimd4$ioAaId}#fbQe9^hv6`H zo!ytw2!4L3`1EFo^WH2SGQ2T!x()}+RXL5N<{8lBswtD{-zW%?4awtrHo{=SjdV|Z zG;s2lPZuwu1%4`c!B@dtzb!B`E+!A2@yefM#AAL_{G}Fu@-ol#lCYa9QfskI?+$wE z8?W3HhGt5N5!FvXa2;xNrL0Hxur%;DC{3I!i;zoHDC7r@WDT||sQ`i1!{=3{cc0vr zK=?IRY5zpiNvd!>yhOtJXn6_?5dm?%x-jN`yO zKl4!%+-QCD`$?cW|DJxcB8}W~IXW|KYxx8{i?Xhq)-Q1wTbSe{Cnkz^LF-b{@RhGS z6%ug_=pfy&+2-2>g-S3)Dg6ZHmqOBnqQ|?eG3uI>KkU1m|AgptAyeVVuIC{IzZyg;Fr zBt#3}6>LP%-C&m1qA(oy1ydmX*CYZ~)y4i!-@fcUEqPSqD;-PdcdH=NmPxXM=5EvI z__lgzB(lM2mK9y786tDTb(5I4M(o-|l&F9O{ZPCVAgz%3mG>-;pjm#1+GMi818?-R zf0+%#+`yctFO@yANr06yCc56pbs2mWW3?q0%~(8{^r8C~+*#u>)P|^9sy5sJIld$| z4wNr`AQLP{)Gi4bPv!?I9Dj?_%l&W_I&pZJ&u0iq&Z%x~=PW^G7SNKfpQ8kIEW&yi z%0mL)fSHsMW^{q!zLwfliJQN7DUwCikC7D2CQnKbyZBxCb!g6w3>UF--)=7DrVgxj z!^ZCqcL)dxo;LwB?*5F2mUzh?xQcL!{iAyGyW#e}jSC+l>`ru@FxWb7tq1NPWw#_y z&(e0HCOJHK@R;Zx?x#xLY!x;qz5WLdC|BXc27=d?1?x(z>9M@PRv+s++r4;#7u@cD zHL$}8hm2x}?(J{z&u?nkqFmoi>Oo3b3RjuZIVP$7JTV=WI0{+IYxJCkX&P}I>_Vp- z)u*Agp`=!fb89}xS=97t)3+Fh7!;qpu9OA&d!E%Gbwu*des1(0g-6PFas$l)22$~iPKM7Eb#SKInCO4M{0 z6z|8E;}3YsTW;92co25s?qR^yv( z^Y~lvkvUcR8V;onsh*=GcBJ0@Z6K`h z)-HUsV&hhqI$8$O8fSAb1I`F7}@=-1{5{(Qj?sFNZy8MargDMpzI4N$(XAuuq}k_`p~uzvD5{X!1O4wn-ad44%nEvG~XNcwW0;n0Pc> z{<0NW3_{V8%*P!1W1WSswG~ONF8yw2FGLdVt4U8Tn=r0W@isYEsF>t(OAe!l16K_vUomFs zK^@L8&QqwNxZNNGXe&C_A(m0t9Gu8Y(;rLeq&=*a)rs?y1vqL|-H}Zkm8OeU_a#W| zREggGoD*hwwo1;nl}oH2;((`di-4~k5DOD3);GQZJLn@g6Hh5F5fge z1jZyt+?pPeFQW?uI(b=WI9S|E@=O=pV#(*?DLh0i_q1__CU!WIp2F&u6OilfO6=;? zRJ2nx?E6;FU8G7zX6PS}vos9~@X_e^QcNre!wNZCsCpt~Zq14$gn&L&z2dOghqYoj z%Kc(k6&7=N?)9uM0TW9$fnwZ9ngiM%1$@x&av_hDA98fO=Ba`)lO3 zc3MB@IVucL7#QZ*SlW;hfhAP{7 z5lSFOTdS-xF2L-(bujtIhK9&RZrnf`E&4l>i({mQjt36j@?NSYi^`yhbxvJ+dy~+i z2c_}&t1~)pAi+>xG?AwcBYcum^X83B6#c@T!Ao0Jsfeu~6ATbKm5Z;fO*|8Hd@a_f z>R0?G_%S_ze{dpn>E`$`73)>u%NEuuPytZ$LyM(q*NUX6-;?Idjw+pM+oMK7Bn4rP zR8x4ckh?G$N@Kj9*uxsx7))|X7nVpUjD(wO9C3M;`uy#Z}f#b~=e1%XY4*{0mwxU=5laKppX zL@*5t9bRW0jEY7%aYDGJ!e(Ns{ROPDlBP>?7pljxD}ckK_m;S6)0B)O>STozGg$I$ zIH6L?BlZA542aiga=}=Olud3Ectf*>RMlUsr9mX;3K1w^I;!%BIa)gf=) z&R_m4plLG&bJOp>(`Ae18>7(>-GZ){Y1Hq&&A~7VY_?3wqX{NY)|9wU+lVhda18lk z{#L0N@d3Ue^-U((Pg1Y2Y$o`bmE%W38p?;og_qJLu<6#uL23C_TBN)pv^!6;y)?@mj> zzC#t7!(?dqVrcvO5c@y`IR=F(`P2r({&zc?U+X}w_$nTHvW{TMDFK04JB(oF67A$_c<-3a3iuQURO};7^3NnLBieF|d(7J* z?%96|n?UEA8aKtfNywJ{gkRV>%B(a2N8gld15y`PMOH%M{g<*65nA=2+k`vHod;@xHfK59p71A zl(PtJtJFP8KfU*YF#?Z|9QfQmJOFWG4?Ytc6ovx+FN#0-A8e484SNd;Sh60!y(u~A zn9@0GY?+TMENn0!wId2NbH3u`Mdn~AMw;}0kK<+g$$CKpR23YP6sGGBQXtwQ4Wi&< z2b7gN@yN%DX2e8_0dMw9_-IzXd%-lsnV-fNBWZ6i=pRD;$YqIC7;7qpvw3l}yN85B2f6BK<{187js$NdG+i}HF*~738x`gYY6w}Ja^fnaxyj!V%QKkBn9YS%6_0uX;)FR^9DhJ7+OY5di00@wI zlBq3fQo)h$9*aY_=GY5b-ul3bccxcD%cq$QvvO`31#Wq#)U&rI=t?Fkv}! zb!6IeGMDieNy#c107uTk!H4Ly9|@T+)D}O@bsw9p_%jldmk0D?9|)I^dFG|zn? zKgFhQ#4@!Sc9nQ5m3=8HAqIP3rfqK1VaQHM{&-S!nu+#d*ERPN3=oG+okaiOWJ8F|U1{OFzdJI%p^a*A8;6o(#jGb!&V~1cX<;1K6K#Fkj|r@tTX{ z2IWWFI?&?#ihG{#yX5kU1WXCy4{64-ZCEyKxIVp9xvI&S!+mCzbB^>Wo>39`y(HIK z#pB!-3TX#v8qds>smh~u%2qVe;hQ+Ibu>L_HSk<8`i<5r82fjJ0jngH&?-v$ZrRC- zv7Pu?(T%oO6#(;ms6^wr`C}kna{`^Q%Ih$o!ISVVhCK4)>*W!x7DNPcrfXVwpG+KovO&SMrF1v zLa#=aG*E24K>3O2Vydck|6ZX`BuO`poQ`ebHjsAg#)b)0!y*JNPxH$pt~@4k_heRh z+|FbqKQAu&eq%6aZZR4hVjoG*B z8k3N2N%7gf&clZF2lDxkI!P~j`)V@tdYeK^UC;B|sw+34oGSX&H?U737*zM|-68=f zGytd0uzVIMfQ@sDD0$yLZZHbrm^6Y%RDz;^Hy; z4$%SPW2%>pAaM|niEN7&w5WmoMeFhU>MCe}k!$9Zcj07G4<&k0QgDf8+aDS-osPR# zX$xW2Crg5Z($zV1(XZDI)r^_U@GOX?1zZt}cxv58ME5Yy-hYqHz;$eSpCiG|3K##z zVZjsI0VWZ7nFPN+s*aO;C4F}BdQ4Sl+;5a2Uca?W~Ea1l7)*MaFh$B{}My|^#$_Jq5BwPTBmkl2nc?$ z#&f|BY~V*hbTE&-0ze3h|DR*`h_A=)9c|q#tn695>}>rK6y6W9A&1?3@`fjc(4b7& z%onTDB6ETQcVO9UP_3ONZ{;*W(1;fgKA- zYHC=DM%pJ%J0(0UGg}b6GT2a7T2X$QJEd>}NB%H)V?oXr`jQ>?3JyA?7`6E$J|6DXrMbXx8sE>e*Hxaw9Jed2eJu1@uOM z14W(W5H&>>Aw+qeKReH~+UgqNPq|<-d;2b5OELYAQ2+^r4e|d3bZ~OM1lcQrF84Ql zO!}Jrw}BwQOa;souLiPQ)1XO}(Cb5FU#$wZe-p1)6|ZP1IIm2Q;#EhM!*s9fuYSGp z{0cs>|0gE(Du}$s@L%C%DvDP#S?+J}l=(kV)mItlpD5sg4SrXSO!lgv%Kgnj()}mC zhL%Kz3$`P|2BQ@rlf7~za(}~ftpCXpU?q{UgKb}PuMC~s|FwwzP(=To0{Yt|GE(q) zB>F$uSJ_1FZwZC=KhOL?{AYZGV$wep3Yf8&5Q>@n&z;#+LU4QG|IVm)U#K?zwR8`! zwfS#dG^zeKiv$+o!2BowXEewT3y;m$ax=WzD~$gcO^WtUo}h&CA7(|ggb>Py9;{!& zMfQrT$o(yf{MiBjw(rc~`Vu_g6&I2FTkQC6i1f8sEEZO-Ru=XS&SokK|E`xmp2y$b z#UIb(-}dmQ-~Z7){_ge1!uWT?LO`IA{oCjD>hg6V{eLtD_;(2d)R6<2yc7p)UrGYS so(GOAeJlQFcmKVV|2yrNyubIliUREGQiFJ1=-3d?uh3L${-0m}1No>28~^|S diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index b22456d..d5a857c 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -4,6 +4,7 @@ import java.util.logging.Logger; import org.bukkit.plugin.PluginDescriptionFile; +import alisolarflare.flairdoors.FlairMe; import alisolarflare.flairdoors.PortalListener; import alisolarflare.flairdoors.SetFlairDoorColour; import alisolarflare.links.AliLinkSubPlug; @@ -37,6 +38,7 @@ public class AliPresents extends JavaPlugin{ alilinksubplugin.register(); } public void registerCommands(){ + getCommand("FlairMe").setExecutor(new FlairMe()); getCommand("alishulker").setExecutor(new AliShulker()); getCommand("SetFlairDoorColour").setExecutor(new SetFlairDoorColour()); diff --git a/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java b/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java index 9e6d05b..46407d0 100644 --- a/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java +++ b/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java @@ -3,6 +3,7 @@ package alisolarflare.flairdoors; import alisolarflare.AliPresents; public class FlairDoorsSubPlug{ + @SuppressWarnings("unused") private AliPresents plugin; public FlairDoorsSubPlug(AliPresents plugin){ this.plugin = plugin; @@ -12,7 +13,7 @@ public class FlairDoorsSubPlug{ registerEvents(); } private void registerCommands() { - plugin.getCommand("FlairMe").setExecutor(new FlairMe()); + //plugin.getCommand("FlairMe").setExecutor(new FlairMe()); } private void registerEvents() { // TODO Auto-generated method stub From f08413f64248e7b0a49411d9781db8bc472ad899 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 17 Oct 2016 15:08:53 -0400 Subject: [PATCH 025/263] Updateee??? --- AliPresents.jar | Bin 44290 -> 44477 bytes plugin.yml | 2 +- src/alisolarflare/AliPresents.java | 8 +++--- .../flairdoors/PortalListener.java | 24 +++++++++++------- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/AliPresents.jar b/AliPresents.jar index 723f4ae2a37a9c60a7a87492eb8a91bf3e12d292..569ede2b5e2e208a2055e8001fa7c8c3c94ceffa 100644 GIT binary patch delta 4741 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 N-aBey<-$KX{0H&*;jI7w delta 4559 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 Y=ni052L(~Q`YWc@@e#+B{8Ov{180noHvj+t diff --git a/plugin.yml b/plugin.yml index b27b6cd..30e4a6f 100644 --- a/plugin.yml +++ b/plugin.yml @@ -9,7 +9,7 @@ commands: description: Presses an Ali Link pressalilink frequency setalilink: description: Creates an Ali Link setalilink frequency - setFlairDoorColour: + setflairdoorcolour: description: Sets the flair door colour mode, when lighting portals flairme: description: Activates the Flair Me Command. Ask Ali, she was fucking tired when writing this description \ No newline at end of file diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index d5a857c..35c028a 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -34,13 +34,13 @@ public class AliPresents extends JavaPlugin{ } public void registerSubPlugins(){ - AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this); - alilinksubplugin.register(); + //AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this); + //alilinksubplugin.register(); } public void registerCommands(){ - getCommand("FlairMe").setExecutor(new FlairMe()); + getCommand("flairme").setExecutor(new FlairMe()); getCommand("alishulker").setExecutor(new AliShulker()); - getCommand("SetFlairDoorColour").setExecutor(new SetFlairDoorColour()); + getCommand("setflairdoorcolour").setExecutor(new SetFlairDoorColour()); } } diff --git a/src/alisolarflare/flairdoors/PortalListener.java b/src/alisolarflare/flairdoors/PortalListener.java index bebcc49..1cbc25b 100644 --- a/src/alisolarflare/flairdoors/PortalListener.java +++ b/src/alisolarflare/flairdoors/PortalListener.java @@ -12,7 +12,8 @@ import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityPortalEvent; +import org.bukkit.event.player.PlayerPortalEvent; +import org.bukkit.material.MaterialData; import org.bukkit.material.Wool; import alisolarflare.AliPresents; @@ -29,22 +30,23 @@ public class PortalListener implements Listener{ this.plugin = plugin; } @EventHandler - public void onPortalEnter(EntityPortalEvent event){ + public void onPortalEnter(PlayerPortalEvent event){ //SANITATION - Player - if(!(event.getEntity() instanceof Player)){ + if(!(event.getPlayer() instanceof Player)){ return; } //INIT - Player - Player player = (Player) event.getEntity(); + Player player = event.getPlayer(); + player.sendMessage("MAY THE FLAIRING COMMENCE"); //SANITATION - PlayersToBeFlaired if(!(playersToBeFlaired.contains(player.getName()))){ return; } - player.sendMessage("MAY THE FLAIRING COMMENCE"); + player.sendMessage("-MAY THE FLAIRING COMMENCE-"); player.sendMessage("Deactivating regular portal behaviour..."); - event.setCancelled(true); + event.setTo(player.getLocation()); //INIT - x,y,z int x = player.getLocation().getBlockX(); @@ -69,20 +71,24 @@ public class PortalListener implements Listener{ //TOP BLOCK IS WOOL? }else if(blockTopper.getType() == Material.WOOL){ player.sendMessage("WOOL DETECTED T"); - Wool wool = (Wool) blockTopper; + Wool wool = (Wool) blockTopper.getState().getData(); recolourPlayer(player, wool.getColor()); //MIDDLE BLOCK IS WOOL? }else if(blockMiddle.getType() == Material.WOOL){ player.sendMessage("WOOL DETECTED M"); - Wool wool = (Wool) blockMiddle; + MaterialData mData = blockMiddle.getState().getData(); + player.sendMessage("MATERIAL DATA COLLECTED: "+ mData.toString()); + Wool wool = (Wool) mData; + player.sendMessage("WOOL DATA CONVERTED: "+ wool.toString()); + recolourPlayer(player, wool.getColor()); //BOTTOM BLOCK IS WOOL? }else if (blockBottom.getType() == Material.WOOL){ player.sendMessage("WOOL DETECTED B"); - Wool wool = (Wool) blockBottom; + Wool wool = (Wool) blockBottom.getState().getData(); recolourPlayer(player, wool.getColor()); } From 39ef99d4ee01e5994e3cdfe1a3113e6c359006cb Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 17 Oct 2016 15:23:15 -0400 Subject: [PATCH 026/263] Changed to setCustomName --- .../flairdoors/PortalListener.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/alisolarflare/flairdoors/PortalListener.java b/src/alisolarflare/flairdoors/PortalListener.java index 1cbc25b..eff0aac 100644 --- a/src/alisolarflare/flairdoors/PortalListener.java +++ b/src/alisolarflare/flairdoors/PortalListener.java @@ -95,7 +95,7 @@ public class PortalListener implements Listener{ } public void recolourPlayer(Player player, DyeColor dyecolour){ player.sendMessage("Recolouring Player as..." + dyecolour.toString()); - String name = player.getDisplayName(); + String name = player.getCustomName(); player.sendMessage("name:" + name); for(int i = 0; i < name.length(); i++){ if (name.charAt(i) == '&'){ @@ -108,37 +108,37 @@ public class PortalListener implements Listener{ if(dyecolour == DyeColor.GRAY){ player.sendMessage("Adding GRAY"); - player.setDisplayName("&7" + name); + player.setCustomName("&7" + name); }else if(dyecolour == DyeColor.RED){ player.sendMessage("Adding RED"); - player.setDisplayName("&4" + name); + player.setCustomName("&4" + name); }else if(dyecolour == DyeColor.ORANGE){ player.sendMessage("Adding ORANGE"); - player.setDisplayName("&6" + name); + player.setCustomName("&6" + name); }else if(dyecolour == DyeColor.YELLOW){ player.sendMessage("Adding YELLOW"); - player.setDisplayName("&e" + name); + player.setCustomName("&e" + name); }else if(dyecolour == DyeColor.GREEN){ player.sendMessage("Adding GREEN"); - player.setDisplayName("&a" + name); + player.setCustomName("&a" + name); }else if(dyecolour == DyeColor.BLUE){ player.sendMessage("Adding BLUE"); - player.setDisplayName("&9" + name); + player.setCustomName("&9" + name); }else if(dyecolour == DyeColor.PURPLE){ player.sendMessage("Adding PURPLE"); - player.setDisplayName("&5" + name); + player.setCustomName("&5" + name); }else{ player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); return; } - player.sendMessage("Your name is now: " + player.getDisplayName() +"! Removing you from playersToBeFlaired..."); + player.sendMessage("Your name is now: " + player.getCustomName() +"! Removing you from playersToBeFlaired..."); playersToBeFlaired.remove(player.getName()); } } From dd77078ec0a7ec69d5c0639d5d87b0ddb9c98776 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 21 Oct 2016 15:23:46 -0400 Subject: [PATCH 027/263] Created the Framework for Ghostie Powers --- .../flairdoors/PortalListener.java | 2 +- src/alisolarflare/gpowers/gPowerMemory.java | 81 +++++++++++++++++++ src/alisolarflare/gpowers/gPowerTest.java | 26 ++++++ src/alisolarflare/gpowers/gPowers.java | 5 ++ .../gpowers/listeners/gPowerListener.java | 30 +++++++ .../listeners/gPowerRepeatingTask.java | 6 ++ 6 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 src/alisolarflare/gpowers/gPowerMemory.java create mode 100644 src/alisolarflare/gpowers/gPowerTest.java create mode 100644 src/alisolarflare/gpowers/gPowers.java create mode 100644 src/alisolarflare/gpowers/listeners/gPowerListener.java create mode 100644 src/alisolarflare/gpowers/listeners/gPowerRepeatingTask.java diff --git a/src/alisolarflare/flairdoors/PortalListener.java b/src/alisolarflare/flairdoors/PortalListener.java index eff0aac..9bf9b1e 100644 --- a/src/alisolarflare/flairdoors/PortalListener.java +++ b/src/alisolarflare/flairdoors/PortalListener.java @@ -95,7 +95,7 @@ public class PortalListener implements Listener{ } public void recolourPlayer(Player player, DyeColor dyecolour){ player.sendMessage("Recolouring Player as..." + dyecolour.toString()); - String name = player.getCustomName(); + String name = player.getName(); player.sendMessage("name:" + name); for(int i = 0; i < name.length(); i++){ if (name.charAt(i) == '&'){ diff --git a/src/alisolarflare/gpowers/gPowerMemory.java b/src/alisolarflare/gpowers/gPowerMemory.java new file mode 100644 index 0000000..209b734 --- /dev/null +++ b/src/alisolarflare/gpowers/gPowerMemory.java @@ -0,0 +1,81 @@ +package alisolarflare.gpowers; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.bukkit.entity.Player; + +import alisolarflare.AliPresents; + +public class gPowerMemory { + private AliPresents plugin; + private boolean debugMode = true; + public gPowerMemory(AliPresents plugin){ + this.plugin = plugin; + } + //SHORT TERM MEMORY STORAGE + Map PlayerMap = new HashMap(); + + //POWER ACTIVATION + public void PowerUpPlayer(Player player, String colour){ + if (PlayerMap.containsKey(player.getUniqueId())){ + PlayerMap.get(player.getUniqueId()).playerPowersActivated = true; + }else{ + PlayerMap.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); + } + } + + //POWER DEACTIVATION + public void PowerDownPlayer(Player player){ + if (PlayerMap.containsKey(player.getUniqueId())){ + PlayerMap.get(player.getUniqueId()).playerPowersActivated = false; + }else{ + return; + } + + } + public void PowerDownPlayer(UUID UniqueID){ + if (PlayerMap.containsKey(UniqueID)){ + PlayerMap.get(UniqueID).playerPowersActivated = false; + }else{ + return; + } + } + public boolean isPlayerPowered(UUID UniqueID){ + if (PlayerMap.containsKey(UniqueID)){ + return PlayerMap.get(UniqueID).playerPowersActivated; + }else{ + return false; + } + } + public boolean isPlayerPowered(Player player){ + if (PlayerMap.containsKey(player.getUniqueId())){ + return PlayerMap.get(player.getUniqueId()).playerPowersActivated; + }else{ + return false; + } + } + //MEMORY UNIT + class poweredPlayer{ + public UUID uuid; + public String colour; + public Boolean playerPowersActivated; + + public poweredPlayer(UUID uuid, String colour, Boolean activated){ + this.uuid = (uuid); + this.colour = (colour); + this.playerPowersActivated = (activated); + } + public String toString(){ + return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+playerPowersActivated + "]"; + } + } + @SuppressWarnings({ "deprecation" }) + public void debug(String debugString){ + if (plugin.getServer().getPlayer("alisolarflare").isOnline() && debugMode == true){ + plugin.getServer().getPlayer("alisolarflare").sendMessage("[gPowerTest]:"+debugString); + } + } +} + diff --git a/src/alisolarflare/gpowers/gPowerTest.java b/src/alisolarflare/gpowers/gPowerTest.java new file mode 100644 index 0000000..432c6d4 --- /dev/null +++ b/src/alisolarflare/gpowers/gPowerTest.java @@ -0,0 +1,26 @@ +package alisolarflare.gpowers; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class gPowerTest implements CommandExecutor{ + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + return false; + } + Player player = (Player) sender; + if (!(args.length < 2)){ + player.sendMessage("Proper Usage to test G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + + return false; + } + +} diff --git a/src/alisolarflare/gpowers/gPowers.java b/src/alisolarflare/gpowers/gPowers.java new file mode 100644 index 0000000..6f82784 --- /dev/null +++ b/src/alisolarflare/gpowers/gPowers.java @@ -0,0 +1,5 @@ +package alisolarflare.gpowers; + +public class gPowers { + +} diff --git a/src/alisolarflare/gpowers/listeners/gPowerListener.java b/src/alisolarflare/gpowers/listeners/gPowerListener.java new file mode 100644 index 0000000..714581f --- /dev/null +++ b/src/alisolarflare/gpowers/listeners/gPowerListener.java @@ -0,0 +1,30 @@ +package alisolarflare.gpowers.listeners; + +import org.bukkit.event.Listener; +import org.bukkit.scheduler.BukkitTask; + +import alisolarflare.AliPresents; + +public class gPowerListener implements Listener{ + @SuppressWarnings("unused") + private AliPresents plugin; + public gPowerRepeatingTask powerRepeatingTask; + public BukkitTask bukkitTask; + public gPowerListener(AliPresents plugin){ + this.plugin = plugin; + } + +} +/* + * public class CyclicalDisplayListener implements Listener{ + private final ButtonRebirthPlugin plugin; + public CyclicalDisplayTask cyclicalDisplayTask; + public BukkitTask bukkitTask; + + public CyclicalDisplayListener (ButtonRebirthPlugin initPlugin){ + plugin = initPlugin; + cyclicalDisplayTask = new CyclicalDisplayTask (this.plugin); + bukkitTask = cyclicalDisplayTask.runTaskTimer(this.plugin, 20, 20); + } +} + */ \ No newline at end of file diff --git a/src/alisolarflare/gpowers/listeners/gPowerRepeatingTask.java b/src/alisolarflare/gpowers/listeners/gPowerRepeatingTask.java new file mode 100644 index 0000000..c5ef87d --- /dev/null +++ b/src/alisolarflare/gpowers/listeners/gPowerRepeatingTask.java @@ -0,0 +1,6 @@ +package alisolarflare.gpowers.listeners; + +public class gPowerRepeatingTask { + //REPEATS EVERY 5 SECONDS + +} From a49811f4fd564f20adafba74e6ca59f1ee35f06e Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 21 Oct 2016 21:20:36 -0400 Subject: [PATCH 028/263] Finished Building The Parts --- .../{gPowerTest.java => gPowerCommand.java} | 2 +- src/alisolarflare/gpowers/gPowerMemory.java | 6 ++- .../gpowers/listeners/gPowerApplyingTask.java | 52 +++++++++++++++++++ .../gpowers/listeners/gPowerListener.java | 5 +- .../listeners/gPowerRepeatingTask.java | 6 --- 5 files changed, 60 insertions(+), 11 deletions(-) rename src/alisolarflare/gpowers/{gPowerTest.java => gPowerCommand.java} (92%) create mode 100644 src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java delete mode 100644 src/alisolarflare/gpowers/listeners/gPowerRepeatingTask.java diff --git a/src/alisolarflare/gpowers/gPowerTest.java b/src/alisolarflare/gpowers/gPowerCommand.java similarity index 92% rename from src/alisolarflare/gpowers/gPowerTest.java rename to src/alisolarflare/gpowers/gPowerCommand.java index 432c6d4..fc9ad00 100644 --- a/src/alisolarflare/gpowers/gPowerTest.java +++ b/src/alisolarflare/gpowers/gPowerCommand.java @@ -5,7 +5,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -public class gPowerTest implements CommandExecutor{ +public class gPowerCommand implements CommandExecutor{ @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { diff --git a/src/alisolarflare/gpowers/gPowerMemory.java b/src/alisolarflare/gpowers/gPowerMemory.java index 209b734..7d0ad73 100644 --- a/src/alisolarflare/gpowers/gPowerMemory.java +++ b/src/alisolarflare/gpowers/gPowerMemory.java @@ -15,7 +15,7 @@ public class gPowerMemory { this.plugin = plugin; } //SHORT TERM MEMORY STORAGE - Map PlayerMap = new HashMap(); + public static Map PlayerMap = new HashMap(); //POWER ACTIVATION public void PowerUpPlayer(Player player, String colour){ @@ -57,7 +57,7 @@ public class gPowerMemory { } } //MEMORY UNIT - class poweredPlayer{ + public class poweredPlayer{ public UUID uuid; public String colour; public Boolean playerPowersActivated; @@ -71,6 +71,8 @@ public class gPowerMemory { return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+playerPowersActivated + "]"; } } + + //DEBUG @SuppressWarnings({ "deprecation" }) public void debug(String debugString){ if (plugin.getServer().getPlayer("alisolarflare").isOnline() && debugMode == true){ diff --git a/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java new file mode 100644 index 0000000..e281815 --- /dev/null +++ b/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java @@ -0,0 +1,52 @@ +package alisolarflare.gpowers.listeners; + +import org.bukkit.Color; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +import alisolarflare.AliPresents; +import alisolarflare.gpowers.gPowerMemory; + +public class gPowerApplyingTask extends BukkitRunnable{ + + private AliPresents plugin; + + public gPowerApplyingTask(AliPresents plugin) { + this.plugin = plugin; + } + + //REPEATS EVERY 5 SECONDS + @Override + public void run() { + for (Player player : plugin.getServer().getOnlinePlayers()){ + if(gPowerMemory.PlayerMap.containsKey(player.getUniqueId())){ + activatePower(player, gPowerMemory.PlayerMap.get(player.getUniqueId()).colour); + } + } + } + + private void activatePower(Player player, String colour) { + if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 100, 1, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 100, 1, true, false, Color.GRAY)); + }else if (colour.startsWith("r")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 100, 1, true, false, Color.GRAY)); + }else if (colour.startsWith("o")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 100, 1, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 100, 1, true, false, Color.GRAY)); + }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 100, 1, true, false, Color.GRAY)); + }else if (colour.startsWith("g")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 100, 1, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 100, 1, true, false, Color.GRAY)); + }else if (colour.startsWith("b")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 100, 1, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 100, 1, true, false, Color.GRAY)); + }else if (colour.startsWith("p")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 100, 1, true, false, Color.GRAY)); + } + } + +} diff --git a/src/alisolarflare/gpowers/listeners/gPowerListener.java b/src/alisolarflare/gpowers/listeners/gPowerListener.java index 714581f..63d74ea 100644 --- a/src/alisolarflare/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/gpowers/listeners/gPowerListener.java @@ -6,12 +6,13 @@ import org.bukkit.scheduler.BukkitTask; import alisolarflare.AliPresents; public class gPowerListener implements Listener{ - @SuppressWarnings("unused") private AliPresents plugin; - public gPowerRepeatingTask powerRepeatingTask; + public gPowerApplyingTask powerRepeatingTask; public BukkitTask bukkitTask; public gPowerListener(AliPresents plugin){ this.plugin = plugin; + this.powerRepeatingTask = new gPowerApplyingTask(this.plugin); + bukkitTask = powerRepeatingTask.runTaskTimer(plugin, 5, 5); } } diff --git a/src/alisolarflare/gpowers/listeners/gPowerRepeatingTask.java b/src/alisolarflare/gpowers/listeners/gPowerRepeatingTask.java deleted file mode 100644 index c5ef87d..0000000 --- a/src/alisolarflare/gpowers/listeners/gPowerRepeatingTask.java +++ /dev/null @@ -1,6 +0,0 @@ -package alisolarflare.gpowers.listeners; - -public class gPowerRepeatingTask { - //REPEATS EVERY 5 SECONDS - -} From 587586bd90e759cfe8f72b8094708a49a32fb329 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 21 Oct 2016 21:21:31 -0400 Subject: [PATCH 029/263] HOLY FUCK PEOPLE CAN SEE MY COMMITS --- src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java index e281815..2ca8aca 100644 --- a/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java @@ -11,7 +11,7 @@ import alisolarflare.gpowers.gPowerMemory; public class gPowerApplyingTask extends BukkitRunnable{ - private AliPresents plugin; + private AliPresents plugin;; public gPowerApplyingTask(AliPresents plugin) { this.plugin = plugin; From ede758e2b5c1e443df50c8073d094a967b4e2a57 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 21 Oct 2016 21:38:22 -0400 Subject: [PATCH 030/263] Finished Testing Command --- src/alisolarflare/gpowers/gPowerCommand.java | 29 ++++++++++++++++++- src/alisolarflare/gpowers/gPowerMemory.java | 12 ++++---- .../gpowers/listeners/gPowerApplyingTask.java | 2 +- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/alisolarflare/gpowers/gPowerCommand.java b/src/alisolarflare/gpowers/gPowerCommand.java index fc9ad00..1f4bb5c 100644 --- a/src/alisolarflare/gpowers/gPowerCommand.java +++ b/src/alisolarflare/gpowers/gPowerCommand.java @@ -19,7 +19,34 @@ public class gPowerCommand implements CommandExecutor{ player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); return false; } - + String colour; + if(args[0].startsWith("r") || + args[0].startsWith("o")|| + args[0].startsWith("y")|| + args[0].startsWith("g")|| + args[0].startsWith("b")|| + args[0].startsWith("p")){ + colour = args[0]; + }else{ + player.sendMessage("Proper Usage to test G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + boolean isActive; + if(args[1].startsWith("t")){ + isActive = true; + }else if (args[1].startsWith("f")){ + isActive = false; + }else{ + player.sendMessage("Proper Usage to test G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + if(isActive){ + gPowerMemory.PowerUpPlayer(player, colour); + }else{ + gPowerMemory.PowerDownPlayer(player); + } return false; } diff --git a/src/alisolarflare/gpowers/gPowerMemory.java b/src/alisolarflare/gpowers/gPowerMemory.java index 7d0ad73..63fa6a6 100644 --- a/src/alisolarflare/gpowers/gPowerMemory.java +++ b/src/alisolarflare/gpowers/gPowerMemory.java @@ -18,7 +18,7 @@ public class gPowerMemory { public static Map PlayerMap = new HashMap(); //POWER ACTIVATION - public void PowerUpPlayer(Player player, String colour){ + public static void PowerUpPlayer(Player player, String colour){ if (PlayerMap.containsKey(player.getUniqueId())){ PlayerMap.get(player.getUniqueId()).playerPowersActivated = true; }else{ @@ -27,7 +27,7 @@ public class gPowerMemory { } //POWER DEACTIVATION - public void PowerDownPlayer(Player player){ + public static void PowerDownPlayer(Player player){ if (PlayerMap.containsKey(player.getUniqueId())){ PlayerMap.get(player.getUniqueId()).playerPowersActivated = false; }else{ @@ -35,21 +35,21 @@ public class gPowerMemory { } } - public void PowerDownPlayer(UUID UniqueID){ + public static void PowerDownPlayer(UUID UniqueID){ if (PlayerMap.containsKey(UniqueID)){ PlayerMap.get(UniqueID).playerPowersActivated = false; }else{ return; } } - public boolean isPlayerPowered(UUID UniqueID){ + public static boolean isPlayerPowered(UUID UniqueID){ if (PlayerMap.containsKey(UniqueID)){ return PlayerMap.get(UniqueID).playerPowersActivated; }else{ return false; } } - public boolean isPlayerPowered(Player player){ + public static boolean isPlayerPowered(Player player){ if (PlayerMap.containsKey(player.getUniqueId())){ return PlayerMap.get(player.getUniqueId()).playerPowersActivated; }else{ @@ -57,7 +57,7 @@ public class gPowerMemory { } } //MEMORY UNIT - public class poweredPlayer{ + public static class poweredPlayer{ public UUID uuid; public String colour; public Boolean playerPowersActivated; diff --git a/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java index 2ca8aca..e281815 100644 --- a/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java @@ -11,7 +11,7 @@ import alisolarflare.gpowers.gPowerMemory; public class gPowerApplyingTask extends BukkitRunnable{ - private AliPresents plugin;; + private AliPresents plugin; public gPowerApplyingTask(AliPresents plugin) { this.plugin = plugin; From 488bee580147429fed8da62ff641dbc37fe1b90b Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 21 Oct 2016 21:50:31 -0400 Subject: [PATCH 031/263] Readied Powers for Testing Also added a *shit* ton of comments --- plugin.yml | 4 +++- src/alisolarflare/AliPresents.java | 6 ++++-- src/alisolarflare/gpowers/gPowerCommand.java | 7 +++++-- src/alisolarflare/gpowers/gPowerMemory.java | 13 +++++++++---- src/alisolarflare/gpowers/gPowers.java | 5 ----- .../gpowers/listeners/gPowerListener.java | 6 +++--- 6 files changed, 24 insertions(+), 17 deletions(-) delete mode 100644 src/alisolarflare/gpowers/gPowers.java diff --git a/plugin.yml b/plugin.yml index 30e4a6f..7b785ad 100644 --- a/plugin.yml +++ b/plugin.yml @@ -12,4 +12,6 @@ commands: setflairdoorcolour: description: Sets the flair door colour mode, when lighting portals flairme: - description: Activates the Flair Me Command. Ask Ali, she was fucking tired when writing this description \ No newline at end of file + description: Activates the Flair Me Command. Ask Ali, she was fucking tired when writing this description + gpowercommand: + description: Testing command for ghostie powers \ No newline at end of file diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 35c028a..50b1084 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -7,7 +7,8 @@ import org.bukkit.plugin.PluginDescriptionFile; import alisolarflare.flairdoors.FlairMe; import alisolarflare.flairdoors.PortalListener; import alisolarflare.flairdoors.SetFlairDoorColour; -import alisolarflare.links.AliLinkSubPlug; +import alisolarflare.gpowers.gPowerCommand; +import alisolarflare.gpowers.listeners.gPowerListener; //import alisolarflare.links.AliLinkSubPlug; import org.bukkit.plugin.java.JavaPlugin; @@ -31,13 +32,14 @@ public class AliPresents extends JavaPlugin{ } private void registerEvents() { getServer().getPluginManager().registerEvents(new PortalListener(this), this); - + getServer().getPluginManager().registerEvents(new gPowerListener(this), this); } public void registerSubPlugins(){ //AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this); //alilinksubplugin.register(); } public void registerCommands(){ + getCommand("gPowerCommand").setExecutor(new gPowerCommand()); getCommand("flairme").setExecutor(new FlairMe()); getCommand("alishulker").setExecutor(new AliShulker()); getCommand("setflairdoorcolour").setExecutor(new SetFlairDoorColour()); diff --git a/src/alisolarflare/gpowers/gPowerCommand.java b/src/alisolarflare/gpowers/gPowerCommand.java index 1f4bb5c..d9c3306 100644 --- a/src/alisolarflare/gpowers/gPowerCommand.java +++ b/src/alisolarflare/gpowers/gPowerCommand.java @@ -9,6 +9,7 @@ public class gPowerCommand implements CommandExecutor{ @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + sender.sendMessage("G power activate!"); if (!(sender instanceof Player)){ sender.sendMessage("You must be a player to use this command!"); return false; @@ -20,6 +21,7 @@ public class gPowerCommand implements CommandExecutor{ return false; } String colour; + player.sendMessage("Checking terms..."); if(args[0].startsWith("r") || args[0].startsWith("o")|| args[0].startsWith("y")|| @@ -28,7 +30,7 @@ public class gPowerCommand implements CommandExecutor{ args[0].startsWith("p")){ colour = args[0]; }else{ - player.sendMessage("Proper Usage to test G-Powers:"); + player.sendMessage("Term Fail: COLOUR. Proper Usage to test G-Powers:"); player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); return false; } @@ -38,10 +40,11 @@ public class gPowerCommand implements CommandExecutor{ }else if (args[1].startsWith("f")){ isActive = false; }else{ - player.sendMessage("Proper Usage to test G-Powers:"); + player.sendMessage("Term Fail: ACTIVE. Proper Usage to test G-Powers:"); player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); return false; } + player.sendMessage("Terms Vaild!"); if(isActive){ gPowerMemory.PowerUpPlayer(player, colour); }else{ diff --git a/src/alisolarflare/gpowers/gPowerMemory.java b/src/alisolarflare/gpowers/gPowerMemory.java index 63fa6a6..437d4a4 100644 --- a/src/alisolarflare/gpowers/gPowerMemory.java +++ b/src/alisolarflare/gpowers/gPowerMemory.java @@ -9,16 +9,17 @@ import org.bukkit.entity.Player; import alisolarflare.AliPresents; public class gPowerMemory { - private AliPresents plugin; - private boolean debugMode = true; + private static AliPresents plugin; + private static boolean debugMode = true; public gPowerMemory(AliPresents plugin){ - this.plugin = plugin; + gPowerMemory.plugin = plugin; } //SHORT TERM MEMORY STORAGE public static Map PlayerMap = new HashMap(); //POWER ACTIVATION public static void PowerUpPlayer(Player player, String colour){ + debug("POWERRRED UP"); if (PlayerMap.containsKey(player.getUniqueId())){ PlayerMap.get(player.getUniqueId()).playerPowersActivated = true; }else{ @@ -28,6 +29,7 @@ public class gPowerMemory { //POWER DEACTIVATION public static void PowerDownPlayer(Player player){ + debug("POWERRRED DOWN"); if (PlayerMap.containsKey(player.getUniqueId())){ PlayerMap.get(player.getUniqueId()).playerPowersActivated = false; }else{ @@ -36,6 +38,7 @@ public class gPowerMemory { } public static void PowerDownPlayer(UUID UniqueID){ + debug("POWEERRED DOWN"); if (PlayerMap.containsKey(UniqueID)){ PlayerMap.get(UniqueID).playerPowersActivated = false; }else{ @@ -43,6 +46,7 @@ public class gPowerMemory { } } public static boolean isPlayerPowered(UUID UniqueID){ + debug("IS PLAYER POWERED?"); if (PlayerMap.containsKey(UniqueID)){ return PlayerMap.get(UniqueID).playerPowersActivated; }else{ @@ -50,6 +54,7 @@ public class gPowerMemory { } } public static boolean isPlayerPowered(Player player){ + debug("IS PLAYER POWERED?"); if (PlayerMap.containsKey(player.getUniqueId())){ return PlayerMap.get(player.getUniqueId()).playerPowersActivated; }else{ @@ -74,7 +79,7 @@ public class gPowerMemory { //DEBUG @SuppressWarnings({ "deprecation" }) - public void debug(String debugString){ + public static void debug(String debugString){ if (plugin.getServer().getPlayer("alisolarflare").isOnline() && debugMode == true){ plugin.getServer().getPlayer("alisolarflare").sendMessage("[gPowerTest]:"+debugString); } diff --git a/src/alisolarflare/gpowers/gPowers.java b/src/alisolarflare/gpowers/gPowers.java deleted file mode 100644 index 6f82784..0000000 --- a/src/alisolarflare/gpowers/gPowers.java +++ /dev/null @@ -1,5 +0,0 @@ -package alisolarflare.gpowers; - -public class gPowers { - -} diff --git a/src/alisolarflare/gpowers/listeners/gPowerListener.java b/src/alisolarflare/gpowers/listeners/gPowerListener.java index 63d74ea..94588b4 100644 --- a/src/alisolarflare/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/gpowers/listeners/gPowerListener.java @@ -7,12 +7,12 @@ import alisolarflare.AliPresents; public class gPowerListener implements Listener{ private AliPresents plugin; - public gPowerApplyingTask powerRepeatingTask; + public gPowerApplyingTask powerApplyingTask; public BukkitTask bukkitTask; public gPowerListener(AliPresents plugin){ this.plugin = plugin; - this.powerRepeatingTask = new gPowerApplyingTask(this.plugin); - bukkitTask = powerRepeatingTask.runTaskTimer(plugin, 5, 5); + this.powerApplyingTask = new gPowerApplyingTask(this.plugin); + bukkitTask = powerApplyingTask.runTaskTimer(plugin, 5, 5); } } From 0f4d8d5ee75029165920685ee5d67f9284e0505b Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 21 Oct 2016 21:54:06 -0400 Subject: [PATCH 032/263] Ready Plugin for Testing --- AliPresents.jar | Bin 44477 -> 0 bytes plugin.yml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 AliPresents.jar diff --git a/AliPresents.jar b/AliPresents.jar deleted file mode 100644 index 569ede2b5e2e208a2055e8001fa7c8c3c94ceffa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 44477 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 diff --git a/plugin.yml b/plugin.yml index 7b785ad..48d67e4 100644 --- a/plugin.yml +++ b/plugin.yml @@ -14,4 +14,4 @@ commands: flairme: description: Activates the Flair Me Command. Ask Ali, she was fucking tired when writing this description gpowercommand: - description: Testing command for ghostie powers \ No newline at end of file + description: Testing command for ghostie powers From 5962a486cbb5f6a235ea6a0a98a44f3e4fb8562a Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 21 Oct 2016 21:58:08 -0400 Subject: [PATCH 033/263] small bugfix --- src/alisolarflare/gpowers/gPowerCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alisolarflare/gpowers/gPowerCommand.java b/src/alisolarflare/gpowers/gPowerCommand.java index d9c3306..c49ae63 100644 --- a/src/alisolarflare/gpowers/gPowerCommand.java +++ b/src/alisolarflare/gpowers/gPowerCommand.java @@ -15,7 +15,7 @@ public class gPowerCommand implements CommandExecutor{ return false; } Player player = (Player) sender; - if (!(args.length < 2)){ + if (args.length < 2){ player.sendMessage("Proper Usage to test G-Powers:"); player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); return false; From 09526c382044995d03875630cfdc1f8b6b1cedfa Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 21 Oct 2016 22:26:57 -0400 Subject: [PATCH 034/263] Created Working Behaviour --- src/alisolarflare/AliPresents.java | 2 +- src/alisolarflare/gpowers/gPowerMemory.java | 19 +++++++++++-------- .../gpowers/listeners/gPowerApplyingTask.java | 5 ++++- .../gpowers/listeners/gPowerListener.java | 2 +- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 50b1084..5a89570 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -39,7 +39,7 @@ public class AliPresents extends JavaPlugin{ //alilinksubplugin.register(); } public void registerCommands(){ - getCommand("gPowerCommand").setExecutor(new gPowerCommand()); + getCommand("gpowercommand").setExecutor(new gPowerCommand()); getCommand("flairme").setExecutor(new FlairMe()); getCommand("alishulker").setExecutor(new AliShulker()); getCommand("setflairdoorcolour").setExecutor(new SetFlairDoorColour()); diff --git a/src/alisolarflare/gpowers/gPowerMemory.java b/src/alisolarflare/gpowers/gPowerMemory.java index 437d4a4..61f461d 100644 --- a/src/alisolarflare/gpowers/gPowerMemory.java +++ b/src/alisolarflare/gpowers/gPowerMemory.java @@ -8,8 +8,10 @@ import org.bukkit.entity.Player; import alisolarflare.AliPresents; -public class gPowerMemory { +public class gPowerMemory{ + @SuppressWarnings("unused") private static AliPresents plugin; + @SuppressWarnings("unused") private static boolean debugMode = true; public gPowerMemory(AliPresents plugin){ gPowerMemory.plugin = plugin; @@ -19,7 +21,8 @@ public class gPowerMemory { //POWER ACTIVATION public static void PowerUpPlayer(Player player, String colour){ - debug("POWERRRED UP"); + //debug("POWERRRED UP"); + player.sendMessage("POWERRED UP!"); if (PlayerMap.containsKey(player.getUniqueId())){ PlayerMap.get(player.getUniqueId()).playerPowersActivated = true; }else{ @@ -29,7 +32,7 @@ public class gPowerMemory { //POWER DEACTIVATION public static void PowerDownPlayer(Player player){ - debug("POWERRRED DOWN"); + //debug("POWERRRED DOWN"); if (PlayerMap.containsKey(player.getUniqueId())){ PlayerMap.get(player.getUniqueId()).playerPowersActivated = false; }else{ @@ -38,7 +41,7 @@ public class gPowerMemory { } public static void PowerDownPlayer(UUID UniqueID){ - debug("POWEERRED DOWN"); + //debug("POWEERRED DOWN"); if (PlayerMap.containsKey(UniqueID)){ PlayerMap.get(UniqueID).playerPowersActivated = false; }else{ @@ -46,7 +49,7 @@ public class gPowerMemory { } } public static boolean isPlayerPowered(UUID UniqueID){ - debug("IS PLAYER POWERED?"); + //debug("IS PLAYER POWERED?"); if (PlayerMap.containsKey(UniqueID)){ return PlayerMap.get(UniqueID).playerPowersActivated; }else{ @@ -54,7 +57,7 @@ public class gPowerMemory { } } public static boolean isPlayerPowered(Player player){ - debug("IS PLAYER POWERED?"); + //debug("IS PLAYER POWERED?"); if (PlayerMap.containsKey(player.getUniqueId())){ return PlayerMap.get(player.getUniqueId()).playerPowersActivated; }else{ @@ -77,12 +80,12 @@ public class gPowerMemory { } } - //DEBUG + /*DEBUG @SuppressWarnings({ "deprecation" }) public static void debug(String debugString){ if (plugin.getServer().getPlayer("alisolarflare").isOnline() && debugMode == true){ plugin.getServer().getPlayer("alisolarflare").sendMessage("[gPowerTest]:"+debugString); } - } + }*/ } diff --git a/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java index e281815..381d309 100644 --- a/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java @@ -21,6 +21,8 @@ public class gPowerApplyingTask extends BukkitRunnable{ @Override public void run() { for (Player player : plugin.getServer().getOnlinePlayers()){ + player.sendMessage(player.getUniqueId().toString()); + player.sendMessage(gPowerMemory.PlayerMap.toString()); if(gPowerMemory.PlayerMap.containsKey(player.getUniqueId())){ activatePower(player, gPowerMemory.PlayerMap.get(player.getUniqueId()).colour); } @@ -46,7 +48,8 @@ public class gPowerApplyingTask extends BukkitRunnable{ player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 100, 1, true, false, Color.GRAY)); }else if (colour.startsWith("p")){ player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 100, 1, true, false, Color.GRAY)); - } + }else{ + } } } diff --git a/src/alisolarflare/gpowers/listeners/gPowerListener.java b/src/alisolarflare/gpowers/listeners/gPowerListener.java index 94588b4..c2ea39d 100644 --- a/src/alisolarflare/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/gpowers/listeners/gPowerListener.java @@ -12,7 +12,7 @@ public class gPowerListener implements Listener{ public gPowerListener(AliPresents plugin){ this.plugin = plugin; this.powerApplyingTask = new gPowerApplyingTask(this.plugin); - bukkitTask = powerApplyingTask.runTaskTimer(plugin, 5, 5); + bukkitTask = powerApplyingTask.runTaskTimer(plugin, 100, 100); } } From d4e6b6ad6eb6e8fbaf7e27c19bb7de2922aa07d7 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 21 Oct 2016 22:36:31 -0400 Subject: [PATCH 035/263] Removed Annoying Debug Messages --- src/alisolarflare/gpowers/gPowerMemory.java | 6 +----- src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/alisolarflare/gpowers/gPowerMemory.java b/src/alisolarflare/gpowers/gPowerMemory.java index 61f461d..c121f40 100644 --- a/src/alisolarflare/gpowers/gPowerMemory.java +++ b/src/alisolarflare/gpowers/gPowerMemory.java @@ -23,11 +23,7 @@ public class gPowerMemory{ public static void PowerUpPlayer(Player player, String colour){ //debug("POWERRRED UP"); player.sendMessage("POWERRED UP!"); - if (PlayerMap.containsKey(player.getUniqueId())){ - PlayerMap.get(player.getUniqueId()).playerPowersActivated = true; - }else{ - PlayerMap.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); - } + PlayerMap.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); } //POWER DEACTIVATION diff --git a/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java index 381d309..efe1996 100644 --- a/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java @@ -21,7 +21,6 @@ public class gPowerApplyingTask extends BukkitRunnable{ @Override public void run() { for (Player player : plugin.getServer().getOnlinePlayers()){ - player.sendMessage(player.getUniqueId().toString()); player.sendMessage(gPowerMemory.PlayerMap.toString()); if(gPowerMemory.PlayerMap.containsKey(player.getUniqueId())){ activatePower(player, gPowerMemory.PlayerMap.get(player.getUniqueId()).colour); From ce1c84a8eff53ab5634769116531dea793bac130 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 21 Oct 2016 22:37:05 -0400 Subject: [PATCH 036/263] *ACTUALLY* removed annoying debug messages --- src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java index efe1996..a15c04c 100644 --- a/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java @@ -21,7 +21,6 @@ public class gPowerApplyingTask extends BukkitRunnable{ @Override public void run() { for (Player player : plugin.getServer().getOnlinePlayers()){ - player.sendMessage(gPowerMemory.PlayerMap.toString()); if(gPowerMemory.PlayerMap.containsKey(player.getUniqueId())){ activatePower(player, gPowerMemory.PlayerMap.get(player.getUniqueId()).colour); } From 3d1694b75ceb31a550683946db54fb5e00ae5874 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 21 Oct 2016 22:50:35 -0400 Subject: [PATCH 037/263] General Cleanup and Bugfix --- .../gpowers/listeners/gPowerApplyingTask.java | 26 +++++++++---------- .../gpowers/listeners/gPowerListener.java | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java index a15c04c..d110477 100644 --- a/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java @@ -29,23 +29,23 @@ public class gPowerApplyingTask extends BukkitRunnable{ private void activatePower(Player player, String colour) { if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 100, 1, true, false, Color.GRAY)); - player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 100, 1, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 0, true, false, Color.GRAY)); }else if (colour.startsWith("r")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 100, 1, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0, true, false, Color.RED)); }else if (colour.startsWith("o")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 100, 1, true, false, Color.GRAY)); - player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 100, 1, true, false, Color.GRAY)); - }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 100, 1, true, false, Color.GRAY)); - }else if (colour.startsWith("g")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 100, 1, true, false, Color.GRAY)); - player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 100, 1, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); + player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); + }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.YELLOW)); + }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 200, 1, true, false, Color.GREEN)); + player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 200, 0, true, false, Color.GREEN)); }else if (colour.startsWith("b")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 100, 1, true, false, Color.GRAY)); - player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 100, 1, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1, true, false, Color.BLUE)); + player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 200, 0, true, false, Color.BLUE)); }else if (colour.startsWith("p")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 100, 1, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 0, true, false, Color.PURPLE)); }else{ } } diff --git a/src/alisolarflare/gpowers/listeners/gPowerListener.java b/src/alisolarflare/gpowers/listeners/gPowerListener.java index c2ea39d..c8197e8 100644 --- a/src/alisolarflare/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/gpowers/listeners/gPowerListener.java @@ -12,7 +12,7 @@ public class gPowerListener implements Listener{ public gPowerListener(AliPresents plugin){ this.plugin = plugin; this.powerApplyingTask = new gPowerApplyingTask(this.plugin); - bukkitTask = powerApplyingTask.runTaskTimer(plugin, 100, 100); + bukkitTask = powerApplyingTask.runTaskTimer(plugin, 190, 190); } } From 5b4e0a28e7b7f064473d5f3078694204d877b39a Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 22 Oct 2016 15:25:37 -0400 Subject: [PATCH 038/263] Copied Norbi's gitignore --- .classpath | 8 - .gitignore | 231 +++++++++++++++++- plugin.yml | 4 + src/alisolarflare/AliPresents.java | 4 + .../gpowers/commands/PowerDown.java | 15 ++ .../gpowers/commands/PowerUp.java | 20 ++ src/alisolarflare/gpowers/gPowerMemory.java | 41 ++-- 7 files changed, 291 insertions(+), 32 deletions(-) delete mode 100644 .classpath create mode 100644 src/alisolarflare/gpowers/commands/PowerDown.java create mode 100644 src/alisolarflare/gpowers/commands/PowerUp.java diff --git a/.classpath b/.classpath deleted file mode 100644 index cefbd63..0000000 --- a/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/.gitignore b/.gitignore index f8a6805..77d9874 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,224 @@ -*.class +################# +## Eclipse +################# -# Mobile Tools for Java (J2ME) -.mtj.tmp/ +*.pydevproject +.project +.metadata/ +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath +target/ +.project -# Package Files # -*.war -*.ear +# External tool builders +.externalToolBuilders/ -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* -/bin/ -/target/ +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml +*.publishproj + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +#packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + +############# +## Windows detritus +############# + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac crap +.DS_Store + + +############# +## Python +############# + +*.py[cod] + +# Packages +*.egg +*.egg-info +dist/ +build/ +eggs/ +parts/ +var/ +sdist/ +develop-eggs/ +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg +.metadata/* +TheButtonAutoFlair/out/artifacts/Autoflair/Autoflair.jar +*.iml +*.name +.idea/compiler.xml +*.xml diff --git a/plugin.yml b/plugin.yml index 48d67e4..7b9680d 100644 --- a/plugin.yml +++ b/plugin.yml @@ -15,3 +15,7 @@ commands: description: Activates the Flair Me Command. Ask Ali, she was fucking tired when writing this description gpowercommand: description: Testing command for ghostie powers + powerup: + description: Official g-power command that activates the ghostie powerups + powerdown: + description: Offical g-power command that deactivates the ghostie powerups \ No newline at end of file diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 5a89570..0a34135 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -8,6 +8,8 @@ import alisolarflare.flairdoors.FlairMe; import alisolarflare.flairdoors.PortalListener; import alisolarflare.flairdoors.SetFlairDoorColour; import alisolarflare.gpowers.gPowerCommand; +import alisolarflare.gpowers.commands.PowerDown; +import alisolarflare.gpowers.commands.PowerUp; import alisolarflare.gpowers.listeners.gPowerListener; //import alisolarflare.links.AliLinkSubPlug; @@ -39,6 +41,8 @@ public class AliPresents extends JavaPlugin{ //alilinksubplugin.register(); } public void registerCommands(){ + getCommand("powerup").setExecutor(new PowerUp()); + getCommand("powerdown").setExecutor(new PowerDown()); getCommand("gpowercommand").setExecutor(new gPowerCommand()); getCommand("flairme").setExecutor(new FlairMe()); getCommand("alishulker").setExecutor(new AliShulker()); diff --git a/src/alisolarflare/gpowers/commands/PowerDown.java b/src/alisolarflare/gpowers/commands/PowerDown.java new file mode 100644 index 0000000..e94855e --- /dev/null +++ b/src/alisolarflare/gpowers/commands/PowerDown.java @@ -0,0 +1,15 @@ +package alisolarflare.gpowers.commands; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +public class PowerDown implements CommandExecutor { + + @Override + public boolean onCommand(CommandSender arg0, Command arg1, String arg2, String[] arg3) { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/gpowers/commands/PowerUp.java b/src/alisolarflare/gpowers/commands/PowerUp.java new file mode 100644 index 0000000..a172ce3 --- /dev/null +++ b/src/alisolarflare/gpowers/commands/PowerUp.java @@ -0,0 +1,20 @@ +package alisolarflare.gpowers.commands; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +import alisolarflare.gpowers.gPowerMemory; + +public class PowerUp implements CommandExecutor{ + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + } + gPowerMemory.PowerUpPlayer(player, colour); + return false; + } + +} diff --git a/src/alisolarflare/gpowers/gPowerMemory.java b/src/alisolarflare/gpowers/gPowerMemory.java index c121f40..b6c073d 100644 --- a/src/alisolarflare/gpowers/gPowerMemory.java +++ b/src/alisolarflare/gpowers/gPowerMemory.java @@ -25,12 +25,21 @@ public class gPowerMemory{ player.sendMessage("POWERRED UP!"); PlayerMap.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); } + public static void PowerUpPlayer(Player player){ + //debug("POWERRRED UP"); + player.sendMessage("POWERRED UP!"); + if(PlayerMap.containsKey(player.getUniqueId())){ + PlayerMap.get(player.getUniqueId()).isPowersActive = true; + }else{ + player.sendMessage("You must instantiate your power settings using /gpowercommand"); + } + } //POWER DEACTIVATION public static void PowerDownPlayer(Player player){ //debug("POWERRRED DOWN"); if (PlayerMap.containsKey(player.getUniqueId())){ - PlayerMap.get(player.getUniqueId()).playerPowersActivated = false; + PlayerMap.get(player.getUniqueId()).isPowersActive = false; }else{ return; } @@ -39,7 +48,7 @@ public class gPowerMemory{ public static void PowerDownPlayer(UUID UniqueID){ //debug("POWEERRED DOWN"); if (PlayerMap.containsKey(UniqueID)){ - PlayerMap.get(UniqueID).playerPowersActivated = false; + PlayerMap.get(UniqueID).isPowersActive = false; }else{ return; } @@ -47,7 +56,7 @@ public class gPowerMemory{ public static boolean isPlayerPowered(UUID UniqueID){ //debug("IS PLAYER POWERED?"); if (PlayerMap.containsKey(UniqueID)){ - return PlayerMap.get(UniqueID).playerPowersActivated; + return PlayerMap.get(UniqueID).isPowersActive; }else{ return false; } @@ -55,33 +64,37 @@ public class gPowerMemory{ public static boolean isPlayerPowered(Player player){ //debug("IS PLAYER POWERED?"); if (PlayerMap.containsKey(player.getUniqueId())){ - return PlayerMap.get(player.getUniqueId()).playerPowersActivated; + return PlayerMap.get(player.getUniqueId()).isPowersActive; }else{ return false; } } //MEMORY UNIT public static class poweredPlayer{ - public UUID uuid; + public static UUID uuid; public String colour; - public Boolean playerPowersActivated; + public Boolean isPowersActive; public poweredPlayer(UUID uuid, String colour, Boolean activated){ this.uuid = (uuid); this.colour = (colour); - this.playerPowersActivated = (activated); + this.isPowersActive = (activated); } public String toString(){ - return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+playerPowersActivated + "]"; + return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; } } - /*DEBUG - @SuppressWarnings({ "deprecation" }) - public static void debug(String debugString){ - if (plugin.getServer().getPlayer("alisolarflare").isOnline() && debugMode == true){ - plugin.getServer().getPlayer("alisolarflare").sendMessage("[gPowerTest]:"+debugString); + public void saveMemoryState(){ + Map PlayerMap = new HashMap(); + for (UUID uuidKey:PlayerMap.keySet()){ + + UUID uuidToSave = poweredPlayer.uuid; + } - }*/ + } + public void loadMemoryState(){ + + } } From 895e9d96114a359d4c3395f861453e2c34078433 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 22 Oct 2016 17:47:10 -0400 Subject: [PATCH 039/263] Moved AliArrows into AliPresents --- src/alisolarflare/AliPresents.java | 3 ++ .../aliarrow/AliArrowListener.java | 45 +++++++++++++++++++ .../aliarrow/AliArrowSubPlugin.java | 25 +++++++++++ src/alisolarflare/aliarrow/AliArrowTask.java | 40 +++++++++++++++++ .../gpowers/commands/PowerUp.java | 4 +- src/alisolarflare/gpowers/gPowerMemory.java | 7 +-- 6 files changed, 119 insertions(+), 5 deletions(-) create mode 100644 src/alisolarflare/aliarrow/AliArrowListener.java create mode 100644 src/alisolarflare/aliarrow/AliArrowSubPlugin.java create mode 100644 src/alisolarflare/aliarrow/AliArrowTask.java diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 0a34135..064ae40 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -15,6 +15,7 @@ import alisolarflare.gpowers.listeners.gPowerListener; //import alisolarflare.links.AliLinkSubPlug; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.shulker.AliShulker; +import alisolarflare.aliarrow.AliArrowSubPlugin; public class AliPresents extends JavaPlugin{ public void onEnable(){ @@ -37,6 +38,8 @@ public class AliPresents extends JavaPlugin{ getServer().getPluginManager().registerEvents(new gPowerListener(this), this); } public void registerSubPlugins(){ + AliArrowSubPlugin aliArrowSubPlugin = new AliArrowSubPlugin(this); + aliArrowSubPlugin.register(); //AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this); //alilinksubplugin.register(); } diff --git a/src/alisolarflare/aliarrow/AliArrowListener.java b/src/alisolarflare/aliarrow/AliArrowListener.java new file mode 100644 index 0000000..32a1a6c --- /dev/null +++ b/src/alisolarflare/aliarrow/AliArrowListener.java @@ -0,0 +1,45 @@ +package alisolarflare.aliarrow; + +import org.bukkit.entity.Arrow; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Projectile; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.ProjectileLaunchEvent; + +import alisolarflare.AliPresents; + +public class AliArrowListener implements Listener { + private final AliPresents plugin; + + public AliArrowListener(AliPresents plugin){ + this.plugin = plugin; + } + + @EventHandler + public void onProjectileLaunch(ProjectileLaunchEvent event){ + try{ + if(!(event.getEntity().getType() == EntityType.ARROW)){ + return; + } + Projectile projectile = event.getEntity(); + Arrow arrow = (Arrow) projectile; + if (!(arrow.isCritical())){ + return; + } + if (projectile.getShooter().equals(plugin.getServer().getPlayer("alisolarflare"))){ + AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow,"alisolarflare"); + aliArrowTask.runTaskTimer(plugin, 2, 1); + return; + }else if (projectile.getShooter().equals(plugin.getServer().getPlayer("Zanthr"))){ + AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow,"zanthr"); + aliArrowTask.runTaskTimer(plugin, 2, 1); + return; + } + return; + + }catch(Exception e){ + return; + } + } +} \ No newline at end of file diff --git a/src/alisolarflare/aliarrow/AliArrowSubPlugin.java b/src/alisolarflare/aliarrow/AliArrowSubPlugin.java new file mode 100644 index 0000000..2d88ab4 --- /dev/null +++ b/src/alisolarflare/aliarrow/AliArrowSubPlugin.java @@ -0,0 +1,25 @@ +package alisolarflare.aliarrow; + +import java.util.logging.Level; + +import alisolarflare.AliPresents; + +public class AliArrowSubPlugin { + private AliPresents plugin; + + public AliArrowSubPlugin(AliPresents plugin){ + this.plugin = plugin; + } + public void register(){ + registerEvents(); + registerCommands(); + plugin.getLogger().log(Level.INFO, "Discord Sub Plugin Registered!"); + } + private void registerEvents(){ + plugin.getServer().getPluginManager().registerEvents(new AliArrowListener(plugin), plugin); + + } + private void registerCommands(){ + + } +} diff --git a/src/alisolarflare/aliarrow/AliArrowTask.java b/src/alisolarflare/aliarrow/AliArrowTask.java new file mode 100644 index 0000000..8281039 --- /dev/null +++ b/src/alisolarflare/aliarrow/AliArrowTask.java @@ -0,0 +1,40 @@ +package alisolarflare.aliarrow; + +import org.bukkit.Particle; +import org.bukkit.entity.Arrow; +import org.bukkit.scheduler.BukkitRunnable; + +import alisolarflare.AliPresents; + +public class AliArrowTask extends BukkitRunnable{ + AliPresents plugin; + String name; + Arrow arrow; + + + + public AliArrowTask(AliPresents plugin, Arrow arrow, String name){ + this.name = name; + this.plugin = plugin; + this.arrow = arrow; + } + + @Override + public void run() { + if (arrow.isOnGround() || arrow.isDead()){ + this.cancel(); + } + if (name.equalsIgnoreCase("alisolarflare")){ + arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1); + } + if (name.equalsIgnoreCase("Zanthr")){ + arrow.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, arrow.getLocation(), 1); + arrow.getWorld().spawnParticle(Particle.FLAME, arrow.getLocation(), 1); + + } + + + + } + +} diff --git a/src/alisolarflare/gpowers/commands/PowerUp.java b/src/alisolarflare/gpowers/commands/PowerUp.java index a172ce3..535dd48 100644 --- a/src/alisolarflare/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/gpowers/commands/PowerUp.java @@ -3,8 +3,8 @@ package alisolarflare.gpowers.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; -import alisolarflare.gpowers.gPowerMemory; public class PowerUp implements CommandExecutor{ @@ -13,7 +13,7 @@ public class PowerUp implements CommandExecutor{ if (!(sender instanceof Player)){ sender.sendMessage("You must be a player to use this command!"); } - gPowerMemory.PowerUpPlayer(player, colour); + //gPowerMemory.PowerUpPlayer(player, colour); return false; } diff --git a/src/alisolarflare/gpowers/gPowerMemory.java b/src/alisolarflare/gpowers/gPowerMemory.java index b6c073d..ad8282a 100644 --- a/src/alisolarflare/gpowers/gPowerMemory.java +++ b/src/alisolarflare/gpowers/gPowerMemory.java @@ -75,6 +75,7 @@ public class gPowerMemory{ public String colour; public Boolean isPowersActive; + @SuppressWarnings("static-access") public poweredPlayer(UUID uuid, String colour, Boolean activated){ this.uuid = (uuid); this.colour = (colour); @@ -87,11 +88,11 @@ public class gPowerMemory{ public void saveMemoryState(){ Map PlayerMap = new HashMap(); - for (UUID uuidKey:PlayerMap.keySet()){ + //for (UUID uuidKey:PlayerMap.keySet()){ - UUID uuidToSave = poweredPlayer.uuid; + //UUID uuidToSave = poweredPlayer.uuid; - } + //} } public void loadMemoryState(){ From 848811dbfb9c42c19538da7be54cc7239b888295 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 26 Oct 2016 14:55:07 -0400 Subject: [PATCH 040/263] Started work on the UHC module --- src/alisolarflare/uhc/AddToUHC.java | 35 ++++++++++++++++++++++++ src/alisolarflare/uhc/UHCMemoryUnit.java | 25 +++++++++++++++++ src/alisolarflare/uhc/UHCSubPlugin.java | 27 ++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 src/alisolarflare/uhc/AddToUHC.java create mode 100644 src/alisolarflare/uhc/UHCMemoryUnit.java create mode 100644 src/alisolarflare/uhc/UHCSubPlugin.java diff --git a/src/alisolarflare/uhc/AddToUHC.java b/src/alisolarflare/uhc/AddToUHC.java new file mode 100644 index 0000000..6e0a362 --- /dev/null +++ b/src/alisolarflare/uhc/AddToUHC.java @@ -0,0 +1,35 @@ +package alisolarflare.uhc; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class AddToUHC implements CommandExecutor{ + private UHCMemoryUnit generalMemory; + + public AddToUHC(UHCSubPlugin uhcSubPlugin){ + this.generalMemory = uhcSubPlugin.generalMemory; + } + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + return false; + } + Player player = (Player) sender; + if (player.getName() != "alisolarflare"){ + sender.sendMessage("You must be Ali to use this command, send her a message to change the permissions"); + return false; + } + if (args.length <= 1){ + sender.sendMessage("You must supply at least one playername"); + } + + for (int i = 0; i > args.length; i++){ + //TO BE CONTINUED + } + return false; + } + +} diff --git a/src/alisolarflare/uhc/UHCMemoryUnit.java b/src/alisolarflare/uhc/UHCMemoryUnit.java new file mode 100644 index 0000000..80cdee7 --- /dev/null +++ b/src/alisolarflare/uhc/UHCMemoryUnit.java @@ -0,0 +1,25 @@ +package alisolarflare.uhc; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.entity.Player; + +public class UHCMemoryUnit { + private List matchPlayers = new ArrayList(); + + public void addPlayerToMatch(Player player){ + matchPlayers.add(player); + } + public void removePlayerFromMatch(Player player){ + if (matchPlayers.contains(player)){ + matchPlayers.remove(player); + } + } + public void removeAllPlayersFromMatch(){ + matchPlayers.clear(); + } + public void endMatch(){ + matchPlayers.clear(); + } +} diff --git a/src/alisolarflare/uhc/UHCSubPlugin.java b/src/alisolarflare/uhc/UHCSubPlugin.java new file mode 100644 index 0000000..1116633 --- /dev/null +++ b/src/alisolarflare/uhc/UHCSubPlugin.java @@ -0,0 +1,27 @@ +package alisolarflare.uhc; + +import alisolarflare.AliPresents; + +public class UHCSubPlugin { + public AliPresents plugin; + public UHCMemoryUnit generalMemory; + + public UHCSubPlugin(AliPresents plugin){ + this.plugin = plugin; + } + public void register(){ + registerCommands(); + registerListeners(); + registerMemoryUnits(); + } + private void registerListeners() { + } + private void registerCommands() { + // TODO Auto-generated method stub + plugin.getCommand("addToUHC").setExecutor(new AddToUHC(this)); + } + private void registerMemoryUnits(){ + generalMemory = new UHCMemoryUnit(); + } + +} From 7dfb9a9c72e5270b81c900704ccaae4987b1fa98 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 26 Oct 2016 16:26:57 -0400 Subject: [PATCH 041/263] Yo norbi this is pretty cool --- src/alisolarflare/uhc/AddToUHC.java | 69 ++++++++++++------------ src/alisolarflare/uhc/UHCMemoryUnit.java | 53 +++++++++--------- 2 files changed, 62 insertions(+), 60 deletions(-) diff --git a/src/alisolarflare/uhc/AddToUHC.java b/src/alisolarflare/uhc/AddToUHC.java index 6e0a362..c0ae425 100644 --- a/src/alisolarflare/uhc/AddToUHC.java +++ b/src/alisolarflare/uhc/AddToUHC.java @@ -1,35 +1,34 @@ -package alisolarflare.uhc; - -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -public class AddToUHC implements CommandExecutor{ - private UHCMemoryUnit generalMemory; - - public AddToUHC(UHCSubPlugin uhcSubPlugin){ - this.generalMemory = uhcSubPlugin.generalMemory; - } - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - return false; - } - Player player = (Player) sender; - if (player.getName() != "alisolarflare"){ - sender.sendMessage("You must be Ali to use this command, send her a message to change the permissions"); - return false; - } - if (args.length <= 1){ - sender.sendMessage("You must supply at least one playername"); - } - - for (int i = 0; i > args.length; i++){ - //TO BE CONTINUED - } - return false; - } - -} +package alisolarflare.uhc; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class AddToUHC implements CommandExecutor{ + private UHCMemoryUnit generalMemory; + + public AddToUHC(UHCSubPlugin uhcSubPlugin){ + this.generalMemory = uhcSubPlugin.generalMemory; + } + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + return false; + } + Player player = (Player) sender; + if (player.getName() != "alisolarflare"){ + sender.sendMessage("You must be Ali to use this command, send her a message to change the permissions"); + return false; + } + if (args.length <= 1){ + sender.sendMessage("You must supply at least one playername"); + } + for (int i = 0; i > args.length; i++){ + generalMemory.addPlayerToMatch(player); + } + return false; + } + +} diff --git a/src/alisolarflare/uhc/UHCMemoryUnit.java b/src/alisolarflare/uhc/UHCMemoryUnit.java index 80cdee7..24a1e62 100644 --- a/src/alisolarflare/uhc/UHCMemoryUnit.java +++ b/src/alisolarflare/uhc/UHCMemoryUnit.java @@ -1,25 +1,28 @@ -package alisolarflare.uhc; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.entity.Player; - -public class UHCMemoryUnit { - private List matchPlayers = new ArrayList(); - - public void addPlayerToMatch(Player player){ - matchPlayers.add(player); - } - public void removePlayerFromMatch(Player player){ - if (matchPlayers.contains(player)){ - matchPlayers.remove(player); - } - } - public void removeAllPlayersFromMatch(){ - matchPlayers.clear(); - } - public void endMatch(){ - matchPlayers.clear(); - } -} +package alisolarflare.uhc; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.entity.Player; + +public class UHCMemoryUnit { + private List matchPlayerUsernames = new ArrayList(); + + public void addPlayerToMatch(String playername){ + matchPlayerUsernames.add(playername); + } + public void addPlayerToMatch(Player player){ + matchPlayerUsernames.add(player.toString()); + } + public void removePlayerFromMatch(Player player){ + if (matchPlayerUsernames.contains(player)){ + matchPlayerUsernames.remove(player.toString()); + } + } + public void removeAllPlayersFromMatch(){ + matchPlayerUsernames.clear(); + } + public void endMatch(){ + matchPlayerUsernames.clear(); + } +} From 8e0908cd68db332736356cda4d4d08ec88b85675 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 30 Oct 2016 00:45:29 -0400 Subject: [PATCH 042/263] Started commenting my code so I can start work on a javadoc --- src/alisolarflare/uhc/{UHCMemoryUnit.java => UHCMatch.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/alisolarflare/uhc/{UHCMemoryUnit.java => UHCMatch.java} (100%) diff --git a/src/alisolarflare/uhc/UHCMemoryUnit.java b/src/alisolarflare/uhc/UHCMatch.java similarity index 100% rename from src/alisolarflare/uhc/UHCMemoryUnit.java rename to src/alisolarflare/uhc/UHCMatch.java From 43beadfcc185d3e36c18b6a85071d2a0ac5c31ea Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 30 Oct 2016 00:46:14 -0400 Subject: [PATCH 043/263] Started commenting my code so that I can work on a javadoc --- src/alisolarflare/uhc/AddToUHC.java | 28 +++++++++++-- src/alisolarflare/uhc/UHCMatch.java | 7 +++- src/alisolarflare/uhc/UHCSubPlugin.java | 54 ++++++++++++------------- 3 files changed, 58 insertions(+), 31 deletions(-) diff --git a/src/alisolarflare/uhc/AddToUHC.java b/src/alisolarflare/uhc/AddToUHC.java index c0ae425..b084d4b 100644 --- a/src/alisolarflare/uhc/AddToUHC.java +++ b/src/alisolarflare/uhc/AddToUHC.java @@ -5,14 +5,34 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +/** + * This class handles the specific command /addToUHC which, in-game, + * adds a player to a specific UltraHardcore match, that is defined + * by the constructor: {@linkplain #AddToUHC(UHCMatch)} + * @author Alisolarflare + */ public class AddToUHC implements CommandExecutor{ - private UHCMemoryUnit generalMemory; + private UHCMatch generalMemory; - public AddToUHC(UHCSubPlugin uhcSubPlugin){ - this.generalMemory = uhcSubPlugin.generalMemory; + + /** + * Constructor for this AddToUHC + * @param generalMemory The Memory Unit for the current match + */ + public AddToUHC(UHCMatch generalMemory){ + this.generalMemory = generalMemory; } + + /** + * Activated function when /addtoUHC <> is typed in-game + * @param sender CommandSender which sent the command /addToUHC + * @param command Command object created when /addToUHC is called in-game + * @param label Name of the command called + * @param args Arguments passed onto /addToUHC by the player + */ @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + //INPUT SANITATION if (!(sender instanceof Player)){ sender.sendMessage("You must be a player to use this command!"); return false; @@ -25,6 +45,8 @@ public class AddToUHC implements CommandExecutor{ if (args.length <= 1){ sender.sendMessage("You must supply at least one playername"); } + + //Adds players to memory for (int i = 0; i > args.length; i++){ generalMemory.addPlayerToMatch(player); } diff --git a/src/alisolarflare/uhc/UHCMatch.java b/src/alisolarflare/uhc/UHCMatch.java index 24a1e62..3eff51d 100644 --- a/src/alisolarflare/uhc/UHCMatch.java +++ b/src/alisolarflare/uhc/UHCMatch.java @@ -5,7 +5,12 @@ import java.util.List; import org.bukkit.entity.Player; -public class UHCMemoryUnit { +/** + * Class that contains the data for a single UltraHardcore Match, + * which represents a single game. + * @author Alisolarflare + */ +public class UHCMatch { private List matchPlayerUsernames = new ArrayList(); public void addPlayerToMatch(String playername){ diff --git a/src/alisolarflare/uhc/UHCSubPlugin.java b/src/alisolarflare/uhc/UHCSubPlugin.java index 1116633..3841da1 100644 --- a/src/alisolarflare/uhc/UHCSubPlugin.java +++ b/src/alisolarflare/uhc/UHCSubPlugin.java @@ -1,27 +1,27 @@ -package alisolarflare.uhc; - -import alisolarflare.AliPresents; - -public class UHCSubPlugin { - public AliPresents plugin; - public UHCMemoryUnit generalMemory; - - public UHCSubPlugin(AliPresents plugin){ - this.plugin = plugin; - } - public void register(){ - registerCommands(); - registerListeners(); - registerMemoryUnits(); - } - private void registerListeners() { - } - private void registerCommands() { - // TODO Auto-generated method stub - plugin.getCommand("addToUHC").setExecutor(new AddToUHC(this)); - } - private void registerMemoryUnits(){ - generalMemory = new UHCMemoryUnit(); - } - -} +package alisolarflare.uhc; + +import alisolarflare.AliPresents; + +public class UHCSubPlugin { + public AliPresents plugin; + public UHCMatch generalMemory; + + public UHCSubPlugin(AliPresents plugin){ + this.plugin = plugin; + } + public void register(){ + registerCommands(); + registerListeners(); + registerMemoryUnits(); + } + private void registerListeners() { + } + private void registerCommands() { + // TODO Auto-generated method stub + plugin.getCommand("addToUHC").setExecutor(new AddToUHC(this.generalMemory)); + } + private void registerMemoryUnits(){ + generalMemory = new UHCMatch(); + } + +} From dccf0a772e029b9ce28187c70b2b8bc454fc52c1 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 30 Oct 2016 01:26:32 -0400 Subject: [PATCH 044/263] Oh god this code is horrible, commented more --- src/alisolarflare/links/AliLinkSubPlug.java | 68 +++--- .../links/commands/PressAliLink.java | 70 ++++--- .../links/commands/SetAliLink.java | 195 +++++++++++------- src/alisolarflare/shulker/AliShulker.java | 86 ++++---- src/alisolarflare/uhc/UHCMatch.java | 39 +++- 5 files changed, 270 insertions(+), 188 deletions(-) diff --git a/src/alisolarflare/links/AliLinkSubPlug.java b/src/alisolarflare/links/AliLinkSubPlug.java index 08be881..f5e2843 100644 --- a/src/alisolarflare/links/AliLinkSubPlug.java +++ b/src/alisolarflare/links/AliLinkSubPlug.java @@ -1,36 +1,32 @@ -package alisolarflare.links; -import java.util.ArrayList; -import java.util.List; - -import alisolarflare.AliPresents; -import alisolarflare.links.commands.PressAliLink; -import alisolarflare.links.commands.SetAliLink; -import alisolarflare.links.entities.Link; - -public class AliLinkSubPlug{ - public List linkList = new ArrayList(); - public AliPresents plugin; - - @SuppressWarnings("unchecked") - public AliLinkSubPlug(AliPresents plugin){ - this.plugin = plugin; - linkList = (List) plugin.getConfig().getList("aliLinkList"); - if(linkList == null || linkList.isEmpty()){ - linkList = new ArrayList(); - } - - } - public void register(){ - plugin.getCommand("pressalilink").setExecutor(new PressAliLink(this)); - plugin.getCommand("setalilink").setExecutor(new SetAliLink(this)); - - } - public void saveLinkList(){ - plugin.getConfig().set("aliLinkList", linkList); - } - @SuppressWarnings("unchecked") - public List loadLinkList(){ - return (List) plugin.getConfig().getList("aliLinkList"); - } - -} +package alisolarflare.links; +import java.util.List; + +import alisolarflare.AliPresents; +import alisolarflare.links.commands.PressAliLink; +import alisolarflare.links.commands.SetAliLink; +import alisolarflare.links.entities.Link; + +public class AliLinkSubPlug{ + public AliPresents plugin; + private SetAliLink setAliLink; + + public AliLinkSubPlug(AliPresents plugin){ + this.plugin = plugin; + + + } + public void register(){ + setAliLink = new SetAliLink(this.plugin); + plugin.getCommand("setalilink").setExecutor(setAliLink); + plugin.getCommand("pressalilink").setExecutor(new PressAliLink(this, setAliLink)); + + } + public void saveLinkList(){ + plugin.getConfig().set("aliLinkList", setAliLink.linkList); + } + @SuppressWarnings("unchecked") + public List loadLinkList(){ + return (List) plugin.getConfig().getList("aliLinkList"); + } + +} diff --git a/src/alisolarflare/links/commands/PressAliLink.java b/src/alisolarflare/links/commands/PressAliLink.java index ba39b6e..de76443 100644 --- a/src/alisolarflare/links/commands/PressAliLink.java +++ b/src/alisolarflare/links/commands/PressAliLink.java @@ -1,34 +1,36 @@ -package alisolarflare.links.commands; - -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; - -import alisolarflare.links.AliLinkSubPlug; -import alisolarflare.links.entities.Link; - -public class PressAliLink implements CommandExecutor{ - private AliLinkSubPlug subplugin; - public PressAliLink(AliLinkSubPlug subplugin){ - this.subplugin = subplugin; - } - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - - subplugin.plugin.getServer().broadcastMessage(subplugin.linkList.toString() + "over."); - - if (args.length < 1){ - sender.sendMessage("You must specify a link frequency"); - sender.sendMessage("/pressalilink [frequency]"); - } - for (Link link: subplugin.linkList){ - for (String inputlink: args){ - if(inputlink.equals(link.frequency)){ - link.press(subplugin); - } - } - } - return false; - } - -} +package alisolarflare.links.commands; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +import alisolarflare.links.AliLinkSubPlug; +import alisolarflare.links.entities.Link; + +public class PressAliLink implements CommandExecutor{ + private AliLinkSubPlug subplugin; + private SetAliLink setAliLink; + public PressAliLink(AliLinkSubPlug subplugin, SetAliLink setAliLink){ + this.subplugin = subplugin; + this.setAliLink = setAliLink; + } + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + + subplugin.plugin.getServer().broadcastMessage(setAliLink.linkList.toString() + "over."); + + if (args.length < 1){ + sender.sendMessage("You must specify a link frequency"); + sender.sendMessage("/pressalilink [frequency]"); + } + for (Link link: setAliLink.linkList){ + for (String inputlink: args){ + if(inputlink.equals(link.frequency)){ + link.press(subplugin); + } + } + } + return false; + } + +} diff --git a/src/alisolarflare/links/commands/SetAliLink.java b/src/alisolarflare/links/commands/SetAliLink.java index 1df6d82..5fd5fa7 100644 --- a/src/alisolarflare/links/commands/SetAliLink.java +++ b/src/alisolarflare/links/commands/SetAliLink.java @@ -1,71 +1,124 @@ -package alisolarflare.links.commands; - - -import org.apache.commons.lang3.StringUtils; -import org.bukkit.Location; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.links.AliLinkSubPlug; -import alisolarflare.links.entities.Link; - -public class SetAliLink implements CommandExecutor{ - AliLinkSubPlug subplugin; - public SetAliLink(AliLinkSubPlug plugin){ - this.subplugin = plugin; - } - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - sender.sendMessage("you pressed shit"); - if (args == null || args.length < 1){ - sender.sendMessage("You must specify a link frequency"); - sender.sendMessage("/pressalilink [name]"); - return false; - } - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - } - Player player = (Player) sender; - if (args.length < 4){ - player.sendMessage("short"); - subplugin.linkList.add(new Link(args[0], player.getLocation())); - save(player); - player.sendMessage("end"); - return false; - } - if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) && StringUtils.isNumericSpace(args[3])){ - player.sendMessage("CUUUSTOM"); - subplugin.linkList.add(new Link(args[0],new Location(player.getWorld(), Double.parseDouble(args[1]), Double.parseDouble(args[2]), Double.parseDouble(args[3])))); - save(player); - player.sendMessage("FINISHED"); - }else{ - player.sendMessage("UNCUSTOOM"); - subplugin.linkList.add(new Link(args[0], player.getLocation())); - save(player); - player.sendMessage("UNFINISHED"); - return false; - } - return false; - } - private void save(Player player){ - player.sendMessage("SAAAVING"); - player.sendMessage("SAVE FAILED: TELL ALI TO FIX THE SAVE AND UN-COMMENT THE PARAGRAPH SHE COMMENTED"); - player.sendMessage("Link will only last until next server restart"); - return; - /* - subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); - try { - player.sendMessage("SAVIN"); - subplugin.plugin.saveConfig(); - player.sendMessage("GOOD SAVE"); - } catch (Exception e) { - player.sendMessage("YOU FUCKED STUFF UP"); - // TODO Auto-generated catch block - e.printStackTrace(); - } - */ - } - -} +package alisolarflare.links.commands; + + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.bukkit.Location; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.AliPresents; +import alisolarflare.links.AliLinkSubPlug; +import alisolarflare.links.entities.Link; + +/** + * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, + * a location in a world that when called on by {@link Class#PressAliLink}, creates a temporary redstone block, + * enabling wireless redstone + * + * @see Class#PressAliLink + * @author Alisolarflare + * + */ +public class SetAliLink implements CommandExecutor{ + public List linkList = new ArrayList(); + AliLinkSubPlug subplugin; + private AliPresents plugin; + + /** + * Constructs the SetAliLink class + * @param plugin The plugin that contains the configuration file of AliPresents + */ + public SetAliLink(AliPresents plugin){ + this.plugin = plugin; + load(); + } + /** + * This command creates an Ali-Link which, when activated by the command /PressAliLink, + * creates a temporary redstone block if and only if /PressAliLink [frequency] matches the frequency + * saved when /SetAliLink [frequency] is called. + * + * @see Class#PressAliLink + * @param sender Player who sent the command + * @param command Command Object created + * @param label Name of the command + * @param args Arguments: [frequency] [x-coordinate] [y-coordinate] [z-coordinate], where the coordinates point + * to the intended location of the Ali-Link + */ + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + sender.sendMessage("you pressed shit"); + if (args == null || args.length < 1){ + sender.sendMessage("You must specify a link frequency"); + sender.sendMessage("/pressalilink [name]"); + return false; + } + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + } + Player player = (Player) sender; + if (args.length < 4){ + player.sendMessage("short"); + linkList.add(new Link(args[0], player.getLocation())); + save(player); + player.sendMessage("end"); + return false; + } + if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) && StringUtils.isNumericSpace(args[3])){ + player.sendMessage("CUUUSTOM"); + linkList.add(new Link(args[0],new Location(player.getWorld(), Double.parseDouble(args[1]), Double.parseDouble(args[2]), Double.parseDouble(args[3])))); + save(player); + player.sendMessage("FINISHED"); + }else{ + player.sendMessage("UNCUSTOOM"); + linkList.add(new Link(args[0], player.getLocation())); + save(player); + player.sendMessage("UNFINISHED"); + return false; + } + return false; + } + /** + * Tries to save the entire SetAliLink class into memory, which includes + * all of the current Ali-links saved and in use. + * @param player + */ + private void save(Player player){ + player.sendMessage("SAAAVING"); + player.sendMessage("SAVE FAILED: TELL ALI TO FIX THE SAVE AND UN-COMMENT THE PARAGRAPH SHE COMMENTED"); + player.sendMessage("Link will only last until next server restart"); + return; + /* + subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); + try { + player.sendMessage("SAVIN"); + subplugin.plugin.saveConfig(); + player.sendMessage("GOOD SAVE"); + } catch (Exception e) { + player.sendMessage("YOU FUCKED STUFF UP"); + // TODO Auto-generated catch block + e.printStackTrace(); + } + */ + } + /** + * Attempts to load the previous saved state of AliLinks, from the plugin + * configuration file + */ + @SuppressWarnings("unchecked") + private void load(){ + try{ + linkList = (List) plugin.getConfig().getList("aliLinkList"); + if(linkList == null || linkList.isEmpty()){ + linkList = new ArrayList(); + } + }catch (Exception e){ + e.printStackTrace(); + } + } + +} diff --git a/src/alisolarflare/shulker/AliShulker.java b/src/alisolarflare/shulker/AliShulker.java index 5e8ee83..6f503a9 100644 --- a/src/alisolarflare/shulker/AliShulker.java +++ b/src/alisolarflare/shulker/AliShulker.java @@ -1,39 +1,47 @@ -package alisolarflare.shulker; - -import org.bukkit.Location; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Entity; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import org.bukkit.entity.Shulker; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; - -public class AliShulker implements CommandExecutor { - - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - return false; - } - Player player = (Player) sender; - if(!(player.getName().equals("iie"))){ - return false; - } - Location location = player.getLocation(); - Entity entity = player.getWorld().spawnEntity(location, EntityType.SHULKER); - Shulker shulker = (Shulker) entity; - shulker.setHealth(10); - - shulker.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 1728000, 5, false)); - shulker.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 1728000, 5, false)); - shulker.setAI(false); - shulker.setGlowing(true); - - return false; - } - -} +package alisolarflare.shulker; + +import org.bukkit.Location; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.entity.Shulker; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +/** + * @author Alisolarflare + * This class is responsible for the command /aliShulker, which in-game spawns + * a shulker that: + * Has a health of 10 + * Has a wither and invisibility effect present + * Has noAI + * And is Glowing + */ +public class AliShulker implements CommandExecutor { + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + return false; + } + Player player = (Player) sender; + if(!(player.getName().equals("iie") || player.getName().equals("alisolarflare"))){ + return false; + } + Location location = player.getLocation(); + Entity entity = player.getWorld().spawnEntity(location, EntityType.SHULKER); + Shulker shulker = (Shulker) entity; + shulker.setHealth(10); + + shulker.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 1728000, 5, false)); + shulker.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 1728000, 5, false)); + shulker.setAI(false); + shulker.setGlowing(true); + + return false; + } + +} diff --git a/src/alisolarflare/uhc/UHCMatch.java b/src/alisolarflare/uhc/UHCMatch.java index 3eff51d..f4e6ccc 100644 --- a/src/alisolarflare/uhc/UHCMatch.java +++ b/src/alisolarflare/uhc/UHCMatch.java @@ -13,20 +13,43 @@ import org.bukkit.entity.Player; public class UHCMatch { private List matchPlayerUsernames = new ArrayList(); + /** + * Adds a player to an Ultrahardcore match, storing their name + * @param playername player.getName(); + */ public void addPlayerToMatch(String playername){ - matchPlayerUsernames.add(playername); - } - public void addPlayerToMatch(Player player){ - matchPlayerUsernames.add(player.toString()); - } - public void removePlayerFromMatch(Player player){ - if (matchPlayerUsernames.contains(player)){ - matchPlayerUsernames.remove(player.toString()); + if (!(matchPlayerUsernames.contains(playername))){ + matchPlayerUsernames.add(playername); } } + /** + * Adds a player to an Ultrahardcore match, storing their name + * @param player Player to be added + */ + public void addPlayerToMatch(Player player){ + if (!(matchPlayerUsernames.contains(player.getName()))){ + matchPlayerUsernames.add(player.getName()); + } + } + /** + * Removes a player from an Ultrahardcore match, removing their username from the list + * @param player + */ + public void removePlayerFromMatch(Player player){ + if (matchPlayerUsernames.contains(player)){ + matchPlayerUsernames.remove(player.getName()); + } + } + + /** + * Removes all players from the match + */ public void removeAllPlayersFromMatch(){ matchPlayerUsernames.clear(); } + /** + * Fully de-loads and clears out this match, reverting all values to the initialized setting + */ public void endMatch(){ matchPlayerUsernames.clear(); } From e10a5fea0fcbb0bb4f6f84aeaa7d957a3a80b4ba Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 31 Oct 2016 00:12:03 -0400 Subject: [PATCH 045/263] Organized spagetthi projects, trying to put method to this madness --- src/alisolarflare/{ => events}/uhc/AddToUHC.java | 0 src/alisolarflare/{ => events}/uhc/UHCMatch.java | 0 .../{uhc/UHCSubPlugin.java => events/uhc/UHCModule.java} | 0 src/alisolarflare/{ => magictrick}/aliarrow/AliArrowListener.java | 0 .../{ => magictrick}/aliarrow/AliArrowSubPlugin.java | 0 src/alisolarflare/{ => magictrick}/aliarrow/AliArrowTask.java | 0 src/alisolarflare/{ => tools}/flairdoors/FlairDoorsSubPlug.java | 0 src/alisolarflare/{ => tools}/flairdoors/FlairMe.java | 0 src/alisolarflare/{ => tools}/flairdoors/PortalListener.java | 0 src/alisolarflare/{ => tools}/flairdoors/SetFlairDoorColour.java | 0 src/alisolarflare/{ => tools}/gpowers/commands/PowerDown.java | 0 src/alisolarflare/{ => tools}/gpowers/commands/PowerUp.java | 0 src/alisolarflare/{ => tools}/gpowers/gPowerCommand.java | 0 src/alisolarflare/{ => tools}/gpowers/gPowerMemory.java | 0 .../{ => tools}/gpowers/listeners/gPowerApplyingTask.java | 0 .../{ => tools}/gpowers/listeners/gPowerListener.java | 0 src/alisolarflare/{ => tools}/links/AliLinkSubPlug.java | 0 src/alisolarflare/{ => tools}/links/commands/PressAliLink.java | 0 src/alisolarflare/{ => tools}/links/commands/SetAliLink.java | 0 src/alisolarflare/{ => tools}/links/entities/Link.java | 0 src/alisolarflare/{ => tools}/links/serializer/Deserializer.java | 0 src/alisolarflare/{ => tools}/links/serializer/Serializer.java | 0 src/alisolarflare/{ => tools}/links/tasks/UnpressTask.java | 0 src/alisolarflare/{ => tools}/shulker/AliShulker.java | 0 24 files changed, 0 insertions(+), 0 deletions(-) rename src/alisolarflare/{ => events}/uhc/AddToUHC.java (100%) rename src/alisolarflare/{ => events}/uhc/UHCMatch.java (100%) rename src/alisolarflare/{uhc/UHCSubPlugin.java => events/uhc/UHCModule.java} (100%) rename src/alisolarflare/{ => magictrick}/aliarrow/AliArrowListener.java (100%) rename src/alisolarflare/{ => magictrick}/aliarrow/AliArrowSubPlugin.java (100%) rename src/alisolarflare/{ => magictrick}/aliarrow/AliArrowTask.java (100%) rename src/alisolarflare/{ => tools}/flairdoors/FlairDoorsSubPlug.java (100%) rename src/alisolarflare/{ => tools}/flairdoors/FlairMe.java (100%) rename src/alisolarflare/{ => tools}/flairdoors/PortalListener.java (100%) rename src/alisolarflare/{ => tools}/flairdoors/SetFlairDoorColour.java (100%) rename src/alisolarflare/{ => tools}/gpowers/commands/PowerDown.java (100%) rename src/alisolarflare/{ => tools}/gpowers/commands/PowerUp.java (100%) rename src/alisolarflare/{ => tools}/gpowers/gPowerCommand.java (100%) rename src/alisolarflare/{ => tools}/gpowers/gPowerMemory.java (100%) rename src/alisolarflare/{ => tools}/gpowers/listeners/gPowerApplyingTask.java (100%) rename src/alisolarflare/{ => tools}/gpowers/listeners/gPowerListener.java (100%) rename src/alisolarflare/{ => tools}/links/AliLinkSubPlug.java (100%) rename src/alisolarflare/{ => tools}/links/commands/PressAliLink.java (100%) rename src/alisolarflare/{ => tools}/links/commands/SetAliLink.java (100%) rename src/alisolarflare/{ => tools}/links/entities/Link.java (100%) rename src/alisolarflare/{ => tools}/links/serializer/Deserializer.java (100%) rename src/alisolarflare/{ => tools}/links/serializer/Serializer.java (100%) rename src/alisolarflare/{ => tools}/links/tasks/UnpressTask.java (100%) rename src/alisolarflare/{ => tools}/shulker/AliShulker.java (100%) diff --git a/src/alisolarflare/uhc/AddToUHC.java b/src/alisolarflare/events/uhc/AddToUHC.java similarity index 100% rename from src/alisolarflare/uhc/AddToUHC.java rename to src/alisolarflare/events/uhc/AddToUHC.java diff --git a/src/alisolarflare/uhc/UHCMatch.java b/src/alisolarflare/events/uhc/UHCMatch.java similarity index 100% rename from src/alisolarflare/uhc/UHCMatch.java rename to src/alisolarflare/events/uhc/UHCMatch.java diff --git a/src/alisolarflare/uhc/UHCSubPlugin.java b/src/alisolarflare/events/uhc/UHCModule.java similarity index 100% rename from src/alisolarflare/uhc/UHCSubPlugin.java rename to src/alisolarflare/events/uhc/UHCModule.java diff --git a/src/alisolarflare/aliarrow/AliArrowListener.java b/src/alisolarflare/magictrick/aliarrow/AliArrowListener.java similarity index 100% rename from src/alisolarflare/aliarrow/AliArrowListener.java rename to src/alisolarflare/magictrick/aliarrow/AliArrowListener.java diff --git a/src/alisolarflare/aliarrow/AliArrowSubPlugin.java b/src/alisolarflare/magictrick/aliarrow/AliArrowSubPlugin.java similarity index 100% rename from src/alisolarflare/aliarrow/AliArrowSubPlugin.java rename to src/alisolarflare/magictrick/aliarrow/AliArrowSubPlugin.java diff --git a/src/alisolarflare/aliarrow/AliArrowTask.java b/src/alisolarflare/magictrick/aliarrow/AliArrowTask.java similarity index 100% rename from src/alisolarflare/aliarrow/AliArrowTask.java rename to src/alisolarflare/magictrick/aliarrow/AliArrowTask.java diff --git a/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java b/src/alisolarflare/tools/flairdoors/FlairDoorsSubPlug.java similarity index 100% rename from src/alisolarflare/flairdoors/FlairDoorsSubPlug.java rename to src/alisolarflare/tools/flairdoors/FlairDoorsSubPlug.java diff --git a/src/alisolarflare/flairdoors/FlairMe.java b/src/alisolarflare/tools/flairdoors/FlairMe.java similarity index 100% rename from src/alisolarflare/flairdoors/FlairMe.java rename to src/alisolarflare/tools/flairdoors/FlairMe.java diff --git a/src/alisolarflare/flairdoors/PortalListener.java b/src/alisolarflare/tools/flairdoors/PortalListener.java similarity index 100% rename from src/alisolarflare/flairdoors/PortalListener.java rename to src/alisolarflare/tools/flairdoors/PortalListener.java diff --git a/src/alisolarflare/flairdoors/SetFlairDoorColour.java b/src/alisolarflare/tools/flairdoors/SetFlairDoorColour.java similarity index 100% rename from src/alisolarflare/flairdoors/SetFlairDoorColour.java rename to src/alisolarflare/tools/flairdoors/SetFlairDoorColour.java diff --git a/src/alisolarflare/gpowers/commands/PowerDown.java b/src/alisolarflare/tools/gpowers/commands/PowerDown.java similarity index 100% rename from src/alisolarflare/gpowers/commands/PowerDown.java rename to src/alisolarflare/tools/gpowers/commands/PowerDown.java diff --git a/src/alisolarflare/gpowers/commands/PowerUp.java b/src/alisolarflare/tools/gpowers/commands/PowerUp.java similarity index 100% rename from src/alisolarflare/gpowers/commands/PowerUp.java rename to src/alisolarflare/tools/gpowers/commands/PowerUp.java diff --git a/src/alisolarflare/gpowers/gPowerCommand.java b/src/alisolarflare/tools/gpowers/gPowerCommand.java similarity index 100% rename from src/alisolarflare/gpowers/gPowerCommand.java rename to src/alisolarflare/tools/gpowers/gPowerCommand.java diff --git a/src/alisolarflare/gpowers/gPowerMemory.java b/src/alisolarflare/tools/gpowers/gPowerMemory.java similarity index 100% rename from src/alisolarflare/gpowers/gPowerMemory.java rename to src/alisolarflare/tools/gpowers/gPowerMemory.java diff --git a/src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/tools/gpowers/listeners/gPowerApplyingTask.java similarity index 100% rename from src/alisolarflare/gpowers/listeners/gPowerApplyingTask.java rename to src/alisolarflare/tools/gpowers/listeners/gPowerApplyingTask.java diff --git a/src/alisolarflare/gpowers/listeners/gPowerListener.java b/src/alisolarflare/tools/gpowers/listeners/gPowerListener.java similarity index 100% rename from src/alisolarflare/gpowers/listeners/gPowerListener.java rename to src/alisolarflare/tools/gpowers/listeners/gPowerListener.java diff --git a/src/alisolarflare/links/AliLinkSubPlug.java b/src/alisolarflare/tools/links/AliLinkSubPlug.java similarity index 100% rename from src/alisolarflare/links/AliLinkSubPlug.java rename to src/alisolarflare/tools/links/AliLinkSubPlug.java diff --git a/src/alisolarflare/links/commands/PressAliLink.java b/src/alisolarflare/tools/links/commands/PressAliLink.java similarity index 100% rename from src/alisolarflare/links/commands/PressAliLink.java rename to src/alisolarflare/tools/links/commands/PressAliLink.java diff --git a/src/alisolarflare/links/commands/SetAliLink.java b/src/alisolarflare/tools/links/commands/SetAliLink.java similarity index 100% rename from src/alisolarflare/links/commands/SetAliLink.java rename to src/alisolarflare/tools/links/commands/SetAliLink.java diff --git a/src/alisolarflare/links/entities/Link.java b/src/alisolarflare/tools/links/entities/Link.java similarity index 100% rename from src/alisolarflare/links/entities/Link.java rename to src/alisolarflare/tools/links/entities/Link.java diff --git a/src/alisolarflare/links/serializer/Deserializer.java b/src/alisolarflare/tools/links/serializer/Deserializer.java similarity index 100% rename from src/alisolarflare/links/serializer/Deserializer.java rename to src/alisolarflare/tools/links/serializer/Deserializer.java diff --git a/src/alisolarflare/links/serializer/Serializer.java b/src/alisolarflare/tools/links/serializer/Serializer.java similarity index 100% rename from src/alisolarflare/links/serializer/Serializer.java rename to src/alisolarflare/tools/links/serializer/Serializer.java diff --git a/src/alisolarflare/links/tasks/UnpressTask.java b/src/alisolarflare/tools/links/tasks/UnpressTask.java similarity index 100% rename from src/alisolarflare/links/tasks/UnpressTask.java rename to src/alisolarflare/tools/links/tasks/UnpressTask.java diff --git a/src/alisolarflare/shulker/AliShulker.java b/src/alisolarflare/tools/shulker/AliShulker.java similarity index 100% rename from src/alisolarflare/shulker/AliShulker.java rename to src/alisolarflare/tools/shulker/AliShulker.java From 50107bff819984aca2c47f3e41968e955ea9031a Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 31 Oct 2016 00:12:40 -0400 Subject: [PATCH 046/263] Begun work on Object Orientating my classes, so that things are more organized --- src/alisolarflare/AliPresents.java | 110 +++---- src/alisolarflare/Module.java | 48 +++ src/alisolarflare/Registerable.java | 11 + src/alisolarflare/events/uhc/AddToUHC.java | 2 +- src/alisolarflare/events/uhc/UHCMatch.java | 2 +- src/alisolarflare/events/uhc/UHCModule.java | 29 +- .../magictrick/aliarrow/AliArrowListener.java | 89 +++--- .../aliarrow/AliArrowSubPlugin.java | 52 ++-- .../magictrick/aliarrow/AliArrowTask.java | 80 ++--- .../tools/flairdoors/FlairDoorsSubPlug.java | 44 +-- .../tools/flairdoors/FlairMe.java | 36 +-- .../tools/flairdoors/PortalListener.java | 288 +++++++++--------- .../tools/flairdoors/SetFlairDoorColour.java | 96 +++--- .../tools/gpowers/commands/PowerDown.java | 30 +- .../tools/gpowers/commands/PowerUp.java | 40 +-- .../tools/gpowers/gPowerCommand.java | 112 +++---- .../tools/gpowers/gPowerMemory.java | 203 ++++++------ .../gpowers/listeners/gPowerApplyingTask.java | 106 +++---- .../gpowers/listeners/gPowerListener.java | 60 ++-- .../tools/links/AliLinkSubPlug.java | 8 +- .../tools/links/commands/PressAliLink.java | 6 +- .../tools/links/commands/SetAliLink.java | 6 +- .../tools/links/entities/Link.java | 74 ++--- .../tools/links/serializer/Deserializer.java | 72 ++--- .../tools/links/serializer/Serializer.java | 64 ++-- .../tools/links/tasks/UnpressTask.java | 42 +-- .../tools/shulker/AliShulker.java | 2 +- 27 files changed, 886 insertions(+), 826 deletions(-) create mode 100644 src/alisolarflare/Module.java create mode 100644 src/alisolarflare/Registerable.java diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 064ae40..9c82e32 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -1,55 +1,55 @@ -package alisolarflare; - -import java.util.logging.Logger; - -import org.bukkit.plugin.PluginDescriptionFile; - -import alisolarflare.flairdoors.FlairMe; -import alisolarflare.flairdoors.PortalListener; -import alisolarflare.flairdoors.SetFlairDoorColour; -import alisolarflare.gpowers.gPowerCommand; -import alisolarflare.gpowers.commands.PowerDown; -import alisolarflare.gpowers.commands.PowerUp; -import alisolarflare.gpowers.listeners.gPowerListener; - -//import alisolarflare.links.AliLinkSubPlug; -import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.shulker.AliShulker; -import alisolarflare.aliarrow.AliArrowSubPlugin; - -public class AliPresents extends JavaPlugin{ - public void onEnable(){ - PluginDescriptionFile pdfFile = getDescription(); - Logger logger = getLogger(); - - - logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); - - registerSubPlugins(); - registerCommands(); - registerEvents(); - - logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); - - - } - private void registerEvents() { - getServer().getPluginManager().registerEvents(new PortalListener(this), this); - getServer().getPluginManager().registerEvents(new gPowerListener(this), this); - } - public void registerSubPlugins(){ - AliArrowSubPlugin aliArrowSubPlugin = new AliArrowSubPlugin(this); - aliArrowSubPlugin.register(); - //AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this); - //alilinksubplugin.register(); - } - public void registerCommands(){ - getCommand("powerup").setExecutor(new PowerUp()); - getCommand("powerdown").setExecutor(new PowerDown()); - getCommand("gpowercommand").setExecutor(new gPowerCommand()); - getCommand("flairme").setExecutor(new FlairMe()); - getCommand("alishulker").setExecutor(new AliShulker()); - getCommand("setflairdoorcolour").setExecutor(new SetFlairDoorColour()); - - } -} +package alisolarflare; + +import java.util.logging.Logger; + +import org.bukkit.plugin.PluginDescriptionFile; +//import alisolarflare.links.AliLinkSubPlug; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.magictrick.aliarrow.AliArrowSubPlugin; +import alisolarflare.tools.flairdoors.FlairMe; +import alisolarflare.tools.flairdoors.PortalListener; +import alisolarflare.tools.flairdoors.SetFlairDoorColour; +import alisolarflare.tools.gpowers.gPowerCommand; +import alisolarflare.tools.gpowers.commands.PowerDown; +import alisolarflare.tools.gpowers.commands.PowerUp; +import alisolarflare.tools.gpowers.listeners.gPowerListener; +import alisolarflare.tools.shulker.AliShulker; + +public class AliPresents extends JavaPlugin{ + public void onEnable(){ + PluginDescriptionFile pdfFile = getDescription(); + Logger logger = getLogger(); + + + logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); + + registerModules(); + registerCommands(); + registerEvents(); + + logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); + + + } + private void registerEvents() { + getServer().getPluginManager().registerEvents(new PortalListener(this), this); + getServer().getPluginManager().registerEvents(new gPowerListener(this), this); + } + public void registerModules(){ + new AliArrowSubPlugin(this).register(); + + + //AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this); + //alilinksubplugin.register(); + } + public void registerCommands(){ + getCommand("powerup").setExecutor(new PowerUp()); + getCommand("powerdown").setExecutor(new PowerDown()); + getCommand("gpowercommand").setExecutor(new gPowerCommand()); + getCommand("flairme").setExecutor(new FlairMe()); + getCommand("alishulker").setExecutor(new AliShulker()); + getCommand("setflairdoorcolour").setExecutor(new SetFlairDoorColour()); + + } +} diff --git a/src/alisolarflare/Module.java b/src/alisolarflare/Module.java new file mode 100644 index 0000000..af580b5 --- /dev/null +++ b/src/alisolarflare/Module.java @@ -0,0 +1,48 @@ +package alisolarflare; + +import org.bukkit.command.CommandExecutor; +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.magictrick.aliarrow.AliArrowListener; + +/** + * A Module class is a helper class that allows the compacting of projects into one single package. + * Each feature, whether game, arrow trail listener, or command tool, can have its command and listener + * registration coded into the Module class, as well as any other pointers to memory units, or other + * classes in the package. + * + * This package can then be moved from eclipse project to eclipse project smoothly, + * as long as the destination project has the Module abstract class, and as long as all dependencies are either + * contained in the moved package, or moved along with it. + * @author Alisolarflare + * + */ +public abstract class Module implements Registerable{ + /** + * Registers the project, when called by the Main JavaPlugin class that handles + * the main plugin. + * + * To register a command, call plugin.getCommand(//label).setExecutor(//commandExecutor); where + * label is a string containing the name of the command in plugin.yml, and where commandExecutor + * is a class implementing command executor + * + * To register a listener, + * @param plugin Plugin class called to register commands and listeners + */ + public abstract void register(JavaPlugin plugin); + /** + * Lazy route to type plugin.getCommand("label").setExecutor + * @param plugin Main plugin responsible for stuff + * @param label Name of the command in plugin.yml + * @param commandExecutor Custom coded CommandExecutor class + */ + protected CommandExecutor registerCommand(JavaPlugin plugin, String label, CommandExecutor commandExecutor){ + plugin.getCommand(label).setExecutor(commandExecutor); + return commandExecutor; + } + protected Listener registerListener(JavaPlugin plugin, Listener listener){ + plugin.getServer().getPluginManager().registerEvents(listener, plugin); + return listener; + } +} diff --git a/src/alisolarflare/Registerable.java b/src/alisolarflare/Registerable.java new file mode 100644 index 0000000..22cf3a0 --- /dev/null +++ b/src/alisolarflare/Registerable.java @@ -0,0 +1,11 @@ +package alisolarflare; + +import org.bukkit.plugin.java.JavaPlugin; + +/** + * Allows the project to be registered by any Main JavaPlugin class, by calling //modulename.register(this) + * in any JavaPlugin class. + */ +public interface Registerable { + public void register(JavaPlugin plugin); +} diff --git a/src/alisolarflare/events/uhc/AddToUHC.java b/src/alisolarflare/events/uhc/AddToUHC.java index b084d4b..2abc2c4 100644 --- a/src/alisolarflare/events/uhc/AddToUHC.java +++ b/src/alisolarflare/events/uhc/AddToUHC.java @@ -1,4 +1,4 @@ -package alisolarflare.uhc; +package alisolarflare.events.uhc; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/src/alisolarflare/events/uhc/UHCMatch.java b/src/alisolarflare/events/uhc/UHCMatch.java index f4e6ccc..e9a078d 100644 --- a/src/alisolarflare/events/uhc/UHCMatch.java +++ b/src/alisolarflare/events/uhc/UHCMatch.java @@ -1,4 +1,4 @@ -package alisolarflare.uhc; +package alisolarflare.events.uhc; import java.util.ArrayList; import java.util.List; diff --git a/src/alisolarflare/events/uhc/UHCModule.java b/src/alisolarflare/events/uhc/UHCModule.java index 3841da1..8acaf0e 100644 --- a/src/alisolarflare/events/uhc/UHCModule.java +++ b/src/alisolarflare/events/uhc/UHCModule.java @@ -1,27 +1,24 @@ -package alisolarflare.uhc; +package alisolarflare.events.uhc; -import alisolarflare.AliPresents; +import org.bukkit.plugin.java.JavaPlugin; -public class UHCSubPlugin { - public AliPresents plugin; +import alisolarflare.Module; + +public class UHCModule extends Module { public UHCMatch generalMemory; - public UHCSubPlugin(AliPresents plugin){ - this.plugin = plugin; + public void register(JavaPlugin plugin){ + registerCommands(plugin); + registerListeners(plugin); + registerMemoryUnits(plugin); } - public void register(){ - registerCommands(); - registerListeners(); - registerMemoryUnits(); + private void registerListeners(JavaPlugin plugin) { } - private void registerListeners() { - } - private void registerCommands() { + private void registerCommands(JavaPlugin plugin) { // TODO Auto-generated method stub - plugin.getCommand("addToUHC").setExecutor(new AddToUHC(this.generalMemory)); + registerCommand(plugin, "addToUHC", new AddToUHC(this.generalMemory)); } - private void registerMemoryUnits(){ + private void registerMemoryUnits(JavaPlugin plugin){ generalMemory = new UHCMatch(); } - } diff --git a/src/alisolarflare/magictrick/aliarrow/AliArrowListener.java b/src/alisolarflare/magictrick/aliarrow/AliArrowListener.java index 32a1a6c..12227b1 100644 --- a/src/alisolarflare/magictrick/aliarrow/AliArrowListener.java +++ b/src/alisolarflare/magictrick/aliarrow/AliArrowListener.java @@ -1,45 +1,46 @@ -package alisolarflare.aliarrow; - -import org.bukkit.entity.Arrow; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Projectile; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.ProjectileLaunchEvent; - -import alisolarflare.AliPresents; - -public class AliArrowListener implements Listener { - private final AliPresents plugin; - - public AliArrowListener(AliPresents plugin){ - this.plugin = plugin; - } - - @EventHandler - public void onProjectileLaunch(ProjectileLaunchEvent event){ - try{ - if(!(event.getEntity().getType() == EntityType.ARROW)){ - return; - } - Projectile projectile = event.getEntity(); - Arrow arrow = (Arrow) projectile; - if (!(arrow.isCritical())){ - return; - } - if (projectile.getShooter().equals(plugin.getServer().getPlayer("alisolarflare"))){ - AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow,"alisolarflare"); - aliArrowTask.runTaskTimer(plugin, 2, 1); - return; - }else if (projectile.getShooter().equals(plugin.getServer().getPlayer("Zanthr"))){ - AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow,"zanthr"); - aliArrowTask.runTaskTimer(plugin, 2, 1); - return; - } - return; - - }catch(Exception e){ - return; - } - } +package alisolarflare.magictrick.aliarrow; + +import org.bukkit.entity.Arrow; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Projectile; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.ProjectileLaunchEvent; + +import alisolarflare.AliPresents; + +public class AliArrowListener implements Listener { + private final AliPresents plugin; + + public AliArrowListener(AliPresents plugin){ + this.plugin = plugin; + } + + @SuppressWarnings("deprecation") + @EventHandler + public void onProjectileLaunch(ProjectileLaunchEvent event){ + try{ + if(!(event.getEntity().getType() == EntityType.ARROW)){ + return; + } + Projectile projectile = event.getEntity(); + Arrow arrow = (Arrow) projectile; + if (!(arrow.isCritical())){ + return; + } + if (projectile.getShooter().equals(plugin.getServer().getPlayer("alisolarflare"))){ + AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow,"alisolarflare"); + aliArrowTask.runTaskTimer(plugin, 2, 1); + return; + }else if (projectile.getShooter().equals(plugin.getServer().getPlayer("Zanthr"))){ + AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow,"zanthr"); + aliArrowTask.runTaskTimer(plugin, 2, 1); + return; + } + return; + + }catch(Exception e){ + return; + } + } } \ No newline at end of file diff --git a/src/alisolarflare/magictrick/aliarrow/AliArrowSubPlugin.java b/src/alisolarflare/magictrick/aliarrow/AliArrowSubPlugin.java index 2d88ab4..05d63c3 100644 --- a/src/alisolarflare/magictrick/aliarrow/AliArrowSubPlugin.java +++ b/src/alisolarflare/magictrick/aliarrow/AliArrowSubPlugin.java @@ -1,25 +1,27 @@ -package alisolarflare.aliarrow; - -import java.util.logging.Level; - -import alisolarflare.AliPresents; - -public class AliArrowSubPlugin { - private AliPresents plugin; - - public AliArrowSubPlugin(AliPresents plugin){ - this.plugin = plugin; - } - public void register(){ - registerEvents(); - registerCommands(); - plugin.getLogger().log(Level.INFO, "Discord Sub Plugin Registered!"); - } - private void registerEvents(){ - plugin.getServer().getPluginManager().registerEvents(new AliArrowListener(plugin), plugin); - - } - private void registerCommands(){ - - } -} +package alisolarflare.magictrick.aliarrow; + +import java.util.logging.Level; +import alisolarflare.AliPresents; + +public class AliArrowSubPlugin { + private AliPresents plugin; + + public AliArrowSubPlugin(AliPresents plugin){ + this.plugin = plugin; + } + /** + * Registers the plugin, activating listeners, commands, and events + */ + public void register(){ + registerEvents(); + registerCommands(); + plugin.getLogger().log(Level.INFO, "Discord Sub Plugin Registered!"); + } + private void registerEvents(){ + plugin.getServer().getPluginManager().registerEvents(new AliArrowListener(plugin), plugin); + + } + private void registerCommands(){ + + } +} diff --git a/src/alisolarflare/magictrick/aliarrow/AliArrowTask.java b/src/alisolarflare/magictrick/aliarrow/AliArrowTask.java index 8281039..e52f984 100644 --- a/src/alisolarflare/magictrick/aliarrow/AliArrowTask.java +++ b/src/alisolarflare/magictrick/aliarrow/AliArrowTask.java @@ -1,40 +1,40 @@ -package alisolarflare.aliarrow; - -import org.bukkit.Particle; -import org.bukkit.entity.Arrow; -import org.bukkit.scheduler.BukkitRunnable; - -import alisolarflare.AliPresents; - -public class AliArrowTask extends BukkitRunnable{ - AliPresents plugin; - String name; - Arrow arrow; - - - - public AliArrowTask(AliPresents plugin, Arrow arrow, String name){ - this.name = name; - this.plugin = plugin; - this.arrow = arrow; - } - - @Override - public void run() { - if (arrow.isOnGround() || arrow.isDead()){ - this.cancel(); - } - if (name.equalsIgnoreCase("alisolarflare")){ - arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1); - } - if (name.equalsIgnoreCase("Zanthr")){ - arrow.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, arrow.getLocation(), 1); - arrow.getWorld().spawnParticle(Particle.FLAME, arrow.getLocation(), 1); - - } - - - - } - -} +package alisolarflare.magictrick.aliarrow; + +import org.bukkit.Particle; +import org.bukkit.entity.Arrow; +import org.bukkit.scheduler.BukkitRunnable; + +import alisolarflare.AliPresents; + +public class AliArrowTask extends BukkitRunnable{ + AliPresents plugin; + String name; + Arrow arrow; + + + + public AliArrowTask(AliPresents plugin, Arrow arrow, String name){ + this.name = name; + this.plugin = plugin; + this.arrow = arrow; + } + + @Override + public void run() { + if (arrow.isOnGround() || arrow.isDead()){ + this.cancel(); + } + if (name.equalsIgnoreCase("alisolarflare")){ + arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1); + } + if (name.equalsIgnoreCase("Zanthr")){ + arrow.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, arrow.getLocation(), 1); + arrow.getWorld().spawnParticle(Particle.FLAME, arrow.getLocation(), 1); + + } + + + + } + +} diff --git a/src/alisolarflare/tools/flairdoors/FlairDoorsSubPlug.java b/src/alisolarflare/tools/flairdoors/FlairDoorsSubPlug.java index 46407d0..1fea366 100644 --- a/src/alisolarflare/tools/flairdoors/FlairDoorsSubPlug.java +++ b/src/alisolarflare/tools/flairdoors/FlairDoorsSubPlug.java @@ -1,22 +1,22 @@ -package alisolarflare.flairdoors; - -import alisolarflare.AliPresents; - -public class FlairDoorsSubPlug{ - @SuppressWarnings("unused") - private AliPresents plugin; - public FlairDoorsSubPlug(AliPresents plugin){ - this.plugin = plugin; - } - public void register(){ - registerCommands(); - registerEvents(); - } - private void registerCommands() { - //plugin.getCommand("FlairMe").setExecutor(new FlairMe()); - } - private void registerEvents() { - // TODO Auto-generated method stub - - } -} +package alisolarflare.tools.flairdoors; + +import alisolarflare.AliPresents; + +public class FlairDoorsSubPlug{ + @SuppressWarnings("unused") + private AliPresents plugin; + public FlairDoorsSubPlug(AliPresents plugin){ + this.plugin = plugin; + } + public void register(){ + registerCommands(); + registerEvents(); + } + private void registerCommands() { + //plugin.getCommand("FlairMe").setExecutor(new FlairMe()); + } + private void registerEvents() { + // TODO Auto-generated method stub + + } +} diff --git a/src/alisolarflare/tools/flairdoors/FlairMe.java b/src/alisolarflare/tools/flairdoors/FlairMe.java index 789524d..49e04fb 100644 --- a/src/alisolarflare/tools/flairdoors/FlairMe.java +++ b/src/alisolarflare/tools/flairdoors/FlairMe.java @@ -1,18 +1,18 @@ -package alisolarflare.flairdoors; - -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; - -public class FlairMe implements CommandExecutor{ - - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - sender.sendMessage("Flairing..." + sender.getName()); - PortalListener.playersToBeFlaired.add(sender.getName()); - sender.sendMessage("Finished Preparation! Walk through a portal to get your flair"); - - return false; - } - -} +package alisolarflare.tools.flairdoors; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +public class FlairMe implements CommandExecutor{ + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + sender.sendMessage("Flairing..." + sender.getName()); + PortalListener.playersToBeFlaired.add(sender.getName()); + sender.sendMessage("Finished Preparation! Walk through a portal to get your flair"); + + return false; + } + +} diff --git a/src/alisolarflare/tools/flairdoors/PortalListener.java b/src/alisolarflare/tools/flairdoors/PortalListener.java index 9bf9b1e..887697b 100644 --- a/src/alisolarflare/tools/flairdoors/PortalListener.java +++ b/src/alisolarflare/tools/flairdoors/PortalListener.java @@ -1,144 +1,144 @@ -package alisolarflare.flairdoors; - -import java.util.AbstractMap; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import org.bukkit.DyeColor; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerPortalEvent; -import org.bukkit.material.MaterialData; -import org.bukkit.material.Wool; - -import alisolarflare.AliPresents; - -public class PortalListener implements Listener{ - AbstractMap portalMap = new HashMap(); - public static List playersToBeFlaired = new ArrayList(); - public AliPresents plugin; - - //TODO: CREATE - LIST OF PORTALS (only x-z values) - - - public PortalListener(AliPresents plugin) { - this.plugin = plugin; - } - @EventHandler - public void onPortalEnter(PlayerPortalEvent event){ - //SANITATION - Player - if(!(event.getPlayer() instanceof Player)){ - return; - } - - //INIT - Player - Player player = event.getPlayer(); - player.sendMessage("MAY THE FLAIRING COMMENCE"); - - //SANITATION - PlayersToBeFlaired - if(!(playersToBeFlaired.contains(player.getName()))){ - return; - } - player.sendMessage("-MAY THE FLAIRING COMMENCE-"); - player.sendMessage("Deactivating regular portal behaviour..."); - event.setTo(player.getLocation()); - - //INIT - x,y,z - int x = player.getLocation().getBlockX(); - int y = player.getLocation().getBlockY(); - int z = player.getLocation().getBlockZ(); - - //INIT - Blocks Under Portal - Block blockTopper = player.getWorld().getBlockAt(x,y-1,z); - Block blockMiddle = player.getWorld().getBlockAt(x,y-2,z); - Block blockBottom = player.getWorld().getBlockAt(x,y-3,z); - - player.sendMessage("Blocks being inspected:"); - player.sendMessage(blockTopper.toString()); - player.sendMessage(blockMiddle.toString()); - player.sendMessage(blockBottom.toString()); - - //RECOLOUR PLAYER - if(blockTopper.getType() == Material.STONE){ - player.sendMessage("STONE DETECTED"); - recolourPlayer(player, DyeColor.GRAY); - - //TOP BLOCK IS WOOL? - }else if(blockTopper.getType() == Material.WOOL){ - player.sendMessage("WOOL DETECTED T"); - Wool wool = (Wool) blockTopper.getState().getData(); - recolourPlayer(player, wool.getColor()); - - //MIDDLE BLOCK IS WOOL? - }else if(blockMiddle.getType() == Material.WOOL){ - - player.sendMessage("WOOL DETECTED M"); - MaterialData mData = blockMiddle.getState().getData(); - player.sendMessage("MATERIAL DATA COLLECTED: "+ mData.toString()); - Wool wool = (Wool) mData; - player.sendMessage("WOOL DATA CONVERTED: "+ wool.toString()); - - recolourPlayer(player, wool.getColor()); - - //BOTTOM BLOCK IS WOOL? - }else if (blockBottom.getType() == Material.WOOL){ - player.sendMessage("WOOL DETECTED B"); - Wool wool = (Wool) blockBottom.getState().getData(); - recolourPlayer(player, wool.getColor()); - } - - } - public void recolourPlayer(Player player, DyeColor dyecolour){ - player.sendMessage("Recolouring Player as..." + dyecolour.toString()); - String name = player.getName(); - player.sendMessage("name:" + name); - for(int i = 0; i < name.length(); i++){ - if (name.charAt(i) == '&'){ - //TODO: Remove all &* symbols - name = name.substring(0, i) + name.substring(i + 1, name.length()); - - } - } - player.sendMessage("Adjusted Name: " + name); - - if(dyecolour == DyeColor.GRAY){ - player.sendMessage("Adding GRAY"); - player.setCustomName("&7" + name); - - }else if(dyecolour == DyeColor.RED){ - player.sendMessage("Adding RED"); - player.setCustomName("&4" + name); - - }else if(dyecolour == DyeColor.ORANGE){ - player.sendMessage("Adding ORANGE"); - player.setCustomName("&6" + name); - - }else if(dyecolour == DyeColor.YELLOW){ - player.sendMessage("Adding YELLOW"); - player.setCustomName("&e" + name); - - }else if(dyecolour == DyeColor.GREEN){ - player.sendMessage("Adding GREEN"); - player.setCustomName("&a" + name); - - }else if(dyecolour == DyeColor.BLUE){ - player.sendMessage("Adding BLUE"); - player.setCustomName("&9" + name); - - }else if(dyecolour == DyeColor.PURPLE){ - player.sendMessage("Adding PURPLE"); - player.setCustomName("&5" + name); - - }else{ - player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); - return; - } - player.sendMessage("Your name is now: " + player.getCustomName() +"! Removing you from playersToBeFlaired..."); - playersToBeFlaired.remove(player.getName()); - } -} +package alisolarflare.tools.flairdoors; + +import java.util.AbstractMap; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import org.bukkit.DyeColor; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerPortalEvent; +import org.bukkit.material.MaterialData; +import org.bukkit.material.Wool; + +import alisolarflare.AliPresents; + +public class PortalListener implements Listener{ + AbstractMap portalMap = new HashMap(); + public static List playersToBeFlaired = new ArrayList(); + public AliPresents plugin; + + //TODO: CREATE - LIST OF PORTALS (only x-z values) + + + public PortalListener(AliPresents plugin) { + this.plugin = plugin; + } + @EventHandler + public void onPortalEnter(PlayerPortalEvent event){ + //SANITATION - Player + if(!(event.getPlayer() instanceof Player)){ + return; + } + + //INIT - Player + Player player = event.getPlayer(); + player.sendMessage("MAY THE FLAIRING COMMENCE"); + + //SANITATION - PlayersToBeFlaired + if(!(playersToBeFlaired.contains(player.getName()))){ + return; + } + player.sendMessage("-MAY THE FLAIRING COMMENCE-"); + player.sendMessage("Deactivating regular portal behaviour..."); + event.setTo(player.getLocation()); + + //INIT - x,y,z + int x = player.getLocation().getBlockX(); + int y = player.getLocation().getBlockY(); + int z = player.getLocation().getBlockZ(); + + //INIT - Blocks Under Portal + Block blockTopper = player.getWorld().getBlockAt(x,y-1,z); + Block blockMiddle = player.getWorld().getBlockAt(x,y-2,z); + Block blockBottom = player.getWorld().getBlockAt(x,y-3,z); + + player.sendMessage("Blocks being inspected:"); + player.sendMessage(blockTopper.toString()); + player.sendMessage(blockMiddle.toString()); + player.sendMessage(blockBottom.toString()); + + //RECOLOUR PLAYER + if(blockTopper.getType() == Material.STONE){ + player.sendMessage("STONE DETECTED"); + recolourPlayer(player, DyeColor.GRAY); + + //TOP BLOCK IS WOOL? + }else if(blockTopper.getType() == Material.WOOL){ + player.sendMessage("WOOL DETECTED T"); + Wool wool = (Wool) blockTopper.getState().getData(); + recolourPlayer(player, wool.getColor()); + + //MIDDLE BLOCK IS WOOL? + }else if(blockMiddle.getType() == Material.WOOL){ + + player.sendMessage("WOOL DETECTED M"); + MaterialData mData = blockMiddle.getState().getData(); + player.sendMessage("MATERIAL DATA COLLECTED: "+ mData.toString()); + Wool wool = (Wool) mData; + player.sendMessage("WOOL DATA CONVERTED: "+ wool.toString()); + + recolourPlayer(player, wool.getColor()); + + //BOTTOM BLOCK IS WOOL? + }else if (blockBottom.getType() == Material.WOOL){ + player.sendMessage("WOOL DETECTED B"); + Wool wool = (Wool) blockBottom.getState().getData(); + recolourPlayer(player, wool.getColor()); + } + + } + public void recolourPlayer(Player player, DyeColor dyecolour){ + player.sendMessage("Recolouring Player as..." + dyecolour.toString()); + String name = player.getName(); + player.sendMessage("name:" + name); + for(int i = 0; i < name.length(); i++){ + if (name.charAt(i) == '&'){ + //TODO: Remove all &* symbols + name = name.substring(0, i) + name.substring(i + 1, name.length()); + + } + } + player.sendMessage("Adjusted Name: " + name); + + if(dyecolour == DyeColor.GRAY){ + player.sendMessage("Adding GRAY"); + player.setCustomName("&7" + name); + + }else if(dyecolour == DyeColor.RED){ + player.sendMessage("Adding RED"); + player.setCustomName("&4" + name); + + }else if(dyecolour == DyeColor.ORANGE){ + player.sendMessage("Adding ORANGE"); + player.setCustomName("&6" + name); + + }else if(dyecolour == DyeColor.YELLOW){ + player.sendMessage("Adding YELLOW"); + player.setCustomName("&e" + name); + + }else if(dyecolour == DyeColor.GREEN){ + player.sendMessage("Adding GREEN"); + player.setCustomName("&a" + name); + + }else if(dyecolour == DyeColor.BLUE){ + player.sendMessage("Adding BLUE"); + player.setCustomName("&9" + name); + + }else if(dyecolour == DyeColor.PURPLE){ + player.sendMessage("Adding PURPLE"); + player.setCustomName("&5" + name); + + }else{ + player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); + return; + } + player.sendMessage("Your name is now: " + player.getCustomName() +"! Removing you from playersToBeFlaired..."); + playersToBeFlaired.remove(player.getName()); + } +} diff --git a/src/alisolarflare/tools/flairdoors/SetFlairDoorColour.java b/src/alisolarflare/tools/flairdoors/SetFlairDoorColour.java index f76e163..965acf5 100644 --- a/src/alisolarflare/tools/flairdoors/SetFlairDoorColour.java +++ b/src/alisolarflare/tools/flairdoors/SetFlairDoorColour.java @@ -1,48 +1,48 @@ -package alisolarflare.flairdoors; - -import java.util.Arrays; -import java.util.List; - -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; - -public class SetFlairDoorColour implements CommandExecutor { - public static String FlairDoorColorMode = "null"; - public static final List COLOURMODES = Arrays.asList("red", "orange", "yellow", "green", "blue", "purple", "gray"); - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (args.length > 1){ - sender.sendMessage("You must specify and argument, Red-Purple or Null.HHAHHAHAHAHHAHAHAHHA"); - } - - String firstCommand = args[0]; - firstCommand = firstCommand.toLowerCase(); - if(firstCommand.startsWith("e")|| firstCommand.startsWith("gra")|| firstCommand.startsWith("grey")){ - sender.sendMessage("Flair Door Colour Mode set to gray"); - FlairDoorColorMode = "gray"; - }else if(firstCommand.startsWith("r")){ - sender.sendMessage("Flair Door Colour Mode set to Red"); - FlairDoorColorMode = "red"; - }else if(firstCommand.startsWith("o")){ - sender.sendMessage("Flair Door Colour Mode set to Orange"); - FlairDoorColorMode = "orange"; - }else if(firstCommand.startsWith("y")){ - sender.sendMessage("Flair Door Colour Mode set to Yellow"); - FlairDoorColorMode = "yellow"; - }else if(firstCommand.startsWith("g")){ - sender.sendMessage("Flair Door Colour Mode set to Green (use E for grey)"); - FlairDoorColorMode = "green"; - }else if(firstCommand.startsWith("b") || firstCommand.startsWith("i")){ - sender.sendMessage("Flair Door Colour Mode set to Blue"); - FlairDoorColorMode = "blue"; - }else if(firstCommand.startsWith("v") || firstCommand.startsWith("p")){ - sender.sendMessage("Flair Door Colour Mode set to Purple"); - FlairDoorColorMode = "purple"; - }else if(firstCommand.startsWith("n")){ - sender.sendMessage("Flair Door Colour Mode set to Null"); - FlairDoorColorMode = "null"; - } - return false; - } -} +package alisolarflare.tools.flairdoors; + +import java.util.Arrays; +import java.util.List; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +public class SetFlairDoorColour implements CommandExecutor { + public static String FlairDoorColorMode = "null"; + public static final List COLOURMODES = Arrays.asList("red", "orange", "yellow", "green", "blue", "purple", "gray"); + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (args.length > 1){ + sender.sendMessage("You must specify and argument, Red-Purple or Null.HHAHHAHAHAHHAHAHAHHA"); + } + + String firstCommand = args[0]; + firstCommand = firstCommand.toLowerCase(); + if(firstCommand.startsWith("e")|| firstCommand.startsWith("gra")|| firstCommand.startsWith("grey")){ + sender.sendMessage("Flair Door Colour Mode set to gray"); + FlairDoorColorMode = "gray"; + }else if(firstCommand.startsWith("r")){ + sender.sendMessage("Flair Door Colour Mode set to Red"); + FlairDoorColorMode = "red"; + }else if(firstCommand.startsWith("o")){ + sender.sendMessage("Flair Door Colour Mode set to Orange"); + FlairDoorColorMode = "orange"; + }else if(firstCommand.startsWith("y")){ + sender.sendMessage("Flair Door Colour Mode set to Yellow"); + FlairDoorColorMode = "yellow"; + }else if(firstCommand.startsWith("g")){ + sender.sendMessage("Flair Door Colour Mode set to Green (use E for grey)"); + FlairDoorColorMode = "green"; + }else if(firstCommand.startsWith("b") || firstCommand.startsWith("i")){ + sender.sendMessage("Flair Door Colour Mode set to Blue"); + FlairDoorColorMode = "blue"; + }else if(firstCommand.startsWith("v") || firstCommand.startsWith("p")){ + sender.sendMessage("Flair Door Colour Mode set to Purple"); + FlairDoorColorMode = "purple"; + }else if(firstCommand.startsWith("n")){ + sender.sendMessage("Flair Door Colour Mode set to Null"); + FlairDoorColorMode = "null"; + } + return false; + } +} diff --git a/src/alisolarflare/tools/gpowers/commands/PowerDown.java b/src/alisolarflare/tools/gpowers/commands/PowerDown.java index e94855e..bcdc714 100644 --- a/src/alisolarflare/tools/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/tools/gpowers/commands/PowerDown.java @@ -1,15 +1,15 @@ -package alisolarflare.gpowers.commands; - -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; - -public class PowerDown implements CommandExecutor { - - @Override - public boolean onCommand(CommandSender arg0, Command arg1, String arg2, String[] arg3) { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.tools.gpowers.commands; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +public class PowerDown implements CommandExecutor { + + @Override + public boolean onCommand(CommandSender arg0, Command arg1, String arg2, String[] arg3) { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/tools/gpowers/commands/PowerUp.java b/src/alisolarflare/tools/gpowers/commands/PowerUp.java index 535dd48..c89fcd5 100644 --- a/src/alisolarflare/tools/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/tools/gpowers/commands/PowerUp.java @@ -1,20 +1,20 @@ -package alisolarflare.gpowers.commands; - -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - - -public class PowerUp implements CommandExecutor{ - - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - } - //gPowerMemory.PowerUpPlayer(player, colour); - return false; - } - -} +package alisolarflare.tools.gpowers.commands; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + + +public class PowerUp implements CommandExecutor{ + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + } + //gPowerMemory.PowerUpPlayer(player, colour); + return false; + } + +} diff --git a/src/alisolarflare/tools/gpowers/gPowerCommand.java b/src/alisolarflare/tools/gpowers/gPowerCommand.java index c49ae63..2170d8c 100644 --- a/src/alisolarflare/tools/gpowers/gPowerCommand.java +++ b/src/alisolarflare/tools/gpowers/gPowerCommand.java @@ -1,56 +1,56 @@ -package alisolarflare.gpowers; - -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -public class gPowerCommand implements CommandExecutor{ - - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - sender.sendMessage("G power activate!"); - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - return false; - } - Player player = (Player) sender; - if (args.length < 2){ - player.sendMessage("Proper Usage to test G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); - return false; - } - String colour; - player.sendMessage("Checking terms..."); - if(args[0].startsWith("r") || - args[0].startsWith("o")|| - args[0].startsWith("y")|| - args[0].startsWith("g")|| - args[0].startsWith("b")|| - args[0].startsWith("p")){ - colour = args[0]; - }else{ - player.sendMessage("Term Fail: COLOUR. Proper Usage to test G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); - return false; - } - boolean isActive; - if(args[1].startsWith("t")){ - isActive = true; - }else if (args[1].startsWith("f")){ - isActive = false; - }else{ - player.sendMessage("Term Fail: ACTIVE. Proper Usage to test G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); - return false; - } - player.sendMessage("Terms Vaild!"); - if(isActive){ - gPowerMemory.PowerUpPlayer(player, colour); - }else{ - gPowerMemory.PowerDownPlayer(player); - } - return false; - } - -} +package alisolarflare.tools.gpowers; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class gPowerCommand implements CommandExecutor{ + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + sender.sendMessage("G power activate!"); + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + return false; + } + Player player = (Player) sender; + if (args.length < 2){ + player.sendMessage("Proper Usage to test G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + String colour; + player.sendMessage("Checking terms..."); + if(args[0].startsWith("r") || + args[0].startsWith("o")|| + args[0].startsWith("y")|| + args[0].startsWith("g")|| + args[0].startsWith("b")|| + args[0].startsWith("p")){ + colour = args[0]; + }else{ + player.sendMessage("Term Fail: COLOUR. Proper Usage to test G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + boolean isActive; + if(args[1].startsWith("t")){ + isActive = true; + }else if (args[1].startsWith("f")){ + isActive = false; + }else{ + player.sendMessage("Term Fail: ACTIVE. Proper Usage to test G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + player.sendMessage("Terms Vaild!"); + if(isActive){ + gPowerMemory.PowerUpPlayer(player, colour); + }else{ + gPowerMemory.PowerDownPlayer(player); + } + return false; + } + +} diff --git a/src/alisolarflare/tools/gpowers/gPowerMemory.java b/src/alisolarflare/tools/gpowers/gPowerMemory.java index ad8282a..56c9a58 100644 --- a/src/alisolarflare/tools/gpowers/gPowerMemory.java +++ b/src/alisolarflare/tools/gpowers/gPowerMemory.java @@ -1,101 +1,102 @@ -package alisolarflare.gpowers; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.bukkit.entity.Player; - -import alisolarflare.AliPresents; - -public class gPowerMemory{ - @SuppressWarnings("unused") - private static AliPresents plugin; - @SuppressWarnings("unused") - private static boolean debugMode = true; - public gPowerMemory(AliPresents plugin){ - gPowerMemory.plugin = plugin; - } - //SHORT TERM MEMORY STORAGE - public static Map PlayerMap = new HashMap(); - - //POWER ACTIVATION - public static void PowerUpPlayer(Player player, String colour){ - //debug("POWERRRED UP"); - player.sendMessage("POWERRED UP!"); - PlayerMap.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); - } - public static void PowerUpPlayer(Player player){ - //debug("POWERRRED UP"); - player.sendMessage("POWERRED UP!"); - if(PlayerMap.containsKey(player.getUniqueId())){ - PlayerMap.get(player.getUniqueId()).isPowersActive = true; - }else{ - player.sendMessage("You must instantiate your power settings using /gpowercommand"); - } - } - - //POWER DEACTIVATION - public static void PowerDownPlayer(Player player){ - //debug("POWERRRED DOWN"); - if (PlayerMap.containsKey(player.getUniqueId())){ - PlayerMap.get(player.getUniqueId()).isPowersActive = false; - }else{ - return; - } - - } - public static void PowerDownPlayer(UUID UniqueID){ - //debug("POWEERRED DOWN"); - if (PlayerMap.containsKey(UniqueID)){ - PlayerMap.get(UniqueID).isPowersActive = false; - }else{ - return; - } - } - public static boolean isPlayerPowered(UUID UniqueID){ - //debug("IS PLAYER POWERED?"); - if (PlayerMap.containsKey(UniqueID)){ - return PlayerMap.get(UniqueID).isPowersActive; - }else{ - return false; - } - } - public static boolean isPlayerPowered(Player player){ - //debug("IS PLAYER POWERED?"); - if (PlayerMap.containsKey(player.getUniqueId())){ - return PlayerMap.get(player.getUniqueId()).isPowersActive; - }else{ - return false; - } - } - //MEMORY UNIT - public static class poweredPlayer{ - public static UUID uuid; - public String colour; - public Boolean isPowersActive; - - @SuppressWarnings("static-access") - public poweredPlayer(UUID uuid, String colour, Boolean activated){ - this.uuid = (uuid); - this.colour = (colour); - this.isPowersActive = (activated); - } - public String toString(){ - return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; - } - } - - public void saveMemoryState(){ - Map PlayerMap = new HashMap(); - //for (UUID uuidKey:PlayerMap.keySet()){ - - //UUID uuidToSave = poweredPlayer.uuid; - - //} - } - public void loadMemoryState(){ - - } -} - +package alisolarflare.tools.gpowers; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.bukkit.entity.Player; + +import alisolarflare.AliPresents; + +public class gPowerMemory{ + @SuppressWarnings("unused") + private static AliPresents plugin; + @SuppressWarnings("unused") + private static boolean debugMode = true; + public gPowerMemory(AliPresents plugin){ + gPowerMemory.plugin = plugin; + } + //SHORT TERM MEMORY STORAGE + public static Map PlayerMap = new HashMap(); + + //POWER ACTIVATION + public static void PowerUpPlayer(Player player, String colour){ + //debug("POWERRRED UP"); + player.sendMessage("POWERRED UP!"); + PlayerMap.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); + } + public static void PowerUpPlayer(Player player){ + //debug("POWERRRED UP"); + player.sendMessage("POWERRED UP!"); + if(PlayerMap.containsKey(player.getUniqueId())){ + PlayerMap.get(player.getUniqueId()).isPowersActive = true; + }else{ + player.sendMessage("You must instantiate your power settings using /gpowercommand"); + } + } + + //POWER DEACTIVATION + public static void PowerDownPlayer(Player player){ + //debug("POWERRRED DOWN"); + if (PlayerMap.containsKey(player.getUniqueId())){ + PlayerMap.get(player.getUniqueId()).isPowersActive = false; + }else{ + return; + } + + } + public static void PowerDownPlayer(UUID UniqueID){ + //debug("POWEERRED DOWN"); + if (PlayerMap.containsKey(UniqueID)){ + PlayerMap.get(UniqueID).isPowersActive = false; + }else{ + return; + } + } + public static boolean isPlayerPowered(UUID UniqueID){ + //debug("IS PLAYER POWERED?"); + if (PlayerMap.containsKey(UniqueID)){ + return PlayerMap.get(UniqueID).isPowersActive; + }else{ + return false; + } + } + public static boolean isPlayerPowered(Player player){ + //debug("IS PLAYER POWERED?"); + if (PlayerMap.containsKey(player.getUniqueId())){ + return PlayerMap.get(player.getUniqueId()).isPowersActive; + }else{ + return false; + } + } + //MEMORY UNIT + public static class poweredPlayer{ + public static UUID uuid; + public String colour; + public Boolean isPowersActive; + + @SuppressWarnings("static-access") + public poweredPlayer(UUID uuid, String colour, Boolean activated){ + this.uuid = (uuid); + this.colour = (colour); + this.isPowersActive = (activated); + } + public String toString(){ + return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; + } + } + + public void saveMemoryState(){ + @SuppressWarnings("unused") + Map PlayerMap = new HashMap(); + //for (UUID uuidKey:PlayerMap.keySet()){ + + //UUID uuidToSave = poweredPlayer.uuid; + + //} + } + public void loadMemoryState(){ + + } +} + diff --git a/src/alisolarflare/tools/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/tools/gpowers/listeners/gPowerApplyingTask.java index d110477..63d1676 100644 --- a/src/alisolarflare/tools/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/tools/gpowers/listeners/gPowerApplyingTask.java @@ -1,53 +1,53 @@ -package alisolarflare.gpowers.listeners; - -import org.bukkit.Color; -import org.bukkit.entity.Player; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import alisolarflare.AliPresents; -import alisolarflare.gpowers.gPowerMemory; - -public class gPowerApplyingTask extends BukkitRunnable{ - - private AliPresents plugin; - - public gPowerApplyingTask(AliPresents plugin) { - this.plugin = plugin; - } - - //REPEATS EVERY 5 SECONDS - @Override - public void run() { - for (Player player : plugin.getServer().getOnlinePlayers()){ - if(gPowerMemory.PlayerMap.containsKey(player.getUniqueId())){ - activatePower(player, gPowerMemory.PlayerMap.get(player.getUniqueId()).colour); - } - } - } - - private void activatePower(Player player, String colour) { - if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.GRAY)); - player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 0, true, false, Color.GRAY)); - }else if (colour.startsWith("r")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0, true, false, Color.RED)); - }else if (colour.startsWith("o")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); - player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); - }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.YELLOW)); - }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 200, 1, true, false, Color.GREEN)); - player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 200, 0, true, false, Color.GREEN)); - }else if (colour.startsWith("b")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1, true, false, Color.BLUE)); - player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 200, 0, true, false, Color.BLUE)); - }else if (colour.startsWith("p")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 0, true, false, Color.PURPLE)); - }else{ - } - } - -} +package alisolarflare.tools.gpowers.listeners; + +import org.bukkit.Color; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +import alisolarflare.AliPresents; +import alisolarflare.tools.gpowers.gPowerMemory; + +public class gPowerApplyingTask extends BukkitRunnable{ + + private AliPresents plugin; + + public gPowerApplyingTask(AliPresents plugin) { + this.plugin = plugin; + } + + //REPEATS EVERY 5 SECONDS + @Override + public void run() { + for (Player player : plugin.getServer().getOnlinePlayers()){ + if(gPowerMemory.PlayerMap.containsKey(player.getUniqueId())){ + activatePower(player, gPowerMemory.PlayerMap.get(player.getUniqueId()).colour); + } + } + } + + private void activatePower(Player player, String colour) { + if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 0, true, false, Color.GRAY)); + }else if (colour.startsWith("r")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0, true, false, Color.RED)); + }else if (colour.startsWith("o")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); + player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); + }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.YELLOW)); + }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 200, 1, true, false, Color.GREEN)); + player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 200, 0, true, false, Color.GREEN)); + }else if (colour.startsWith("b")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1, true, false, Color.BLUE)); + player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 200, 0, true, false, Color.BLUE)); + }else if (colour.startsWith("p")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 0, true, false, Color.PURPLE)); + }else{ + } + } + +} diff --git a/src/alisolarflare/tools/gpowers/listeners/gPowerListener.java b/src/alisolarflare/tools/gpowers/listeners/gPowerListener.java index c8197e8..bca5927 100644 --- a/src/alisolarflare/tools/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/tools/gpowers/listeners/gPowerListener.java @@ -1,31 +1,31 @@ -package alisolarflare.gpowers.listeners; - -import org.bukkit.event.Listener; -import org.bukkit.scheduler.BukkitTask; - -import alisolarflare.AliPresents; - -public class gPowerListener implements Listener{ - private AliPresents plugin; - public gPowerApplyingTask powerApplyingTask; - public BukkitTask bukkitTask; - public gPowerListener(AliPresents plugin){ - this.plugin = plugin; - this.powerApplyingTask = new gPowerApplyingTask(this.plugin); - bukkitTask = powerApplyingTask.runTaskTimer(plugin, 190, 190); - } - -} -/* - * public class CyclicalDisplayListener implements Listener{ - private final ButtonRebirthPlugin plugin; - public CyclicalDisplayTask cyclicalDisplayTask; - public BukkitTask bukkitTask; - - public CyclicalDisplayListener (ButtonRebirthPlugin initPlugin){ - plugin = initPlugin; - cyclicalDisplayTask = new CyclicalDisplayTask (this.plugin); - bukkitTask = cyclicalDisplayTask.runTaskTimer(this.plugin, 20, 20); - } -} +package alisolarflare.tools.gpowers.listeners; + +import org.bukkit.event.Listener; +import org.bukkit.scheduler.BukkitTask; + +import alisolarflare.AliPresents; + +public class gPowerListener implements Listener{ + private AliPresents plugin; + public gPowerApplyingTask powerApplyingTask; + public BukkitTask bukkitTask; + public gPowerListener(AliPresents plugin){ + this.plugin = plugin; + this.powerApplyingTask = new gPowerApplyingTask(this.plugin); + bukkitTask = powerApplyingTask.runTaskTimer(plugin, 190, 190); + } + +} +/* + * public class CyclicalDisplayListener implements Listener{ + private final ButtonRebirthPlugin plugin; + public CyclicalDisplayTask cyclicalDisplayTask; + public BukkitTask bukkitTask; + + public CyclicalDisplayListener (ButtonRebirthPlugin initPlugin){ + plugin = initPlugin; + cyclicalDisplayTask = new CyclicalDisplayTask (this.plugin); + bukkitTask = cyclicalDisplayTask.runTaskTimer(this.plugin, 20, 20); + } +} */ \ No newline at end of file diff --git a/src/alisolarflare/tools/links/AliLinkSubPlug.java b/src/alisolarflare/tools/links/AliLinkSubPlug.java index f5e2843..c85db53 100644 --- a/src/alisolarflare/tools/links/AliLinkSubPlug.java +++ b/src/alisolarflare/tools/links/AliLinkSubPlug.java @@ -1,10 +1,10 @@ -package alisolarflare.links; +package alisolarflare.tools.links; import java.util.List; import alisolarflare.AliPresents; -import alisolarflare.links.commands.PressAliLink; -import alisolarflare.links.commands.SetAliLink; -import alisolarflare.links.entities.Link; +import alisolarflare.tools.links.commands.PressAliLink; +import alisolarflare.tools.links.commands.SetAliLink; +import alisolarflare.tools.links.entities.Link; public class AliLinkSubPlug{ public AliPresents plugin; diff --git a/src/alisolarflare/tools/links/commands/PressAliLink.java b/src/alisolarflare/tools/links/commands/PressAliLink.java index de76443..e8ec607 100644 --- a/src/alisolarflare/tools/links/commands/PressAliLink.java +++ b/src/alisolarflare/tools/links/commands/PressAliLink.java @@ -1,11 +1,11 @@ -package alisolarflare.links.commands; +package alisolarflare.tools.links.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; -import alisolarflare.links.AliLinkSubPlug; -import alisolarflare.links.entities.Link; +import alisolarflare.tools.links.AliLinkSubPlug; +import alisolarflare.tools.links.entities.Link; public class PressAliLink implements CommandExecutor{ private AliLinkSubPlug subplugin; diff --git a/src/alisolarflare/tools/links/commands/SetAliLink.java b/src/alisolarflare/tools/links/commands/SetAliLink.java index 5fd5fa7..4d5f74a 100644 --- a/src/alisolarflare/tools/links/commands/SetAliLink.java +++ b/src/alisolarflare/tools/links/commands/SetAliLink.java @@ -1,4 +1,4 @@ -package alisolarflare.links.commands; +package alisolarflare.tools.links.commands; import java.util.ArrayList; @@ -12,8 +12,8 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.AliPresents; -import alisolarflare.links.AliLinkSubPlug; -import alisolarflare.links.entities.Link; +import alisolarflare.tools.links.AliLinkSubPlug; +import alisolarflare.tools.links.entities.Link; /** * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, diff --git a/src/alisolarflare/tools/links/entities/Link.java b/src/alisolarflare/tools/links/entities/Link.java index a0a7449..d9868b5 100644 --- a/src/alisolarflare/tools/links/entities/Link.java +++ b/src/alisolarflare/tools/links/entities/Link.java @@ -1,37 +1,37 @@ -package alisolarflare.links.entities; - -import java.io.Serializable; - -import org.bukkit.Location; -import org.bukkit.Material; - -import alisolarflare.links.AliLinkSubPlug; -import alisolarflare.links.tasks.UnpressTask; - -public class Link implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - public String frequency; - public String world; - public String x; - public String y; - public String z; - - - public Link(String frequency, Location location){ - this.frequency = frequency; - this.world = location.getWorld().getName(); - this.x = "" + location.getBlockX(); - this.y = "" + location.getBlockY(); - this.z = "" + location.getBlockZ(); - //plugin.plugin.getConfig().set("frequency", 10); - } - public void press(AliLinkSubPlug plugin) { - Location location = new Location(plugin.plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); - location.getBlock().setType(Material.REDSTONE_BLOCK); - UnpressTask unPressTask = new UnpressTask(location); - unPressTask.runTaskTimer(plugin.plugin, 2, 1); - } -} +package alisolarflare.tools.links.entities; + +import java.io.Serializable; + +import org.bukkit.Location; +import org.bukkit.Material; + +import alisolarflare.tools.links.AliLinkSubPlug; +import alisolarflare.tools.links.tasks.UnpressTask; + +public class Link implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + public String frequency; + public String world; + public String x; + public String y; + public String z; + + + public Link(String frequency, Location location){ + this.frequency = frequency; + this.world = location.getWorld().getName(); + this.x = "" + location.getBlockX(); + this.y = "" + location.getBlockY(); + this.z = "" + location.getBlockZ(); + //plugin.plugin.getConfig().set("frequency", 10); + } + public void press(AliLinkSubPlug plugin) { + Location location = new Location(plugin.plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); + location.getBlock().setType(Material.REDSTONE_BLOCK); + UnpressTask unPressTask = new UnpressTask(location); + unPressTask.runTaskTimer(plugin.plugin, 2, 1); + } +} diff --git a/src/alisolarflare/tools/links/serializer/Deserializer.java b/src/alisolarflare/tools/links/serializer/Deserializer.java index db5da86..7aacfb8 100644 --- a/src/alisolarflare/tools/links/serializer/Deserializer.java +++ b/src/alisolarflare/tools/links/serializer/Deserializer.java @@ -1,36 +1,36 @@ -package alisolarflare.links.serializer; - - -import java.io.FileInputStream; -import java.io.ObjectInputStream; -import java.util.List; - -import alisolarflare.links.entities.Link; - -public class Deserializer{ - - public static void main (String args[]) { - - //Deserializer deserializer = new Deserializer(); - //List aliLink = deserializer.loadLink(aliLink); - //System.out.println(aliLink); - } - - @SuppressWarnings("unchecked") - public List loadLinkList(){ - List aliLinkList; - try{ - - FileInputStream fin = new FileInputStream("AliLinkList.ser"); - ObjectInputStream ois = new ObjectInputStream(fin); - aliLinkList = (List) ois.readObject(); - ois.close(); - - return aliLinkList; - - }catch(Exception ex){ - ex.printStackTrace(); - return null; - } - } -} +package alisolarflare.tools.links.serializer; + + +import java.io.FileInputStream; +import java.io.ObjectInputStream; +import java.util.List; + +import alisolarflare.tools.links.entities.Link; + +public class Deserializer{ + + public static void main (String args[]) { + + //Deserializer deserializer = new Deserializer(); + //List aliLink = deserializer.loadLink(aliLink); + //System.out.println(aliLink); + } + + @SuppressWarnings("unchecked") + public List loadLinkList(){ + List aliLinkList; + try{ + + FileInputStream fin = new FileInputStream("AliLinkList.ser"); + ObjectInputStream ois = new ObjectInputStream(fin); + aliLinkList = (List) ois.readObject(); + ois.close(); + + return aliLinkList; + + }catch(Exception ex){ + ex.printStackTrace(); + return null; + } + } +} diff --git a/src/alisolarflare/tools/links/serializer/Serializer.java b/src/alisolarflare/tools/links/serializer/Serializer.java index f05ab1b..20b9daa 100644 --- a/src/alisolarflare/tools/links/serializer/Serializer.java +++ b/src/alisolarflare/tools/links/serializer/Serializer.java @@ -1,33 +1,33 @@ -package alisolarflare.links.serializer; - - -import java.io.FileOutputStream; -import java.io.ObjectOutputStream; -import java.util.List; - -import alisolarflare.links.entities.Link; - -public class Serializer { - - public static void main (String args[]) { - - //Serializer serializer = new Serializer(); - //serializer.saveLink(plugin, frequency, location) - } - - public void saveLinkList(List aliLinkList){ - //saves link - - try{ - - FileOutputStream fout = new FileOutputStream("AliLinkList.ser"); - ObjectOutputStream oos = new ObjectOutputStream(fout); - oos.writeObject(aliLinkList); - oos.close(); - System.out.println("Done"); - - }catch(Exception ex){ - ex.printStackTrace(); - } - } +package alisolarflare.tools.links.serializer; + + +import java.io.FileOutputStream; +import java.io.ObjectOutputStream; +import java.util.List; + +import alisolarflare.tools.links.entities.Link; + +public class Serializer { + + public static void main (String args[]) { + + //Serializer serializer = new Serializer(); + //serializer.saveLink(plugin, frequency, location) + } + + public void saveLinkList(List aliLinkList){ + //saves link + + try{ + + FileOutputStream fout = new FileOutputStream("AliLinkList.ser"); + ObjectOutputStream oos = new ObjectOutputStream(fout); + oos.writeObject(aliLinkList); + oos.close(); + System.out.println("Done"); + + }catch(Exception ex){ + ex.printStackTrace(); + } + } } \ No newline at end of file diff --git a/src/alisolarflare/tools/links/tasks/UnpressTask.java b/src/alisolarflare/tools/links/tasks/UnpressTask.java index c65c76f..79a457c 100644 --- a/src/alisolarflare/tools/links/tasks/UnpressTask.java +++ b/src/alisolarflare/tools/links/tasks/UnpressTask.java @@ -1,21 +1,21 @@ -package alisolarflare.links.tasks; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.scheduler.BukkitRunnable; - -public class UnpressTask extends BukkitRunnable { - private Location location; - public UnpressTask(Location location){ - this.location = location; - } - - @SuppressWarnings("deprecation") - @Override - public void run() { - location.getBlock().setType(Material.STAINED_CLAY); - location.getBlock().setData((byte) 14); - this.cancel(); - } - -} +package alisolarflare.tools.links.tasks; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.scheduler.BukkitRunnable; + +public class UnpressTask extends BukkitRunnable { + private Location location; + public UnpressTask(Location location){ + this.location = location; + } + + @SuppressWarnings("deprecation") + @Override + public void run() { + location.getBlock().setType(Material.STAINED_CLAY); + location.getBlock().setData((byte) 14); + this.cancel(); + } + +} diff --git a/src/alisolarflare/tools/shulker/AliShulker.java b/src/alisolarflare/tools/shulker/AliShulker.java index 6f503a9..0bd2534 100644 --- a/src/alisolarflare/tools/shulker/AliShulker.java +++ b/src/alisolarflare/tools/shulker/AliShulker.java @@ -1,4 +1,4 @@ -package alisolarflare.shulker; +package alisolarflare.tools.shulker; import org.bukkit.Location; import org.bukkit.command.Command; From 34c0bc432b82248b92efcc2cd07cdf45d2afb4ed Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 31 Oct 2016 00:46:51 -0400 Subject: [PATCH 047/263] Finishing re-organizing --- src/alisolarflare/{ => modules}/Module.java | 0 src/alisolarflare/{ => modules}/Registerable.java | 0 .../components/flairdoor/FlairDoorModule.java} | 0 .../components/flairdoor/commands}/FlairMe.java | 0 .../components/flairdoor/commands}/SetFlairDoorColour.java | 0 .../components/flairdoor/listeners}/PortalListener.java | 0 .../{tools => modules/components}/gpowers/commands/PowerDown.java | 0 .../{tools => modules/components}/gpowers/commands/PowerUp.java | 0 .../components/gpowers/commands}/gPowerCommand.java | 0 .../{tools => modules/components}/gpowers/gPowerMemory.java | 0 .../components}/gpowers/listeners/gPowerApplyingTask.java | 0 .../components}/gpowers/listeners/gPowerListener.java | 0 .../components/links/AliLinkModule.java} | 0 .../components}/links/commands/PressAliLink.java | 0 .../{tools => modules/components}/links/commands/SetAliLink.java | 0 .../{tools => modules/components}/links/entities/Link.java | 0 .../components}/links/serializer/Deserializer.java | 0 .../components}/links/serializer/Serializer.java | 0 .../{tools => modules/components}/links/tasks/UnpressTask.java | 0 .../components/shulker/commands}/AliShulker.java | 0 src/alisolarflare/{ => modules}/events/uhc/UHCMatch.java | 0 src/alisolarflare/{ => modules}/events/uhc/UHCModule.java | 0 .../{events/uhc => modules/events/uhc/commands}/AddToUHC.java | 0 .../{ => modules}/magictrick/aliarrow/AliArrowListener.java | 0 .../magictrick/aliarrow/AliArrowModule.java} | 0 .../{ => modules}/magictrick/aliarrow/AliArrowTask.java | 0 26 files changed, 0 insertions(+), 0 deletions(-) rename src/alisolarflare/{ => modules}/Module.java (100%) rename src/alisolarflare/{ => modules}/Registerable.java (100%) rename src/alisolarflare/{tools/flairdoors/FlairDoorsSubPlug.java => modules/components/flairdoor/FlairDoorModule.java} (100%) rename src/alisolarflare/{tools/flairdoors => modules/components/flairdoor/commands}/FlairMe.java (100%) rename src/alisolarflare/{tools/flairdoors => modules/components/flairdoor/commands}/SetFlairDoorColour.java (100%) rename src/alisolarflare/{tools/flairdoors => modules/components/flairdoor/listeners}/PortalListener.java (100%) rename src/alisolarflare/{tools => modules/components}/gpowers/commands/PowerDown.java (100%) rename src/alisolarflare/{tools => modules/components}/gpowers/commands/PowerUp.java (100%) rename src/alisolarflare/{tools/gpowers => modules/components/gpowers/commands}/gPowerCommand.java (100%) rename src/alisolarflare/{tools => modules/components}/gpowers/gPowerMemory.java (100%) rename src/alisolarflare/{tools => modules/components}/gpowers/listeners/gPowerApplyingTask.java (100%) rename src/alisolarflare/{tools => modules/components}/gpowers/listeners/gPowerListener.java (100%) rename src/alisolarflare/{tools/links/AliLinkSubPlug.java => modules/components/links/AliLinkModule.java} (100%) rename src/alisolarflare/{tools => modules/components}/links/commands/PressAliLink.java (100%) rename src/alisolarflare/{tools => modules/components}/links/commands/SetAliLink.java (100%) rename src/alisolarflare/{tools => modules/components}/links/entities/Link.java (100%) rename src/alisolarflare/{tools => modules/components}/links/serializer/Deserializer.java (100%) rename src/alisolarflare/{tools => modules/components}/links/serializer/Serializer.java (100%) rename src/alisolarflare/{tools => modules/components}/links/tasks/UnpressTask.java (100%) rename src/alisolarflare/{tools/shulker => modules/components/shulker/commands}/AliShulker.java (100%) rename src/alisolarflare/{ => modules}/events/uhc/UHCMatch.java (100%) rename src/alisolarflare/{ => modules}/events/uhc/UHCModule.java (100%) rename src/alisolarflare/{events/uhc => modules/events/uhc/commands}/AddToUHC.java (100%) rename src/alisolarflare/{ => modules}/magictrick/aliarrow/AliArrowListener.java (100%) rename src/alisolarflare/{magictrick/aliarrow/AliArrowSubPlugin.java => modules/magictrick/aliarrow/AliArrowModule.java} (100%) rename src/alisolarflare/{ => modules}/magictrick/aliarrow/AliArrowTask.java (100%) diff --git a/src/alisolarflare/Module.java b/src/alisolarflare/modules/Module.java similarity index 100% rename from src/alisolarflare/Module.java rename to src/alisolarflare/modules/Module.java diff --git a/src/alisolarflare/Registerable.java b/src/alisolarflare/modules/Registerable.java similarity index 100% rename from src/alisolarflare/Registerable.java rename to src/alisolarflare/modules/Registerable.java diff --git a/src/alisolarflare/tools/flairdoors/FlairDoorsSubPlug.java b/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java similarity index 100% rename from src/alisolarflare/tools/flairdoors/FlairDoorsSubPlug.java rename to src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java diff --git a/src/alisolarflare/tools/flairdoors/FlairMe.java b/src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java similarity index 100% rename from src/alisolarflare/tools/flairdoors/FlairMe.java rename to src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java diff --git a/src/alisolarflare/tools/flairdoors/SetFlairDoorColour.java b/src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java similarity index 100% rename from src/alisolarflare/tools/flairdoors/SetFlairDoorColour.java rename to src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java diff --git a/src/alisolarflare/tools/flairdoors/PortalListener.java b/src/alisolarflare/modules/components/flairdoor/listeners/PortalListener.java similarity index 100% rename from src/alisolarflare/tools/flairdoors/PortalListener.java rename to src/alisolarflare/modules/components/flairdoor/listeners/PortalListener.java diff --git a/src/alisolarflare/tools/gpowers/commands/PowerDown.java b/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java similarity index 100% rename from src/alisolarflare/tools/gpowers/commands/PowerDown.java rename to src/alisolarflare/modules/components/gpowers/commands/PowerDown.java diff --git a/src/alisolarflare/tools/gpowers/commands/PowerUp.java b/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java similarity index 100% rename from src/alisolarflare/tools/gpowers/commands/PowerUp.java rename to src/alisolarflare/modules/components/gpowers/commands/PowerUp.java diff --git a/src/alisolarflare/tools/gpowers/gPowerCommand.java b/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java similarity index 100% rename from src/alisolarflare/tools/gpowers/gPowerCommand.java rename to src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java diff --git a/src/alisolarflare/tools/gpowers/gPowerMemory.java b/src/alisolarflare/modules/components/gpowers/gPowerMemory.java similarity index 100% rename from src/alisolarflare/tools/gpowers/gPowerMemory.java rename to src/alisolarflare/modules/components/gpowers/gPowerMemory.java diff --git a/src/alisolarflare/tools/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/modules/components/gpowers/listeners/gPowerApplyingTask.java similarity index 100% rename from src/alisolarflare/tools/gpowers/listeners/gPowerApplyingTask.java rename to src/alisolarflare/modules/components/gpowers/listeners/gPowerApplyingTask.java diff --git a/src/alisolarflare/tools/gpowers/listeners/gPowerListener.java b/src/alisolarflare/modules/components/gpowers/listeners/gPowerListener.java similarity index 100% rename from src/alisolarflare/tools/gpowers/listeners/gPowerListener.java rename to src/alisolarflare/modules/components/gpowers/listeners/gPowerListener.java diff --git a/src/alisolarflare/tools/links/AliLinkSubPlug.java b/src/alisolarflare/modules/components/links/AliLinkModule.java similarity index 100% rename from src/alisolarflare/tools/links/AliLinkSubPlug.java rename to src/alisolarflare/modules/components/links/AliLinkModule.java diff --git a/src/alisolarflare/tools/links/commands/PressAliLink.java b/src/alisolarflare/modules/components/links/commands/PressAliLink.java similarity index 100% rename from src/alisolarflare/tools/links/commands/PressAliLink.java rename to src/alisolarflare/modules/components/links/commands/PressAliLink.java diff --git a/src/alisolarflare/tools/links/commands/SetAliLink.java b/src/alisolarflare/modules/components/links/commands/SetAliLink.java similarity index 100% rename from src/alisolarflare/tools/links/commands/SetAliLink.java rename to src/alisolarflare/modules/components/links/commands/SetAliLink.java diff --git a/src/alisolarflare/tools/links/entities/Link.java b/src/alisolarflare/modules/components/links/entities/Link.java similarity index 100% rename from src/alisolarflare/tools/links/entities/Link.java rename to src/alisolarflare/modules/components/links/entities/Link.java diff --git a/src/alisolarflare/tools/links/serializer/Deserializer.java b/src/alisolarflare/modules/components/links/serializer/Deserializer.java similarity index 100% rename from src/alisolarflare/tools/links/serializer/Deserializer.java rename to src/alisolarflare/modules/components/links/serializer/Deserializer.java diff --git a/src/alisolarflare/tools/links/serializer/Serializer.java b/src/alisolarflare/modules/components/links/serializer/Serializer.java similarity index 100% rename from src/alisolarflare/tools/links/serializer/Serializer.java rename to src/alisolarflare/modules/components/links/serializer/Serializer.java diff --git a/src/alisolarflare/tools/links/tasks/UnpressTask.java b/src/alisolarflare/modules/components/links/tasks/UnpressTask.java similarity index 100% rename from src/alisolarflare/tools/links/tasks/UnpressTask.java rename to src/alisolarflare/modules/components/links/tasks/UnpressTask.java diff --git a/src/alisolarflare/tools/shulker/AliShulker.java b/src/alisolarflare/modules/components/shulker/commands/AliShulker.java similarity index 100% rename from src/alisolarflare/tools/shulker/AliShulker.java rename to src/alisolarflare/modules/components/shulker/commands/AliShulker.java diff --git a/src/alisolarflare/events/uhc/UHCMatch.java b/src/alisolarflare/modules/events/uhc/UHCMatch.java similarity index 100% rename from src/alisolarflare/events/uhc/UHCMatch.java rename to src/alisolarflare/modules/events/uhc/UHCMatch.java diff --git a/src/alisolarflare/events/uhc/UHCModule.java b/src/alisolarflare/modules/events/uhc/UHCModule.java similarity index 100% rename from src/alisolarflare/events/uhc/UHCModule.java rename to src/alisolarflare/modules/events/uhc/UHCModule.java diff --git a/src/alisolarflare/events/uhc/AddToUHC.java b/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java similarity index 100% rename from src/alisolarflare/events/uhc/AddToUHC.java rename to src/alisolarflare/modules/events/uhc/commands/AddToUHC.java diff --git a/src/alisolarflare/magictrick/aliarrow/AliArrowListener.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java similarity index 100% rename from src/alisolarflare/magictrick/aliarrow/AliArrowListener.java rename to src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java diff --git a/src/alisolarflare/magictrick/aliarrow/AliArrowSubPlugin.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java similarity index 100% rename from src/alisolarflare/magictrick/aliarrow/AliArrowSubPlugin.java rename to src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java diff --git a/src/alisolarflare/magictrick/aliarrow/AliArrowTask.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java similarity index 100% rename from src/alisolarflare/magictrick/aliarrow/AliArrowTask.java rename to src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java From 4c8ffa5a9eae87c3713898b1d393f5d5c03c3039 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 31 Oct 2016 00:47:13 -0400 Subject: [PATCH 048/263] Added Module Class, for extra portability --- src/alisolarflare/AliPresents.java | 29 ++----------------- src/alisolarflare/modules/Module.java | 4 +-- src/alisolarflare/modules/Registerable.java | 2 +- .../components/flairdoor/FlairDoorModule.java | 29 ++++++++++--------- .../flairdoor/commands/FlairMe.java | 4 ++- .../commands/SetFlairDoorColour.java | 2 +- .../flairdoor/listeners/PortalListener.java | 9 +++--- .../components/gpowers/GPowerModule.java | 22 ++++++++++++++ .../gpowers/commands/PowerDown.java | 2 +- .../components/gpowers/commands/PowerUp.java | 2 +- .../gpowers/commands/gPowerCommand.java | 4 ++- .../components/gpowers/gPowerMemory.java | 2 +- .../gpowers/listeners/gPowerApplyingTask.java | 10 +++---- .../gpowers/listeners/gPowerListener.java | 10 +++---- .../components/links/AliLinkModule.java | 24 ++++++++------- .../links/commands/PressAliLink.java | 16 +++++----- .../components/links/commands/SetAliLink.java | 16 +++++----- .../components/links/entities/Link.java | 8 ++--- .../links/serializer/Deserializer.java | 4 +-- .../links/serializer/Serializer.java | 4 +-- .../components/links/tasks/UnpressTask.java | 2 +- .../components/shulker/AliShulkerModule.java | 15 ++++++++++ .../shulker/commands/AliShulker.java | 2 +- .../modules/events/uhc/UHCMatch.java | 2 +- .../modules/events/uhc/UHCModule.java | 5 ++-- .../modules/events/uhc/commands/AddToUHC.java | 4 ++- .../magictrick/aliarrow/AliArrowListener.java | 2 +- .../magictrick/aliarrow/AliArrowModule.java | 6 ++-- .../magictrick/aliarrow/AliArrowTask.java | 2 +- 29 files changed, 133 insertions(+), 110 deletions(-) create mode 100644 src/alisolarflare/modules/components/gpowers/GPowerModule.java create mode 100644 src/alisolarflare/modules/components/shulker/AliShulkerModule.java diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 9c82e32..6384f76 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -6,15 +6,8 @@ import org.bukkit.plugin.PluginDescriptionFile; //import alisolarflare.links.AliLinkSubPlug; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.magictrick.aliarrow.AliArrowSubPlugin; -import alisolarflare.tools.flairdoors.FlairMe; -import alisolarflare.tools.flairdoors.PortalListener; -import alisolarflare.tools.flairdoors.SetFlairDoorColour; -import alisolarflare.tools.gpowers.gPowerCommand; -import alisolarflare.tools.gpowers.commands.PowerDown; -import alisolarflare.tools.gpowers.commands.PowerUp; -import alisolarflare.tools.gpowers.listeners.gPowerListener; -import alisolarflare.tools.shulker.AliShulker; +import alisolarflare.modules.components.flairdoor.listeners.PortalListener; +import alisolarflare.modules.magictrick.aliarrow.AliArrowModule; public class AliPresents extends JavaPlugin{ public void onEnable(){ @@ -25,7 +18,6 @@ public class AliPresents extends JavaPlugin{ logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); registerModules(); - registerCommands(); registerEvents(); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); @@ -33,23 +25,8 @@ public class AliPresents extends JavaPlugin{ } private void registerEvents() { - getServer().getPluginManager().registerEvents(new PortalListener(this), this); - getServer().getPluginManager().registerEvents(new gPowerListener(this), this); } public void registerModules(){ - new AliArrowSubPlugin(this).register(); - - - //AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this); - //alilinksubplugin.register(); - } - public void registerCommands(){ - getCommand("powerup").setExecutor(new PowerUp()); - getCommand("powerdown").setExecutor(new PowerDown()); - getCommand("gpowercommand").setExecutor(new gPowerCommand()); - getCommand("flairme").setExecutor(new FlairMe()); - getCommand("alishulker").setExecutor(new AliShulker()); - getCommand("setflairdoorcolour").setExecutor(new SetFlairDoorColour()); - + new AliArrowModule(this).register(); } } diff --git a/src/alisolarflare/modules/Module.java b/src/alisolarflare/modules/Module.java index af580b5..a68d1f6 100644 --- a/src/alisolarflare/modules/Module.java +++ b/src/alisolarflare/modules/Module.java @@ -1,11 +1,9 @@ -package alisolarflare; +package alisolarflare.modules; import org.bukkit.command.CommandExecutor; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.magictrick.aliarrow.AliArrowListener; - /** * A Module class is a helper class that allows the compacting of projects into one single package. * Each feature, whether game, arrow trail listener, or command tool, can have its command and listener diff --git a/src/alisolarflare/modules/Registerable.java b/src/alisolarflare/modules/Registerable.java index 22cf3a0..052a4e9 100644 --- a/src/alisolarflare/modules/Registerable.java +++ b/src/alisolarflare/modules/Registerable.java @@ -1,4 +1,4 @@ -package alisolarflare; +package alisolarflare.modules; import org.bukkit.plugin.java.JavaPlugin; diff --git a/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java index 1fea366..a7de4c9 100644 --- a/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java +++ b/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java @@ -1,22 +1,23 @@ -package alisolarflare.tools.flairdoors; +package alisolarflare.modules.components.flairdoor; -import alisolarflare.AliPresents; +import org.bukkit.plugin.java.JavaPlugin; -public class FlairDoorsSubPlug{ +import alisolarflare.modules.Module; +import alisolarflare.modules.components.flairdoor.commands.FlairMe; +import alisolarflare.modules.components.flairdoor.commands.SetFlairDoorColour; +import alisolarflare.modules.components.flairdoor.listeners.PortalListener; + +public class FlairDoorModule extends Module{ @SuppressWarnings("unused") - private AliPresents plugin; - public FlairDoorsSubPlug(AliPresents plugin){ + private JavaPlugin plugin; + public FlairDoorModule(JavaPlugin plugin){ this.plugin = plugin; } - public void register(){ - registerCommands(); - registerEvents(); - } - private void registerCommands() { - //plugin.getCommand("FlairMe").setExecutor(new FlairMe()); - } - private void registerEvents() { - // TODO Auto-generated method stub + @Override + public void register(JavaPlugin plugin) { + plugin.getCommand("flairme").setExecutor(new FlairMe()); + plugin.getCommand("setflairdoorcolour").setExecutor(new SetFlairDoorColour()); + plugin.getServer().getPluginManager().registerEvents(new PortalListener(plugin), plugin); } } diff --git a/src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java index 49e04fb..5b10c0c 100644 --- a/src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java @@ -1,9 +1,11 @@ -package alisolarflare.tools.flairdoors; +package alisolarflare.modules.components.flairdoor.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; +import alisolarflare.modules.components.flairdoor.listeners.PortalListener; + public class FlairMe implements CommandExecutor{ @Override diff --git a/src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java b/src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java index 965acf5..686350f 100644 --- a/src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java +++ b/src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java @@ -1,4 +1,4 @@ -package alisolarflare.tools.flairdoors; +package alisolarflare.modules.components.flairdoor.commands; import java.util.Arrays; import java.util.List; diff --git a/src/alisolarflare/modules/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/modules/components/flairdoor/listeners/PortalListener.java index 887697b..abf5e07 100644 --- a/src/alisolarflare/modules/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/modules/components/flairdoor/listeners/PortalListener.java @@ -1,4 +1,4 @@ -package alisolarflare.tools.flairdoors; +package alisolarflare.modules.components.flairdoor.listeners; import java.util.AbstractMap; import java.util.ArrayList; @@ -15,18 +15,17 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerPortalEvent; import org.bukkit.material.MaterialData; import org.bukkit.material.Wool; - -import alisolarflare.AliPresents; +import org.bukkit.plugin.java.JavaPlugin; public class PortalListener implements Listener{ AbstractMap portalMap = new HashMap(); public static List playersToBeFlaired = new ArrayList(); - public AliPresents plugin; + public JavaPlugin plugin; //TODO: CREATE - LIST OF PORTALS (only x-z values) - public PortalListener(AliPresents plugin) { + public PortalListener(JavaPlugin plugin) { this.plugin = plugin; } @EventHandler diff --git a/src/alisolarflare/modules/components/gpowers/GPowerModule.java b/src/alisolarflare/modules/components/gpowers/GPowerModule.java new file mode 100644 index 0000000..8578d46 --- /dev/null +++ b/src/alisolarflare/modules/components/gpowers/GPowerModule.java @@ -0,0 +1,22 @@ +package alisolarflare.modules.components.gpowers; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.modules.Module; +import alisolarflare.modules.components.gpowers.commands.PowerDown; +import alisolarflare.modules.components.gpowers.commands.PowerUp; +import alisolarflare.modules.components.gpowers.commands.gPowerCommand; +import alisolarflare.modules.components.gpowers.listeners.gPowerListener; + +public class GPowerModule extends Module{ + + @Override + public void register(JavaPlugin plugin) { + plugin.getCommand("powerup").setExecutor(new PowerUp()); + plugin.getCommand("powerdown").setExecutor(new PowerDown()); + plugin.getCommand("gpowercommand").setExecutor(new gPowerCommand()); + + plugin.getServer().getPluginManager().registerEvents(new gPowerListener(plugin), plugin); + } + +} diff --git a/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java b/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java index bcdc714..d7c42e3 100644 --- a/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java @@ -1,4 +1,4 @@ -package alisolarflare.tools.gpowers.commands; +package alisolarflare.modules.components.gpowers.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java b/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java index c89fcd5..3668d8d 100644 --- a/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java @@ -1,4 +1,4 @@ -package alisolarflare.tools.gpowers.commands; +package alisolarflare.modules.components.gpowers.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java b/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java index 2170d8c..b9b105e 100644 --- a/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java +++ b/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java @@ -1,10 +1,12 @@ -package alisolarflare.tools.gpowers; +package alisolarflare.modules.components.gpowers.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import alisolarflare.modules.components.gpowers.gPowerMemory; + public class gPowerCommand implements CommandExecutor{ @Override diff --git a/src/alisolarflare/modules/components/gpowers/gPowerMemory.java b/src/alisolarflare/modules/components/gpowers/gPowerMemory.java index 56c9a58..afc9208 100644 --- a/src/alisolarflare/modules/components/gpowers/gPowerMemory.java +++ b/src/alisolarflare/modules/components/gpowers/gPowerMemory.java @@ -1,4 +1,4 @@ -package alisolarflare.tools.gpowers; +package alisolarflare.modules.components.gpowers; import java.util.HashMap; import java.util.Map; diff --git a/src/alisolarflare/modules/components/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/modules/components/gpowers/listeners/gPowerApplyingTask.java index 63d1676..a13a19d 100644 --- a/src/alisolarflare/modules/components/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/modules/components/gpowers/listeners/gPowerApplyingTask.java @@ -1,19 +1,19 @@ -package alisolarflare.tools.gpowers.listeners; +package alisolarflare.modules.components.gpowers.listeners; import org.bukkit.Color; import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitRunnable; -import alisolarflare.AliPresents; -import alisolarflare.tools.gpowers.gPowerMemory; +import alisolarflare.modules.components.gpowers.gPowerMemory; public class gPowerApplyingTask extends BukkitRunnable{ - private AliPresents plugin; + private JavaPlugin plugin; - public gPowerApplyingTask(AliPresents plugin) { + public gPowerApplyingTask(JavaPlugin plugin) { this.plugin = plugin; } diff --git a/src/alisolarflare/modules/components/gpowers/listeners/gPowerListener.java b/src/alisolarflare/modules/components/gpowers/listeners/gPowerListener.java index bca5927..1892244 100644 --- a/src/alisolarflare/modules/components/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/modules/components/gpowers/listeners/gPowerListener.java @@ -1,15 +1,15 @@ -package alisolarflare.tools.gpowers.listeners; +package alisolarflare.modules.components.gpowers.listeners; import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitTask; -import alisolarflare.AliPresents; - public class gPowerListener implements Listener{ - private AliPresents plugin; + private JavaPlugin plugin; public gPowerApplyingTask powerApplyingTask; public BukkitTask bukkitTask; - public gPowerListener(AliPresents plugin){ + + public gPowerListener(JavaPlugin plugin){ this.plugin = plugin; this.powerApplyingTask = new gPowerApplyingTask(this.plugin); bukkitTask = powerApplyingTask.runTaskTimer(plugin, 190, 190); diff --git a/src/alisolarflare/modules/components/links/AliLinkModule.java b/src/alisolarflare/modules/components/links/AliLinkModule.java index c85db53..23ce869 100644 --- a/src/alisolarflare/modules/components/links/AliLinkModule.java +++ b/src/alisolarflare/modules/components/links/AliLinkModule.java @@ -1,22 +1,25 @@ -package alisolarflare.tools.links; +package alisolarflare.modules.components.links; import java.util.List; -import alisolarflare.AliPresents; -import alisolarflare.tools.links.commands.PressAliLink; -import alisolarflare.tools.links.commands.SetAliLink; -import alisolarflare.tools.links.entities.Link; +import org.bukkit.plugin.java.JavaPlugin; -public class AliLinkSubPlug{ - public AliPresents plugin; +import alisolarflare.modules.Module; +import alisolarflare.modules.components.links.commands.PressAliLink; +import alisolarflare.modules.components.links.commands.SetAliLink; +import alisolarflare.modules.components.links.entities.Link; + +public class AliLinkModule extends Module{ + public JavaPlugin plugin; private SetAliLink setAliLink; - public AliLinkSubPlug(AliPresents plugin){ + public AliLinkModule(JavaPlugin plugin){ this.plugin = plugin; } - public void register(){ - setAliLink = new SetAliLink(this.plugin); + @Override + public void register(JavaPlugin plugin){ + setAliLink = new SetAliLink(plugin); plugin.getCommand("setalilink").setExecutor(setAliLink); plugin.getCommand("pressalilink").setExecutor(new PressAliLink(this, setAliLink)); @@ -29,4 +32,5 @@ public class AliLinkSubPlug{ return (List) plugin.getConfig().getList("aliLinkList"); } + } diff --git a/src/alisolarflare/modules/components/links/commands/PressAliLink.java b/src/alisolarflare/modules/components/links/commands/PressAliLink.java index e8ec607..b062149 100644 --- a/src/alisolarflare/modules/components/links/commands/PressAliLink.java +++ b/src/alisolarflare/modules/components/links/commands/PressAliLink.java @@ -1,23 +1,23 @@ -package alisolarflare.tools.links.commands; +package alisolarflare.modules.components.links.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; -import alisolarflare.tools.links.AliLinkSubPlug; -import alisolarflare.tools.links.entities.Link; +import alisolarflare.modules.components.links.AliLinkModule; +import alisolarflare.modules.components.links.entities.Link; public class PressAliLink implements CommandExecutor{ - private AliLinkSubPlug subplugin; + private AliLinkModule module; private SetAliLink setAliLink; - public PressAliLink(AliLinkSubPlug subplugin, SetAliLink setAliLink){ - this.subplugin = subplugin; + public PressAliLink(AliLinkModule subplugin, SetAliLink setAliLink){ + this.module = subplugin; this.setAliLink = setAliLink; } @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - subplugin.plugin.getServer().broadcastMessage(setAliLink.linkList.toString() + "over."); + module.plugin.getServer().broadcastMessage(setAliLink.linkList.toString() + "over."); if (args.length < 1){ sender.sendMessage("You must specify a link frequency"); @@ -26,7 +26,7 @@ public class PressAliLink implements CommandExecutor{ for (Link link: setAliLink.linkList){ for (String inputlink: args){ if(inputlink.equals(link.frequency)){ - link.press(subplugin); + link.press(module); } } } diff --git a/src/alisolarflare/modules/components/links/commands/SetAliLink.java b/src/alisolarflare/modules/components/links/commands/SetAliLink.java index 4d5f74a..ec3083d 100644 --- a/src/alisolarflare/modules/components/links/commands/SetAliLink.java +++ b/src/alisolarflare/modules/components/links/commands/SetAliLink.java @@ -1,4 +1,4 @@ -package alisolarflare.tools.links.commands; +package alisolarflare.modules.components.links.commands; import java.util.ArrayList; @@ -10,10 +10,10 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.AliPresents; -import alisolarflare.tools.links.AliLinkSubPlug; -import alisolarflare.tools.links.entities.Link; +import alisolarflare.modules.components.links.AliLinkModule; +import alisolarflare.modules.components.links.entities.Link; /** * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, @@ -26,14 +26,14 @@ import alisolarflare.tools.links.entities.Link; */ public class SetAliLink implements CommandExecutor{ public List linkList = new ArrayList(); - AliLinkSubPlug subplugin; - private AliPresents plugin; + AliLinkModule subplugin; + private JavaPlugin plugin; /** * Constructs the SetAliLink class - * @param plugin The plugin that contains the configuration file of AliPresents + * @param plugin The plugin that contains the configuration file of SetAliLink */ - public SetAliLink(AliPresents plugin){ + public SetAliLink(JavaPlugin plugin){ this.plugin = plugin; load(); } diff --git a/src/alisolarflare/modules/components/links/entities/Link.java b/src/alisolarflare/modules/components/links/entities/Link.java index d9868b5..a5bd186 100644 --- a/src/alisolarflare/modules/components/links/entities/Link.java +++ b/src/alisolarflare/modules/components/links/entities/Link.java @@ -1,12 +1,12 @@ -package alisolarflare.tools.links.entities; +package alisolarflare.modules.components.links.entities; import java.io.Serializable; import org.bukkit.Location; import org.bukkit.Material; -import alisolarflare.tools.links.AliLinkSubPlug; -import alisolarflare.tools.links.tasks.UnpressTask; +import alisolarflare.modules.components.links.AliLinkModule; +import alisolarflare.modules.components.links.tasks.UnpressTask; public class Link implements Serializable{ /** @@ -28,7 +28,7 @@ public class Link implements Serializable{ this.z = "" + location.getBlockZ(); //plugin.plugin.getConfig().set("frequency", 10); } - public void press(AliLinkSubPlug plugin) { + public void press(AliLinkModule plugin) { Location location = new Location(plugin.plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); location.getBlock().setType(Material.REDSTONE_BLOCK); UnpressTask unPressTask = new UnpressTask(location); diff --git a/src/alisolarflare/modules/components/links/serializer/Deserializer.java b/src/alisolarflare/modules/components/links/serializer/Deserializer.java index 7aacfb8..ff4c1fe 100644 --- a/src/alisolarflare/modules/components/links/serializer/Deserializer.java +++ b/src/alisolarflare/modules/components/links/serializer/Deserializer.java @@ -1,11 +1,11 @@ -package alisolarflare.tools.links.serializer; +package alisolarflare.modules.components.links.serializer; import java.io.FileInputStream; import java.io.ObjectInputStream; import java.util.List; -import alisolarflare.tools.links.entities.Link; +import alisolarflare.modules.components.links.entities.Link; public class Deserializer{ diff --git a/src/alisolarflare/modules/components/links/serializer/Serializer.java b/src/alisolarflare/modules/components/links/serializer/Serializer.java index 20b9daa..359e95a 100644 --- a/src/alisolarflare/modules/components/links/serializer/Serializer.java +++ b/src/alisolarflare/modules/components/links/serializer/Serializer.java @@ -1,11 +1,11 @@ -package alisolarflare.tools.links.serializer; +package alisolarflare.modules.components.links.serializer; import java.io.FileOutputStream; import java.io.ObjectOutputStream; import java.util.List; -import alisolarflare.tools.links.entities.Link; +import alisolarflare.modules.components.links.entities.Link; public class Serializer { diff --git a/src/alisolarflare/modules/components/links/tasks/UnpressTask.java b/src/alisolarflare/modules/components/links/tasks/UnpressTask.java index 79a457c..4eed62a 100644 --- a/src/alisolarflare/modules/components/links/tasks/UnpressTask.java +++ b/src/alisolarflare/modules/components/links/tasks/UnpressTask.java @@ -1,4 +1,4 @@ -package alisolarflare.tools.links.tasks; +package alisolarflare.modules.components.links.tasks; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/alisolarflare/modules/components/shulker/AliShulkerModule.java b/src/alisolarflare/modules/components/shulker/AliShulkerModule.java new file mode 100644 index 0000000..97f2e31 --- /dev/null +++ b/src/alisolarflare/modules/components/shulker/AliShulkerModule.java @@ -0,0 +1,15 @@ +package alisolarflare.modules.components.shulker; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.modules.Module; +import alisolarflare.modules.components.shulker.commands.AliShulker; + +public class AliShulkerModule extends Module{ + + @Override + public void register(JavaPlugin plugin) { + plugin.getCommand("alishulker").setExecutor(new AliShulker()); + } + +} diff --git a/src/alisolarflare/modules/components/shulker/commands/AliShulker.java b/src/alisolarflare/modules/components/shulker/commands/AliShulker.java index 0bd2534..cc802c6 100644 --- a/src/alisolarflare/modules/components/shulker/commands/AliShulker.java +++ b/src/alisolarflare/modules/components/shulker/commands/AliShulker.java @@ -1,4 +1,4 @@ -package alisolarflare.tools.shulker; +package alisolarflare.modules.components.shulker.commands; import org.bukkit.Location; import org.bukkit.command.Command; diff --git a/src/alisolarflare/modules/events/uhc/UHCMatch.java b/src/alisolarflare/modules/events/uhc/UHCMatch.java index e9a078d..f8aa26c 100644 --- a/src/alisolarflare/modules/events/uhc/UHCMatch.java +++ b/src/alisolarflare/modules/events/uhc/UHCMatch.java @@ -1,4 +1,4 @@ -package alisolarflare.events.uhc; +package alisolarflare.modules.events.uhc; import java.util.ArrayList; import java.util.List; diff --git a/src/alisolarflare/modules/events/uhc/UHCModule.java b/src/alisolarflare/modules/events/uhc/UHCModule.java index 8acaf0e..35dd1a2 100644 --- a/src/alisolarflare/modules/events/uhc/UHCModule.java +++ b/src/alisolarflare/modules/events/uhc/UHCModule.java @@ -1,8 +1,9 @@ -package alisolarflare.events.uhc; +package alisolarflare.modules.events.uhc; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.Module; +import alisolarflare.modules.Module; +import alisolarflare.modules.events.uhc.commands.AddToUHC; public class UHCModule extends Module { public UHCMatch generalMemory; diff --git a/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java b/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java index 2abc2c4..02a90cf 100644 --- a/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java +++ b/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java @@ -1,10 +1,12 @@ -package alisolarflare.events.uhc; +package alisolarflare.modules.events.uhc.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import alisolarflare.modules.events.uhc.UHCMatch; + /** * This class handles the specific command /addToUHC which, in-game, * adds a player to a specific UltraHardcore match, that is defined diff --git a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java index 12227b1..2d009b4 100644 --- a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java +++ b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.magictrick.aliarrow; +package alisolarflare.modules.magictrick.aliarrow; import org.bukkit.entity.Arrow; import org.bukkit.entity.EntityType; diff --git a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java index 05d63c3..2de4069 100644 --- a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java +++ b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java @@ -1,12 +1,12 @@ -package alisolarflare.magictrick.aliarrow; +package alisolarflare.modules.magictrick.aliarrow; import java.util.logging.Level; import alisolarflare.AliPresents; -public class AliArrowSubPlugin { +public class AliArrowModule { private AliPresents plugin; - public AliArrowSubPlugin(AliPresents plugin){ + public AliArrowModule(AliPresents plugin){ this.plugin = plugin; } /** diff --git a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java index e52f984..b032db1 100644 --- a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java +++ b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java @@ -1,4 +1,4 @@ -package alisolarflare.magictrick.aliarrow; +package alisolarflare.modules.magictrick.aliarrow; import org.bukkit.Particle; import org.bukkit.entity.Arrow; From 86bc0637188940047e296ceb6b78b1f1a92e2766 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 31 Oct 2016 01:02:58 -0400 Subject: [PATCH 049/263] Wired up modules to AliPresents, SHIT's DOOONE --- src/alisolarflare/AliPresents.java | 16 +++++++++----- .../components/flairdoor/FlairDoorModule.java | 5 ----- .../components/links/AliLinkModule.java | 13 ++++-------- .../links/commands/PressAliLink.java | 12 +++++------ .../components/links/entities/Link.java | 12 +++++++---- .../magictrick/aliarrow/AliArrowListener.java | 7 +++---- .../magictrick/aliarrow/AliArrowModule.java | 21 +++++-------------- .../magictrick/aliarrow/AliArrowTask.java | 7 +++---- 8 files changed, 40 insertions(+), 53 deletions(-) diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 6384f76..64f614a 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -6,7 +6,11 @@ import org.bukkit.plugin.PluginDescriptionFile; //import alisolarflare.links.AliLinkSubPlug; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.components.flairdoor.listeners.PortalListener; +import alisolarflare.modules.components.flairdoor.FlairDoorModule; +import alisolarflare.modules.components.gpowers.GPowerModule; +import alisolarflare.modules.components.links.AliLinkModule; +import alisolarflare.modules.components.shulker.AliShulkerModule; +import alisolarflare.modules.events.uhc.UHCModule; import alisolarflare.modules.magictrick.aliarrow.AliArrowModule; public class AliPresents extends JavaPlugin{ @@ -18,15 +22,17 @@ public class AliPresents extends JavaPlugin{ logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); registerModules(); - registerEvents(); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); - } - private void registerEvents() { } public void registerModules(){ - new AliArrowModule(this).register(); + new FlairDoorModule().register(this); + new GPowerModule().register(this); + new AliLinkModule().register(this); + new AliShulkerModule().register(this); + new UHCModule().register(this); + new AliArrowModule().register(this); } } diff --git a/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java index a7de4c9..2563a3c 100644 --- a/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java +++ b/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java @@ -8,11 +8,6 @@ import alisolarflare.modules.components.flairdoor.commands.SetFlairDoorColour; import alisolarflare.modules.components.flairdoor.listeners.PortalListener; public class FlairDoorModule extends Module{ - @SuppressWarnings("unused") - private JavaPlugin plugin; - public FlairDoorModule(JavaPlugin plugin){ - this.plugin = plugin; - } @Override public void register(JavaPlugin plugin) { plugin.getCommand("flairme").setExecutor(new FlairMe()); diff --git a/src/alisolarflare/modules/components/links/AliLinkModule.java b/src/alisolarflare/modules/components/links/AliLinkModule.java index 23ce869..4861f3a 100644 --- a/src/alisolarflare/modules/components/links/AliLinkModule.java +++ b/src/alisolarflare/modules/components/links/AliLinkModule.java @@ -9,26 +9,21 @@ import alisolarflare.modules.components.links.commands.SetAliLink; import alisolarflare.modules.components.links.entities.Link; public class AliLinkModule extends Module{ - public JavaPlugin plugin; private SetAliLink setAliLink; - public AliLinkModule(JavaPlugin plugin){ - this.plugin = plugin; - - - } @Override public void register(JavaPlugin plugin){ setAliLink = new SetAliLink(plugin); plugin.getCommand("setalilink").setExecutor(setAliLink); - plugin.getCommand("pressalilink").setExecutor(new PressAliLink(this, setAliLink)); + plugin.getCommand("pressalilink").setExecutor(new PressAliLink(plugin, setAliLink)); } - public void saveLinkList(){ + public void saveLinkList(JavaPlugin plugin){ plugin.getConfig().set("aliLinkList", setAliLink.linkList); } + @SuppressWarnings("unchecked") - public List loadLinkList(){ + public List loadLinkList(JavaPlugin plugin){ return (List) plugin.getConfig().getList("aliLinkList"); } diff --git a/src/alisolarflare/modules/components/links/commands/PressAliLink.java b/src/alisolarflare/modules/components/links/commands/PressAliLink.java index b062149..7c277fd 100644 --- a/src/alisolarflare/modules/components/links/commands/PressAliLink.java +++ b/src/alisolarflare/modules/components/links/commands/PressAliLink.java @@ -3,21 +3,21 @@ package alisolarflare.modules.components.links.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; +import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.components.links.AliLinkModule; import alisolarflare.modules.components.links.entities.Link; public class PressAliLink implements CommandExecutor{ - private AliLinkModule module; + private JavaPlugin plugin; private SetAliLink setAliLink; - public PressAliLink(AliLinkModule subplugin, SetAliLink setAliLink){ - this.module = subplugin; + public PressAliLink(JavaPlugin plugin, SetAliLink setAliLink){ + this.plugin = plugin; this.setAliLink = setAliLink; } @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - module.plugin.getServer().broadcastMessage(setAliLink.linkList.toString() + "over."); + sender.getServer().broadcastMessage(setAliLink.linkList.toString() + "over."); if (args.length < 1){ sender.sendMessage("You must specify a link frequency"); @@ -26,7 +26,7 @@ public class PressAliLink implements CommandExecutor{ for (Link link: setAliLink.linkList){ for (String inputlink: args){ if(inputlink.equals(link.frequency)){ - link.press(module); + link.press(plugin); } } } diff --git a/src/alisolarflare/modules/components/links/entities/Link.java b/src/alisolarflare/modules/components/links/entities/Link.java index a5bd186..cd8b075 100644 --- a/src/alisolarflare/modules/components/links/entities/Link.java +++ b/src/alisolarflare/modules/components/links/entities/Link.java @@ -4,8 +4,8 @@ import java.io.Serializable; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.components.links.AliLinkModule; import alisolarflare.modules.components.links.tasks.UnpressTask; public class Link implements Serializable{ @@ -28,10 +28,14 @@ public class Link implements Serializable{ this.z = "" + location.getBlockZ(); //plugin.plugin.getConfig().set("frequency", 10); } - public void press(AliLinkModule plugin) { - Location location = new Location(plugin.plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); + /** + * Activates the Ali-Link + * @param plugin + */ + public void press(JavaPlugin plugin) { + Location location = new Location(plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); location.getBlock().setType(Material.REDSTONE_BLOCK); UnpressTask unPressTask = new UnpressTask(location); - unPressTask.runTaskTimer(plugin.plugin, 2, 1); + unPressTask.runTaskTimer(plugin, 2, 1); } } diff --git a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java index 2d009b4..bcdc62f 100644 --- a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java +++ b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java @@ -6,13 +6,12 @@ import org.bukkit.entity.Projectile; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.ProjectileLaunchEvent; - -import alisolarflare.AliPresents; +import org.bukkit.plugin.java.JavaPlugin; public class AliArrowListener implements Listener { - private final AliPresents plugin; + private final JavaPlugin plugin; - public AliArrowListener(AliPresents plugin){ + public AliArrowListener(JavaPlugin plugin){ this.plugin = plugin; } diff --git a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java index 2de4069..42f02dd 100644 --- a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java +++ b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java @@ -1,27 +1,16 @@ package alisolarflare.modules.magictrick.aliarrow; -import java.util.logging.Level; -import alisolarflare.AliPresents; -public class AliArrowModule { - private AliPresents plugin; +import org.bukkit.plugin.java.JavaPlugin; +import alisolarflare.modules.Module; - public AliArrowModule(AliPresents plugin){ - this.plugin = plugin; - } +public class AliArrowModule extends Module{ /** * Registers the plugin, activating listeners, commands, and events */ - public void register(){ - registerEvents(); - registerCommands(); - plugin.getLogger().log(Level.INFO, "Discord Sub Plugin Registered!"); - } - private void registerEvents(){ + @Override + public void register(JavaPlugin plugin) { plugin.getServer().getPluginManager().registerEvents(new AliArrowListener(plugin), plugin); - } - private void registerCommands(){ - } } diff --git a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java index b032db1..0a8cdf8 100644 --- a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java +++ b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java @@ -2,18 +2,17 @@ package alisolarflare.modules.magictrick.aliarrow; import org.bukkit.Particle; import org.bukkit.entity.Arrow; +import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; -import alisolarflare.AliPresents; - public class AliArrowTask extends BukkitRunnable{ - AliPresents plugin; + JavaPlugin plugin; String name; Arrow arrow; - public AliArrowTask(AliPresents plugin, Arrow arrow, String name){ + public AliArrowTask(JavaPlugin plugin, Arrow arrow, String name){ this.name = name; this.plugin = plugin; this.arrow = arrow; From bf1847375060f8f8f788374801ea8a83cb166bd0 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 2 Nov 2016 15:33:19 -0400 Subject: [PATCH 050/263] added new files --- .../modules/events/uhc/MatchState.java | 5 +++ .../modules/events/uhc/UHCMatch.java | 42 +------------------ .../modules/events/uhc/UHCModule.java | 1 + .../modules/events/uhc/commands/AddToUHC.java | 2 +- .../listeners/PlayerPowerCyclingListener.java | 18 ++++++++ .../events/uhc/listeners/PlayerPowerTask.java | 24 +++++++++++ .../events/uhc/memory/PlayerPowerModule.java | 5 +++ 7 files changed, 55 insertions(+), 42 deletions(-) create mode 100644 src/alisolarflare/modules/events/uhc/MatchState.java create mode 100644 src/alisolarflare/modules/events/uhc/listeners/PlayerPowerCyclingListener.java create mode 100644 src/alisolarflare/modules/events/uhc/listeners/PlayerPowerTask.java create mode 100644 src/alisolarflare/modules/events/uhc/memory/PlayerPowerModule.java diff --git a/src/alisolarflare/modules/events/uhc/MatchState.java b/src/alisolarflare/modules/events/uhc/MatchState.java new file mode 100644 index 0000000..107358c --- /dev/null +++ b/src/alisolarflare/modules/events/uhc/MatchState.java @@ -0,0 +1,5 @@ +package alisolarflare.modules.events.uhc; + +public enum MatchState { + +} diff --git a/src/alisolarflare/modules/events/uhc/UHCMatch.java b/src/alisolarflare/modules/events/uhc/UHCMatch.java index f8aa26c..9b4bad7 100644 --- a/src/alisolarflare/modules/events/uhc/UHCMatch.java +++ b/src/alisolarflare/modules/events/uhc/UHCMatch.java @@ -11,46 +11,6 @@ import org.bukkit.entity.Player; * @author Alisolarflare */ public class UHCMatch { - private List matchPlayerUsernames = new ArrayList(); + public List matchPlayerUsernames = new ArrayList(); - /** - * Adds a player to an Ultrahardcore match, storing their name - * @param playername player.getName(); - */ - public void addPlayerToMatch(String playername){ - if (!(matchPlayerUsernames.contains(playername))){ - matchPlayerUsernames.add(playername); - } - } - /** - * Adds a player to an Ultrahardcore match, storing their name - * @param player Player to be added - */ - public void addPlayerToMatch(Player player){ - if (!(matchPlayerUsernames.contains(player.getName()))){ - matchPlayerUsernames.add(player.getName()); - } - } - /** - * Removes a player from an Ultrahardcore match, removing their username from the list - * @param player - */ - public void removePlayerFromMatch(Player player){ - if (matchPlayerUsernames.contains(player)){ - matchPlayerUsernames.remove(player.getName()); - } - } - - /** - * Removes all players from the match - */ - public void removeAllPlayersFromMatch(){ - matchPlayerUsernames.clear(); - } - /** - * Fully de-loads and clears out this match, reverting all values to the initialized setting - */ - public void endMatch(){ - matchPlayerUsernames.clear(); - } } diff --git a/src/alisolarflare/modules/events/uhc/UHCModule.java b/src/alisolarflare/modules/events/uhc/UHCModule.java index 35dd1a2..17fa970 100644 --- a/src/alisolarflare/modules/events/uhc/UHCModule.java +++ b/src/alisolarflare/modules/events/uhc/UHCModule.java @@ -7,6 +7,7 @@ import alisolarflare.modules.events.uhc.commands.AddToUHC; public class UHCModule extends Module { public UHCMatch generalMemory; + public String[] finiteStates = {"SETUP", "INTRO", "PEACE", "TENSION", "POWER", "END"}; public void register(JavaPlugin plugin){ registerCommands(plugin); diff --git a/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java b/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java index 02a90cf..227a7c7 100644 --- a/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java +++ b/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java @@ -50,7 +50,7 @@ public class AddToUHC implements CommandExecutor{ //Adds players to memory for (int i = 0; i > args.length; i++){ - generalMemory.addPlayerToMatch(player); + generalMemory.matchPlayerUsernames.add(player.getName()); } return false; } diff --git a/src/alisolarflare/modules/events/uhc/listeners/PlayerPowerCyclingListener.java b/src/alisolarflare/modules/events/uhc/listeners/PlayerPowerCyclingListener.java new file mode 100644 index 0000000..dca5fe2 --- /dev/null +++ b/src/alisolarflare/modules/events/uhc/listeners/PlayerPowerCyclingListener.java @@ -0,0 +1,18 @@ +package alisolarflare.modules.events.uhc.listeners; + +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitTask; + +/** + * Main launcher for the repeating task that activates the + * ghostie powers, if an Ultrahardcore Match is going on, + * and it's time for powers to activate + */ +public class PlayerPowerCyclingListener implements Listener { + public BukkitTask PowerCyclingTask; + + public PlayerPowerCyclingListener(JavaPlugin plugin){ + PowerCyclingTask = (new PlayerPowerTask(plugin)).runTaskTimer(plugin, 20, 20); + } +} diff --git a/src/alisolarflare/modules/events/uhc/listeners/PlayerPowerTask.java b/src/alisolarflare/modules/events/uhc/listeners/PlayerPowerTask.java new file mode 100644 index 0000000..4c41cf6 --- /dev/null +++ b/src/alisolarflare/modules/events/uhc/listeners/PlayerPowerTask.java @@ -0,0 +1,24 @@ +package alisolarflare.modules.events.uhc.listeners; + +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitRunnable; + +/** + * This is the main class that creates and implemnts Ghostie powers + * When run, it will apply the right potion effects to different players + * based on what colours they identify as in that time. + * @author Alisolarflare + * + */ +public class PlayerPowerTask extends BukkitRunnable{ + private JavaPlugin plugin; + public PlayerPowerTask(JavaPlugin plugin){ + this.plugin = plugin; + } + @Override + public void run() { + + } + + +} diff --git a/src/alisolarflare/modules/events/uhc/memory/PlayerPowerModule.java b/src/alisolarflare/modules/events/uhc/memory/PlayerPowerModule.java new file mode 100644 index 0000000..80f9f24 --- /dev/null +++ b/src/alisolarflare/modules/events/uhc/memory/PlayerPowerModule.java @@ -0,0 +1,5 @@ +package alisolarflare.modules.events.uhc.memory; + +public class PlayerPowerModule { + +} From 9e8449e3c951339f0d97e0ee150fb4d58241b882 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 2 Nov 2016 15:33:32 -0400 Subject: [PATCH 051/263] Ripped out a metric SHIT TON of useless code --- src/alisolarflare/modules/events/uhc/MatchState.java | 2 +- .../events/uhc/listeners/PlayerPowerCyclingListener.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/alisolarflare/modules/events/uhc/MatchState.java b/src/alisolarflare/modules/events/uhc/MatchState.java index 107358c..9a6e87c 100644 --- a/src/alisolarflare/modules/events/uhc/MatchState.java +++ b/src/alisolarflare/modules/events/uhc/MatchState.java @@ -1,5 +1,5 @@ package alisolarflare.modules.events.uhc; public enum MatchState { - + SETUP, INTRO, PEACE, TENSION, POWER, END } diff --git a/src/alisolarflare/modules/events/uhc/listeners/PlayerPowerCyclingListener.java b/src/alisolarflare/modules/events/uhc/listeners/PlayerPowerCyclingListener.java index dca5fe2..eee8820 100644 --- a/src/alisolarflare/modules/events/uhc/listeners/PlayerPowerCyclingListener.java +++ b/src/alisolarflare/modules/events/uhc/listeners/PlayerPowerCyclingListener.java @@ -6,7 +6,7 @@ import org.bukkit.scheduler.BukkitTask; /** * Main launcher for the repeating task that activates the - * ghostie powers, if an Ultrahardcore Match is going on, + * ghostie powers if an Ultrahardcore Match is going on, * and it's time for powers to activate */ public class PlayerPowerCyclingListener implements Listener { From 0d3c83b65fbf1af190a62729b035993dc6a8e712 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 2 Nov 2016 16:17:26 -0400 Subject: [PATCH 052/263] Fully rethought the structure of what I'm trying to do --- .../modules/events/uhc/MatchState.java | 5 --- .../modules/events/uhc/UHCMatch.java | 16 --------- .../modules/events/uhc/UHCModule.java | 11 +++--- .../modules/events/uhc/commands/AddToUHC.java | 2 +- .../events/uhc/commands/StartMatch.java | 35 +++++++++++++++++++ ...istener.java => MatchCyclingListener.java} | 6 ++-- .../events/uhc/listeners/MatchMainLoop.java | 12 +++++++ .../events/uhc/listeners/PlayerPowerTask.java | 24 ------------- .../modules/events/uhc/memory/MatchState.java | 5 +++ .../events/uhc/memory/PlayerPowerModule.java | 5 --- .../modules/events/uhc/memory/UHCMatch.java | 34 ++++++++++++++++++ 11 files changed, 96 insertions(+), 59 deletions(-) delete mode 100644 src/alisolarflare/modules/events/uhc/MatchState.java delete mode 100644 src/alisolarflare/modules/events/uhc/UHCMatch.java create mode 100644 src/alisolarflare/modules/events/uhc/commands/StartMatch.java rename src/alisolarflare/modules/events/uhc/listeners/{PlayerPowerCyclingListener.java => MatchCyclingListener.java} (63%) create mode 100644 src/alisolarflare/modules/events/uhc/listeners/MatchMainLoop.java delete mode 100644 src/alisolarflare/modules/events/uhc/listeners/PlayerPowerTask.java create mode 100644 src/alisolarflare/modules/events/uhc/memory/MatchState.java delete mode 100644 src/alisolarflare/modules/events/uhc/memory/PlayerPowerModule.java create mode 100644 src/alisolarflare/modules/events/uhc/memory/UHCMatch.java diff --git a/src/alisolarflare/modules/events/uhc/MatchState.java b/src/alisolarflare/modules/events/uhc/MatchState.java deleted file mode 100644 index 9a6e87c..0000000 --- a/src/alisolarflare/modules/events/uhc/MatchState.java +++ /dev/null @@ -1,5 +0,0 @@ -package alisolarflare.modules.events.uhc; - -public enum MatchState { - SETUP, INTRO, PEACE, TENSION, POWER, END -} diff --git a/src/alisolarflare/modules/events/uhc/UHCMatch.java b/src/alisolarflare/modules/events/uhc/UHCMatch.java deleted file mode 100644 index 9b4bad7..0000000 --- a/src/alisolarflare/modules/events/uhc/UHCMatch.java +++ /dev/null @@ -1,16 +0,0 @@ -package alisolarflare.modules.events.uhc; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.entity.Player; - -/** - * Class that contains the data for a single UltraHardcore Match, - * which represents a single game. - * @author Alisolarflare - */ -public class UHCMatch { - public List matchPlayerUsernames = new ArrayList(); - -} diff --git a/src/alisolarflare/modules/events/uhc/UHCModule.java b/src/alisolarflare/modules/events/uhc/UHCModule.java index 17fa970..77f3ec2 100644 --- a/src/alisolarflare/modules/events/uhc/UHCModule.java +++ b/src/alisolarflare/modules/events/uhc/UHCModule.java @@ -4,10 +4,11 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.modules.Module; import alisolarflare.modules.events.uhc.commands.AddToUHC; +import alisolarflare.modules.events.uhc.commands.StartMatch; +import alisolarflare.modules.events.uhc.memory.UHCMatch; public class UHCModule extends Module { - public UHCMatch generalMemory; - public String[] finiteStates = {"SETUP", "INTRO", "PEACE", "TENSION", "POWER", "END"}; + public UHCMatch match; public void register(JavaPlugin plugin){ registerCommands(plugin); @@ -17,10 +18,10 @@ public class UHCModule extends Module { private void registerListeners(JavaPlugin plugin) { } private void registerCommands(JavaPlugin plugin) { - // TODO Auto-generated method stub - registerCommand(plugin, "addToUHC", new AddToUHC(this.generalMemory)); + registerCommand(plugin, "addToUHC", new AddToUHC(this.match)); + registerCommand(plugin, "startMatch", new StartMatch(this.match)); } private void registerMemoryUnits(JavaPlugin plugin){ - generalMemory = new UHCMatch(); + match = new UHCMatch(plugin.getConfig(), plugin.getConfig().getString("UHCMatchState")); } } diff --git a/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java b/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java index 227a7c7..aa0ed34 100644 --- a/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java +++ b/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java @@ -5,7 +5,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.events.uhc.UHCMatch; +import alisolarflare.modules.events.uhc.memory.UHCMatch; /** * This class handles the specific command /addToUHC which, in-game, diff --git a/src/alisolarflare/modules/events/uhc/commands/StartMatch.java b/src/alisolarflare/modules/events/uhc/commands/StartMatch.java new file mode 100644 index 0000000..8aa5d07 --- /dev/null +++ b/src/alisolarflare/modules/events/uhc/commands/StartMatch.java @@ -0,0 +1,35 @@ +package alisolarflare.modules.events.uhc.commands; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.modules.events.uhc.memory.MatchState; +import alisolarflare.modules.events.uhc.memory.UHCMatch; + +public class StartMatch implements CommandExecutor { + private UHCMatch match; + public StartMatch(UHCMatch match){ + this.match = match; + } + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command! Contact a dev if you think this is wrong"); + } + if (match.getMatchState() == MatchState.NULL) + sender.sendMessage("There is no match to begin."); + else if (match.getMatchState() == MatchState.IDLE) + sender.sendMessage("There is currently a match ready... Activating..."); + else if (match.getMatchState() == MatchState.WAITING) + sender.sendMessage("There currently a match planned for: TIME:TIME:TIME"); + else if (match.getMatchState() == MatchState.END) + sender.sendMessage("The match has ended! Would you like to restart?"); + else + sender.sendMessage("You cannot start a match now, one is already in progress!"); + + return false; + + } +} diff --git a/src/alisolarflare/modules/events/uhc/listeners/PlayerPowerCyclingListener.java b/src/alisolarflare/modules/events/uhc/listeners/MatchCyclingListener.java similarity index 63% rename from src/alisolarflare/modules/events/uhc/listeners/PlayerPowerCyclingListener.java rename to src/alisolarflare/modules/events/uhc/listeners/MatchCyclingListener.java index eee8820..53d5949 100644 --- a/src/alisolarflare/modules/events/uhc/listeners/PlayerPowerCyclingListener.java +++ b/src/alisolarflare/modules/events/uhc/listeners/MatchCyclingListener.java @@ -9,10 +9,10 @@ import org.bukkit.scheduler.BukkitTask; * ghostie powers if an Ultrahardcore Match is going on, * and it's time for powers to activate */ -public class PlayerPowerCyclingListener implements Listener { +public class MatchCyclingListener implements Listener { public BukkitTask PowerCyclingTask; - public PlayerPowerCyclingListener(JavaPlugin plugin){ - PowerCyclingTask = (new PlayerPowerTask(plugin)).runTaskTimer(plugin, 20, 20); + public MatchCyclingListener(JavaPlugin plugin){ + PowerCyclingTask = (new MatchMainLoop()).runTaskTimer(plugin, 20, 20); } } diff --git a/src/alisolarflare/modules/events/uhc/listeners/MatchMainLoop.java b/src/alisolarflare/modules/events/uhc/listeners/MatchMainLoop.java new file mode 100644 index 0000000..e44d372 --- /dev/null +++ b/src/alisolarflare/modules/events/uhc/listeners/MatchMainLoop.java @@ -0,0 +1,12 @@ +package alisolarflare.modules.events.uhc.listeners; + +import org.bukkit.scheduler.BukkitRunnable; + +public class MatchMainLoop extends BukkitRunnable{ + @Override + public void run() { + + } + + +} diff --git a/src/alisolarflare/modules/events/uhc/listeners/PlayerPowerTask.java b/src/alisolarflare/modules/events/uhc/listeners/PlayerPowerTask.java deleted file mode 100644 index 4c41cf6..0000000 --- a/src/alisolarflare/modules/events/uhc/listeners/PlayerPowerTask.java +++ /dev/null @@ -1,24 +0,0 @@ -package alisolarflare.modules.events.uhc.listeners; - -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.scheduler.BukkitRunnable; - -/** - * This is the main class that creates and implemnts Ghostie powers - * When run, it will apply the right potion effects to different players - * based on what colours they identify as in that time. - * @author Alisolarflare - * - */ -public class PlayerPowerTask extends BukkitRunnable{ - private JavaPlugin plugin; - public PlayerPowerTask(JavaPlugin plugin){ - this.plugin = plugin; - } - @Override - public void run() { - - } - - -} diff --git a/src/alisolarflare/modules/events/uhc/memory/MatchState.java b/src/alisolarflare/modules/events/uhc/memory/MatchState.java new file mode 100644 index 0000000..8f65034 --- /dev/null +++ b/src/alisolarflare/modules/events/uhc/memory/MatchState.java @@ -0,0 +1,5 @@ +package alisolarflare.modules.events.uhc.memory; + +public enum MatchState { + NULL, IDLE, WAITING, SETUP, INTRO, PEACE, TENSION, POWER, END +} diff --git a/src/alisolarflare/modules/events/uhc/memory/PlayerPowerModule.java b/src/alisolarflare/modules/events/uhc/memory/PlayerPowerModule.java deleted file mode 100644 index 80f9f24..0000000 --- a/src/alisolarflare/modules/events/uhc/memory/PlayerPowerModule.java +++ /dev/null @@ -1,5 +0,0 @@ -package alisolarflare.modules.events.uhc.memory; - -public class PlayerPowerModule { - -} diff --git a/src/alisolarflare/modules/events/uhc/memory/UHCMatch.java b/src/alisolarflare/modules/events/uhc/memory/UHCMatch.java new file mode 100644 index 0000000..f102be5 --- /dev/null +++ b/src/alisolarflare/modules/events/uhc/memory/UHCMatch.java @@ -0,0 +1,34 @@ +package alisolarflare.modules.events.uhc.memory; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.configuration.file.FileConfiguration; + +/** + * Class that contains the data for a single UltraHardcore Match, + * which represents a single game. + * @author Alisolarflare + */ +public class UHCMatch { + public List matchPlayerUsernames = new ArrayList(); + private MatchState matchState = MatchState.IDLE; + private FileConfiguration fileConfiguration; + + /**Class that fucks shit up*/ + public UHCMatch(FileConfiguration fileConfiguration, String stateName) { + this.fileConfiguration = fileConfiguration; + this.matchState = MatchState.valueOf(stateName); + } + + /**Other class that doesn't fuck shit up*/ + public MatchState getMatchState(){ + return matchState; + } + + /**Other class that REALLY fucks shit up*/ + public void setMatchState(MatchState newMS){ + matchState = newMS; + fileConfiguration.set("UHCMatchState", newMS.toString()); + } +} From 20e8ce27b80d1231a76eb31b51c41351bd59618a Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 3 Nov 2016 01:22:51 +0100 Subject: [PATCH 053/263] Added code for exception handling And other stuff :P --- pom.xml | 134 +++++++++--------- src/alisolarflare/modules/Module.java | 9 +- .../components/flairdoor/FlairDoorModule.java | 9 +- .../flairdoor/commands/FlairMe.java | 30 +++- .../commands/SetFlairDoorColour.java | 54 ++++--- .../components/gpowers/GPowerModule.java | 12 +- .../gpowers/commands/PowerDown.java | 29 +++- .../components/gpowers/commands/PowerUp.java | 32 ++++- .../gpowers/commands/gPowerCommand.java | 52 ++++--- .../components/links/AliLinkModule.java | 23 +-- .../links/commands/PressAliLink.java | 44 ++++-- .../components/links/commands/SetAliLink.java | 112 +++++++++------ .../components/shulker/AliShulkerModule.java | 5 +- .../shulker/commands/AliShulker.java | 48 ++++--- .../modules/events/uhc/UHCModule.java | 11 +- .../modules/events/uhc/commands/AddToUHC.java | 76 ++++++---- .../events/uhc/commands/StartMatch.java | 38 +++-- .../magictrick/aliarrow/AliArrowListener.java | 1 - .../magictrick/aliarrow/AliArrowModule.java | 10 +- .../magictrick/aliarrow/AliArrowTask.java | 22 ++- 20 files changed, 483 insertions(+), 268 deletions(-) diff --git a/pom.xml b/pom.xml index b788546..81da534 100644 --- a/pom.xml +++ b/pom.xml @@ -1,67 +1,73 @@ - - 4.0.0 - com.github.tbmcplugins - AliPresents - 0.0.1-SNAPSHOT - AliPresents - A bucket of aaall the stuff Ali makes. It's a bit smelly. - - src - - - src - - **/*.java - - - - . - - *.yml - - - - - - maven-compiler-plugin - 3.3 - - 1.8 - 1.8 - - - - - - UTF-8 - + + 4.0.0 + com.github.tbmcplugins + AliPresents + 0.0.1-SNAPSHOT + AliPresents + A bucket of aaall the stuff Ali makes. It's a bit smelly. + + src + + + src + + **/*.java + + + + . + + *.yml + + + + + + maven-compiler-plugin + 3.3 + + 1.8 + 1.8 + + + + + + UTF-8 + - - - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots/ - - - jcenter - http://jcenter.bintray.com - - - jitpack.io - https://jitpack.io - - + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + jcenter + http://jcenter.bintray.com + + + jitpack.io + https://jitpack.io + + - - - org.spigotmc - spigot-api - 1.9.2-R0.1-SNAPSHOT - - - - org.apache.commons - commons-lang3 - 3.4 - - + + + org.spigotmc + spigot-api + 1.9.2-R0.1-SNAPSHOT + + + + org.apache.commons + commons-lang3 + 3.4 + + + com.github.TBMCPlugins.ButtonCore + ButtonCore + master-SNAPSHOT + + diff --git a/src/alisolarflare/modules/Module.java b/src/alisolarflare/modules/Module.java index a68d1f6..2284a28 100644 --- a/src/alisolarflare/modules/Module.java +++ b/src/alisolarflare/modules/Module.java @@ -1,9 +1,11 @@ package alisolarflare.modules; -import org.bukkit.command.CommandExecutor; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; +import buttondevteam.lib.chat.TBMCChatAPI; +import buttondevteam.lib.chat.TBMCCommandBase; + /** * A Module class is a helper class that allows the compacting of projects into one single package. * Each feature, whether game, arrow trail listener, or command tool, can have its command and listener @@ -35,9 +37,8 @@ public abstract class Module implements Registerable{ * @param label Name of the command in plugin.yml * @param commandExecutor Custom coded CommandExecutor class */ - protected CommandExecutor registerCommand(JavaPlugin plugin, String label, CommandExecutor commandExecutor){ - plugin.getCommand(label).setExecutor(commandExecutor); - return commandExecutor; + protected void registerCommand(JavaPlugin plugin, String label, Class commandExecutor){ + TBMCChatAPI.AddCommands(plugin, commandExecutor); } protected Listener registerListener(JavaPlugin plugin, Listener listener){ plugin.getServer().getPluginManager().registerEvents(listener, plugin); diff --git a/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java index 2563a3c..2374f61 100644 --- a/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java +++ b/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java @@ -6,13 +6,14 @@ import alisolarflare.modules.Module; import alisolarflare.modules.components.flairdoor.commands.FlairMe; import alisolarflare.modules.components.flairdoor.commands.SetFlairDoorColour; import alisolarflare.modules.components.flairdoor.listeners.PortalListener; +import buttondevteam.lib.TBMCCoreAPI; +import buttondevteam.lib.chat.TBMCChatAPI; -public class FlairDoorModule extends Module{ +public class FlairDoorModule extends Module { @Override public void register(JavaPlugin plugin) { - plugin.getCommand("flairme").setExecutor(new FlairMe()); - plugin.getCommand("setflairdoorcolour").setExecutor(new SetFlairDoorColour()); + TBMCChatAPI.AddCommands(plugin, FlairMe.class); - plugin.getServer().getPluginManager().registerEvents(new PortalListener(plugin), plugin); + TBMCCoreAPI.RegisterEventsForExceptions(new PortalListener(plugin), plugin); } } diff --git a/src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java index 5b10c0c..320f3f8 100644 --- a/src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java @@ -1,19 +1,39 @@ package alisolarflare.modules.components.flairdoor.commands; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import alisolarflare.modules.components.flairdoor.listeners.PortalListener; +import buttondevteam.lib.chat.TBMCCommandBase; -public class FlairMe implements CommandExecutor{ +public class FlairMe extends TBMCCommandBase { @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + public boolean OnCommand(CommandSender sender, String label, String[] args) { sender.sendMessage("Flairing..." + sender.getName()); PortalListener.playersToBeFlaired.add(sender.getName()); sender.sendMessage("Finished Preparation! Walk through a portal to get your flair"); - + + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return new String[] { "" }; + } + + @Override + public String GetCommandPath() { + return "flairme"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { return false; } diff --git a/src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java b/src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java index 686350f..63debd0 100644 --- a/src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java +++ b/src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java @@ -3,46 +3,68 @@ package alisolarflare.modules.components.flairdoor.commands; import java.util.Arrays; import java.util.List; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; -public class SetFlairDoorColour implements CommandExecutor { +import buttondevteam.lib.chat.TBMCCommandBase; + +public class SetFlairDoorColour extends TBMCCommandBase { public static String FlairDoorColorMode = "null"; - public static final List COLOURMODES = Arrays.asList("red", "orange", "yellow", "green", "blue", "purple", "gray"); + public static final List COLOURMODES = Arrays.asList("red", "orange", "yellow", "green", "blue", "purple", + "gray"); + @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (args.length > 1){ + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (args.length > 1) { sender.sendMessage("You must specify and argument, Red-Purple or Null.HHAHHAHAHAHHAHAHAHHA"); } - + String firstCommand = args[0]; firstCommand = firstCommand.toLowerCase(); - if(firstCommand.startsWith("e")|| firstCommand.startsWith("gra")|| firstCommand.startsWith("grey")){ + if (firstCommand.startsWith("e") || firstCommand.startsWith("gra") || firstCommand.startsWith("grey")) { sender.sendMessage("Flair Door Colour Mode set to gray"); FlairDoorColorMode = "gray"; - }else if(firstCommand.startsWith("r")){ + } else if (firstCommand.startsWith("r")) { sender.sendMessage("Flair Door Colour Mode set to Red"); FlairDoorColorMode = "red"; - }else if(firstCommand.startsWith("o")){ + } else if (firstCommand.startsWith("o")) { sender.sendMessage("Flair Door Colour Mode set to Orange"); FlairDoorColorMode = "orange"; - }else if(firstCommand.startsWith("y")){ + } else if (firstCommand.startsWith("y")) { sender.sendMessage("Flair Door Colour Mode set to Yellow"); FlairDoorColorMode = "yellow"; - }else if(firstCommand.startsWith("g")){ + } else if (firstCommand.startsWith("g")) { sender.sendMessage("Flair Door Colour Mode set to Green (use E for grey)"); FlairDoorColorMode = "green"; - }else if(firstCommand.startsWith("b") || firstCommand.startsWith("i")){ + } else if (firstCommand.startsWith("b") || firstCommand.startsWith("i")) { sender.sendMessage("Flair Door Colour Mode set to Blue"); FlairDoorColorMode = "blue"; - }else if(firstCommand.startsWith("v") || firstCommand.startsWith("p")){ + } else if (firstCommand.startsWith("v") || firstCommand.startsWith("p")) { sender.sendMessage("Flair Door Colour Mode set to Purple"); FlairDoorColorMode = "purple"; - }else if(firstCommand.startsWith("n")){ + } else if (firstCommand.startsWith("n")) { sender.sendMessage("Flair Door Colour Mode set to Null"); FlairDoorColorMode = "null"; } return false; - } + } + + @Override + public String[] GetHelpText(String alias) { // TODO + return new String[] { "" }; + } + + @Override + public String GetCommandPath() { + return "setflairdoorcolour"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + return false; + } } diff --git a/src/alisolarflare/modules/components/gpowers/GPowerModule.java b/src/alisolarflare/modules/components/gpowers/GPowerModule.java index 8578d46..2e3632c 100644 --- a/src/alisolarflare/modules/components/gpowers/GPowerModule.java +++ b/src/alisolarflare/modules/components/gpowers/GPowerModule.java @@ -7,16 +7,16 @@ import alisolarflare.modules.components.gpowers.commands.PowerDown; import alisolarflare.modules.components.gpowers.commands.PowerUp; import alisolarflare.modules.components.gpowers.commands.gPowerCommand; import alisolarflare.modules.components.gpowers.listeners.gPowerListener; +import buttondevteam.lib.TBMCCoreAPI; +import buttondevteam.lib.chat.TBMCChatAPI; -public class GPowerModule extends Module{ +public class GPowerModule extends Module { @Override public void register(JavaPlugin plugin) { - plugin.getCommand("powerup").setExecutor(new PowerUp()); - plugin.getCommand("powerdown").setExecutor(new PowerDown()); - plugin.getCommand("gpowercommand").setExecutor(new gPowerCommand()); - - plugin.getServer().getPluginManager().registerEvents(new gPowerListener(plugin), plugin); + TBMCChatAPI.AddCommands(plugin, gPowerCommand.class); + + TBMCCoreAPI.RegisterEventsForExceptions(new gPowerListener(plugin), plugin); } } diff --git a/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java b/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java index d7c42e3..5ecb982 100644 --- a/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java @@ -4,10 +4,35 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; -public class PowerDown implements CommandExecutor { +import buttondevteam.lib.chat.TBMCCommandBase; + +public class PowerDown extends TBMCCommandBase { @Override - public boolean onCommand(CommandSender arg0, Command arg1, String arg2, String[] arg3) { + public boolean OnCommand(CommandSender arg0, String arg2, String[] arg3) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "powerdown"; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { // TODO Auto-generated method stub return false; } diff --git a/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java b/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java index 3668d8d..38fcffc 100644 --- a/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java @@ -5,15 +5,35 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import buttondevteam.lib.chat.TBMCCommandBase; -public class PowerUp implements CommandExecutor{ +public class PowerUp extends TBMCCommandBase { @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - } - //gPowerMemory.PowerUpPlayer(player, colour); + public boolean OnCommand(CommandSender sender, String label, String[] args) { + // gPowerMemory.PowerUpPlayer(player, colour); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "powerup"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub return false; } diff --git a/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java b/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java index b9b105e..9d6c136 100644 --- a/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java +++ b/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java @@ -6,53 +6,67 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.modules.components.gpowers.gPowerMemory; +import buttondevteam.lib.chat.TBMCCommandBase; -public class gPowerCommand implements CommandExecutor{ +public class gPowerCommand extends TBMCCommandBase { @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + public boolean OnCommand(CommandSender sender, String label, String[] args) { sender.sendMessage("G power activate!"); - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - return false; - } Player player = (Player) sender; - if (args.length < 2){ + if (args.length < 2) { player.sendMessage("Proper Usage to test G-Powers:"); player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); return false; } String colour; player.sendMessage("Checking terms..."); - if(args[0].startsWith("r") || - args[0].startsWith("o")|| - args[0].startsWith("y")|| - args[0].startsWith("g")|| - args[0].startsWith("b")|| - args[0].startsWith("p")){ + if (args[0].startsWith("r") || args[0].startsWith("o") || args[0].startsWith("y") || args[0].startsWith("g") + || args[0].startsWith("b") || args[0].startsWith("p")) { colour = args[0]; - }else{ + } else { player.sendMessage("Term Fail: COLOUR. Proper Usage to test G-Powers:"); player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); return false; } boolean isActive; - if(args[1].startsWith("t")){ + if (args[1].startsWith("t")) { isActive = true; - }else if (args[1].startsWith("f")){ + } else if (args[1].startsWith("f")) { isActive = false; - }else{ + } else { player.sendMessage("Term Fail: ACTIVE. Proper Usage to test G-Powers:"); player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); return false; } player.sendMessage("Terms Vaild!"); - if(isActive){ + if (isActive) { gPowerMemory.PowerUpPlayer(player, colour); - }else{ + } else { gPowerMemory.PowerDownPlayer(player); } return false; } + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return new String[] { "" }; + } + + @Override + public String GetCommandPath() { + return "gpower"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + return false; + } + } diff --git a/src/alisolarflare/modules/components/links/AliLinkModule.java b/src/alisolarflare/modules/components/links/AliLinkModule.java index 4861f3a..07a8a51 100644 --- a/src/alisolarflare/modules/components/links/AliLinkModule.java +++ b/src/alisolarflare/modules/components/links/AliLinkModule.java @@ -1,4 +1,5 @@ package alisolarflare.modules.components.links; + import java.util.List; import org.bukkit.plugin.java.JavaPlugin; @@ -7,25 +8,25 @@ import alisolarflare.modules.Module; import alisolarflare.modules.components.links.commands.PressAliLink; import alisolarflare.modules.components.links.commands.SetAliLink; import alisolarflare.modules.components.links.entities.Link; +import buttondevteam.lib.chat.TBMCChatAPI; -public class AliLinkModule extends Module{ +public class AliLinkModule extends Module { private SetAliLink setAliLink; - + @Override - public void register(JavaPlugin plugin){ + public void register(JavaPlugin plugin) { setAliLink = new SetAliLink(plugin); - plugin.getCommand("setalilink").setExecutor(setAliLink); - plugin.getCommand("pressalilink").setExecutor(new PressAliLink(plugin, setAliLink)); - + TBMCChatAPI.AddCommands(plugin, PressAliLink.class); + } - public void saveLinkList(JavaPlugin plugin){ + + public void saveLinkList(JavaPlugin plugin) { plugin.getConfig().set("aliLinkList", setAliLink.linkList); } - + @SuppressWarnings("unchecked") - public List loadLinkList(JavaPlugin plugin){ + public List loadLinkList(JavaPlugin plugin) { return (List) plugin.getConfig().getList("aliLinkList"); } - - + } diff --git a/src/alisolarflare/modules/components/links/commands/PressAliLink.java b/src/alisolarflare/modules/components/links/commands/PressAliLink.java index 7c277fd..c60e43b 100644 --- a/src/alisolarflare/modules/components/links/commands/PressAliLink.java +++ b/src/alisolarflare/modules/components/links/commands/PressAliLink.java @@ -6,26 +6,29 @@ import org.bukkit.command.CommandSender; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.modules.components.links.entities.Link; +import buttondevteam.lib.chat.TBMCCommandBase; -public class PressAliLink implements CommandExecutor{ +public class PressAliLink extends TBMCCommandBase { private JavaPlugin plugin; private SetAliLink setAliLink; - public PressAliLink(JavaPlugin plugin, SetAliLink setAliLink){ + + public PressAliLink(JavaPlugin plugin, SetAliLink setAliLink) { this.plugin = plugin; - this.setAliLink = setAliLink; + this.setAliLink = setAliLink; } + @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + public boolean OnCommand(CommandSender sender, String label, String[] args) { sender.getServer().broadcastMessage(setAliLink.linkList.toString() + "over."); - - if (args.length < 1){ + + if (args.length < 1) { sender.sendMessage("You must specify a link frequency"); sender.sendMessage("/pressalilink [frequency]"); } - for (Link link: setAliLink.linkList){ - for (String inputlink: args){ - if(inputlink.equals(link.frequency)){ + for (Link link : setAliLink.linkList) { + for (String inputlink : args) { + if (inputlink.equals(link.frequency)) { link.press(plugin); } } @@ -33,4 +36,27 @@ public class PressAliLink implements CommandExecutor{ return false; } + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "pressalilink"; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + } diff --git a/src/alisolarflare/modules/components/links/commands/SetAliLink.java b/src/alisolarflare/modules/components/links/commands/SetAliLink.java index ec3083d..83d7de1 100644 --- a/src/alisolarflare/modules/components/links/commands/SetAliLink.java +++ b/src/alisolarflare/modules/components/links/commands/SetAliLink.java @@ -1,6 +1,5 @@ package alisolarflare.modules.components.links.commands; - import java.util.ArrayList; import java.util.List; @@ -14,66 +13,70 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.modules.components.links.AliLinkModule; import alisolarflare.modules.components.links.entities.Link; +import buttondevteam.lib.chat.TBMCCommandBase; /** - * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, - * a location in a world that when called on by {@link Class#PressAliLink}, creates a temporary redstone block, - * enabling wireless redstone + * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, a location in a world that when called on by {@link PressAliLink}, creates a temporary redstone + * block, enabling wireless redstone * - * @see Class#PressAliLink + * @see PressAliLink * @author Alisolarflare * */ -public class SetAliLink implements CommandExecutor{ +public class SetAliLink extends TBMCCommandBase { public List linkList = new ArrayList(); AliLinkModule subplugin; private JavaPlugin plugin; - + /** * Constructs the SetAliLink class - * @param plugin The plugin that contains the configuration file of SetAliLink + * + * @param plugin + * The plugin that contains the configuration file of SetAliLink */ - public SetAliLink(JavaPlugin plugin){ + public SetAliLink(JavaPlugin plugin) { this.plugin = plugin; load(); } + /** - * This command creates an Ali-Link which, when activated by the command /PressAliLink, - * creates a temporary redstone block if and only if /PressAliLink [frequency] matches the frequency - * saved when /SetAliLink [frequency] is called. + * This command creates an Ali-Link which, when activated by the command /PressAliLink, creates a temporary redstone block if and only if /PressAliLink [frequency] matches the frequency saved when + * /SetAliLink [frequency] is called. * * @see Class#PressAliLink - * @param sender Player who sent the command - * @param command Command Object created - * @param label Name of the command - * @param args Arguments: [frequency] [x-coordinate] [y-coordinate] [z-coordinate], where the coordinates point - * to the intended location of the Ali-Link + * @param sender + * Player who sent the command + * @param command + * Command Object created + * @param label + * Name of the command + * @param args + * Arguments: [frequency] [x-coordinate] [y-coordinate] [z-coordinate], where the coordinates point to the intended location of the Ali-Link */ @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + public boolean OnCommand(CommandSender sender, String label, String[] args) { sender.sendMessage("you pressed shit"); - if (args == null || args.length < 1){ + if (args == null || args.length < 1) { sender.sendMessage("You must specify a link frequency"); sender.sendMessage("/pressalilink [name]"); return false; } - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - } Player player = (Player) sender; - if (args.length < 4){ + if (args.length < 4) { player.sendMessage("short"); linkList.add(new Link(args[0], player.getLocation())); save(player); player.sendMessage("end"); return false; } - if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) && StringUtils.isNumericSpace(args[3])){ + if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) + && StringUtils.isNumericSpace(args[3])) { player.sendMessage("CUUUSTOM"); - linkList.add(new Link(args[0],new Location(player.getWorld(), Double.parseDouble(args[1]), Double.parseDouble(args[2]), Double.parseDouble(args[3])))); + linkList.add(new Link(args[0], new Location(player.getWorld(), Double.parseDouble(args[1]), + Double.parseDouble(args[2]), Double.parseDouble(args[3])))); save(player); player.sendMessage("FINISHED"); - }else{ + } else { player.sendMessage("UNCUSTOOM"); linkList.add(new Link(args[0], player.getLocation())); save(player); @@ -82,43 +85,58 @@ public class SetAliLink implements CommandExecutor{ } return false; } + /** - * Tries to save the entire SetAliLink class into memory, which includes - * all of the current Ali-links saved and in use. + * Tries to save the entire SetAliLink class into memory, which includes all of the current Ali-links saved and in use. + * * @param player */ - private void save(Player player){ + private void save(Player player) { player.sendMessage("SAAAVING"); player.sendMessage("SAVE FAILED: TELL ALI TO FIX THE SAVE AND UN-COMMENT THE PARAGRAPH SHE COMMENTED"); player.sendMessage("Link will only last until next server restart"); return; /* - subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); - try { - player.sendMessage("SAVIN"); - subplugin.plugin.saveConfig(); - player.sendMessage("GOOD SAVE"); - } catch (Exception e) { - player.sendMessage("YOU FUCKED STUFF UP"); - // TODO Auto-generated catch block - e.printStackTrace(); - } - */ + * subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); try { player.sendMessage("SAVIN"); subplugin.plugin.saveConfig(); player.sendMessage("GOOD SAVE"); } catch (Exception e) + * { player.sendMessage("YOU FUCKED STUFF UP"); // TODO Auto-generated catch block e.printStackTrace(); } + */ } + /** - * Attempts to load the previous saved state of AliLinks, from the plugin - * configuration file + * Attempts to load the previous saved state of AliLinks, from the plugin configuration file */ @SuppressWarnings("unchecked") - private void load(){ - try{ + private void load() { + try { linkList = (List) plugin.getConfig().getList("aliLinkList"); - if(linkList == null || linkList.isEmpty()){ + if (linkList == null || linkList.isEmpty()) { linkList = new ArrayList(); } - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } - + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "setalilink"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + } diff --git a/src/alisolarflare/modules/components/shulker/AliShulkerModule.java b/src/alisolarflare/modules/components/shulker/AliShulkerModule.java index 97f2e31..cab720f 100644 --- a/src/alisolarflare/modules/components/shulker/AliShulkerModule.java +++ b/src/alisolarflare/modules/components/shulker/AliShulkerModule.java @@ -4,12 +4,13 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.modules.Module; import alisolarflare.modules.components.shulker.commands.AliShulker; +import buttondevteam.lib.chat.TBMCChatAPI; -public class AliShulkerModule extends Module{ +public class AliShulkerModule extends Module { @Override public void register(JavaPlugin plugin) { - plugin.getCommand("alishulker").setExecutor(new AliShulker()); + TBMCChatAPI.AddCommands(plugin, AliShulker.class); } } diff --git a/src/alisolarflare/modules/components/shulker/commands/AliShulker.java b/src/alisolarflare/modules/components/shulker/commands/AliShulker.java index cc802c6..10a61f5 100644 --- a/src/alisolarflare/modules/components/shulker/commands/AliShulker.java +++ b/src/alisolarflare/modules/components/shulker/commands/AliShulker.java @@ -10,37 +10,53 @@ import org.bukkit.entity.Player; import org.bukkit.entity.Shulker; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; + +import buttondevteam.lib.chat.TBMCCommandBase; + /** - * @author Alisolarflare - * This class is responsible for the command /aliShulker, which in-game spawns - * a shulker that: - * Has a health of 10 - * Has a wither and invisibility effect present - * Has noAI - * And is Glowing + * @author Alisolarflare This class is responsible for the command /aliShulker, which in-game spawns a shulker that: Has a health of 10 Has a wither and invisibility effect present Has noAI And is + * Glowing */ -public class AliShulker implements CommandExecutor { +public class AliShulker extends TBMCCommandBase { @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - return false; - } + public boolean OnCommand(CommandSender sender, String label, String[] args) { Player player = (Player) sender; - if(!(player.getName().equals("iie") || player.getName().equals("alisolarflare"))){ + if (!(player.getName().equals("iie") || player.getName().equals("alisolarflare"))) { return false; } Location location = player.getLocation(); Entity entity = player.getWorld().spawnEntity(location, EntityType.SHULKER); Shulker shulker = (Shulker) entity; shulker.setHealth(10); - + shulker.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 1728000, 5, false)); shulker.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 1728000, 5, false)); shulker.setAI(false); shulker.setGlowing(true); - + + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "alishulker"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub return false; } diff --git a/src/alisolarflare/modules/events/uhc/UHCModule.java b/src/alisolarflare/modules/events/uhc/UHCModule.java index 77f3ec2..a8b75d7 100644 --- a/src/alisolarflare/modules/events/uhc/UHCModule.java +++ b/src/alisolarflare/modules/events/uhc/UHCModule.java @@ -6,22 +6,25 @@ import alisolarflare.modules.Module; import alisolarflare.modules.events.uhc.commands.AddToUHC; import alisolarflare.modules.events.uhc.commands.StartMatch; import alisolarflare.modules.events.uhc.memory.UHCMatch; +import buttondevteam.lib.chat.TBMCChatAPI; public class UHCModule extends Module { public UHCMatch match; - public void register(JavaPlugin plugin){ + public void register(JavaPlugin plugin) { registerCommands(plugin); registerListeners(plugin); registerMemoryUnits(plugin); } + private void registerListeners(JavaPlugin plugin) { } + private void registerCommands(JavaPlugin plugin) { - registerCommand(plugin, "addToUHC", new AddToUHC(this.match)); - registerCommand(plugin, "startMatch", new StartMatch(this.match)); + TBMCChatAPI.AddCommands(plugin, AddToUHC.class); } - private void registerMemoryUnits(JavaPlugin plugin){ + + private void registerMemoryUnits(JavaPlugin plugin) { match = new UHCMatch(plugin.getConfig(), plugin.getConfig().getString("UHCMatchState")); } } diff --git a/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java b/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java index aa0ed34..f260a83 100644 --- a/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java +++ b/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java @@ -1,58 +1,80 @@ package alisolarflare.modules.events.uhc.commands; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.modules.events.uhc.memory.UHCMatch; +import buttondevteam.lib.chat.TBMCCommandBase; /** - * This class handles the specific command /addToUHC which, in-game, - * adds a player to a specific UltraHardcore match, that is defined - * by the constructor: {@linkplain #AddToUHC(UHCMatch)} - * @author Alisolarflare + * This class handles the specific command /addToUHC which, in-game, adds a player to a specific UltraHardcore match, that is defined by the constructor: {@linkplain #AddToUHC(UHCMatch)} + * + * @author Alisolarflare */ -public class AddToUHC implements CommandExecutor{ +public class AddToUHC extends TBMCCommandBase { private UHCMatch generalMemory; - - + /** * Constructor for this AddToUHC - * @param generalMemory The Memory Unit for the current match + * + * @param generalMemory + * The Memory Unit for the current match */ - public AddToUHC(UHCMatch generalMemory){ + public AddToUHC(UHCMatch generalMemory) { this.generalMemory = generalMemory; } - + /** * Activated function when /addtoUHC <> is typed in-game - * @param sender CommandSender which sent the command /addToUHC - * @param command Command object created when /addToUHC is called in-game - * @param label Name of the command called - * @param args Arguments passed onto /addToUHC by the player + * + * @param sender + * CommandSender which sent the command /addToUHC + * @param command + * Command object created when /addToUHC is called in-game + * @param label + * Name of the command called + * @param args + * Arguments passed onto /addToUHC by the player */ @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - //INPUT SANITATION - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - return false; - } + public boolean OnCommand(CommandSender sender, String label, String[] args) { + // INPUT SANITATION Player player = (Player) sender; - if (player.getName() != "alisolarflare"){ + if (player.getName() != "alisolarflare") { sender.sendMessage("You must be Ali to use this command, send her a message to change the permissions"); return false; } - if (args.length <= 1){ + if (args.length <= 1) { sender.sendMessage("You must supply at least one playername"); } - - //Adds players to memory - for (int i = 0; i > args.length; i++){ + + // Adds players to memory + for (int i = 0; i > args.length; i++) { generalMemory.matchPlayerUsernames.add(player.getName()); } return false; } + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "addtouhc"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + } diff --git a/src/alisolarflare/modules/events/uhc/commands/StartMatch.java b/src/alisolarflare/modules/events/uhc/commands/StartMatch.java index 8aa5d07..2e2d0de 100644 --- a/src/alisolarflare/modules/events/uhc/commands/StartMatch.java +++ b/src/alisolarflare/modules/events/uhc/commands/StartMatch.java @@ -7,17 +7,17 @@ import org.bukkit.entity.Player; import alisolarflare.modules.events.uhc.memory.MatchState; import alisolarflare.modules.events.uhc.memory.UHCMatch; +import buttondevteam.lib.chat.TBMCCommandBase; -public class StartMatch implements CommandExecutor { +public class StartMatch extends TBMCCommandBase { private UHCMatch match; - public StartMatch(UHCMatch match){ + + public StartMatch(UHCMatch match) { this.match = match; } + @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command! Contact a dev if you think this is wrong"); - } + public boolean OnCommand(CommandSender sender, String label, String[] args) { if (match.getMatchState() == MatchState.NULL) sender.sendMessage("There is no match to begin."); else if (match.getMatchState() == MatchState.IDLE) @@ -28,8 +28,30 @@ public class StartMatch implements CommandExecutor { sender.sendMessage("The match has ended! Would you like to restart?"); else sender.sendMessage("You cannot start a match now, one is already in progress!"); - + + return false; + + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "startmatch"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub return false; - } } diff --git a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java index bcdc62f..eeadd4e 100644 --- a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java +++ b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java @@ -15,7 +15,6 @@ public class AliArrowListener implements Listener { this.plugin = plugin; } - @SuppressWarnings("deprecation") @EventHandler public void onProjectileLaunch(ProjectileLaunchEvent event){ try{ diff --git a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java index 42f02dd..b73167f 100644 --- a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java +++ b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java @@ -1,16 +1,16 @@ package alisolarflare.modules.magictrick.aliarrow; - import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.modules.Module; +import buttondevteam.lib.TBMCCoreAPI; -public class AliArrowModule extends Module{ +public class AliArrowModule extends Module { /** * Registers the plugin, activating listeners, commands, and events */ @Override - public void register(JavaPlugin plugin) { - plugin.getServer().getPluginManager().registerEvents(new AliArrowListener(plugin), plugin); - + public void register(JavaPlugin plugin) { + TBMCCoreAPI.RegisterEventsForExceptions(new AliArrowListener(plugin), plugin); + } } diff --git a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java index 0a8cdf8..1904830 100644 --- a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java +++ b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java @@ -5,35 +5,33 @@ import org.bukkit.entity.Arrow; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; -public class AliArrowTask extends BukkitRunnable{ +public class AliArrowTask extends BukkitRunnable { JavaPlugin plugin; String name; Arrow arrow; - - - - public AliArrowTask(JavaPlugin plugin, Arrow arrow, String name){ + + public AliArrowTask(JavaPlugin plugin, Arrow arrow, String name) { this.name = name; this.plugin = plugin; this.arrow = arrow; } - + @Override public void run() { - if (arrow.isOnGround() || arrow.isDead()){ + if (arrow.isOnGround() || arrow.isDead()) { this.cancel(); } - if (name.equalsIgnoreCase("alisolarflare")){ + if (name.equalsIgnoreCase("alisolarflare")) { arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1); } - if (name.equalsIgnoreCase("Zanthr")){ + if (name.equalsIgnoreCase("Zanthr")) { arrow.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, arrow.getLocation(), 1); arrow.getWorld().spawnParticle(Particle.FLAME, arrow.getLocation(), 1); } - - - + if (name.equals("NorbiPeti")) + arrow.getWorld().spawnParticle(Particle.LAVA, arrow.getLocation(), 1); + } } From 63d234ef1df3eb728c80f06689aa27c414f1231e Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 01:08:09 -0400 Subject: [PATCH 054/263] updated plugin.yml --- plugin.yml | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/plugin.yml b/plugin.yml index 7b9680d..5609337 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,21 +1,25 @@ -main: alisolarflare.AliPresents -name: AliPresents -version: 2.0.1 - -commands: - alishulker: - description: Spawns a shulker at player location Alishulker health withereffect invisibility true experiencedrops - pressalilink: - description: Presses an Ali Link pressalilink frequency - setalilink: - description: Creates an Ali Link setalilink frequency - setflairdoorcolour: - description: Sets the flair door colour mode, when lighting portals - flairme: - description: Activates the Flair Me Command. Ask Ali, she was fucking tired when writing this description - gpowercommand: - description: Testing command for ghostie powers - powerup: - description: Official g-power command that activates the ghostie powerups - powerdown: - description: Offical g-power command that deactivates the ghostie powerups \ No newline at end of file +main: alisolarflare.AliPresents +name: AliPresents +version: 2.0.1 + +commands: + alishulker: + description: Spawns a shulker at player location Alishulker health withereffect invisibility true experiencedrops + pressalilink: + description: Presses an Ali Link pressalilink frequency + setalilink: + description: Creates an Ali Link setalilink frequency + setflairdoorcolour: + description: Sets the flair door colour mode, when lighting portals + flairme: + description: Activates the Flair Me Command. Ask Ali, she was fucking tired when writing this description + gpowercommand: + description: Testing command for ghostie powers + powerup: + description: Official g-power command that activates the ghostie powerups + powerdown: + description: Offical g-power command that deactivates the ghostie powerups + addToUHC: + description: Adds a player to the UltraHardcore match + startMatch: + description: Starts an UltraHardcore match \ No newline at end of file From d0a7e5ecb7a14141528e2eb23fd75b7101b605ef Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 01:15:28 -0400 Subject: [PATCH 055/263] Removed unused imports --- .../modules/components/flairdoor/FlairDoorModule.java | 1 - src/alisolarflare/modules/components/gpowers/GPowerModule.java | 2 -- .../modules/components/gpowers/commands/PowerDown.java | 2 -- .../modules/components/gpowers/commands/PowerUp.java | 3 --- .../modules/components/gpowers/commands/gPowerCommand.java | 2 -- .../modules/components/links/commands/PressAliLink.java | 2 -- .../modules/components/links/commands/SetAliLink.java | 2 -- .../modules/components/shulker/commands/AliShulker.java | 2 -- src/alisolarflare/modules/events/uhc/UHCModule.java | 1 - src/alisolarflare/modules/events/uhc/commands/StartMatch.java | 3 --- .../modules/magictrick/aliarrow/AliArrowListener.java | 1 + 11 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java index 2374f61..5c30133 100644 --- a/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java +++ b/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java @@ -4,7 +4,6 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.modules.Module; import alisolarflare.modules.components.flairdoor.commands.FlairMe; -import alisolarflare.modules.components.flairdoor.commands.SetFlairDoorColour; import alisolarflare.modules.components.flairdoor.listeners.PortalListener; import buttondevteam.lib.TBMCCoreAPI; import buttondevteam.lib.chat.TBMCChatAPI; diff --git a/src/alisolarflare/modules/components/gpowers/GPowerModule.java b/src/alisolarflare/modules/components/gpowers/GPowerModule.java index 2e3632c..4f33f40 100644 --- a/src/alisolarflare/modules/components/gpowers/GPowerModule.java +++ b/src/alisolarflare/modules/components/gpowers/GPowerModule.java @@ -3,8 +3,6 @@ package alisolarflare.modules.components.gpowers; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.modules.Module; -import alisolarflare.modules.components.gpowers.commands.PowerDown; -import alisolarflare.modules.components.gpowers.commands.PowerUp; import alisolarflare.modules.components.gpowers.commands.gPowerCommand; import alisolarflare.modules.components.gpowers.listeners.gPowerListener; import buttondevteam.lib.TBMCCoreAPI; diff --git a/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java b/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java index 5ecb982..b3fd942 100644 --- a/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java @@ -1,7 +1,5 @@ package alisolarflare.modules.components.gpowers.commands; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; diff --git a/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java b/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java index 38fcffc..4d1ed16 100644 --- a/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java @@ -1,9 +1,6 @@ package alisolarflare.modules.components.gpowers.commands; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; import buttondevteam.lib.chat.TBMCCommandBase; diff --git a/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java b/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java index 9d6c136..b536a98 100644 --- a/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java +++ b/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java @@ -1,7 +1,5 @@ package alisolarflare.modules.components.gpowers.commands; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/alisolarflare/modules/components/links/commands/PressAliLink.java b/src/alisolarflare/modules/components/links/commands/PressAliLink.java index c60e43b..0e3e8c4 100644 --- a/src/alisolarflare/modules/components/links/commands/PressAliLink.java +++ b/src/alisolarflare/modules/components/links/commands/PressAliLink.java @@ -1,7 +1,5 @@ package alisolarflare.modules.components.links.commands; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.plugin.java.JavaPlugin; diff --git a/src/alisolarflare/modules/components/links/commands/SetAliLink.java b/src/alisolarflare/modules/components/links/commands/SetAliLink.java index 83d7de1..3b3447e 100644 --- a/src/alisolarflare/modules/components/links/commands/SetAliLink.java +++ b/src/alisolarflare/modules/components/links/commands/SetAliLink.java @@ -5,8 +5,6 @@ import java.util.List; import org.apache.commons.lang3.StringUtils; import org.bukkit.Location; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; diff --git a/src/alisolarflare/modules/components/shulker/commands/AliShulker.java b/src/alisolarflare/modules/components/shulker/commands/AliShulker.java index 10a61f5..252ccf5 100644 --- a/src/alisolarflare/modules/components/shulker/commands/AliShulker.java +++ b/src/alisolarflare/modules/components/shulker/commands/AliShulker.java @@ -1,8 +1,6 @@ package alisolarflare.modules.components.shulker.commands; import org.bukkit.Location; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; diff --git a/src/alisolarflare/modules/events/uhc/UHCModule.java b/src/alisolarflare/modules/events/uhc/UHCModule.java index a8b75d7..550c21b 100644 --- a/src/alisolarflare/modules/events/uhc/UHCModule.java +++ b/src/alisolarflare/modules/events/uhc/UHCModule.java @@ -4,7 +4,6 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.modules.Module; import alisolarflare.modules.events.uhc.commands.AddToUHC; -import alisolarflare.modules.events.uhc.commands.StartMatch; import alisolarflare.modules.events.uhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCChatAPI; diff --git a/src/alisolarflare/modules/events/uhc/commands/StartMatch.java b/src/alisolarflare/modules/events/uhc/commands/StartMatch.java index 2e2d0de..e576556 100644 --- a/src/alisolarflare/modules/events/uhc/commands/StartMatch.java +++ b/src/alisolarflare/modules/events/uhc/commands/StartMatch.java @@ -1,9 +1,6 @@ package alisolarflare.modules.events.uhc.commands; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; import alisolarflare.modules.events.uhc.memory.MatchState; import alisolarflare.modules.events.uhc.memory.UHCMatch; diff --git a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java index eeadd4e..bcdc62f 100644 --- a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java +++ b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java @@ -15,6 +15,7 @@ public class AliArrowListener implements Listener { this.plugin = plugin; } + @SuppressWarnings("deprecation") @EventHandler public void onProjectileLaunch(ProjectileLaunchEvent event){ try{ From 28877a9bfa303f96497c00dbbb26d3c767a49b35 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 02:56:29 -0400 Subject: [PATCH 056/263] Optimized AliArrow code --- src/alisolarflare/AliPresents.java | 4 +- .../magictrick/aliarrow/AliArrowListener.java | 40 ++++++++----------- .../magictrick/aliarrow/AliArrowModule.java | 16 -------- .../magictrick/aliarrow/AliArrowTask.java | 23 ++++++----- 4 files changed, 32 insertions(+), 51 deletions(-) delete mode 100644 src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 64f614a..228fcee 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -11,7 +11,7 @@ import alisolarflare.modules.components.gpowers.GPowerModule; import alisolarflare.modules.components.links.AliLinkModule; import alisolarflare.modules.components.shulker.AliShulkerModule; import alisolarflare.modules.events.uhc.UHCModule; -import alisolarflare.modules.magictrick.aliarrow.AliArrowModule; +import alisolarflare.modules.magictrick.MagicModule; public class AliPresents extends JavaPlugin{ public void onEnable(){ @@ -33,6 +33,6 @@ public class AliPresents extends JavaPlugin{ new AliLinkModule().register(this); new AliShulkerModule().register(this); new UHCModule().register(this); - new AliArrowModule().register(this); + new MagicModule().register(this); } } diff --git a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java index bcdc62f..038b148 100644 --- a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java +++ b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java @@ -2,7 +2,7 @@ package alisolarflare.modules.magictrick.aliarrow; import org.bukkit.entity.Arrow; import org.bukkit.entity.EntityType; -import org.bukkit.entity.Projectile; +import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.ProjectileLaunchEvent; @@ -15,31 +15,25 @@ public class AliArrowListener implements Listener { this.plugin = plugin; } - @SuppressWarnings("deprecation") @EventHandler public void onProjectileLaunch(ProjectileLaunchEvent event){ - try{ - if(!(event.getEntity().getType() == EntityType.ARROW)){ - return; - } - Projectile projectile = event.getEntity(); - Arrow arrow = (Arrow) projectile; - if (!(arrow.isCritical())){ - return; - } - if (projectile.getShooter().equals(plugin.getServer().getPlayer("alisolarflare"))){ - AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow,"alisolarflare"); - aliArrowTask.runTaskTimer(plugin, 2, 1); - return; - }else if (projectile.getShooter().equals(plugin.getServer().getPlayer("Zanthr"))){ - AliArrowTask aliArrowTask = new AliArrowTask(plugin,arrow,"zanthr"); - aliArrowTask.runTaskTimer(plugin, 2, 1); - return; - } - return; - - }catch(Exception e){ + if(event.getEntity().getType() != EntityType.ARROW){ return; } + Arrow arrow = (Arrow) event.getEntity(); + if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player)){ + return; + } + + String user = ((Player) arrow.getShooter()).getName(); + + for (String permittedUser : AliArrowTask.permittedUsers){ + if(permittedUser.equalsIgnoreCase(user)){ + new AliArrowTask(arrow,user).runTaskTimer(plugin, 2, 1); + break; + } + } + return; + } } \ No newline at end of file diff --git a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java deleted file mode 100644 index b73167f..0000000 --- a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowModule.java +++ /dev/null @@ -1,16 +0,0 @@ -package alisolarflare.modules.magictrick.aliarrow; - -import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import buttondevteam.lib.TBMCCoreAPI; - -public class AliArrowModule extends Module { - /** - * Registers the plugin, activating listeners, commands, and events - */ - @Override - public void register(JavaPlugin plugin) { - TBMCCoreAPI.RegisterEventsForExceptions(new AliArrowListener(plugin), plugin); - - } -} diff --git a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java index 1904830..603567d 100644 --- a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java +++ b/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java @@ -2,17 +2,15 @@ package alisolarflare.modules.magictrick.aliarrow; import org.bukkit.Particle; import org.bukkit.entity.Arrow; -import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; public class AliArrowTask extends BukkitRunnable { - JavaPlugin plugin; + static String[] permittedUsers = {"alisolarflare", "Zanthr", "NorbiPeti"}; String name; Arrow arrow; - public AliArrowTask(JavaPlugin plugin, Arrow arrow, String name) { + public AliArrowTask(Arrow arrow, String name) { this.name = name; - this.plugin = plugin; this.arrow = arrow; } @@ -21,16 +19,21 @@ public class AliArrowTask extends BukkitRunnable { if (arrow.isOnGround() || arrow.isDead()) { this.cancel(); } - if (name.equalsIgnoreCase("alisolarflare")) { + + switch(name.toLowerCase()){ + case "alisolarflare": arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1); - } - if (name.equalsIgnoreCase("Zanthr")) { + break; + + case "zanthr": arrow.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, arrow.getLocation(), 1); arrow.getWorld().spawnParticle(Particle.FLAME, arrow.getLocation(), 1); - - } - if (name.equals("NorbiPeti")) + break; + + case "norbipeti": arrow.getWorld().spawnParticle(Particle.LAVA, arrow.getLocation(), 1); + break; + } } From 07d6a32e982dd1479f23286c132615d42cef5302 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 02:56:51 -0400 Subject: [PATCH 057/263] Moved BoomBow to AliPresents --- .../modules/magictrick/MagicModule.java | 22 ++++ .../magictrick/boombow/BoomBowListener.java | 105 ++++++++++++++++++ .../magictrick/boombow/BoomBowRule.java | 80 +++++++++++++ 3 files changed, 207 insertions(+) create mode 100644 src/alisolarflare/modules/magictrick/MagicModule.java create mode 100644 src/alisolarflare/modules/magictrick/boombow/BoomBowListener.java create mode 100644 src/alisolarflare/modules/magictrick/boombow/BoomBowRule.java diff --git a/src/alisolarflare/modules/magictrick/MagicModule.java b/src/alisolarflare/modules/magictrick/MagicModule.java new file mode 100644 index 0000000..b29179e --- /dev/null +++ b/src/alisolarflare/modules/magictrick/MagicModule.java @@ -0,0 +1,22 @@ +package alisolarflare.modules.magictrick; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.modules.Module; +import alisolarflare.modules.events.uhc.commands.AddToUHC; +import alisolarflare.modules.magictrick.aliarrow.AliArrowListener; +import alisolarflare.modules.magictrick.boombow.BoomBowListener; +import buttondevteam.lib.TBMCCoreAPI; +import buttondevteam.lib.chat.TBMCChatAPI; + +public class MagicModule extends Module{ + + @Override + public void register(JavaPlugin plugin) { + TBMCCoreAPI.RegisterEventsForExceptions(new AliArrowListener(plugin), plugin); + TBMCCoreAPI.RegisterEventsForExceptions(new BoomBowListener(), plugin); + TBMCChatAPI.AddCommands(plugin, AddToUHC.class); + + } + +} diff --git a/src/alisolarflare/modules/magictrick/boombow/BoomBowListener.java b/src/alisolarflare/modules/magictrick/boombow/BoomBowListener.java new file mode 100644 index 0000000..3c05bff --- /dev/null +++ b/src/alisolarflare/modules/magictrick/boombow/BoomBowListener.java @@ -0,0 +1,105 @@ +package alisolarflare.modules.magictrick.boombow; + +import org.bukkit.GameMode; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Particle; +import org.bukkit.Sound; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.entity.PlayerDeathEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +public class BoomBowListener implements Listener { + + @EventHandler + public void ClickEvent(PlayerInteractEvent event){ + FlyBowBoost(event); + + } + public void FlyBowBoost(PlayerInteractEvent event){ + + //ACTION SANITATION + if(!(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK)) return; + if(!(event.getPlayer().isGliding())) return; + if(!(event.getMaterial() == Material.BOW)) return; + + //BOW SANITATION + ItemStack bow = event.getItem(); + if(!(bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK))) return; + if(!(bow.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) == 3)) return; + if(!(bow.getItemMeta().getDisplayName().contains("BOOM BOW"))) return; + + //PLAYER SANITATION + Player player = event.getPlayer(); + if(player.getGameMode().equals(GameMode.CREATIVE))return; + + if(bow.containsEnchantment(Enchantment.ARROW_INFINITE)){ + //HAS INIFINITY + Activate(event); + + }else if((player.getInventory().contains(Material.TNT))){ + //HAS TNT + Activate(event); + + //Reduce tnt by 1 + int tntSlot = player.getInventory().first(Material.TNT); + ItemStack tntStack = player.getInventory().getItem(tntSlot); + if(tntStack.getAmount() > 3){ + tntStack.setAmount(tntStack.getAmount()-3); + }else{ + tntStack.setAmount(0);; + } + + }else{ + return; + } + } + + + + @SuppressWarnings("deprecation") + public void Activate(PlayerInteractEvent event){ + //INIT - Player variables + Player player = event.getPlayer(); + Location playerLocation = player.getLocation(); + + //TODO: NERF - boomDecay + //TODO: NERF - endCrystal + //TODO: NERF - healthReduction + //TODO: NERF - localized + + if(BoomBowRule.boomDecay); + if(BoomBowRule.endCrystal){ + } + if(BoomBowRule.healthReduction){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1)); + } + if(BoomBowRule.localized); + + + //SET - Player Velocity + player.setVelocity(event.getPlayer().getLocation().getDirection().normalize().multiply(2.5)); + player.sendMessage("" + event.getPlayer().getVelocity().length()); + + //CREATE - Explosion + damage + player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); + event.getPlayer().getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); + player.damage(9.0, player); + player.getItemInHand().setDurability((short) (player.getItemInHand().getDurability() - 3)); + + + + + } + public void FlyBowBoostDeath(PlayerDeathEvent event){ + event.getEntity().getServer().broadcastMessage("[boombow debug]: "+event.getEntity().getLastDamageCause().getCause().toString()); + + } +} diff --git a/src/alisolarflare/modules/magictrick/boombow/BoomBowRule.java b/src/alisolarflare/modules/magictrick/boombow/BoomBowRule.java new file mode 100644 index 0000000..06f5ea0 --- /dev/null +++ b/src/alisolarflare/modules/magictrick/boombow/BoomBowRule.java @@ -0,0 +1,80 @@ +package alisolarflare.modules.magictrick.boombow; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import buttondevteam.lib.chat.TBMCCommandBase; +//HEHEHHEHEH EAASSSTER EGGS +public class BoomBowRule extends TBMCCommandBase{ + public static boolean boomDecay; + public static boolean healthReduction; + public static boolean endCrystal; + public static boolean localized;; + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (sender instanceof Player == false){ + sender.sendMessage("You must be a player to use this command"); + return false; + } + Player player = (Player) sender; + if (player.getName().equals("alisolarflare") == false){ + player.sendMessage("You must be alisolarflare to use this command"); + return false; + } + if (args.length < 2){ + player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); + player.sendMessage("Rule settings: boomDecay, healthReduction, endCrystal, localized"); + return false; + } + if(!(args[1].startsWith("t")|| args[1].startsWith("f"))){ + player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); + return false; + } + boolean gameRule = false; + if(args[1].startsWith("t") || args[1].startsWith("T")){ + gameRule = true; + } + switch(args[0]){ + case "boomDecay": + boomDecay = gameRule; + break; + case "healthReduction": + healthReduction = gameRule; + break; + case "endCrystal": + endCrystal = gameRule; + break; + case "localized": + localized = gameRule; + break; + default: + player.sendMessage("Error: "+args[0]+" not defined as a rule"); + player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); + player.sendMessage("Rule settings: boomDecay, healthReduction, endCrystal, localized"); + break; + } + + return false; + } + @Override + public String GetCommandPath() { + // TODO Auto-generated method stub + return null; + } + @Override + public String[] GetHelpText(String arg0) { + // TODO Auto-generated method stub + return null; + } + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + +} From 1dfef6a08d8d683bbc24a0fd894b6876ecf89d23 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 07:01:50 -0400 Subject: [PATCH 058/263] nom nom nom --- src/alisolarflare/AliPresents.java | 2 +- .../freeforall/Freeforall.java | 29 +++++++ .../freeforall/StartMinigame.java | 5 ++ .../freeforall/commands/SetFFAS.java | 79 +++++++++++++++++++ .../buttonminigames/freeforall/data/Data.java | 8 ++ .../freeforall/data/SpawnSet.java | 27 +++++++ .../freeforall/entities/Fighter.java | 17 ++++ .../buttonminigames/hero/Hero.java | 21 +++++ .../buttonminigames/lobby/Lobby.java | 25 ++++++ .../lobby/commands/ButtonFight.java | 40 ++++++++++ .../lobby/commands/ButtonLeave.java | 35 ++++++++ .../lobby/commands/ListFighters.java | 20 +++++ .../modules/events/uhc/commands/AddToUHC.java | 26 +----- .../modules/events/uhc/memory/UHCMatch.java | 2 +- .../{magictrick => magic}/MagicModule.java | 6 +- .../aliarrow/AliArrowListener.java | 2 +- .../aliarrow/AliArrowTask.java | 2 +- .../boombow/BoomBowListener.java | 2 +- .../boombow/BoomBowRule.java | 2 +- 19 files changed, 319 insertions(+), 31 deletions(-) create mode 100644 src/alisolarflare/buttonminigames/freeforall/Freeforall.java create mode 100644 src/alisolarflare/buttonminigames/freeforall/StartMinigame.java create mode 100644 src/alisolarflare/buttonminigames/freeforall/commands/SetFFAS.java create mode 100644 src/alisolarflare/buttonminigames/freeforall/data/Data.java create mode 100644 src/alisolarflare/buttonminigames/freeforall/data/SpawnSet.java create mode 100644 src/alisolarflare/buttonminigames/freeforall/entities/Fighter.java create mode 100644 src/alisolarflare/buttonminigames/hero/Hero.java create mode 100644 src/alisolarflare/buttonminigames/lobby/Lobby.java create mode 100644 src/alisolarflare/buttonminigames/lobby/commands/ButtonFight.java create mode 100644 src/alisolarflare/buttonminigames/lobby/commands/ButtonLeave.java create mode 100644 src/alisolarflare/buttonminigames/lobby/commands/ListFighters.java rename src/alisolarflare/modules/{magictrick => magic}/MagicModule.java (73%) rename src/alisolarflare/modules/{magictrick => magic}/aliarrow/AliArrowListener.java (91%) rename src/alisolarflare/modules/{magictrick => magic}/aliarrow/AliArrowTask.java (90%) rename src/alisolarflare/modules/{magictrick => magic}/boombow/BoomBowListener.java (95%) rename src/alisolarflare/modules/{magictrick => magic}/boombow/BoomBowRule.java (94%) diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 228fcee..e2f566d 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -11,7 +11,7 @@ import alisolarflare.modules.components.gpowers.GPowerModule; import alisolarflare.modules.components.links.AliLinkModule; import alisolarflare.modules.components.shulker.AliShulkerModule; import alisolarflare.modules.events.uhc.UHCModule; -import alisolarflare.modules.magictrick.MagicModule; +import alisolarflare.modules.magic.MagicModule; public class AliPresents extends JavaPlugin{ public void onEnable(){ diff --git a/src/alisolarflare/buttonminigames/freeforall/Freeforall.java b/src/alisolarflare/buttonminigames/freeforall/Freeforall.java new file mode 100644 index 0000000..1d7be0b --- /dev/null +++ b/src/alisolarflare/buttonminigames/freeforall/Freeforall.java @@ -0,0 +1,29 @@ +package alisolarflare.buttonminigames.freeforall; + + +import alisolarflare.MainPlugin; +import alisolarflare.buttonminigames.freeforall.commands.SetFFAS; +import alisolarflare.buttonminigames.freeforall.data.SpawnSet; + +public class Freeforall { + private MainPlugin plugin; + public SpawnSet spawnSet; + private int GameState; + + public Freeforall(MainPlugin plugin){ + this.plugin = plugin; + this.spawnSet = new SpawnSet(); + } + public void register(){ + registerEvents(); + registerCommands(); + } + private void registerEvents() { + } + + private void registerCommands() { + plugin.getCommand("setFFAS").setExecutor(new SetFFAS(plugin, spawnSet)); + } + public int getGameState() {return GameState;} + public void setGameState(int gameState) {GameState = gameState;} +} diff --git a/src/alisolarflare/buttonminigames/freeforall/StartMinigame.java b/src/alisolarflare/buttonminigames/freeforall/StartMinigame.java new file mode 100644 index 0000000..22a0102 --- /dev/null +++ b/src/alisolarflare/buttonminigames/freeforall/StartMinigame.java @@ -0,0 +1,5 @@ +package alisolarflare.buttonminigames.freeforall; + +public class StartMinigame { + +} diff --git a/src/alisolarflare/buttonminigames/freeforall/commands/SetFFAS.java b/src/alisolarflare/buttonminigames/freeforall/commands/SetFFAS.java new file mode 100644 index 0000000..abde10d --- /dev/null +++ b/src/alisolarflare/buttonminigames/freeforall/commands/SetFFAS.java @@ -0,0 +1,79 @@ +package alisolarflare.buttonminigames.freeforall.commands; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.MainPlugin; +import alisolarflare.buttonminigames.freeforall.data.SpawnSet; + +public class SetFFAS implements CommandExecutor{ + private MainPlugin plugin; + private SpawnSet spawnSet; + + public SetFFAS(MainPlugin plugin, SpawnSet spawnSet){ + this.plugin = plugin; + this.spawnSet = spawnSet; + } + @SuppressWarnings("deprecation") + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (!(sender instanceof Player)){ + sender.sendMessage("ERROR: You must be a Alisolarflare and playing to use this command!"); + } + Player player = (Player) sender; + + if(!(player.equals(plugin.getServer().getPlayer("Alisolarflare")))){ + player.sendMessage("ERROR: You must be Alisolarflare to use this command!"); + } + + if(args.length <= 0){ + sender.sendMessage("ERROR: Arguments required."); + return false; + } + + String input = args[0]; + + if(input == null){ + sender.sendMessage("ERROR: Arguments are null"); + return false; + } + + input.toLowerCase(); + switch(input){ + case ("r"): + sender.sendMessage("Setting Red Spawn..."); + spawnSet.setRSpawn(player.getLocation()); + sender.sendMessage("Red Spawn Set!"); + break; + case ("o"): + sender.sendMessage("Setting Orange Spawn..."); + spawnSet.setRSpawn(player.getLocation()); + sender.sendMessage("Orange Spawn Set!"); + break; + case ("y"): + sender.sendMessage("Setting Yellow Spawn..."); + spawnSet.setRSpawn(player.getLocation()); + sender.sendMessage("Yellow Spawn Set!"); + break; + case ("g"): + sender.sendMessage("Setting Green Spawn..."); + spawnSet.setRSpawn(player.getLocation()); + sender.sendMessage("Green Spawn Set!"); + break; + case ("b"): + sender.sendMessage("Setting Blue Spawn..."); + spawnSet.setRSpawn(player.getLocation()); + sender.sendMessage("Blue Spawn Set!"); + break; + case ("p"): + sender.sendMessage("Setting Purple Spawn..."); + spawnSet.setRSpawn(player.getLocation()); + sender.sendMessage("Purple Spawn Set!"); + break; + } + return false; + } + +} diff --git a/src/alisolarflare/buttonminigames/freeforall/data/Data.java b/src/alisolarflare/buttonminigames/freeforall/data/Data.java new file mode 100644 index 0000000..c537b74 --- /dev/null +++ b/src/alisolarflare/buttonminigames/freeforall/data/Data.java @@ -0,0 +1,8 @@ +package alisolarflare.buttonminigames.freeforall.data; + +public class Data { + public SpawnSet spawnset; + public Data(){ + spawnset = new SpawnSet(); + } +} diff --git a/src/alisolarflare/buttonminigames/freeforall/data/SpawnSet.java b/src/alisolarflare/buttonminigames/freeforall/data/SpawnSet.java new file mode 100644 index 0000000..8871a88 --- /dev/null +++ b/src/alisolarflare/buttonminigames/freeforall/data/SpawnSet.java @@ -0,0 +1,27 @@ +package alisolarflare.buttonminigames.freeforall.data; + +import org.bukkit.Location; + +public class SpawnSet { + private Location RSpawn; + private Location OSpawn; + private Location YSpawn; + private Location GSpawn; + private Location BSpawn; + private Location PSpawn; + + public Location getRSpawn(){return RSpawn;} + public Location getOSpawn(){return OSpawn;} + public Location getYSpawn(){return YSpawn;} + public Location getGSpawn(){return GSpawn;} + public Location getBSpawn(){return BSpawn;} + public Location getPSpawn(){return PSpawn;} + + public void setRSpawn(Location RSpawn){this.RSpawn = RSpawn; return;} + public void setOSpawn(Location OSpawn){this.OSpawn = OSpawn; return;} + public void setYSpawn(Location YSpawn){this.YSpawn = YSpawn; return;} + public void setGSpawn(Location GSpawn){this.GSpawn = GSpawn; return;} + public void setBSpawn(Location BSpawn){this.BSpawn = BSpawn; return;} + public void setPSpawn(Location PSpawn){this.PSpawn = PSpawn; return;} + +} diff --git a/src/alisolarflare/buttonminigames/freeforall/entities/Fighter.java b/src/alisolarflare/buttonminigames/freeforall/entities/Fighter.java new file mode 100644 index 0000000..7963aee --- /dev/null +++ b/src/alisolarflare/buttonminigames/freeforall/entities/Fighter.java @@ -0,0 +1,17 @@ +package alisolarflare.buttonminigames.freeforall.entities; + +import org.bukkit.entity.Player; + +public class Fighter { + public Player player; + public String colour; + public Fighter(Player player){ + this.player = player; + } + public Fighter(Player player, String colour){ + this.colour = colour; + } + public String ToString(){ + return player.toString() +": " + colour.toString(); + } +} diff --git a/src/alisolarflare/buttonminigames/hero/Hero.java b/src/alisolarflare/buttonminigames/hero/Hero.java new file mode 100644 index 0000000..b7baf5c --- /dev/null +++ b/src/alisolarflare/buttonminigames/hero/Hero.java @@ -0,0 +1,21 @@ +package alisolarflare.buttonminigames.hero; + + +import alisolarflare.MainPlugin; + +public class Hero { + @SuppressWarnings("unused") + private MainPlugin plugin; + public Hero(MainPlugin plugin){ + this.plugin = plugin; + } + public void register(){ + registerEvents(); + registerCommands(); + } + private void registerEvents() { + } + + private void registerCommands() { + } +} diff --git a/src/alisolarflare/buttonminigames/lobby/Lobby.java b/src/alisolarflare/buttonminigames/lobby/Lobby.java new file mode 100644 index 0000000..9f1f04e --- /dev/null +++ b/src/alisolarflare/buttonminigames/lobby/Lobby.java @@ -0,0 +1,25 @@ +package alisolarflare.buttonminigames.lobby; + +import alisolarflare.MainPlugin; +import alisolarflare.buttonminigames.lobby.commands.ButtonFight; +import alisolarflare.buttonminigames.lobby.commands.ButtonLeave; +import alisolarflare.buttonminigames.lobby.commands.ListFighters; + +public class Lobby { + private MainPlugin plugin; + public Lobby(MainPlugin plugin){ + this.plugin = plugin; + } + public void register(){ + registerEvents(); + registerCommands(); + } + private void registerEvents() { + } + + private void registerCommands() { + plugin.getCommand("buttonfight").setExecutor(new ButtonFight(plugin)); + plugin.getCommand("buttonleave").setExecutor(new ButtonLeave(plugin)); + plugin.getCommand("listfighters").setExecutor(new ListFighters(plugin)); + } +} diff --git a/src/alisolarflare/buttonminigames/lobby/commands/ButtonFight.java b/src/alisolarflare/buttonminigames/lobby/commands/ButtonFight.java new file mode 100644 index 0000000..18abeda --- /dev/null +++ b/src/alisolarflare/buttonminigames/lobby/commands/ButtonFight.java @@ -0,0 +1,40 @@ +package alisolarflare.buttonminigames.lobby.commands; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.MainPlugin; + +public class ButtonFight implements CommandExecutor{ + private MainPlugin plugin; + public ButtonFight(MainPlugin initPlugin){ + plugin = initPlugin; + } + @Override + public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { + + if(!(sender instanceof Player)){ + sender.sendMessage("You must be a player to be using this command!"); + return false; + } + + + Player player = (Player) sender; + player.sendMessage(player.toString()); + + if(plugin.fighters.contains(player)){ + player.sendMessage("You are already in the button fight!"); + return false; + } + + plugin.fighters.add(player); + + if(plugin.fighters.contains(player)){ + player.sendMessage("You have joined the fighters category!"); + } + return false; + } + +} diff --git a/src/alisolarflare/buttonminigames/lobby/commands/ButtonLeave.java b/src/alisolarflare/buttonminigames/lobby/commands/ButtonLeave.java new file mode 100644 index 0000000..840517c --- /dev/null +++ b/src/alisolarflare/buttonminigames/lobby/commands/ButtonLeave.java @@ -0,0 +1,35 @@ +package alisolarflare.buttonminigames.lobby.commands; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.MainPlugin; + +public class ButtonLeave implements CommandExecutor{ + private MainPlugin plugin; + public ButtonLeave(MainPlugin initPlugin){ + plugin = initPlugin; + } + + @Override + public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { + if(!(sender instanceof Player)){ + sender.sendMessage("You must be a player to be using this command!"); + return false; + } + + Player player = (Player) sender; + if (!(plugin.fighters.contains(player))){ + player.sendMessage("You are not fighting!"); + return false; + } + plugin.fighters.remove(player); + if(!(plugin.fighters.contains(player))){ + player.sendMessage("You have left the fighters category!"); + } + return false; + } + +} diff --git a/src/alisolarflare/buttonminigames/lobby/commands/ListFighters.java b/src/alisolarflare/buttonminigames/lobby/commands/ListFighters.java new file mode 100644 index 0000000..1532c4b --- /dev/null +++ b/src/alisolarflare/buttonminigames/lobby/commands/ListFighters.java @@ -0,0 +1,20 @@ +package alisolarflare.buttonminigames.lobby.commands; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +import alisolarflare.MainPlugin; + +public class ListFighters implements CommandExecutor{ + private MainPlugin plugin; + public ListFighters(MainPlugin initPlugin){ + plugin = initPlugin; + } + @Override + public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { + sender.sendMessage(plugin.fighters.toString()); + return false; + } + +} diff --git a/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java b/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java index f260a83..13bf168 100644 --- a/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java +++ b/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java @@ -12,30 +12,12 @@ import buttondevteam.lib.chat.TBMCCommandBase; * @author Alisolarflare */ public class AddToUHC extends TBMCCommandBase { - private UHCMatch generalMemory; + private UHCMatch match; - /** - * Constructor for this AddToUHC - * - * @param generalMemory - * The Memory Unit for the current match - */ - public AddToUHC(UHCMatch generalMemory) { - this.generalMemory = generalMemory; + public AddToUHC(UHCMatch match) { + this.match = match; } - /** - * Activated function when /addtoUHC <> is typed in-game - * - * @param sender - * CommandSender which sent the command /addToUHC - * @param command - * Command object created when /addToUHC is called in-game - * @param label - * Name of the command called - * @param args - * Arguments passed onto /addToUHC by the player - */ @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { // INPUT SANITATION @@ -50,7 +32,7 @@ public class AddToUHC extends TBMCCommandBase { // Adds players to memory for (int i = 0; i > args.length; i++) { - generalMemory.matchPlayerUsernames.add(player.getName()); + match.playerList.add(player.getName()); } return false; } diff --git a/src/alisolarflare/modules/events/uhc/memory/UHCMatch.java b/src/alisolarflare/modules/events/uhc/memory/UHCMatch.java index f102be5..9cf2323 100644 --- a/src/alisolarflare/modules/events/uhc/memory/UHCMatch.java +++ b/src/alisolarflare/modules/events/uhc/memory/UHCMatch.java @@ -11,7 +11,7 @@ import org.bukkit.configuration.file.FileConfiguration; * @author Alisolarflare */ public class UHCMatch { - public List matchPlayerUsernames = new ArrayList(); + public List playerList = new ArrayList(); private MatchState matchState = MatchState.IDLE; private FileConfiguration fileConfiguration; diff --git a/src/alisolarflare/modules/magictrick/MagicModule.java b/src/alisolarflare/modules/magic/MagicModule.java similarity index 73% rename from src/alisolarflare/modules/magictrick/MagicModule.java rename to src/alisolarflare/modules/magic/MagicModule.java index b29179e..e89ff5f 100644 --- a/src/alisolarflare/modules/magictrick/MagicModule.java +++ b/src/alisolarflare/modules/magic/MagicModule.java @@ -1,11 +1,11 @@ -package alisolarflare.modules.magictrick; +package alisolarflare.modules.magic; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.modules.Module; import alisolarflare.modules.events.uhc.commands.AddToUHC; -import alisolarflare.modules.magictrick.aliarrow.AliArrowListener; -import alisolarflare.modules.magictrick.boombow.BoomBowListener; +import alisolarflare.modules.magic.aliarrow.AliArrowListener; +import alisolarflare.modules.magic.boombow.BoomBowListener; import buttondevteam.lib.TBMCCoreAPI; import buttondevteam.lib.chat.TBMCChatAPI; diff --git a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java b/src/alisolarflare/modules/magic/aliarrow/AliArrowListener.java similarity index 91% rename from src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java rename to src/alisolarflare/modules/magic/aliarrow/AliArrowListener.java index 038b148..5c678d7 100644 --- a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowListener.java +++ b/src/alisolarflare/modules/magic/aliarrow/AliArrowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magictrick.aliarrow; +package alisolarflare.modules.magic.aliarrow; import org.bukkit.entity.Arrow; import org.bukkit.entity.EntityType; diff --git a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java b/src/alisolarflare/modules/magic/aliarrow/AliArrowTask.java similarity index 90% rename from src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java rename to src/alisolarflare/modules/magic/aliarrow/AliArrowTask.java index 603567d..11451c5 100644 --- a/src/alisolarflare/modules/magictrick/aliarrow/AliArrowTask.java +++ b/src/alisolarflare/modules/magic/aliarrow/AliArrowTask.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magictrick.aliarrow; +package alisolarflare.modules.magic.aliarrow; import org.bukkit.Particle; import org.bukkit.entity.Arrow; diff --git a/src/alisolarflare/modules/magictrick/boombow/BoomBowListener.java b/src/alisolarflare/modules/magic/boombow/BoomBowListener.java similarity index 95% rename from src/alisolarflare/modules/magictrick/boombow/BoomBowListener.java rename to src/alisolarflare/modules/magic/boombow/BoomBowListener.java index 3c05bff..86b6e06 100644 --- a/src/alisolarflare/modules/magictrick/boombow/BoomBowListener.java +++ b/src/alisolarflare/modules/magic/boombow/BoomBowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magictrick.boombow; +package alisolarflare.modules.magic.boombow; import org.bukkit.GameMode; import org.bukkit.Location; diff --git a/src/alisolarflare/modules/magictrick/boombow/BoomBowRule.java b/src/alisolarflare/modules/magic/boombow/BoomBowRule.java similarity index 94% rename from src/alisolarflare/modules/magictrick/boombow/BoomBowRule.java rename to src/alisolarflare/modules/magic/boombow/BoomBowRule.java index 06f5ea0..7b7c493 100644 --- a/src/alisolarflare/modules/magictrick/boombow/BoomBowRule.java +++ b/src/alisolarflare/modules/magic/boombow/BoomBowRule.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magictrick.boombow; +package alisolarflare.modules.magic.boombow; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; From c3f642c65b98bb64c39533850a772a95ee72331b Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 07:04:02 -0400 Subject: [PATCH 059/263] ARLAJGAGAPGEPVECH --- .../buttonminigames/freeforall/commands/SetFFAS.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/alisolarflare/buttonminigames/freeforall/commands/SetFFAS.java b/src/alisolarflare/buttonminigames/freeforall/commands/SetFFAS.java index abde10d..760ba83 100644 --- a/src/alisolarflare/buttonminigames/freeforall/commands/SetFFAS.java +++ b/src/alisolarflare/buttonminigames/freeforall/commands/SetFFAS.java @@ -9,11 +9,9 @@ import alisolarflare.MainPlugin; import alisolarflare.buttonminigames.freeforall.data.SpawnSet; public class SetFFAS implements CommandExecutor{ - private MainPlugin plugin; private SpawnSet spawnSet; - public SetFFAS(MainPlugin plugin, SpawnSet spawnSet){ - this.plugin = plugin; + public SetFFAS(SpawnSet spawnSet){ this.spawnSet = spawnSet; } @SuppressWarnings("deprecation") @@ -24,7 +22,7 @@ public class SetFFAS implements CommandExecutor{ } Player player = (Player) sender; - if(!(player.equals(plugin.getServer().getPlayer("Alisolarflare")))){ + if(!(player.getName().equalsIgnoreCase("Alisolarflare"))){ player.sendMessage("ERROR: You must be Alisolarflare to use this command!"); } From 73bdb7e0bf50ac31567307665f98b73e17804786 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 07:35:25 -0400 Subject: [PATCH 060/263] Fully digested ButtonMinigames --- src/alisolarflare/AliPresents.java | 12 ++--- src/alisolarflare/{modules => }/Module.java | 4 +- .../freeforall/Freeforall.java | 29 ----------- .../freeforall/StartMinigame.java | 5 -- .../buttonminigames/hero/Hero.java | 21 -------- .../buttonminigames/lobby/Lobby.java | 25 ---------- .../components/flairdoor/FlairDoorModule.java | 8 +-- .../flairdoor/commands/FlairMe.java | 4 +- .../commands/SetFlairDoorColour.java | 2 +- .../flairdoor/listeners/PortalListener.java | 2 +- .../components/gpowers/GPowerModule.java | 8 +-- .../gpowers/commands/PowerDown.java | 2 +- .../components/gpowers/commands/PowerUp.java | 2 +- .../gpowers/commands/gPowerCommand.java | 4 +- .../components/gpowers/gPowerMemory.java | 2 +- .../gpowers/listeners/gPowerApplyingTask.java | 4 +- .../gpowers/listeners/gPowerListener.java | 2 +- .../components/links/AliLinkModule.java | 10 ++-- .../links/commands/PressAliLink.java | 4 +- .../components/links/commands/SetAliLink.java | 6 +-- .../components/links/entities/Link.java | 4 +- .../links/serializer/Deserializer.java | 4 +- .../links/serializer/Serializer.java | 4 +- .../components/links/tasks/UnpressTask.java | 2 +- .../components/shulker/AliShulkerModule.java | 6 +-- .../shulker/commands/AliShulker.java | 2 +- .../{modules => }/events/uhc/UHCModule.java | 8 +-- .../events/uhc/commands/AddToUHC.java | 4 +- .../events/uhc/commands/StartMatch.java | 6 +-- .../uhc/listeners/MatchCyclingListener.java | 2 +- .../events/uhc/listeners/MatchMainLoop.java | 2 +- .../events/uhc/memory/MatchState.java | 2 +- .../events/uhc/memory/UHCMatch.java | 2 +- .../{modules => }/magic/MagicModule.java | 10 ++-- .../magic/aliarrow/AliArrowListener.java | 2 +- .../magic/aliarrow/AliArrowTask.java | 2 +- .../magic/boombow/BoomBowListener.java | 2 +- .../magic/boombow/BoomBowRule.java | 2 +- .../freeforall/FreeForAllModule.java | 34 +++++++++++++ .../minigames/freeforall/StartMinigame.java | 5 ++ .../freeforall/commands/SetFFAS.java | 50 ++++++++++++------- .../freeforall/data/Data.java | 2 +- .../freeforall/data/SpawnSet.java | 2 +- .../freeforall/entities/Fighter.java | 2 +- .../minigames/lobby/LobbyModule.java | 27 ++++++++++ .../lobby/commands/ButtonFight.java | 20 ++++---- .../lobby/commands/ButtonLeave.java | 22 ++++---- .../lobby/commands/ListFighters.java | 14 +++--- src/alisolarflare/modules/Registerable.java | 11 ---- 49 files changed, 203 insertions(+), 208 deletions(-) rename src/alisolarflare/{modules => }/Module.java (93%) delete mode 100644 src/alisolarflare/buttonminigames/freeforall/Freeforall.java delete mode 100644 src/alisolarflare/buttonminigames/freeforall/StartMinigame.java delete mode 100644 src/alisolarflare/buttonminigames/hero/Hero.java delete mode 100644 src/alisolarflare/buttonminigames/lobby/Lobby.java rename src/alisolarflare/{modules => }/components/flairdoor/FlairDoorModule.java (58%) rename src/alisolarflare/{modules => }/components/flairdoor/commands/FlairMe.java (81%) rename src/alisolarflare/{modules => }/components/flairdoor/commands/SetFlairDoorColour.java (94%) rename src/alisolarflare/{modules => }/components/flairdoor/listeners/PortalListener.java (95%) rename src/alisolarflare/{modules => }/components/gpowers/GPowerModule.java (59%) rename src/alisolarflare/{modules => }/components/gpowers/commands/PowerDown.java (87%) rename src/alisolarflare/{modules => }/components/gpowers/commands/PowerUp.java (87%) rename src/alisolarflare/{modules => }/components/gpowers/commands/gPowerCommand.java (90%) rename src/alisolarflare/{modules => }/components/gpowers/gPowerMemory.java (94%) rename src/alisolarflare/{modules => }/components/gpowers/listeners/gPowerApplyingTask.java (93%) rename src/alisolarflare/{modules => }/components/gpowers/listeners/gPowerListener.java (90%) rename src/alisolarflare/{modules => }/components/links/AliLinkModule.java (66%) rename src/alisolarflare/{modules => }/components/links/commands/PressAliLink.java (87%) rename src/alisolarflare/{modules => }/components/links/commands/SetAliLink.java (92%) rename src/alisolarflare/{modules => }/components/links/entities/Link.java (86%) rename src/alisolarflare/{modules => }/components/links/serializer/Deserializer.java (81%) rename src/alisolarflare/{modules => }/components/links/serializer/Serializer.java (79%) rename src/alisolarflare/{modules => }/components/links/tasks/UnpressTask.java (85%) rename src/alisolarflare/{modules => }/components/shulker/AliShulkerModule.java (59%) rename src/alisolarflare/{modules => }/components/shulker/commands/AliShulker.java (93%) rename src/alisolarflare/{modules => }/events/uhc/UHCModule.java (72%) rename src/alisolarflare/{modules => }/events/uhc/commands/AddToUHC.java (89%) rename src/alisolarflare/{modules => }/events/uhc/commands/StartMatch.java (85%) rename src/alisolarflare/{modules => }/events/uhc/listeners/MatchCyclingListener.java (87%) rename src/alisolarflare/{modules => }/events/uhc/listeners/MatchMainLoop.java (68%) rename src/alisolarflare/{modules => }/events/uhc/memory/MatchState.java (62%) rename src/alisolarflare/{modules => }/events/uhc/memory/UHCMatch.java (91%) rename src/alisolarflare/{modules => }/magic/MagicModule.java (61%) rename src/alisolarflare/{modules => }/magic/aliarrow/AliArrowListener.java (92%) rename src/alisolarflare/{modules => }/magic/aliarrow/AliArrowTask.java (91%) rename src/alisolarflare/{modules => }/magic/boombow/BoomBowListener.java (95%) rename src/alisolarflare/{modules => }/magic/boombow/BoomBowRule.java (94%) create mode 100644 src/alisolarflare/minigames/freeforall/FreeForAllModule.java create mode 100644 src/alisolarflare/minigames/freeforall/StartMinigame.java rename src/alisolarflare/{buttonminigames => minigames}/freeforall/commands/SetFFAS.java (59%) rename src/alisolarflare/{buttonminigames => minigames}/freeforall/data/Data.java (60%) rename src/alisolarflare/{buttonminigames => minigames}/freeforall/data/SpawnSet.java (91%) rename src/alisolarflare/{buttonminigames => minigames}/freeforall/entities/Fighter.java (80%) create mode 100644 src/alisolarflare/minigames/lobby/LobbyModule.java rename src/alisolarflare/{buttonminigames => minigames}/lobby/commands/ButtonFight.java (65%) rename src/alisolarflare/{buttonminigames => minigames}/lobby/commands/ButtonLeave.java (62%) rename src/alisolarflare/{buttonminigames => minigames}/lobby/commands/ListFighters.java (53%) delete mode 100644 src/alisolarflare/modules/Registerable.java diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index e2f566d..e738436 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -6,12 +6,12 @@ import org.bukkit.plugin.PluginDescriptionFile; //import alisolarflare.links.AliLinkSubPlug; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.components.flairdoor.FlairDoorModule; -import alisolarflare.modules.components.gpowers.GPowerModule; -import alisolarflare.modules.components.links.AliLinkModule; -import alisolarflare.modules.components.shulker.AliShulkerModule; -import alisolarflare.modules.events.uhc.UHCModule; -import alisolarflare.modules.magic.MagicModule; +import alisolarflare.components.flairdoor.FlairDoorModule; +import alisolarflare.components.gpowers.GPowerModule; +import alisolarflare.components.links.AliLinkModule; +import alisolarflare.components.shulker.AliShulkerModule; +import alisolarflare.events.uhc.UHCModule; +import alisolarflare.magic.MagicModule; public class AliPresents extends JavaPlugin{ public void onEnable(){ diff --git a/src/alisolarflare/modules/Module.java b/src/alisolarflare/Module.java similarity index 93% rename from src/alisolarflare/modules/Module.java rename to src/alisolarflare/Module.java index 2284a28..986bb00 100644 --- a/src/alisolarflare/modules/Module.java +++ b/src/alisolarflare/Module.java @@ -1,4 +1,4 @@ -package alisolarflare.modules; +package alisolarflare; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; @@ -18,7 +18,7 @@ import buttondevteam.lib.chat.TBMCCommandBase; * @author Alisolarflare * */ -public abstract class Module implements Registerable{ +public abstract class Module{ /** * Registers the project, when called by the Main JavaPlugin class that handles * the main plugin. diff --git a/src/alisolarflare/buttonminigames/freeforall/Freeforall.java b/src/alisolarflare/buttonminigames/freeforall/Freeforall.java deleted file mode 100644 index 1d7be0b..0000000 --- a/src/alisolarflare/buttonminigames/freeforall/Freeforall.java +++ /dev/null @@ -1,29 +0,0 @@ -package alisolarflare.buttonminigames.freeforall; - - -import alisolarflare.MainPlugin; -import alisolarflare.buttonminigames.freeforall.commands.SetFFAS; -import alisolarflare.buttonminigames.freeforall.data.SpawnSet; - -public class Freeforall { - private MainPlugin plugin; - public SpawnSet spawnSet; - private int GameState; - - public Freeforall(MainPlugin plugin){ - this.plugin = plugin; - this.spawnSet = new SpawnSet(); - } - public void register(){ - registerEvents(); - registerCommands(); - } - private void registerEvents() { - } - - private void registerCommands() { - plugin.getCommand("setFFAS").setExecutor(new SetFFAS(plugin, spawnSet)); - } - public int getGameState() {return GameState;} - public void setGameState(int gameState) {GameState = gameState;} -} diff --git a/src/alisolarflare/buttonminigames/freeforall/StartMinigame.java b/src/alisolarflare/buttonminigames/freeforall/StartMinigame.java deleted file mode 100644 index 22a0102..0000000 --- a/src/alisolarflare/buttonminigames/freeforall/StartMinigame.java +++ /dev/null @@ -1,5 +0,0 @@ -package alisolarflare.buttonminigames.freeforall; - -public class StartMinigame { - -} diff --git a/src/alisolarflare/buttonminigames/hero/Hero.java b/src/alisolarflare/buttonminigames/hero/Hero.java deleted file mode 100644 index b7baf5c..0000000 --- a/src/alisolarflare/buttonminigames/hero/Hero.java +++ /dev/null @@ -1,21 +0,0 @@ -package alisolarflare.buttonminigames.hero; - - -import alisolarflare.MainPlugin; - -public class Hero { - @SuppressWarnings("unused") - private MainPlugin plugin; - public Hero(MainPlugin plugin){ - this.plugin = plugin; - } - public void register(){ - registerEvents(); - registerCommands(); - } - private void registerEvents() { - } - - private void registerCommands() { - } -} diff --git a/src/alisolarflare/buttonminigames/lobby/Lobby.java b/src/alisolarflare/buttonminigames/lobby/Lobby.java deleted file mode 100644 index 9f1f04e..0000000 --- a/src/alisolarflare/buttonminigames/lobby/Lobby.java +++ /dev/null @@ -1,25 +0,0 @@ -package alisolarflare.buttonminigames.lobby; - -import alisolarflare.MainPlugin; -import alisolarflare.buttonminigames.lobby.commands.ButtonFight; -import alisolarflare.buttonminigames.lobby.commands.ButtonLeave; -import alisolarflare.buttonminigames.lobby.commands.ListFighters; - -public class Lobby { - private MainPlugin plugin; - public Lobby(MainPlugin plugin){ - this.plugin = plugin; - } - public void register(){ - registerEvents(); - registerCommands(); - } - private void registerEvents() { - } - - private void registerCommands() { - plugin.getCommand("buttonfight").setExecutor(new ButtonFight(plugin)); - plugin.getCommand("buttonleave").setExecutor(new ButtonLeave(plugin)); - plugin.getCommand("listfighters").setExecutor(new ListFighters(plugin)); - } -} diff --git a/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/components/flairdoor/FlairDoorModule.java similarity index 58% rename from src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java rename to src/alisolarflare/components/flairdoor/FlairDoorModule.java index 5c30133..981abdd 100644 --- a/src/alisolarflare/modules/components/flairdoor/FlairDoorModule.java +++ b/src/alisolarflare/components/flairdoor/FlairDoorModule.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.components.flairdoor; +package alisolarflare.components.flairdoor; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.components.flairdoor.commands.FlairMe; -import alisolarflare.modules.components.flairdoor.listeners.PortalListener; +import alisolarflare.Module; +import alisolarflare.components.flairdoor.commands.FlairMe; +import alisolarflare.components.flairdoor.listeners.PortalListener; import buttondevteam.lib.TBMCCoreAPI; import buttondevteam.lib.chat.TBMCChatAPI; diff --git a/src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java similarity index 81% rename from src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java rename to src/alisolarflare/components/flairdoor/commands/FlairMe.java index 320f3f8..548fe9a 100644 --- a/src/alisolarflare/modules/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.components.flairdoor.commands; +package alisolarflare.components.flairdoor.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.components.flairdoor.listeners.PortalListener; +import alisolarflare.components.flairdoor.listeners.PortalListener; import buttondevteam.lib.chat.TBMCCommandBase; public class FlairMe extends TBMCCommandBase { diff --git a/src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java b/src/alisolarflare/components/flairdoor/commands/SetFlairDoorColour.java similarity index 94% rename from src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java rename to src/alisolarflare/components/flairdoor/commands/SetFlairDoorColour.java index 63debd0..4477fb6 100644 --- a/src/alisolarflare/modules/components/flairdoor/commands/SetFlairDoorColour.java +++ b/src/alisolarflare/components/flairdoor/commands/SetFlairDoorColour.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.flairdoor.commands; +package alisolarflare.components.flairdoor.commands; import java.util.Arrays; import java.util.List; diff --git a/src/alisolarflare/modules/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java similarity index 95% rename from src/alisolarflare/modules/components/flairdoor/listeners/PortalListener.java rename to src/alisolarflare/components/flairdoor/listeners/PortalListener.java index abf5e07..4e86f74 100644 --- a/src/alisolarflare/modules/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.flairdoor.listeners; +package alisolarflare.components.flairdoor.listeners; import java.util.AbstractMap; import java.util.ArrayList; diff --git a/src/alisolarflare/modules/components/gpowers/GPowerModule.java b/src/alisolarflare/components/gpowers/GPowerModule.java similarity index 59% rename from src/alisolarflare/modules/components/gpowers/GPowerModule.java rename to src/alisolarflare/components/gpowers/GPowerModule.java index 4f33f40..a73e81e 100644 --- a/src/alisolarflare/modules/components/gpowers/GPowerModule.java +++ b/src/alisolarflare/components/gpowers/GPowerModule.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.components.gpowers; +package alisolarflare.components.gpowers; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.components.gpowers.commands.gPowerCommand; -import alisolarflare.modules.components.gpowers.listeners.gPowerListener; +import alisolarflare.Module; +import alisolarflare.components.gpowers.commands.gPowerCommand; +import alisolarflare.components.gpowers.listeners.gPowerListener; import buttondevteam.lib.TBMCCoreAPI; import buttondevteam.lib.chat.TBMCChatAPI; diff --git a/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java b/src/alisolarflare/components/gpowers/commands/PowerDown.java similarity index 87% rename from src/alisolarflare/modules/components/gpowers/commands/PowerDown.java rename to src/alisolarflare/components/gpowers/commands/PowerDown.java index b3fd942..d94c407 100644 --- a/src/alisolarflare/modules/components/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/components/gpowers/commands/PowerDown.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.gpowers.commands; +package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; diff --git a/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java b/src/alisolarflare/components/gpowers/commands/PowerUp.java similarity index 87% rename from src/alisolarflare/modules/components/gpowers/commands/PowerUp.java rename to src/alisolarflare/components/gpowers/commands/PowerUp.java index 4d1ed16..4392bbe 100644 --- a/src/alisolarflare/modules/components/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/components/gpowers/commands/PowerUp.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.gpowers.commands; +package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; diff --git a/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java b/src/alisolarflare/components/gpowers/commands/gPowerCommand.java similarity index 90% rename from src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java rename to src/alisolarflare/components/gpowers/commands/gPowerCommand.java index b536a98..2683c91 100644 --- a/src/alisolarflare/modules/components/gpowers/commands/gPowerCommand.java +++ b/src/alisolarflare/components/gpowers/commands/gPowerCommand.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.components.gpowers.commands; +package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.components.gpowers.gPowerMemory; +import alisolarflare.components.gpowers.gPowerMemory; import buttondevteam.lib.chat.TBMCCommandBase; public class gPowerCommand extends TBMCCommandBase { diff --git a/src/alisolarflare/modules/components/gpowers/gPowerMemory.java b/src/alisolarflare/components/gpowers/gPowerMemory.java similarity index 94% rename from src/alisolarflare/modules/components/gpowers/gPowerMemory.java rename to src/alisolarflare/components/gpowers/gPowerMemory.java index afc9208..f37fd7a 100644 --- a/src/alisolarflare/modules/components/gpowers/gPowerMemory.java +++ b/src/alisolarflare/components/gpowers/gPowerMemory.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.gpowers; +package alisolarflare.components.gpowers; import java.util.HashMap; import java.util.Map; diff --git a/src/alisolarflare/modules/components/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java similarity index 93% rename from src/alisolarflare/modules/components/gpowers/listeners/gPowerApplyingTask.java rename to src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java index a13a19d..60f2709 100644 --- a/src/alisolarflare/modules/components/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.gpowers.listeners; +package alisolarflare.components.gpowers.listeners; import org.bukkit.Color; import org.bukkit.entity.Player; @@ -7,7 +7,7 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitRunnable; -import alisolarflare.modules.components.gpowers.gPowerMemory; +import alisolarflare.components.gpowers.gPowerMemory; public class gPowerApplyingTask extends BukkitRunnable{ diff --git a/src/alisolarflare/modules/components/gpowers/listeners/gPowerListener.java b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java similarity index 90% rename from src/alisolarflare/modules/components/gpowers/listeners/gPowerListener.java rename to src/alisolarflare/components/gpowers/listeners/gPowerListener.java index 1892244..5ec3780 100644 --- a/src/alisolarflare/modules/components/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.gpowers.listeners; +package alisolarflare.components.gpowers.listeners; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; diff --git a/src/alisolarflare/modules/components/links/AliLinkModule.java b/src/alisolarflare/components/links/AliLinkModule.java similarity index 66% rename from src/alisolarflare/modules/components/links/AliLinkModule.java rename to src/alisolarflare/components/links/AliLinkModule.java index 07a8a51..5760d93 100644 --- a/src/alisolarflare/modules/components/links/AliLinkModule.java +++ b/src/alisolarflare/components/links/AliLinkModule.java @@ -1,13 +1,13 @@ -package alisolarflare.modules.components.links; +package alisolarflare.components.links; import java.util.List; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.components.links.commands.PressAliLink; -import alisolarflare.modules.components.links.commands.SetAliLink; -import alisolarflare.modules.components.links.entities.Link; +import alisolarflare.Module; +import alisolarflare.components.links.commands.PressAliLink; +import alisolarflare.components.links.commands.SetAliLink; +import alisolarflare.components.links.entities.Link; import buttondevteam.lib.chat.TBMCChatAPI; public class AliLinkModule extends Module { diff --git a/src/alisolarflare/modules/components/links/commands/PressAliLink.java b/src/alisolarflare/components/links/commands/PressAliLink.java similarity index 87% rename from src/alisolarflare/modules/components/links/commands/PressAliLink.java rename to src/alisolarflare/components/links/commands/PressAliLink.java index 0e3e8c4..da21f6d 100644 --- a/src/alisolarflare/modules/components/links/commands/PressAliLink.java +++ b/src/alisolarflare/components/links/commands/PressAliLink.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.components.links.commands; +package alisolarflare.components.links.commands; import org.bukkit.command.CommandSender; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.components.links.entities.Link; +import alisolarflare.components.links.entities.Link; import buttondevteam.lib.chat.TBMCCommandBase; public class PressAliLink extends TBMCCommandBase { diff --git a/src/alisolarflare/modules/components/links/commands/SetAliLink.java b/src/alisolarflare/components/links/commands/SetAliLink.java similarity index 92% rename from src/alisolarflare/modules/components/links/commands/SetAliLink.java rename to src/alisolarflare/components/links/commands/SetAliLink.java index 3b3447e..03c4e57 100644 --- a/src/alisolarflare/modules/components/links/commands/SetAliLink.java +++ b/src/alisolarflare/components/links/commands/SetAliLink.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.links.commands; +package alisolarflare.components.links.commands; import java.util.ArrayList; import java.util.List; @@ -9,8 +9,8 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.components.links.AliLinkModule; -import alisolarflare.modules.components.links.entities.Link; +import alisolarflare.components.links.AliLinkModule; +import alisolarflare.components.links.entities.Link; import buttondevteam.lib.chat.TBMCCommandBase; /** diff --git a/src/alisolarflare/modules/components/links/entities/Link.java b/src/alisolarflare/components/links/entities/Link.java similarity index 86% rename from src/alisolarflare/modules/components/links/entities/Link.java rename to src/alisolarflare/components/links/entities/Link.java index cd8b075..f55bfc8 100644 --- a/src/alisolarflare/modules/components/links/entities/Link.java +++ b/src/alisolarflare/components/links/entities/Link.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.links.entities; +package alisolarflare.components.links.entities; import java.io.Serializable; @@ -6,7 +6,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.components.links.tasks.UnpressTask; +import alisolarflare.components.links.tasks.UnpressTask; public class Link implements Serializable{ /** diff --git a/src/alisolarflare/modules/components/links/serializer/Deserializer.java b/src/alisolarflare/components/links/serializer/Deserializer.java similarity index 81% rename from src/alisolarflare/modules/components/links/serializer/Deserializer.java rename to src/alisolarflare/components/links/serializer/Deserializer.java index ff4c1fe..ccc161d 100644 --- a/src/alisolarflare/modules/components/links/serializer/Deserializer.java +++ b/src/alisolarflare/components/links/serializer/Deserializer.java @@ -1,11 +1,11 @@ -package alisolarflare.modules.components.links.serializer; +package alisolarflare.components.links.serializer; import java.io.FileInputStream; import java.io.ObjectInputStream; import java.util.List; -import alisolarflare.modules.components.links.entities.Link; +import alisolarflare.components.links.entities.Link; public class Deserializer{ diff --git a/src/alisolarflare/modules/components/links/serializer/Serializer.java b/src/alisolarflare/components/links/serializer/Serializer.java similarity index 79% rename from src/alisolarflare/modules/components/links/serializer/Serializer.java rename to src/alisolarflare/components/links/serializer/Serializer.java index 359e95a..eb1024f 100644 --- a/src/alisolarflare/modules/components/links/serializer/Serializer.java +++ b/src/alisolarflare/components/links/serializer/Serializer.java @@ -1,11 +1,11 @@ -package alisolarflare.modules.components.links.serializer; +package alisolarflare.components.links.serializer; import java.io.FileOutputStream; import java.io.ObjectOutputStream; import java.util.List; -import alisolarflare.modules.components.links.entities.Link; +import alisolarflare.components.links.entities.Link; public class Serializer { diff --git a/src/alisolarflare/modules/components/links/tasks/UnpressTask.java b/src/alisolarflare/components/links/tasks/UnpressTask.java similarity index 85% rename from src/alisolarflare/modules/components/links/tasks/UnpressTask.java rename to src/alisolarflare/components/links/tasks/UnpressTask.java index 4eed62a..769f4f1 100644 --- a/src/alisolarflare/modules/components/links/tasks/UnpressTask.java +++ b/src/alisolarflare/components/links/tasks/UnpressTask.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.links.tasks; +package alisolarflare.components.links.tasks; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/alisolarflare/modules/components/shulker/AliShulkerModule.java b/src/alisolarflare/components/shulker/AliShulkerModule.java similarity index 59% rename from src/alisolarflare/modules/components/shulker/AliShulkerModule.java rename to src/alisolarflare/components/shulker/AliShulkerModule.java index cab720f..ffccad4 100644 --- a/src/alisolarflare/modules/components/shulker/AliShulkerModule.java +++ b/src/alisolarflare/components/shulker/AliShulkerModule.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.components.shulker; +package alisolarflare.components.shulker; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.components.shulker.commands.AliShulker; +import alisolarflare.Module; +import alisolarflare.components.shulker.commands.AliShulker; import buttondevteam.lib.chat.TBMCChatAPI; public class AliShulkerModule extends Module { diff --git a/src/alisolarflare/modules/components/shulker/commands/AliShulker.java b/src/alisolarflare/components/shulker/commands/AliShulker.java similarity index 93% rename from src/alisolarflare/modules/components/shulker/commands/AliShulker.java rename to src/alisolarflare/components/shulker/commands/AliShulker.java index 252ccf5..1b4a4da 100644 --- a/src/alisolarflare/modules/components/shulker/commands/AliShulker.java +++ b/src/alisolarflare/components/shulker/commands/AliShulker.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.components.shulker.commands; +package alisolarflare.components.shulker.commands; import org.bukkit.Location; import org.bukkit.command.CommandSender; diff --git a/src/alisolarflare/modules/events/uhc/UHCModule.java b/src/alisolarflare/events/uhc/UHCModule.java similarity index 72% rename from src/alisolarflare/modules/events/uhc/UHCModule.java rename to src/alisolarflare/events/uhc/UHCModule.java index 550c21b..4e27b57 100644 --- a/src/alisolarflare/modules/events/uhc/UHCModule.java +++ b/src/alisolarflare/events/uhc/UHCModule.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.events.uhc; +package alisolarflare.events.uhc; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.events.uhc.commands.AddToUHC; -import alisolarflare.modules.events.uhc.memory.UHCMatch; +import alisolarflare.Module; +import alisolarflare.events.uhc.commands.AddToUHC; +import alisolarflare.events.uhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCChatAPI; public class UHCModule extends Module { diff --git a/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java b/src/alisolarflare/events/uhc/commands/AddToUHC.java similarity index 89% rename from src/alisolarflare/modules/events/uhc/commands/AddToUHC.java rename to src/alisolarflare/events/uhc/commands/AddToUHC.java index 13bf168..ba51a83 100644 --- a/src/alisolarflare/modules/events/uhc/commands/AddToUHC.java +++ b/src/alisolarflare/events/uhc/commands/AddToUHC.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.events.uhc.commands; +package alisolarflare.events.uhc.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.events.uhc.memory.UHCMatch; +import alisolarflare.events.uhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCCommandBase; /** diff --git a/src/alisolarflare/modules/events/uhc/commands/StartMatch.java b/src/alisolarflare/events/uhc/commands/StartMatch.java similarity index 85% rename from src/alisolarflare/modules/events/uhc/commands/StartMatch.java rename to src/alisolarflare/events/uhc/commands/StartMatch.java index e576556..513c23d 100644 --- a/src/alisolarflare/modules/events/uhc/commands/StartMatch.java +++ b/src/alisolarflare/events/uhc/commands/StartMatch.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.events.uhc.commands; +package alisolarflare.events.uhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.events.uhc.memory.MatchState; -import alisolarflare.modules.events.uhc.memory.UHCMatch; +import alisolarflare.events.uhc.memory.MatchState; +import alisolarflare.events.uhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCCommandBase; public class StartMatch extends TBMCCommandBase { diff --git a/src/alisolarflare/modules/events/uhc/listeners/MatchCyclingListener.java b/src/alisolarflare/events/uhc/listeners/MatchCyclingListener.java similarity index 87% rename from src/alisolarflare/modules/events/uhc/listeners/MatchCyclingListener.java rename to src/alisolarflare/events/uhc/listeners/MatchCyclingListener.java index 53d5949..892eb07 100644 --- a/src/alisolarflare/modules/events/uhc/listeners/MatchCyclingListener.java +++ b/src/alisolarflare/events/uhc/listeners/MatchCyclingListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.events.uhc.listeners; +package alisolarflare.events.uhc.listeners; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; diff --git a/src/alisolarflare/modules/events/uhc/listeners/MatchMainLoop.java b/src/alisolarflare/events/uhc/listeners/MatchMainLoop.java similarity index 68% rename from src/alisolarflare/modules/events/uhc/listeners/MatchMainLoop.java rename to src/alisolarflare/events/uhc/listeners/MatchMainLoop.java index e44d372..5fc3887 100644 --- a/src/alisolarflare/modules/events/uhc/listeners/MatchMainLoop.java +++ b/src/alisolarflare/events/uhc/listeners/MatchMainLoop.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.events.uhc.listeners; +package alisolarflare.events.uhc.listeners; import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/alisolarflare/modules/events/uhc/memory/MatchState.java b/src/alisolarflare/events/uhc/memory/MatchState.java similarity index 62% rename from src/alisolarflare/modules/events/uhc/memory/MatchState.java rename to src/alisolarflare/events/uhc/memory/MatchState.java index 8f65034..8425f71 100644 --- a/src/alisolarflare/modules/events/uhc/memory/MatchState.java +++ b/src/alisolarflare/events/uhc/memory/MatchState.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.events.uhc.memory; +package alisolarflare.events.uhc.memory; public enum MatchState { NULL, IDLE, WAITING, SETUP, INTRO, PEACE, TENSION, POWER, END diff --git a/src/alisolarflare/modules/events/uhc/memory/UHCMatch.java b/src/alisolarflare/events/uhc/memory/UHCMatch.java similarity index 91% rename from src/alisolarflare/modules/events/uhc/memory/UHCMatch.java rename to src/alisolarflare/events/uhc/memory/UHCMatch.java index 9cf2323..de42cf8 100644 --- a/src/alisolarflare/modules/events/uhc/memory/UHCMatch.java +++ b/src/alisolarflare/events/uhc/memory/UHCMatch.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.events.uhc.memory; +package alisolarflare.events.uhc.memory; import java.util.ArrayList; import java.util.List; diff --git a/src/alisolarflare/modules/magic/MagicModule.java b/src/alisolarflare/magic/MagicModule.java similarity index 61% rename from src/alisolarflare/modules/magic/MagicModule.java rename to src/alisolarflare/magic/MagicModule.java index e89ff5f..628bef8 100644 --- a/src/alisolarflare/modules/magic/MagicModule.java +++ b/src/alisolarflare/magic/MagicModule.java @@ -1,11 +1,11 @@ -package alisolarflare.modules.magic; +package alisolarflare.magic; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.events.uhc.commands.AddToUHC; -import alisolarflare.modules.magic.aliarrow.AliArrowListener; -import alisolarflare.modules.magic.boombow.BoomBowListener; +import alisolarflare.Module; +import alisolarflare.events.uhc.commands.AddToUHC; +import alisolarflare.magic.aliarrow.AliArrowListener; +import alisolarflare.magic.boombow.BoomBowListener; import buttondevteam.lib.TBMCCoreAPI; import buttondevteam.lib.chat.TBMCChatAPI; diff --git a/src/alisolarflare/modules/magic/aliarrow/AliArrowListener.java b/src/alisolarflare/magic/aliarrow/AliArrowListener.java similarity index 92% rename from src/alisolarflare/modules/magic/aliarrow/AliArrowListener.java rename to src/alisolarflare/magic/aliarrow/AliArrowListener.java index 5c678d7..a7617a8 100644 --- a/src/alisolarflare/modules/magic/aliarrow/AliArrowListener.java +++ b/src/alisolarflare/magic/aliarrow/AliArrowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.aliarrow; +package alisolarflare.magic.aliarrow; import org.bukkit.entity.Arrow; import org.bukkit.entity.EntityType; diff --git a/src/alisolarflare/modules/magic/aliarrow/AliArrowTask.java b/src/alisolarflare/magic/aliarrow/AliArrowTask.java similarity index 91% rename from src/alisolarflare/modules/magic/aliarrow/AliArrowTask.java rename to src/alisolarflare/magic/aliarrow/AliArrowTask.java index 11451c5..f131ace 100644 --- a/src/alisolarflare/modules/magic/aliarrow/AliArrowTask.java +++ b/src/alisolarflare/magic/aliarrow/AliArrowTask.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.aliarrow; +package alisolarflare.magic.aliarrow; import org.bukkit.Particle; import org.bukkit.entity.Arrow; diff --git a/src/alisolarflare/modules/magic/boombow/BoomBowListener.java b/src/alisolarflare/magic/boombow/BoomBowListener.java similarity index 95% rename from src/alisolarflare/modules/magic/boombow/BoomBowListener.java rename to src/alisolarflare/magic/boombow/BoomBowListener.java index 86b6e06..9b5ad69 100644 --- a/src/alisolarflare/modules/magic/boombow/BoomBowListener.java +++ b/src/alisolarflare/magic/boombow/BoomBowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.boombow; +package alisolarflare.magic.boombow; import org.bukkit.GameMode; import org.bukkit.Location; diff --git a/src/alisolarflare/modules/magic/boombow/BoomBowRule.java b/src/alisolarflare/magic/boombow/BoomBowRule.java similarity index 94% rename from src/alisolarflare/modules/magic/boombow/BoomBowRule.java rename to src/alisolarflare/magic/boombow/BoomBowRule.java index 7b7c493..aae9a76 100644 --- a/src/alisolarflare/modules/magic/boombow/BoomBowRule.java +++ b/src/alisolarflare/magic/boombow/BoomBowRule.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.boombow; +package alisolarflare.magic.boombow; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/alisolarflare/minigames/freeforall/FreeForAllModule.java b/src/alisolarflare/minigames/freeforall/FreeForAllModule.java new file mode 100644 index 0000000..070ccf9 --- /dev/null +++ b/src/alisolarflare/minigames/freeforall/FreeForAllModule.java @@ -0,0 +1,34 @@ +package alisolarflare.minigames.freeforall; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.minigames.freeforall.commands.SetFFAS; +import alisolarflare.minigames.freeforall.data.SpawnSet; +import buttondevteam.lib.chat.TBMCChatAPI; + +public class FreeForAllModule extends Module{ + public SpawnSet spawnSet; + private int GameState; + + @Override + public void register(JavaPlugin plugin) { + registerEvents(); + registerCommands(plugin); + registerMemory(); + } + + private void registerEvents() { + } + + private void registerCommands(JavaPlugin plugin) { + TBMCChatAPI.AddCommands(plugin, SetFFAS.class); + } + private void registerMemory() { + this.spawnSet = new SpawnSet(); + } + public int getGameState() {return GameState;} + public void setGameState(int gameState) {GameState = gameState;} + + +} diff --git a/src/alisolarflare/minigames/freeforall/StartMinigame.java b/src/alisolarflare/minigames/freeforall/StartMinigame.java new file mode 100644 index 0000000..1017cae --- /dev/null +++ b/src/alisolarflare/minigames/freeforall/StartMinigame.java @@ -0,0 +1,5 @@ +package alisolarflare.minigames.freeforall; + +public class StartMinigame { + +} diff --git a/src/alisolarflare/buttonminigames/freeforall/commands/SetFFAS.java b/src/alisolarflare/minigames/freeforall/commands/SetFFAS.java similarity index 59% rename from src/alisolarflare/buttonminigames/freeforall/commands/SetFFAS.java rename to src/alisolarflare/minigames/freeforall/commands/SetFFAS.java index 760ba83..56e7a17 100644 --- a/src/alisolarflare/buttonminigames/freeforall/commands/SetFFAS.java +++ b/src/alisolarflare/minigames/freeforall/commands/SetFFAS.java @@ -1,43 +1,35 @@ -package alisolarflare.buttonminigames.freeforall.commands; +package alisolarflare.minigames.freeforall.commands; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.MainPlugin; -import alisolarflare.buttonminigames.freeforall.data.SpawnSet; +import alisolarflare.minigames.freeforall.data.SpawnSet; +import buttondevteam.lib.chat.TBMCCommandBase; -public class SetFFAS implements CommandExecutor{ +public class SetFFAS extends TBMCCommandBase{ private SpawnSet spawnSet; public SetFFAS(SpawnSet spawnSet){ this.spawnSet = spawnSet; } - @SuppressWarnings("deprecation") @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!(sender instanceof Player)){ - sender.sendMessage("ERROR: You must be a Alisolarflare and playing to use this command!"); - } + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (!(sender instanceof Player)) + sender.sendMessage("ERROR: You must be a player to use this command!"); + Player player = (Player) sender; - if(!(player.getName().equalsIgnoreCase("Alisolarflare"))){ + if(!(player.getName().equalsIgnoreCase("Alisolarflare"))) player.sendMessage("ERROR: You must be Alisolarflare to use this command!"); - } - if(args.length <= 0){ + + if(args.length == 0){ sender.sendMessage("ERROR: Arguments required."); return false; } String input = args[0]; - if(input == null){ - sender.sendMessage("ERROR: Arguments are null"); - return false; - } - input.toLowerCase(); switch(input){ case ("r"): @@ -73,5 +65,25 @@ public class SetFFAS implements CommandExecutor{ } return false; } + @Override + public String GetCommandPath() { + // TODO Auto-generated method stub + return "setFFAS"; + } + @Override + public String[] GetHelpText(String arg0) { + // TODO Auto-generated method stub + return null; + } + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } } diff --git a/src/alisolarflare/buttonminigames/freeforall/data/Data.java b/src/alisolarflare/minigames/freeforall/data/Data.java similarity index 60% rename from src/alisolarflare/buttonminigames/freeforall/data/Data.java rename to src/alisolarflare/minigames/freeforall/data/Data.java index c537b74..29ad380 100644 --- a/src/alisolarflare/buttonminigames/freeforall/data/Data.java +++ b/src/alisolarflare/minigames/freeforall/data/Data.java @@ -1,4 +1,4 @@ -package alisolarflare.buttonminigames.freeforall.data; +package alisolarflare.minigames.freeforall.data; public class Data { public SpawnSet spawnset; diff --git a/src/alisolarflare/buttonminigames/freeforall/data/SpawnSet.java b/src/alisolarflare/minigames/freeforall/data/SpawnSet.java similarity index 91% rename from src/alisolarflare/buttonminigames/freeforall/data/SpawnSet.java rename to src/alisolarflare/minigames/freeforall/data/SpawnSet.java index 8871a88..79d29de 100644 --- a/src/alisolarflare/buttonminigames/freeforall/data/SpawnSet.java +++ b/src/alisolarflare/minigames/freeforall/data/SpawnSet.java @@ -1,4 +1,4 @@ -package alisolarflare.buttonminigames.freeforall.data; +package alisolarflare.minigames.freeforall.data; import org.bukkit.Location; diff --git a/src/alisolarflare/buttonminigames/freeforall/entities/Fighter.java b/src/alisolarflare/minigames/freeforall/entities/Fighter.java similarity index 80% rename from src/alisolarflare/buttonminigames/freeforall/entities/Fighter.java rename to src/alisolarflare/minigames/freeforall/entities/Fighter.java index 7963aee..98aea3a 100644 --- a/src/alisolarflare/buttonminigames/freeforall/entities/Fighter.java +++ b/src/alisolarflare/minigames/freeforall/entities/Fighter.java @@ -1,4 +1,4 @@ -package alisolarflare.buttonminigames.freeforall.entities; +package alisolarflare.minigames.freeforall.entities; import org.bukkit.entity.Player; diff --git a/src/alisolarflare/minigames/lobby/LobbyModule.java b/src/alisolarflare/minigames/lobby/LobbyModule.java new file mode 100644 index 0000000..27416bf --- /dev/null +++ b/src/alisolarflare/minigames/lobby/LobbyModule.java @@ -0,0 +1,27 @@ +package alisolarflare.minigames.lobby; + +import java.util.List; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.minigames.lobby.commands.ButtonFight; +import alisolarflare.minigames.lobby.commands.ButtonLeave; +import alisolarflare.minigames.lobby.commands.ListFighters; + +public class LobbyModule extends Module{ + public List fighters; + + public void register(JavaPlugin plugin){ + registerEvents(); + registerCommands(plugin); + } + private void registerEvents() { + } + + private void registerCommands(JavaPlugin plugin) { + plugin.getCommand("buttonfight").setExecutor(new ButtonFight(this)); + plugin.getCommand("buttonleave").setExecutor(new ButtonLeave(this)); + plugin.getCommand("listfighters").setExecutor(new ListFighters(this)); + } +} diff --git a/src/alisolarflare/buttonminigames/lobby/commands/ButtonFight.java b/src/alisolarflare/minigames/lobby/commands/ButtonFight.java similarity index 65% rename from src/alisolarflare/buttonminigames/lobby/commands/ButtonFight.java rename to src/alisolarflare/minigames/lobby/commands/ButtonFight.java index 18abeda..373af3e 100644 --- a/src/alisolarflare/buttonminigames/lobby/commands/ButtonFight.java +++ b/src/alisolarflare/minigames/lobby/commands/ButtonFight.java @@ -1,17 +1,19 @@ -package alisolarflare.buttonminigames.lobby.commands; +package alisolarflare.minigames.lobby.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.MainPlugin; +import alisolarflare.minigames.lobby.LobbyModule; public class ButtonFight implements CommandExecutor{ - private MainPlugin plugin; - public ButtonFight(MainPlugin initPlugin){ - plugin = initPlugin; + private LobbyModule lobby; + + public ButtonFight(LobbyModule lobby) { + this.lobby = lobby; } + @Override public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { @@ -23,15 +25,15 @@ public class ButtonFight implements CommandExecutor{ Player player = (Player) sender; player.sendMessage(player.toString()); - - if(plugin.fighters.contains(player)){ + String name = player.getName(); + if(lobby.fighters.contains(name)){ player.sendMessage("You are already in the button fight!"); return false; } - plugin.fighters.add(player); + lobby.fighters.add(name); - if(plugin.fighters.contains(player)){ + if(lobby.fighters.contains(name)){ player.sendMessage("You have joined the fighters category!"); } return false; diff --git a/src/alisolarflare/buttonminigames/lobby/commands/ButtonLeave.java b/src/alisolarflare/minigames/lobby/commands/ButtonLeave.java similarity index 62% rename from src/alisolarflare/buttonminigames/lobby/commands/ButtonLeave.java rename to src/alisolarflare/minigames/lobby/commands/ButtonLeave.java index 840517c..5ff3f59 100644 --- a/src/alisolarflare/buttonminigames/lobby/commands/ButtonLeave.java +++ b/src/alisolarflare/minigames/lobby/commands/ButtonLeave.java @@ -1,18 +1,21 @@ -package alisolarflare.buttonminigames.lobby.commands; +package alisolarflare.minigames.lobby.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.MainPlugin; +import alisolarflare.minigames.lobby.LobbyModule; public class ButtonLeave implements CommandExecutor{ - private MainPlugin plugin; - public ButtonLeave(MainPlugin initPlugin){ - plugin = initPlugin; - } + + private LobbyModule lobby; + + public ButtonLeave(LobbyModule lobby) { + this.lobby = lobby; + } + @Override public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { if(!(sender instanceof Player)){ @@ -21,12 +24,13 @@ public class ButtonLeave implements CommandExecutor{ } Player player = (Player) sender; - if (!(plugin.fighters.contains(player))){ + String name = player.getName(); + if (!(lobby.fighters.contains(name))){ player.sendMessage("You are not fighting!"); return false; } - plugin.fighters.remove(player); - if(!(plugin.fighters.contains(player))){ + lobby.fighters.remove(name); + if(!(lobby.fighters.contains(name))){ player.sendMessage("You have left the fighters category!"); } return false; diff --git a/src/alisolarflare/buttonminigames/lobby/commands/ListFighters.java b/src/alisolarflare/minigames/lobby/commands/ListFighters.java similarity index 53% rename from src/alisolarflare/buttonminigames/lobby/commands/ListFighters.java rename to src/alisolarflare/minigames/lobby/commands/ListFighters.java index 1532c4b..3931d13 100644 --- a/src/alisolarflare/buttonminigames/lobby/commands/ListFighters.java +++ b/src/alisolarflare/minigames/lobby/commands/ListFighters.java @@ -1,19 +1,21 @@ -package alisolarflare.buttonminigames.lobby.commands; +package alisolarflare.minigames.lobby.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; -import alisolarflare.MainPlugin; +import alisolarflare.minigames.lobby.LobbyModule; public class ListFighters implements CommandExecutor{ - private MainPlugin plugin; - public ListFighters(MainPlugin initPlugin){ - plugin = initPlugin; + private LobbyModule lobby; + + public ListFighters(LobbyModule lobby) { + this.lobby = lobby; } + @Override public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { - sender.sendMessage(plugin.fighters.toString()); + sender.sendMessage(lobby.fighters.toString()); return false; } diff --git a/src/alisolarflare/modules/Registerable.java b/src/alisolarflare/modules/Registerable.java deleted file mode 100644 index 052a4e9..0000000 --- a/src/alisolarflare/modules/Registerable.java +++ /dev/null @@ -1,11 +0,0 @@ -package alisolarflare.modules; - -import org.bukkit.plugin.java.JavaPlugin; - -/** - * Allows the project to be registered by any Main JavaPlugin class, by calling //modulename.register(this) - * in any JavaPlugin class. - */ -public interface Registerable { - public void register(JavaPlugin plugin); -} From 254a0cdf105bbf1e398532b79b93831d90e16cf4 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 3 Nov 2016 17:38:20 +0100 Subject: [PATCH 061/263] Fixed command adding --- .../components/links/AliLinkModule.java | 3 +- .../components/shulker/AliShulkerModule.java | 2 +- src/alisolarflare/events/uhc/UHCModule.java | 4 +- src/alisolarflare/magic/MagicModule.java | 3 -- .../freeforall/FreeForAllModule.java | 2 +- .../minigames/lobby/LobbyModule.java | 7 ++-- .../minigames/lobby/commands/ButtonFight.java | 41 +++++++++++-------- .../minigames/lobby/commands/ButtonLeave.java | 37 ++++++++++------- .../lobby/commands/ListFighters.java | 29 ++++++++++--- 9 files changed, 82 insertions(+), 46 deletions(-) diff --git a/src/alisolarflare/components/links/AliLinkModule.java b/src/alisolarflare/components/links/AliLinkModule.java index 5760d93..73b39de 100644 --- a/src/alisolarflare/components/links/AliLinkModule.java +++ b/src/alisolarflare/components/links/AliLinkModule.java @@ -16,7 +16,8 @@ public class AliLinkModule extends Module { @Override public void register(JavaPlugin plugin) { setAliLink = new SetAliLink(plugin); - TBMCChatAPI.AddCommands(plugin, PressAliLink.class); + TBMCChatAPI.AddCommand(plugin, new PressAliLink(plugin, setAliLink)); + TBMCChatAPI.AddCommand(plugin, setAliLink); } diff --git a/src/alisolarflare/components/shulker/AliShulkerModule.java b/src/alisolarflare/components/shulker/AliShulkerModule.java index ffccad4..1ba2fbc 100644 --- a/src/alisolarflare/components/shulker/AliShulkerModule.java +++ b/src/alisolarflare/components/shulker/AliShulkerModule.java @@ -10,7 +10,7 @@ public class AliShulkerModule extends Module { @Override public void register(JavaPlugin plugin) { - TBMCChatAPI.AddCommands(plugin, AliShulker.class); + TBMCChatAPI.AddCommand(plugin, AliShulker.class); } } diff --git a/src/alisolarflare/events/uhc/UHCModule.java b/src/alisolarflare/events/uhc/UHCModule.java index 4e27b57..0b0dd41 100644 --- a/src/alisolarflare/events/uhc/UHCModule.java +++ b/src/alisolarflare/events/uhc/UHCModule.java @@ -4,6 +4,7 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; import alisolarflare.events.uhc.commands.AddToUHC; +import alisolarflare.events.uhc.commands.StartMatch; import alisolarflare.events.uhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCChatAPI; @@ -20,7 +21,8 @@ public class UHCModule extends Module { } private void registerCommands(JavaPlugin plugin) { - TBMCChatAPI.AddCommands(plugin, AddToUHC.class); + TBMCChatAPI.AddCommand(plugin, AddToUHC.class, match); + TBMCChatAPI.AddCommand(plugin, new StartMatch(match)); } private void registerMemoryUnits(JavaPlugin plugin) { diff --git a/src/alisolarflare/magic/MagicModule.java b/src/alisolarflare/magic/MagicModule.java index 628bef8..96ff14f 100644 --- a/src/alisolarflare/magic/MagicModule.java +++ b/src/alisolarflare/magic/MagicModule.java @@ -3,11 +3,9 @@ package alisolarflare.magic; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; -import alisolarflare.events.uhc.commands.AddToUHC; import alisolarflare.magic.aliarrow.AliArrowListener; import alisolarflare.magic.boombow.BoomBowListener; import buttondevteam.lib.TBMCCoreAPI; -import buttondevteam.lib.chat.TBMCChatAPI; public class MagicModule extends Module{ @@ -15,7 +13,6 @@ public class MagicModule extends Module{ public void register(JavaPlugin plugin) { TBMCCoreAPI.RegisterEventsForExceptions(new AliArrowListener(plugin), plugin); TBMCCoreAPI.RegisterEventsForExceptions(new BoomBowListener(), plugin); - TBMCChatAPI.AddCommands(plugin, AddToUHC.class); } diff --git a/src/alisolarflare/minigames/freeforall/FreeForAllModule.java b/src/alisolarflare/minigames/freeforall/FreeForAllModule.java index 070ccf9..78828e5 100644 --- a/src/alisolarflare/minigames/freeforall/FreeForAllModule.java +++ b/src/alisolarflare/minigames/freeforall/FreeForAllModule.java @@ -22,7 +22,7 @@ public class FreeForAllModule extends Module{ } private void registerCommands(JavaPlugin plugin) { - TBMCChatAPI.AddCommands(plugin, SetFFAS.class); + TBMCChatAPI.AddCommand(plugin, SetFFAS.class, spawnSet); } private void registerMemory() { this.spawnSet = new SpawnSet(); diff --git a/src/alisolarflare/minigames/lobby/LobbyModule.java b/src/alisolarflare/minigames/lobby/LobbyModule.java index 27416bf..2793307 100644 --- a/src/alisolarflare/minigames/lobby/LobbyModule.java +++ b/src/alisolarflare/minigames/lobby/LobbyModule.java @@ -8,6 +8,7 @@ import alisolarflare.Module; import alisolarflare.minigames.lobby.commands.ButtonFight; import alisolarflare.minigames.lobby.commands.ButtonLeave; import alisolarflare.minigames.lobby.commands.ListFighters; +import buttondevteam.lib.chat.TBMCChatAPI; public class LobbyModule extends Module{ public List fighters; @@ -20,8 +21,8 @@ public class LobbyModule extends Module{ } private void registerCommands(JavaPlugin plugin) { - plugin.getCommand("buttonfight").setExecutor(new ButtonFight(this)); - plugin.getCommand("buttonleave").setExecutor(new ButtonLeave(this)); - plugin.getCommand("listfighters").setExecutor(new ListFighters(this)); + TBMCChatAPI.AddCommand(plugin, new ButtonFight(this)); + TBMCChatAPI.AddCommand(plugin, new ButtonLeave(this)); + TBMCChatAPI.AddCommand(plugin, new ListFighters(this)); } } diff --git a/src/alisolarflare/minigames/lobby/commands/ButtonFight.java b/src/alisolarflare/minigames/lobby/commands/ButtonFight.java index 373af3e..25fdb44 100644 --- a/src/alisolarflare/minigames/lobby/commands/ButtonFight.java +++ b/src/alisolarflare/minigames/lobby/commands/ButtonFight.java @@ -1,13 +1,12 @@ package alisolarflare.minigames.lobby.commands; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.minigames.lobby.LobbyModule; +import buttondevteam.lib.chat.TBMCCommandBase; -public class ButtonFight implements CommandExecutor{ +public class ButtonFight extends TBMCCommandBase { private LobbyModule lobby; public ButtonFight(LobbyModule lobby) { @@ -15,28 +14,38 @@ public class ButtonFight implements CommandExecutor{ } @Override - public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { - - if(!(sender instanceof Player)){ - sender.sendMessage("You must be a player to be using this command!"); - return false; - } - + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { Player player = (Player) sender; player.sendMessage(player.toString()); String name = player.getName(); - if(lobby.fighters.contains(name)){ + if (lobby.fighters.contains(name)) { player.sendMessage("You are already in the button fight!"); return false; } - + lobby.fighters.add(name); - - if(lobby.fighters.contains(name)){ + + if (lobby.fighters.contains(name)) { player.sendMessage("You have joined the fighters category!"); - } + } return false; } - + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + return false; + } + } diff --git a/src/alisolarflare/minigames/lobby/commands/ButtonLeave.java b/src/alisolarflare/minigames/lobby/commands/ButtonLeave.java index 5ff3f59..2882075 100644 --- a/src/alisolarflare/minigames/lobby/commands/ButtonLeave.java +++ b/src/alisolarflare/minigames/lobby/commands/ButtonLeave.java @@ -1,15 +1,13 @@ package alisolarflare.minigames.lobby.commands; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.minigames.lobby.LobbyModule; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class ButtonLeave extends TBMCCommandBase { -public class ButtonLeave implements CommandExecutor{ - - private LobbyModule lobby; public ButtonLeave(LobbyModule lobby) { @@ -17,23 +15,34 @@ public class ButtonLeave implements CommandExecutor{ } @Override - public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { - if(!(sender instanceof Player)){ - sender.sendMessage("You must be a player to be using this command!"); - return false; - } - + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { Player player = (Player) sender; String name = player.getName(); - if (!(lobby.fighters.contains(name))){ + if (!(lobby.fighters.contains(name))) { player.sendMessage("You are not fighting!"); return false; } lobby.fighters.remove(name); - if(!(lobby.fighters.contains(name))){ + if (!(lobby.fighters.contains(name))) { player.sendMessage("You have left the fighters category!"); } return false; } - + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + return false; + } + } diff --git a/src/alisolarflare/minigames/lobby/commands/ListFighters.java b/src/alisolarflare/minigames/lobby/commands/ListFighters.java index 3931d13..8024727 100644 --- a/src/alisolarflare/minigames/lobby/commands/ListFighters.java +++ b/src/alisolarflare/minigames/lobby/commands/ListFighters.java @@ -1,12 +1,13 @@ package alisolarflare.minigames.lobby.commands; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; +import java.util.stream.Collectors; + import org.bukkit.command.CommandSender; import alisolarflare.minigames.lobby.LobbyModule; +import buttondevteam.lib.chat.TBMCCommandBase; -public class ListFighters implements CommandExecutor{ +public class ListFighters extends TBMCCommandBase { private LobbyModule lobby; public ListFighters(LobbyModule lobby) { @@ -14,9 +15,25 @@ public class ListFighters implements CommandExecutor{ } @Override - public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { - sender.sendMessage(lobby.fighters.toString()); + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { + sender.sendMessage(lobby.fighters.stream().map(Object::toString).collect(Collectors.joining(", "))); return false; } - + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + return false; + } + + @Override + public boolean GetModOnly() { + return false; + } + } From f24d9ad9ac03482594311cb5a471c2d15545ad30 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 3 Nov 2016 18:05:40 +0100 Subject: [PATCH 062/263] Fixed NPE --- src/alisolarflare/events/uhc/UHCModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alisolarflare/events/uhc/UHCModule.java b/src/alisolarflare/events/uhc/UHCModule.java index 0b0dd41..7d3b750 100644 --- a/src/alisolarflare/events/uhc/UHCModule.java +++ b/src/alisolarflare/events/uhc/UHCModule.java @@ -12,9 +12,9 @@ public class UHCModule extends Module { public UHCMatch match; public void register(JavaPlugin plugin) { + registerMemoryUnits(plugin); registerCommands(plugin); registerListeners(plugin); - registerMemoryUnits(plugin); } private void registerListeners(JavaPlugin plugin) { From b6ce31e5474b8791dea5779ab0b80c2dc112b67a Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 14:47:00 -0400 Subject: [PATCH 063/263] Fixed bug: UHCMatchState not initialized in config. --- config.yml | 1 + src/alisolarflare/events/uhc/UHCModule.java | 7 ++++- .../events/uhc/commands/StartMatch.java | 29 ++++++++++++++----- .../events/uhc/memory/MatchState.java | 2 +- .../events/uhc/memory/UHCMatch.java | 13 ++------- .../minigames/freeforall/StartMinigame.java | 5 ---- 6 files changed, 33 insertions(+), 24 deletions(-) delete mode 100644 src/alisolarflare/minigames/freeforall/StartMinigame.java diff --git a/config.yml b/config.yml index e69de29..30ae627 100644 --- a/config.yml +++ b/config.yml @@ -0,0 +1 @@ +UHCMatchState: "NULL" \ No newline at end of file diff --git a/src/alisolarflare/events/uhc/UHCModule.java b/src/alisolarflare/events/uhc/UHCModule.java index 4e27b57..b470c3d 100644 --- a/src/alisolarflare/events/uhc/UHCModule.java +++ b/src/alisolarflare/events/uhc/UHCModule.java @@ -4,6 +4,7 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; import alisolarflare.events.uhc.commands.AddToUHC; +import alisolarflare.events.uhc.memory.MatchState; import alisolarflare.events.uhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCChatAPI; @@ -24,6 +25,10 @@ public class UHCModule extends Module { } private void registerMemoryUnits(JavaPlugin plugin) { - match = new UHCMatch(plugin.getConfig(), plugin.getConfig().getString("UHCMatchState")); + if (plugin.getConfig().contains("UHCMatchState")){ + match = new UHCMatch(plugin.getConfig(), MatchState.valueOf(plugin.getConfig().getString("UHCMatchState"))); + }else{ + match = new UHCMatch(plugin.getConfig(), MatchState.IDLE); + } } } diff --git a/src/alisolarflare/events/uhc/commands/StartMatch.java b/src/alisolarflare/events/uhc/commands/StartMatch.java index 513c23d..bee51bb 100644 --- a/src/alisolarflare/events/uhc/commands/StartMatch.java +++ b/src/alisolarflare/events/uhc/commands/StartMatch.java @@ -15,18 +15,33 @@ public class StartMatch extends TBMCCommandBase { @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (match.getMatchState() == MatchState.NULL) - sender.sendMessage("There is no match to begin."); - else if (match.getMatchState() == MatchState.IDLE) + + if (!sender.hasPermission("moderator") && !(sender.getName() == "")) + sender.sendMessage("You must be a moderator or Arsenalis to use this command! " + + "Contact a TBMC dev if you think this is wrong"); + + //ACTIVATES MATCH + switch(match.getMatchState()){ + case IDLE: sender.sendMessage("There is currently a match ready... Activating..."); - else if (match.getMatchState() == MatchState.WAITING) + break; + + case WAITING: sender.sendMessage("There currently a match planned for: TIME:TIME:TIME"); - else if (match.getMatchState() == MatchState.END) + break; + + case END: sender.sendMessage("The match has ended! Would you like to restart?"); - else + break; + + default: sender.sendMessage("You cannot start a match now, one is already in progress!"); - + + + } + return false; + } diff --git a/src/alisolarflare/events/uhc/memory/MatchState.java b/src/alisolarflare/events/uhc/memory/MatchState.java index 8425f71..0838048 100644 --- a/src/alisolarflare/events/uhc/memory/MatchState.java +++ b/src/alisolarflare/events/uhc/memory/MatchState.java @@ -1,5 +1,5 @@ package alisolarflare.events.uhc.memory; public enum MatchState { - NULL, IDLE, WAITING, SETUP, INTRO, PEACE, TENSION, POWER, END + IDLE, WAITING, SETUP, INTRO, PEACE, TENSION, POWER, END } diff --git a/src/alisolarflare/events/uhc/memory/UHCMatch.java b/src/alisolarflare/events/uhc/memory/UHCMatch.java index de42cf8..0461d3f 100644 --- a/src/alisolarflare/events/uhc/memory/UHCMatch.java +++ b/src/alisolarflare/events/uhc/memory/UHCMatch.java @@ -5,28 +5,21 @@ import java.util.List; import org.bukkit.configuration.file.FileConfiguration; -/** - * Class that contains the data for a single UltraHardcore Match, - * which represents a single game. - * @author Alisolarflare - */ + public class UHCMatch { public List playerList = new ArrayList(); private MatchState matchState = MatchState.IDLE; private FileConfiguration fileConfiguration; - /**Class that fucks shit up*/ - public UHCMatch(FileConfiguration fileConfiguration, String stateName) { + public UHCMatch(FileConfiguration fileConfiguration, MatchState state) { this.fileConfiguration = fileConfiguration; - this.matchState = MatchState.valueOf(stateName); + this.matchState = state; } - /**Other class that doesn't fuck shit up*/ public MatchState getMatchState(){ return matchState; } - /**Other class that REALLY fucks shit up*/ public void setMatchState(MatchState newMS){ matchState = newMS; fileConfiguration.set("UHCMatchState", newMS.toString()); diff --git a/src/alisolarflare/minigames/freeforall/StartMinigame.java b/src/alisolarflare/minigames/freeforall/StartMinigame.java deleted file mode 100644 index 1017cae..0000000 --- a/src/alisolarflare/minigames/freeforall/StartMinigame.java +++ /dev/null @@ -1,5 +0,0 @@ -package alisolarflare.minigames.freeforall; - -public class StartMinigame { - -} From 70b2e89e10dfd1d6c389cbe61ea36d5f05277249 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 15:44:03 -0400 Subject: [PATCH 064/263] Replaced hard-coded registerCommands with general registerCommand from Module --- src/alisolarflare/Module.java | 7 ++++--- .../components/flairdoor/FlairDoorModule.java | 3 +-- .../components/gpowers/GPowerModule.java | 3 +-- .../components/links/AliLinkModule.java | 5 ++--- .../components/shulker/AliShulkerModule.java | 3 +-- src/alisolarflare/events/uhc/UHCModule.java | 21 +++++++++---------- .../events/uhc/commands/StartMatch.java | 1 - src/alisolarflare/magic/MagicModule.java | 5 ++--- .../freeforall/FreeForAllModule.java | 12 +++++------ .../minigames/lobby/LobbyModule.java | 7 +++---- 10 files changed, 30 insertions(+), 37 deletions(-) diff --git a/src/alisolarflare/Module.java b/src/alisolarflare/Module.java index 986bb00..ad674d1 100644 --- a/src/alisolarflare/Module.java +++ b/src/alisolarflare/Module.java @@ -3,6 +3,7 @@ package alisolarflare; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; +import buttondevteam.lib.TBMCCoreAPI; import buttondevteam.lib.chat.TBMCChatAPI; import buttondevteam.lib.chat.TBMCCommandBase; @@ -37,11 +38,11 @@ public abstract class Module{ * @param label Name of the command in plugin.yml * @param commandExecutor Custom coded CommandExecutor class */ - protected void registerCommand(JavaPlugin plugin, String label, Class commandExecutor){ - TBMCChatAPI.AddCommands(plugin, commandExecutor); + protected void registerCommand(JavaPlugin plugin, TBMCCommandBase commandBase){ + TBMCChatAPI.AddCommand(plugin, commandBase); } protected Listener registerListener(JavaPlugin plugin, Listener listener){ - plugin.getServer().getPluginManager().registerEvents(listener, plugin); + TBMCCoreAPI.RegisterEventsForExceptions(listener, plugin); return listener; } } diff --git a/src/alisolarflare/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/components/flairdoor/FlairDoorModule.java index 981abdd..0368634 100644 --- a/src/alisolarflare/components/flairdoor/FlairDoorModule.java +++ b/src/alisolarflare/components/flairdoor/FlairDoorModule.java @@ -6,12 +6,11 @@ import alisolarflare.Module; import alisolarflare.components.flairdoor.commands.FlairMe; import alisolarflare.components.flairdoor.listeners.PortalListener; import buttondevteam.lib.TBMCCoreAPI; -import buttondevteam.lib.chat.TBMCChatAPI; public class FlairDoorModule extends Module { @Override public void register(JavaPlugin plugin) { - TBMCChatAPI.AddCommands(plugin, FlairMe.class); + registerCommand(plugin, new FlairMe()); TBMCCoreAPI.RegisterEventsForExceptions(new PortalListener(plugin), plugin); } diff --git a/src/alisolarflare/components/gpowers/GPowerModule.java b/src/alisolarflare/components/gpowers/GPowerModule.java index a73e81e..8eb4287 100644 --- a/src/alisolarflare/components/gpowers/GPowerModule.java +++ b/src/alisolarflare/components/gpowers/GPowerModule.java @@ -6,13 +6,12 @@ import alisolarflare.Module; import alisolarflare.components.gpowers.commands.gPowerCommand; import alisolarflare.components.gpowers.listeners.gPowerListener; import buttondevteam.lib.TBMCCoreAPI; -import buttondevteam.lib.chat.TBMCChatAPI; public class GPowerModule extends Module { @Override public void register(JavaPlugin plugin) { - TBMCChatAPI.AddCommands(plugin, gPowerCommand.class); + registerCommand(plugin, new gPowerCommand()); TBMCCoreAPI.RegisterEventsForExceptions(new gPowerListener(plugin), plugin); } diff --git a/src/alisolarflare/components/links/AliLinkModule.java b/src/alisolarflare/components/links/AliLinkModule.java index c076791..1ef6c46 100644 --- a/src/alisolarflare/components/links/AliLinkModule.java +++ b/src/alisolarflare/components/links/AliLinkModule.java @@ -8,7 +8,6 @@ import alisolarflare.Module; import alisolarflare.components.links.commands.PressAliLink; import alisolarflare.components.links.commands.SetAliLink; import alisolarflare.components.links.entities.Link; -import buttondevteam.lib.chat.TBMCChatAPI; public class AliLinkModule extends Module { private SetAliLink setAliLink; @@ -16,8 +15,8 @@ public class AliLinkModule extends Module { @Override public void register(JavaPlugin plugin) { setAliLink = new SetAliLink(plugin); - TBMCChatAPI.AddCommands(plugin, PressAliLink.class); - TBMCChatAPI.AddCommands(plugin, SetAliLink.class); + registerCommand(plugin, new PressAliLink(plugin, setAliLink)); + registerCommand(plugin, setAliLink); } diff --git a/src/alisolarflare/components/shulker/AliShulkerModule.java b/src/alisolarflare/components/shulker/AliShulkerModule.java index ffccad4..7cfaac3 100644 --- a/src/alisolarflare/components/shulker/AliShulkerModule.java +++ b/src/alisolarflare/components/shulker/AliShulkerModule.java @@ -4,13 +4,12 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; import alisolarflare.components.shulker.commands.AliShulker; -import buttondevteam.lib.chat.TBMCChatAPI; public class AliShulkerModule extends Module { @Override public void register(JavaPlugin plugin) { - TBMCChatAPI.AddCommands(plugin, AliShulker.class); + registerCommand(plugin, new AliShulker()); } } diff --git a/src/alisolarflare/events/uhc/UHCModule.java b/src/alisolarflare/events/uhc/UHCModule.java index 98881b4..ddb9bdb 100644 --- a/src/alisolarflare/events/uhc/UHCModule.java +++ b/src/alisolarflare/events/uhc/UHCModule.java @@ -4,10 +4,9 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; import alisolarflare.events.uhc.commands.AddToUHC; -import alisolarflare.events.uhc.memory.MatchState; import alisolarflare.events.uhc.commands.StartMatch; +import alisolarflare.events.uhc.memory.MatchState; import alisolarflare.events.uhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCChatAPI; public class UHCModule extends Module { public UHCMatch match; @@ -17,15 +16,6 @@ public class UHCModule extends Module { registerCommands(plugin); registerListeners(plugin); } - - private void registerListeners(JavaPlugin plugin) { - } - - private void registerCommands(JavaPlugin plugin) { - TBMCChatAPI.AddCommand(plugin, AddToUHC.class, match); - TBMCChatAPI.AddCommand(plugin, new StartMatch(match)); - } - private void registerMemoryUnits(JavaPlugin plugin) { if (plugin.getConfig().contains("UHCMatchState")){ match = new UHCMatch(plugin.getConfig(), MatchState.valueOf(plugin.getConfig().getString("UHCMatchState"))); @@ -33,4 +23,13 @@ public class UHCModule extends Module { match = new UHCMatch(plugin.getConfig(), MatchState.IDLE); } } + private void registerListeners(JavaPlugin plugin) { + } + + private void registerCommands(JavaPlugin plugin) { + registerCommand(plugin, new AddToUHC(match)); + registerCommand(plugin, new StartMatch(match)); + } + + } diff --git a/src/alisolarflare/events/uhc/commands/StartMatch.java b/src/alisolarflare/events/uhc/commands/StartMatch.java index bee51bb..29f8a54 100644 --- a/src/alisolarflare/events/uhc/commands/StartMatch.java +++ b/src/alisolarflare/events/uhc/commands/StartMatch.java @@ -2,7 +2,6 @@ package alisolarflare.events.uhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.events.uhc.memory.MatchState; import alisolarflare.events.uhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCCommandBase; diff --git a/src/alisolarflare/magic/MagicModule.java b/src/alisolarflare/magic/MagicModule.java index 96ff14f..4da9fc3 100644 --- a/src/alisolarflare/magic/MagicModule.java +++ b/src/alisolarflare/magic/MagicModule.java @@ -5,14 +5,13 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; import alisolarflare.magic.aliarrow.AliArrowListener; import alisolarflare.magic.boombow.BoomBowListener; -import buttondevteam.lib.TBMCCoreAPI; public class MagicModule extends Module{ @Override public void register(JavaPlugin plugin) { - TBMCCoreAPI.RegisterEventsForExceptions(new AliArrowListener(plugin), plugin); - TBMCCoreAPI.RegisterEventsForExceptions(new BoomBowListener(), plugin); + registerListener(plugin, new AliArrowListener(plugin)); + registerListener(plugin, new BoomBowListener()); } diff --git a/src/alisolarflare/minigames/freeforall/FreeForAllModule.java b/src/alisolarflare/minigames/freeforall/FreeForAllModule.java index 5f6dd13..181562f 100644 --- a/src/alisolarflare/minigames/freeforall/FreeForAllModule.java +++ b/src/alisolarflare/minigames/freeforall/FreeForAllModule.java @@ -5,7 +5,6 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; import alisolarflare.minigames.freeforall.commands.SetFFAS; import alisolarflare.minigames.freeforall.data.SpawnSet; -import buttondevteam.lib.chat.TBMCChatAPI; public class FreeForAllModule extends Module{ public SpawnSet spawnSet; @@ -13,20 +12,21 @@ public class FreeForAllModule extends Module{ @Override public void register(JavaPlugin plugin) { + registerMemory(); registerEvents(); registerCommands(plugin); - registerMemory(); + } + private void registerMemory() { + this.spawnSet = new SpawnSet(); } private void registerEvents() { } private void registerCommands(JavaPlugin plugin) { - TBMCChatAPI.AddCommands(plugin, SetFFAS.class); - } - private void registerMemory() { - this.spawnSet = new SpawnSet(); + registerCommand(plugin, new SetFFAS(spawnSet)); } + public int getGameState() {return GameState;} public void setGameState(int gameState) {GameState = gameState;} diff --git a/src/alisolarflare/minigames/lobby/LobbyModule.java b/src/alisolarflare/minigames/lobby/LobbyModule.java index 86227cd..640b91a 100644 --- a/src/alisolarflare/minigames/lobby/LobbyModule.java +++ b/src/alisolarflare/minigames/lobby/LobbyModule.java @@ -8,7 +8,6 @@ import alisolarflare.Module; import alisolarflare.minigames.lobby.commands.ButtonFight; import alisolarflare.minigames.lobby.commands.ButtonLeave; import alisolarflare.minigames.lobby.commands.ListFighters; -import buttondevteam.lib.chat.TBMCChatAPI; public class LobbyModule extends Module{ public List fighters; @@ -21,8 +20,8 @@ public class LobbyModule extends Module{ } private void registerCommands(JavaPlugin plugin) { - TBMCChatAPI.AddCommands(plugin, ButtonFight.class); - TBMCChatAPI.AddCommands(plugin, ButtonLeave.class); - TBMCChatAPI.AddCommands(plugin, ListFighters.class); + registerCommand(plugin, new ButtonFight(this)); + registerCommand(plugin, new ButtonLeave(this)); + registerCommand(plugin, new ListFighters(this)); } } From 2baeb7c0652ea8369c068871ede5b39e4e8599fc Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 15:50:41 -0400 Subject: [PATCH 065/263] Removed unnessecary function calls, my project's neat as FUUUUUUUCCCCCKKKKKKK --- src/alisolarflare/AliPresents.java | 7 +++++++ .../components/flairdoor/FlairDoorModule.java | 3 +-- .../components/gpowers/GPowerModule.java | 3 +-- .../components/links/AliLinkModule.java | 1 + src/alisolarflare/events/uhc/UHCModule.java | 15 ++------------- src/alisolarflare/magic/MagicModule.java | 2 -- .../minigames/freeforall/FreeForAllModule.java | 12 +----------- .../minigames/lobby/LobbyModule.java | 7 ------- 8 files changed, 13 insertions(+), 37 deletions(-) diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index e738436..cbea14d 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -12,6 +12,8 @@ import alisolarflare.components.links.AliLinkModule; import alisolarflare.components.shulker.AliShulkerModule; import alisolarflare.events.uhc.UHCModule; import alisolarflare.magic.MagicModule; +import alisolarflare.minigames.freeforall.FreeForAllModule; +import alisolarflare.minigames.lobby.LobbyModule; public class AliPresents extends JavaPlugin{ public void onEnable(){ @@ -32,7 +34,12 @@ public class AliPresents extends JavaPlugin{ new GPowerModule().register(this); new AliLinkModule().register(this); new AliShulkerModule().register(this); + new UHCModule().register(this); + new MagicModule().register(this); + + new FreeForAllModule().register(this); + new LobbyModule().register(this); } } diff --git a/src/alisolarflare/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/components/flairdoor/FlairDoorModule.java index 0368634..c7e266a 100644 --- a/src/alisolarflare/components/flairdoor/FlairDoorModule.java +++ b/src/alisolarflare/components/flairdoor/FlairDoorModule.java @@ -5,13 +5,12 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; import alisolarflare.components.flairdoor.commands.FlairMe; import alisolarflare.components.flairdoor.listeners.PortalListener; -import buttondevteam.lib.TBMCCoreAPI; public class FlairDoorModule extends Module { @Override public void register(JavaPlugin plugin) { registerCommand(plugin, new FlairMe()); - TBMCCoreAPI.RegisterEventsForExceptions(new PortalListener(plugin), plugin); + registerListener(plugin, new PortalListener(plugin)); } } diff --git a/src/alisolarflare/components/gpowers/GPowerModule.java b/src/alisolarflare/components/gpowers/GPowerModule.java index 8eb4287..91caeb0 100644 --- a/src/alisolarflare/components/gpowers/GPowerModule.java +++ b/src/alisolarflare/components/gpowers/GPowerModule.java @@ -5,7 +5,6 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; import alisolarflare.components.gpowers.commands.gPowerCommand; import alisolarflare.components.gpowers.listeners.gPowerListener; -import buttondevteam.lib.TBMCCoreAPI; public class GPowerModule extends Module { @@ -13,7 +12,7 @@ public class GPowerModule extends Module { public void register(JavaPlugin plugin) { registerCommand(plugin, new gPowerCommand()); - TBMCCoreAPI.RegisterEventsForExceptions(new gPowerListener(plugin), plugin); + registerListener(plugin, new gPowerListener(plugin)); } } diff --git a/src/alisolarflare/components/links/AliLinkModule.java b/src/alisolarflare/components/links/AliLinkModule.java index 1ef6c46..a6d44a9 100644 --- a/src/alisolarflare/components/links/AliLinkModule.java +++ b/src/alisolarflare/components/links/AliLinkModule.java @@ -15,6 +15,7 @@ public class AliLinkModule extends Module { @Override public void register(JavaPlugin plugin) { setAliLink = new SetAliLink(plugin); + registerCommand(plugin, new PressAliLink(plugin, setAliLink)); registerCommand(plugin, setAliLink); diff --git a/src/alisolarflare/events/uhc/UHCModule.java b/src/alisolarflare/events/uhc/UHCModule.java index ddb9bdb..51f6891 100644 --- a/src/alisolarflare/events/uhc/UHCModule.java +++ b/src/alisolarflare/events/uhc/UHCModule.java @@ -12,24 +12,13 @@ public class UHCModule extends Module { public UHCMatch match; public void register(JavaPlugin plugin) { - registerMemoryUnits(plugin); - registerCommands(plugin); - registerListeners(plugin); - } - private void registerMemoryUnits(JavaPlugin plugin) { if (plugin.getConfig().contains("UHCMatchState")){ match = new UHCMatch(plugin.getConfig(), MatchState.valueOf(plugin.getConfig().getString("UHCMatchState"))); }else{ match = new UHCMatch(plugin.getConfig(), MatchState.IDLE); } - } - private void registerListeners(JavaPlugin plugin) { - } - - private void registerCommands(JavaPlugin plugin) { + registerCommand(plugin, new AddToUHC(match)); registerCommand(plugin, new StartMatch(match)); - } - - + } } diff --git a/src/alisolarflare/magic/MagicModule.java b/src/alisolarflare/magic/MagicModule.java index 4da9fc3..6b77bb1 100644 --- a/src/alisolarflare/magic/MagicModule.java +++ b/src/alisolarflare/magic/MagicModule.java @@ -12,7 +12,5 @@ public class MagicModule extends Module{ public void register(JavaPlugin plugin) { registerListener(plugin, new AliArrowListener(plugin)); registerListener(plugin, new BoomBowListener()); - } - } diff --git a/src/alisolarflare/minigames/freeforall/FreeForAllModule.java b/src/alisolarflare/minigames/freeforall/FreeForAllModule.java index 181562f..5560929 100644 --- a/src/alisolarflare/minigames/freeforall/FreeForAllModule.java +++ b/src/alisolarflare/minigames/freeforall/FreeForAllModule.java @@ -12,19 +12,9 @@ public class FreeForAllModule extends Module{ @Override public void register(JavaPlugin plugin) { - registerMemory(); - registerEvents(); - registerCommands(plugin); - } - private void registerMemory() { this.spawnSet = new SpawnSet(); - } - - private void registerEvents() { - } - - private void registerCommands(JavaPlugin plugin) { registerCommand(plugin, new SetFFAS(spawnSet)); + } public int getGameState() {return GameState;} diff --git a/src/alisolarflare/minigames/lobby/LobbyModule.java b/src/alisolarflare/minigames/lobby/LobbyModule.java index 640b91a..63f74e6 100644 --- a/src/alisolarflare/minigames/lobby/LobbyModule.java +++ b/src/alisolarflare/minigames/lobby/LobbyModule.java @@ -13,13 +13,6 @@ public class LobbyModule extends Module{ public List fighters; public void register(JavaPlugin plugin){ - registerEvents(); - registerCommands(plugin); - } - private void registerEvents() { - } - - private void registerCommands(JavaPlugin plugin) { registerCommand(plugin, new ButtonFight(this)); registerCommand(plugin, new ButtonLeave(this)); registerCommand(plugin, new ListFighters(this)); From cb02693c0f6a42d12f68eb4ac76b1a9fdd1a293d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 17:32:08 -0400 Subject: [PATCH 066/263] gpower fix --- plugin.yml | 6 +--- src/alisolarflare/AliPresents.java | 28 +++++++------------ .../commands/SetFlairDoorColour.java | 5 ++++ .../components/gpowers/GPowerModule.java | 4 +-- .../{gPowerCommand.java => GPower.java} | 2 +- .../links/serializer/Deserializer.java | 8 +++++- .../links/serializer/Serializer.java | 7 ++++- .../shulker/AliShulkerModule.java | 5 ++-- .../shulker/commands/AliShulker.java | 4 +-- 9 files changed, 37 insertions(+), 32 deletions(-) rename src/alisolarflare/components/gpowers/commands/{gPowerCommand.java => GPower.java} (93%) rename src/{alisolarflare/components => graveyard}/shulker/AliShulkerModule.java (65%) rename src/{alisolarflare/components => graveyard}/shulker/commands/AliShulker.java (93%) diff --git a/plugin.yml b/plugin.yml index 5609337..fdb2a8d 100644 --- a/plugin.yml +++ b/plugin.yml @@ -3,17 +3,13 @@ name: AliPresents version: 2.0.1 commands: - alishulker: - description: Spawns a shulker at player location Alishulker health withereffect invisibility true experiencedrops pressalilink: description: Presses an Ali Link pressalilink frequency setalilink: description: Creates an Ali Link setalilink frequency - setflairdoorcolour: - description: Sets the flair door colour mode, when lighting portals flairme: description: Activates the Flair Me Command. Ask Ali, she was fucking tired when writing this description - gpowercommand: + gpower: description: Testing command for ghostie powers powerup: description: Official g-power command that activates the ghostie powerups diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index cbea14d..ab28777 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -9,7 +9,6 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.flairdoor.FlairDoorModule; import alisolarflare.components.gpowers.GPowerModule; import alisolarflare.components.links.AliLinkModule; -import alisolarflare.components.shulker.AliShulkerModule; import alisolarflare.events.uhc.UHCModule; import alisolarflare.magic.MagicModule; import alisolarflare.minigames.freeforall.FreeForAllModule; @@ -18,28 +17,21 @@ import alisolarflare.minigames.lobby.LobbyModule; public class AliPresents extends JavaPlugin{ public void onEnable(){ PluginDescriptionFile pdfFile = getDescription(); + + Logger logger = getLogger(); - - logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); - - registerModules(); + + new FlairDoorModule().register(this); + new GPowerModule().register(this); + new AliLinkModule().register(this); + new UHCModule().register(this); + new MagicModule().register(this); + new FreeForAllModule().register(this); + new LobbyModule().register(this); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); } - public void registerModules(){ - new FlairDoorModule().register(this); - new GPowerModule().register(this); - new AliLinkModule().register(this); - new AliShulkerModule().register(this); - - new UHCModule().register(this); - - new MagicModule().register(this); - - new FreeForAllModule().register(this); - new LobbyModule().register(this); - } } diff --git a/src/alisolarflare/components/flairdoor/commands/SetFlairDoorColour.java b/src/alisolarflare/components/flairdoor/commands/SetFlairDoorColour.java index 4477fb6..9447abb 100644 --- a/src/alisolarflare/components/flairdoor/commands/SetFlairDoorColour.java +++ b/src/alisolarflare/components/flairdoor/commands/SetFlairDoorColour.java @@ -7,6 +7,11 @@ import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; +/** + * @deprecated + * @author Alisolarflare + * + */ public class SetFlairDoorColour extends TBMCCommandBase { public static String FlairDoorColorMode = "null"; public static final List COLOURMODES = Arrays.asList("red", "orange", "yellow", "green", "blue", "purple", diff --git a/src/alisolarflare/components/gpowers/GPowerModule.java b/src/alisolarflare/components/gpowers/GPowerModule.java index 91caeb0..b46d651 100644 --- a/src/alisolarflare/components/gpowers/GPowerModule.java +++ b/src/alisolarflare/components/gpowers/GPowerModule.java @@ -3,14 +3,14 @@ package alisolarflare.components.gpowers; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; -import alisolarflare.components.gpowers.commands.gPowerCommand; +import alisolarflare.components.gpowers.commands.GPower; import alisolarflare.components.gpowers.listeners.gPowerListener; public class GPowerModule extends Module { @Override public void register(JavaPlugin plugin) { - registerCommand(plugin, new gPowerCommand()); + registerCommand(plugin, new GPower()); registerListener(plugin, new gPowerListener(plugin)); } diff --git a/src/alisolarflare/components/gpowers/commands/gPowerCommand.java b/src/alisolarflare/components/gpowers/commands/GPower.java similarity index 93% rename from src/alisolarflare/components/gpowers/commands/gPowerCommand.java rename to src/alisolarflare/components/gpowers/commands/GPower.java index 2683c91..e37d2b7 100644 --- a/src/alisolarflare/components/gpowers/commands/gPowerCommand.java +++ b/src/alisolarflare/components/gpowers/commands/GPower.java @@ -6,7 +6,7 @@ import org.bukkit.entity.Player; import alisolarflare.components.gpowers.gPowerMemory; import buttondevteam.lib.chat.TBMCCommandBase; -public class gPowerCommand extends TBMCCommandBase { +public class GPower extends TBMCCommandBase { @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { diff --git a/src/alisolarflare/components/links/serializer/Deserializer.java b/src/alisolarflare/components/links/serializer/Deserializer.java index ccc161d..cfc1786 100644 --- a/src/alisolarflare/components/links/serializer/Deserializer.java +++ b/src/alisolarflare/components/links/serializer/Deserializer.java @@ -7,6 +7,11 @@ import java.util.List; import alisolarflare.components.links.entities.Link; +/** + * @deprecated + * @author Alisolarflare + * + */ public class Deserializer{ public static void main (String args[]) { @@ -15,7 +20,8 @@ public class Deserializer{ //List aliLink = deserializer.loadLink(aliLink); //System.out.println(aliLink); } - + + /**@deprecated*/ @SuppressWarnings("unchecked") public List loadLinkList(){ List aliLinkList; diff --git a/src/alisolarflare/components/links/serializer/Serializer.java b/src/alisolarflare/components/links/serializer/Serializer.java index eb1024f..fe4efef 100644 --- a/src/alisolarflare/components/links/serializer/Serializer.java +++ b/src/alisolarflare/components/links/serializer/Serializer.java @@ -7,6 +7,11 @@ import java.util.List; import alisolarflare.components.links.entities.Link; +/** + * @deprecated + * @author Alisolarflare + * + */ public class Serializer { public static void main (String args[]) { @@ -14,7 +19,7 @@ public class Serializer { //Serializer serializer = new Serializer(); //serializer.saveLink(plugin, frequency, location) } - + /**@deprecated*/ public void saveLinkList(List aliLinkList){ //saves link diff --git a/src/alisolarflare/components/shulker/AliShulkerModule.java b/src/graveyard/shulker/AliShulkerModule.java similarity index 65% rename from src/alisolarflare/components/shulker/AliShulkerModule.java rename to src/graveyard/shulker/AliShulkerModule.java index 7cfaac3..3425a02 100644 --- a/src/alisolarflare/components/shulker/AliShulkerModule.java +++ b/src/graveyard/shulker/AliShulkerModule.java @@ -1,10 +1,11 @@ -package alisolarflare.components.shulker; +package graveyard.shulker; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; -import alisolarflare.components.shulker.commands.AliShulker; +import graveyard.shulker.commands.AliShulker; +/**@deprecated*/ public class AliShulkerModule extends Module { @Override diff --git a/src/alisolarflare/components/shulker/commands/AliShulker.java b/src/graveyard/shulker/commands/AliShulker.java similarity index 93% rename from src/alisolarflare/components/shulker/commands/AliShulker.java rename to src/graveyard/shulker/commands/AliShulker.java index 1b4a4da..abf44f3 100644 --- a/src/alisolarflare/components/shulker/commands/AliShulker.java +++ b/src/graveyard/shulker/commands/AliShulker.java @@ -1,4 +1,4 @@ -package alisolarflare.components.shulker.commands; +package graveyard.shulker.commands; import org.bukkit.Location; import org.bukkit.command.CommandSender; @@ -14,7 +14,7 @@ import buttondevteam.lib.chat.TBMCCommandBase; /** * @author Alisolarflare This class is responsible for the command /aliShulker, which in-game spawns a shulker that: Has a health of 10 Has a wither and invisibility effect present Has noAI And is * Glowing - */ + *@deprecated*/ public class AliShulker extends TBMCCommandBase { @Override From ac580c9c37ae3fadaababd810d9d1dd37371872a Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 17:38:18 -0400 Subject: [PATCH 067/263] uncase-sensitive'd ze uhc bucket --- plugin.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.yml b/plugin.yml index fdb2a8d..20ff168 100644 --- a/plugin.yml +++ b/plugin.yml @@ -15,7 +15,7 @@ commands: description: Official g-power command that activates the ghostie powerups powerdown: description: Offical g-power command that deactivates the ghostie powerups - addToUHC: + addtouhc: description: Adds a player to the UltraHardcore match - startMatch: + startmatch: description: Starts an UltraHardcore match \ No newline at end of file From a6e5c2ad2693d30c97bac7420eec138daa32daba Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 18:05:55 -0400 Subject: [PATCH 068/263] OM NOM NOM NOM NOM --- src/alisolarflare/townylearn/MainPlugin.java | 34 ++++++++++++ .../townylearn/PlotChangeListener.java | 47 ++++++++++++++++ .../townylearn/commands/Cbgm0.java | 23 ++++++++ .../townylearn/commands/Cbgm1.java | 53 +++++++++++++++++++ .../townylearn/commands/SetDickmode.java | 37 +++++++++++++ 5 files changed, 194 insertions(+) create mode 100644 src/alisolarflare/townylearn/MainPlugin.java create mode 100644 src/alisolarflare/townylearn/PlotChangeListener.java create mode 100644 src/alisolarflare/townylearn/commands/Cbgm0.java create mode 100644 src/alisolarflare/townylearn/commands/Cbgm1.java create mode 100644 src/alisolarflare/townylearn/commands/SetDickmode.java diff --git a/src/alisolarflare/townylearn/MainPlugin.java b/src/alisolarflare/townylearn/MainPlugin.java new file mode 100644 index 0000000..1adf4dd --- /dev/null +++ b/src/alisolarflare/townylearn/MainPlugin.java @@ -0,0 +1,34 @@ +package alisolarflare.townylearn; + +import org.bukkit.plugin.java.JavaPlugin; +import alisolarflare.townylearn.commands.Cbgm0; +import alisolarflare.townylearn.commands.Cbgm1; +import alisolarflare.townylearn.commands.SetDickmode; + + +public class MainPlugin extends JavaPlugin{ + public boolean dickmode; + public void onEnable(){ + registerCommands(); + registerEvents(); + } + public void registerCommands(){ + getCommand("cbgm1").setExecutor(new Cbgm1()); + getCommand("cbgm0").setExecutor(new Cbgm0()); + getCommand("setdickmode").setExecutor(new SetDickmode(this)); + } + public void registerEvents(){ + PlotChangeListener plotChangeListener = new PlotChangeListener(this); + + getServer().getPluginManager().registerEvents(plotChangeListener, this); + } + public void setDickmode(boolean YES){ + dickmode = YES; + this.getConfig().set("dickmode", YES); + } + public boolean getDickmode(){ + boolean dickmode = this.getConfig().getBoolean("dickmode"); + this.dickmode = dickmode; + return dickmode; + } +} diff --git a/src/alisolarflare/townylearn/PlotChangeListener.java b/src/alisolarflare/townylearn/PlotChangeListener.java new file mode 100644 index 0000000..3e9421b --- /dev/null +++ b/src/alisolarflare/townylearn/PlotChangeListener.java @@ -0,0 +1,47 @@ +package alisolarflare.townylearn; + +import org.bukkit.GameMode; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; + +import com.palmergames.bukkit.towny.event.PlayerChangePlotEvent; +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.Resident; +import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.towny.object.TownBlock; + +public class PlotChangeListener implements Listener{ + public boolean isInTown; + public MainPlugin plugin; + public PlotChangeListener(MainPlugin plugin){ + this.plugin = plugin; + } + @EventHandler + public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ + if (plugin.dickmode == false){ + return; + } + try{ + Resident currentResident = new Resident(plotEvent.getPlayer().getName().toLowerCase()); + TownBlock plot = plotEvent.getTo().getTownBlock(); + + if(plot.hasTown()){ + Town plotTown = plot.getTown(); + + if(!(plotTown.hasResident(currentResident))){ + plotEvent.getPlayer().setGameMode(GameMode.SURVIVAL); + + } + + } else { + plotEvent.getPlayer().setGameMode(GameMode.SURVIVAL); + } + + }catch(NotRegisteredException e){ + //thrown by plotEvent.getTo().getTownBlock() + //thrown by plotEvent.getTo().getTownBlock().getTown(); + plotEvent.getPlayer().setGameMode(GameMode.SURVIVAL); + + } + } +} diff --git a/src/alisolarflare/townylearn/commands/Cbgm0.java b/src/alisolarflare/townylearn/commands/Cbgm0.java new file mode 100644 index 0000000..12a0bc1 --- /dev/null +++ b/src/alisolarflare/townylearn/commands/Cbgm0.java @@ -0,0 +1,23 @@ +package alisolarflare.townylearn.commands; + +import org.bukkit.GameMode; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class Cbgm0 implements CommandExecutor{ + + @Override + public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + return false; + } + + Player player = (Player) sender; + player.setGameMode(GameMode.SURVIVAL); + return false; + } + +} diff --git a/src/alisolarflare/townylearn/commands/Cbgm1.java b/src/alisolarflare/townylearn/commands/Cbgm1.java new file mode 100644 index 0000000..4a3f2ac --- /dev/null +++ b/src/alisolarflare/townylearn/commands/Cbgm1.java @@ -0,0 +1,53 @@ +package alisolarflare.townylearn.commands; + +import org.bukkit.GameMode; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.*; + +public class Cbgm1 implements CommandExecutor { + + @Override + public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { + + if (!(sender instanceof Player)) { + sender.sendMessage("You must be a player to use this command!"); + return false; + } + + Player player = (Player) sender; + + TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); + if (tb == null) { + player.sendMessage("§cYou aren't standing in a town or some other error occured."); + player.sendMessage("§cTownBlock is null."); + return false; + } + Town town; + try { + town = tb.getTown(); + } catch (NotRegisteredException e) { + player.sendMessage("§cYou aren't standing in a town or some other error occured."); + player.sendMessage("§cTownBlock's town is not registered."); + return false; + } + if (town == null) { + player.sendMessage("§cERROR: The town you're standing in is Null."); + return false; + } + + for(Resident res : town.getResidents()){ + if (res.getName().toString().equals(player.getName().toString())){ + player.setGameMode(GameMode.CREATIVE); + return true; + } + } + player.sendMessage("Sorry, you're not part of this town"); + return false; + } + +} diff --git a/src/alisolarflare/townylearn/commands/SetDickmode.java b/src/alisolarflare/townylearn/commands/SetDickmode.java new file mode 100644 index 0000000..a83a019 --- /dev/null +++ b/src/alisolarflare/townylearn/commands/SetDickmode.java @@ -0,0 +1,37 @@ +package alisolarflare.townylearn.commands; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +import alisolarflare.townylearn.MainPlugin; + +public class SetDickmode implements CommandExecutor{ + private MainPlugin plugin; + + public SetDickmode(MainPlugin plugin){ + this.plugin = plugin; + } + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (sender.getName().equals("Alisolarflare") || sender.getName().equals("iie")){ + if(args[0] == null){ + sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); + return false; + } + if(args[0].equalsIgnoreCase("TRUE") || args[0].equalsIgnoreCase("1")){ + sender.sendMessage("Dickmode has been turned on!"); + plugin.setDickmode(true); + return true; + } + if(args[0].equalsIgnoreCase("FALSE") || args[0].equalsIgnoreCase("0")){ + sender.sendMessage("Dickmode has been turned off!"); + plugin.setDickmode(false); + return true; + } + return false; + } + return false; + } +} From 79f909a28891089e6f3694144662da3a25c05ab2 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 19:59:57 -0400 Subject: [PATCH 069/263] changed "NULL" to "IDLE" --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 30ae627..c3cfef7 100644 --- a/config.yml +++ b/config.yml @@ -1 +1 @@ -UHCMatchState: "NULL" \ No newline at end of file +UHCMatchState: "IDLE" \ No newline at end of file From fc5141a197f61333eaf49683f7b4895a72bf08b5 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 3 Nov 2016 23:01:12 -0400 Subject: [PATCH 070/263] Digested Townylearn, and refactored more --- src/alisolarflare/AliPresents.java | 10 +- .../flairdoor/listeners/PortalListener.java | 27 +++--- .../CreativeBoundariesModule.java | 23 +++++ .../PlotChangeListener.java | 94 +++++++++---------- .../creativeboundaries/commands/Cbgm0.java | 41 ++++++++ .../creativeboundaries/commands/Cbgm1.java | 74 +++++++++++++++ .../commands/SetDickmode.java | 54 +++++++++++ src/alisolarflare/magic/MagicModule.java | 4 +- .../AliArrowListener.java | 2 +- .../{aliarrow => tricks}/AliArrowTask.java | 2 +- .../{boombow => tricks}/BoomBowListener.java | 2 +- .../{boombow => tricks}/BoomBowRule.java | 2 +- .../minigames/MinigameModule.java | 33 +++++++ .../minigames/commands/JoinMinigame.java | 53 +++++++++++ .../minigames/commands/LeaveMinigame.java | 53 +++++++++++ .../{lobby => }/commands/ListFighters.java | 8 +- .../SetColourSpawn.java} | 13 +-- .../{freeforall => }/data/SpawnSet.java | 2 +- .../minigames/entities/Fighter.java | 11 +++ .../freeforall/FreeForAllModule.java | 24 ----- .../minigames/freeforall/data/Data.java | 8 -- .../freeforall/entities/Fighter.java | 17 ---- .../minigames/lobby/LobbyModule.java | 20 ---- .../minigames/lobby/commands/ButtonFight.java | 51 ---------- .../minigames/lobby/commands/ButtonLeave.java | 48 ---------- src/alisolarflare/townylearn/MainPlugin.java | 34 ------- .../townylearn/commands/Cbgm0.java | 23 ----- .../townylearn/commands/Cbgm1.java | 53 ----------- .../townylearn/commands/SetDickmode.java | 37 -------- .../{events => }/uhc/UHCModule.java | 12 ++- .../{events => }/uhc/commands/AddToUHC.java | 4 +- .../{events => }/uhc/commands/StartMatch.java | 4 +- .../uhc/listeners/MatchCyclingListener.java | 2 +- .../uhc/listeners/MatchMainLoop.java | 2 +- .../{events => }/uhc/memory/MatchState.java | 2 +- .../{events => }/uhc/memory/UHCMatch.java | 2 +- 36 files changed, 437 insertions(+), 414 deletions(-) create mode 100644 src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java rename src/alisolarflare/{townylearn => creativeboundaries}/PlotChangeListener.java (86%) create mode 100644 src/alisolarflare/creativeboundaries/commands/Cbgm0.java create mode 100644 src/alisolarflare/creativeboundaries/commands/Cbgm1.java create mode 100644 src/alisolarflare/creativeboundaries/commands/SetDickmode.java rename src/alisolarflare/magic/{aliarrow => tricks}/AliArrowListener.java (92%) rename src/alisolarflare/magic/{aliarrow => tricks}/AliArrowTask.java (92%) rename src/alisolarflare/magic/{boombow => tricks}/BoomBowListener.java (95%) rename src/alisolarflare/magic/{boombow => tricks}/BoomBowRule.java (94%) create mode 100644 src/alisolarflare/minigames/MinigameModule.java create mode 100644 src/alisolarflare/minigames/commands/JoinMinigame.java create mode 100644 src/alisolarflare/minigames/commands/LeaveMinigame.java rename src/alisolarflare/minigames/{lobby => }/commands/ListFighters.java (76%) rename src/alisolarflare/minigames/{freeforall/commands/SetFFAS.java => commands/SetColourSpawn.java} (84%) rename src/alisolarflare/minigames/{freeforall => }/data/SpawnSet.java (92%) create mode 100644 src/alisolarflare/minigames/entities/Fighter.java delete mode 100644 src/alisolarflare/minigames/freeforall/FreeForAllModule.java delete mode 100644 src/alisolarflare/minigames/freeforall/data/Data.java delete mode 100644 src/alisolarflare/minigames/freeforall/entities/Fighter.java delete mode 100644 src/alisolarflare/minigames/lobby/LobbyModule.java delete mode 100644 src/alisolarflare/minigames/lobby/commands/ButtonFight.java delete mode 100644 src/alisolarflare/minigames/lobby/commands/ButtonLeave.java delete mode 100644 src/alisolarflare/townylearn/MainPlugin.java delete mode 100644 src/alisolarflare/townylearn/commands/Cbgm0.java delete mode 100644 src/alisolarflare/townylearn/commands/Cbgm1.java delete mode 100644 src/alisolarflare/townylearn/commands/SetDickmode.java rename src/alisolarflare/{events => }/uhc/UHCModule.java (66%) rename src/alisolarflare/{events => }/uhc/commands/AddToUHC.java (89%) rename src/alisolarflare/{events => }/uhc/commands/StartMatch.java (89%) rename src/alisolarflare/{events => }/uhc/listeners/MatchCyclingListener.java (89%) rename src/alisolarflare/{events => }/uhc/listeners/MatchMainLoop.java (71%) rename src/alisolarflare/{events => }/uhc/memory/MatchState.java (64%) rename src/alisolarflare/{events => }/uhc/memory/UHCMatch.java (90%) diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index ab28777..14da8b4 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -9,10 +9,10 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.flairdoor.FlairDoorModule; import alisolarflare.components.gpowers.GPowerModule; import alisolarflare.components.links.AliLinkModule; -import alisolarflare.events.uhc.UHCModule; +import alisolarflare.creativeboundaries.CreativeBoundariesModule; import alisolarflare.magic.MagicModule; -import alisolarflare.minigames.freeforall.FreeForAllModule; -import alisolarflare.minigames.lobby.LobbyModule; +import alisolarflare.minigames.MinigameModule; +import alisolarflare.uhc.UHCModule; public class AliPresents extends JavaPlugin{ public void onEnable(){ @@ -27,8 +27,8 @@ public class AliPresents extends JavaPlugin{ new AliLinkModule().register(this); new UHCModule().register(this); new MagicModule().register(this); - new FreeForAllModule().register(this); - new LobbyModule().register(this); + new MinigameModule().register(this); + new CreativeBoundariesModule().register(this); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); diff --git a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java index 4e86f74..a41d3bb 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -37,7 +37,6 @@ public class PortalListener implements Listener{ //INIT - Player Player player = event.getPlayer(); - player.sendMessage("MAY THE FLAIRING COMMENCE"); //SANITATION - PlayersToBeFlaired if(!(playersToBeFlaired.contains(player.getName()))){ @@ -53,31 +52,31 @@ public class PortalListener implements Listener{ int z = player.getLocation().getBlockZ(); //INIT - Blocks Under Portal - Block blockTopper = player.getWorld().getBlockAt(x,y-1,z); - Block blockMiddle = player.getWorld().getBlockAt(x,y-2,z); - Block blockBottom = player.getWorld().getBlockAt(x,y-3,z); + Block HigherBlock = player.getWorld().getBlockAt(x,y-1,z); + Block MiddleBlock = player.getWorld().getBlockAt(x,y-2,z); + Block BottomBlock = player.getWorld().getBlockAt(x,y-3,z); player.sendMessage("Blocks being inspected:"); - player.sendMessage(blockTopper.toString()); - player.sendMessage(blockMiddle.toString()); - player.sendMessage(blockBottom.toString()); + player.sendMessage(HigherBlock.toString()); + player.sendMessage(MiddleBlock.toString()); + player.sendMessage(BottomBlock.toString()); //RECOLOUR PLAYER - if(blockTopper.getType() == Material.STONE){ + if(HigherBlock.getType() == Material.STONE){ player.sendMessage("STONE DETECTED"); recolourPlayer(player, DyeColor.GRAY); //TOP BLOCK IS WOOL? - }else if(blockTopper.getType() == Material.WOOL){ + }else if(HigherBlock.getType() == Material.WOOL){ player.sendMessage("WOOL DETECTED T"); - Wool wool = (Wool) blockTopper.getState().getData(); + Wool wool = (Wool) HigherBlock.getState().getData(); recolourPlayer(player, wool.getColor()); //MIDDLE BLOCK IS WOOL? - }else if(blockMiddle.getType() == Material.WOOL){ + }else if(MiddleBlock.getType() == Material.WOOL){ player.sendMessage("WOOL DETECTED M"); - MaterialData mData = blockMiddle.getState().getData(); + MaterialData mData = MiddleBlock.getState().getData(); player.sendMessage("MATERIAL DATA COLLECTED: "+ mData.toString()); Wool wool = (Wool) mData; player.sendMessage("WOOL DATA CONVERTED: "+ wool.toString()); @@ -85,9 +84,9 @@ public class PortalListener implements Listener{ recolourPlayer(player, wool.getColor()); //BOTTOM BLOCK IS WOOL? - }else if (blockBottom.getType() == Material.WOOL){ + }else if (BottomBlock.getType() == Material.WOOL){ player.sendMessage("WOOL DETECTED B"); - Wool wool = (Wool) blockBottom.getState().getData(); + Wool wool = (Wool) BottomBlock.getState().getData(); recolourPlayer(player, wool.getColor()); } diff --git a/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java b/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java new file mode 100644 index 0000000..09b6639 --- /dev/null +++ b/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java @@ -0,0 +1,23 @@ +package alisolarflare.creativeboundaries; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.creativeboundaries.commands.Cbgm0; +import alisolarflare.creativeboundaries.commands.Cbgm1; +import alisolarflare.creativeboundaries.commands.SetDickmode; + + +public class CreativeBoundariesModule extends Module{ + public boolean dickmode; + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new Cbgm1()); + registerCommand(plugin, new Cbgm0()); + registerCommand(plugin, new SetDickmode(this)); + + + registerListener(plugin, new PlotChangeListener(this)); + } + +} diff --git a/src/alisolarflare/townylearn/PlotChangeListener.java b/src/alisolarflare/creativeboundaries/PlotChangeListener.java similarity index 86% rename from src/alisolarflare/townylearn/PlotChangeListener.java rename to src/alisolarflare/creativeboundaries/PlotChangeListener.java index 3e9421b..e815539 100644 --- a/src/alisolarflare/townylearn/PlotChangeListener.java +++ b/src/alisolarflare/creativeboundaries/PlotChangeListener.java @@ -1,47 +1,47 @@ -package alisolarflare.townylearn; - -import org.bukkit.GameMode; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; - -import com.palmergames.bukkit.towny.event.PlayerChangePlotEvent; -import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; -import com.palmergames.bukkit.towny.object.Resident; -import com.palmergames.bukkit.towny.object.Town; -import com.palmergames.bukkit.towny.object.TownBlock; - -public class PlotChangeListener implements Listener{ - public boolean isInTown; - public MainPlugin plugin; - public PlotChangeListener(MainPlugin plugin){ - this.plugin = plugin; - } - @EventHandler - public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ - if (plugin.dickmode == false){ - return; - } - try{ - Resident currentResident = new Resident(plotEvent.getPlayer().getName().toLowerCase()); - TownBlock plot = plotEvent.getTo().getTownBlock(); - - if(plot.hasTown()){ - Town plotTown = plot.getTown(); - - if(!(plotTown.hasResident(currentResident))){ - plotEvent.getPlayer().setGameMode(GameMode.SURVIVAL); - - } - - } else { - plotEvent.getPlayer().setGameMode(GameMode.SURVIVAL); - } - - }catch(NotRegisteredException e){ - //thrown by plotEvent.getTo().getTownBlock() - //thrown by plotEvent.getTo().getTownBlock().getTown(); - plotEvent.getPlayer().setGameMode(GameMode.SURVIVAL); - - } - } -} +package alisolarflare.creativeboundaries; + +import org.bukkit.GameMode; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; + +import com.palmergames.bukkit.towny.event.PlayerChangePlotEvent; +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.Resident; +import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.towny.object.TownBlock; + +public class PlotChangeListener implements Listener{ + public boolean isInTown; + public CreativeBoundariesModule plugin; + public PlotChangeListener(CreativeBoundariesModule plugin){ + this.plugin = plugin; + } + @EventHandler + public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ + if (plugin.dickmode == false){ + return; + } + try{ + Resident currentResident = new Resident(plotEvent.getPlayer().getName().toLowerCase()); + TownBlock plot = plotEvent.getTo().getTownBlock(); + + if(plot.hasTown()){ + Town plotTown = plot.getTown(); + + if(!(plotTown.hasResident(currentResident))){ + plotEvent.getPlayer().setGameMode(GameMode.SURVIVAL); + + } + + } else { + plotEvent.getPlayer().setGameMode(GameMode.SURVIVAL); + } + + }catch(NotRegisteredException e){ + //thrown by plotEvent.getTo().getTownBlock() + //thrown by plotEvent.getTo().getTownBlock().getTown(); + plotEvent.getPlayer().setGameMode(GameMode.SURVIVAL); + + } + } +} diff --git a/src/alisolarflare/creativeboundaries/commands/Cbgm0.java b/src/alisolarflare/creativeboundaries/commands/Cbgm0.java new file mode 100644 index 0000000..88ba03a --- /dev/null +++ b/src/alisolarflare/creativeboundaries/commands/Cbgm0.java @@ -0,0 +1,41 @@ +package alisolarflare.creativeboundaries.commands; + +import org.bukkit.GameMode; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Cbgm0 extends TBMCCommandBase{ + + @Override + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + return false; + } + + Player player = (Player) sender; + player.setGameMode(GameMode.SURVIVAL); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/creativeboundaries/commands/Cbgm1.java b/src/alisolarflare/creativeboundaries/commands/Cbgm1.java new file mode 100644 index 0000000..09753cc --- /dev/null +++ b/src/alisolarflare/creativeboundaries/commands/Cbgm1.java @@ -0,0 +1,74 @@ +package alisolarflare.creativeboundaries.commands; + +import org.bukkit.GameMode; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.Resident; +import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.towny.object.TownBlock; +import com.palmergames.bukkit.towny.object.TownyUniverse; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Cbgm1 extends TBMCCommandBase { + + @Override + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { + + if (!(sender instanceof Player)) { + sender.sendMessage("You must be a player to use this command!"); + return false; + } + + Player player = (Player) sender; + + TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); + if (tb == null) { + player.sendMessage("�cYou aren't standing in a town or some other error occured."); + player.sendMessage("�cTownBlock is null."); + return false; + } + Town town; + try { + town = tb.getTown(); + } catch (NotRegisteredException e) { + player.sendMessage("�cYou aren't standing in a town or some other error occured."); + player.sendMessage("�cTownBlock's town is not registered."); + return false; + } + if (town == null) { + player.sendMessage("�cERROR: The town you're standing in is Null."); + return false; + } + + for(Resident res : town.getResidents()){ + if (res.getName().toString().equals(player.getName().toString())){ + player.setGameMode(GameMode.CREATIVE); + return true; + } + } + player.sendMessage("Sorry, you're not part of this town"); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/creativeboundaries/commands/SetDickmode.java b/src/alisolarflare/creativeboundaries/commands/SetDickmode.java new file mode 100644 index 0000000..5cb3b14 --- /dev/null +++ b/src/alisolarflare/creativeboundaries/commands/SetDickmode.java @@ -0,0 +1,54 @@ +package alisolarflare.creativeboundaries.commands; + +import org.bukkit.command.CommandSender; + +import alisolarflare.creativeboundaries.CreativeBoundariesModule; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class SetDickmode extends TBMCCommandBase{ + private CreativeBoundariesModule plugin; + + public SetDickmode(CreativeBoundariesModule plugin){ + this.plugin = plugin; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (sender.getName().equals("Alisolarflare") || sender.getName().equals("iie")){ + if(args[0] == null){ + sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); + return false; + } + if(args[0].equalsIgnoreCase("TRUE") || args[0].equalsIgnoreCase("1")){ + sender.sendMessage("Dickmode has been turned on!"); + plugin.dickmode=(true); + return true; + } + if(args[0].equalsIgnoreCase("FALSE") || args[0].equalsIgnoreCase("0")){ + sender.sendMessage("Dickmode has been turned off!"); + plugin.dickmode=(false); + return true; + } + return false; + } + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } +} diff --git a/src/alisolarflare/magic/MagicModule.java b/src/alisolarflare/magic/MagicModule.java index 6b77bb1..2b37e22 100644 --- a/src/alisolarflare/magic/MagicModule.java +++ b/src/alisolarflare/magic/MagicModule.java @@ -3,8 +3,8 @@ package alisolarflare.magic; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; -import alisolarflare.magic.aliarrow.AliArrowListener; -import alisolarflare.magic.boombow.BoomBowListener; +import alisolarflare.magic.tricks.AliArrowListener; +import alisolarflare.magic.tricks.BoomBowListener; public class MagicModule extends Module{ diff --git a/src/alisolarflare/magic/aliarrow/AliArrowListener.java b/src/alisolarflare/magic/tricks/AliArrowListener.java similarity index 92% rename from src/alisolarflare/magic/aliarrow/AliArrowListener.java rename to src/alisolarflare/magic/tricks/AliArrowListener.java index a7617a8..36b8e12 100644 --- a/src/alisolarflare/magic/aliarrow/AliArrowListener.java +++ b/src/alisolarflare/magic/tricks/AliArrowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.magic.aliarrow; +package alisolarflare.magic.tricks; import org.bukkit.entity.Arrow; import org.bukkit.entity.EntityType; diff --git a/src/alisolarflare/magic/aliarrow/AliArrowTask.java b/src/alisolarflare/magic/tricks/AliArrowTask.java similarity index 92% rename from src/alisolarflare/magic/aliarrow/AliArrowTask.java rename to src/alisolarflare/magic/tricks/AliArrowTask.java index f131ace..10252b8 100644 --- a/src/alisolarflare/magic/aliarrow/AliArrowTask.java +++ b/src/alisolarflare/magic/tricks/AliArrowTask.java @@ -1,4 +1,4 @@ -package alisolarflare.magic.aliarrow; +package alisolarflare.magic.tricks; import org.bukkit.Particle; import org.bukkit.entity.Arrow; diff --git a/src/alisolarflare/magic/boombow/BoomBowListener.java b/src/alisolarflare/magic/tricks/BoomBowListener.java similarity index 95% rename from src/alisolarflare/magic/boombow/BoomBowListener.java rename to src/alisolarflare/magic/tricks/BoomBowListener.java index 9b5ad69..a7f6a3b 100644 --- a/src/alisolarflare/magic/boombow/BoomBowListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.magic.boombow; +package alisolarflare.magic.tricks; import org.bukkit.GameMode; import org.bukkit.Location; diff --git a/src/alisolarflare/magic/boombow/BoomBowRule.java b/src/alisolarflare/magic/tricks/BoomBowRule.java similarity index 94% rename from src/alisolarflare/magic/boombow/BoomBowRule.java rename to src/alisolarflare/magic/tricks/BoomBowRule.java index aae9a76..b1131c6 100644 --- a/src/alisolarflare/magic/boombow/BoomBowRule.java +++ b/src/alisolarflare/magic/tricks/BoomBowRule.java @@ -1,4 +1,4 @@ -package alisolarflare.magic.boombow; +package alisolarflare.magic.tricks; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/alisolarflare/minigames/MinigameModule.java b/src/alisolarflare/minigames/MinigameModule.java new file mode 100644 index 0000000..72827b3 --- /dev/null +++ b/src/alisolarflare/minigames/MinigameModule.java @@ -0,0 +1,33 @@ +package alisolarflare.minigames; + +import java.util.List; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.minigames.commands.JoinMinigame; +import alisolarflare.minigames.commands.LeaveMinigame; +import alisolarflare.minigames.commands.ListFighters; +import alisolarflare.minigames.commands.SetColourSpawn; +import alisolarflare.minigames.data.SpawnSet; + +public class MinigameModule extends Module{ + public SpawnSet spawnSet; + private int GameState; + public List fighters; + + @Override + public void register(JavaPlugin plugin) { + this.spawnSet = new SpawnSet(); + registerCommand(plugin, new SetColourSpawn(spawnSet)); + registerCommand(plugin, new JoinMinigame(this)); + registerCommand(plugin, new LeaveMinigame(this)); + registerCommand(plugin, new ListFighters(this)); + + } + + public int getGameState() {return GameState;} + public void setGameState(int gameState) {GameState = gameState;} + + +} diff --git a/src/alisolarflare/minigames/commands/JoinMinigame.java b/src/alisolarflare/minigames/commands/JoinMinigame.java new file mode 100644 index 0000000..f0afa6f --- /dev/null +++ b/src/alisolarflare/minigames/commands/JoinMinigame.java @@ -0,0 +1,53 @@ +package alisolarflare.minigames.commands; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.minigames.MinigameModule; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class JoinMinigame extends TBMCCommandBase { + private MinigameModule minigame; + + public JoinMinigame(MinigameModule minigame) { + this.minigame = minigame; + } + + @Override + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + return false; + } + + String name = sender.getName(); + if (minigame.fighters.contains(name)) { + sender.sendMessage("You are already in the minigame!"); + return false; + } + + minigame.fighters.add(name); + + if (minigame.fighters.contains(name)) { + sender.sendMessage("You have joined the minigame!"); + } + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + return false; + } + +} diff --git a/src/alisolarflare/minigames/commands/LeaveMinigame.java b/src/alisolarflare/minigames/commands/LeaveMinigame.java new file mode 100644 index 0000000..844ed07 --- /dev/null +++ b/src/alisolarflare/minigames/commands/LeaveMinigame.java @@ -0,0 +1,53 @@ +package alisolarflare.minigames.commands; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.minigames.MinigameModule; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class LeaveMinigame extends TBMCCommandBase { + + private MinigameModule lobby; + + public LeaveMinigame(MinigameModule lobby) { + this.lobby = lobby; + } + + @Override + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { + if(!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + } + + String name = sender.getName(); + if (!(lobby.fighters.contains(name))) { + sender.sendMessage("You are not fighting!"); + return false; + } + + while(lobby.fighters.contains(name)){ + lobby.fighters.remove(name); + } + sender.sendMessage("You have left the fighters category!"); + + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + return false; + } + +} diff --git a/src/alisolarflare/minigames/lobby/commands/ListFighters.java b/src/alisolarflare/minigames/commands/ListFighters.java similarity index 76% rename from src/alisolarflare/minigames/lobby/commands/ListFighters.java rename to src/alisolarflare/minigames/commands/ListFighters.java index 8024727..209d9f8 100644 --- a/src/alisolarflare/minigames/lobby/commands/ListFighters.java +++ b/src/alisolarflare/minigames/commands/ListFighters.java @@ -1,16 +1,16 @@ -package alisolarflare.minigames.lobby.commands; +package alisolarflare.minigames.commands; import java.util.stream.Collectors; import org.bukkit.command.CommandSender; -import alisolarflare.minigames.lobby.LobbyModule; +import alisolarflare.minigames.MinigameModule; import buttondevteam.lib.chat.TBMCCommandBase; public class ListFighters extends TBMCCommandBase { - private LobbyModule lobby; + private MinigameModule lobby; - public ListFighters(LobbyModule lobby) { + public ListFighters(MinigameModule lobby) { this.lobby = lobby; } diff --git a/src/alisolarflare/minigames/freeforall/commands/SetFFAS.java b/src/alisolarflare/minigames/commands/SetColourSpawn.java similarity index 84% rename from src/alisolarflare/minigames/freeforall/commands/SetFFAS.java rename to src/alisolarflare/minigames/commands/SetColourSpawn.java index 56e7a17..ca9501f 100644 --- a/src/alisolarflare/minigames/freeforall/commands/SetFFAS.java +++ b/src/alisolarflare/minigames/commands/SetColourSpawn.java @@ -1,15 +1,15 @@ -package alisolarflare.minigames.freeforall.commands; +package alisolarflare.minigames.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.minigames.freeforall.data.SpawnSet; +import alisolarflare.minigames.data.SpawnSet; import buttondevteam.lib.chat.TBMCCommandBase; -public class SetFFAS extends TBMCCommandBase{ +public class SetColourSpawn extends TBMCCommandBase{ private SpawnSet spawnSet; - public SetFFAS(SpawnSet spawnSet){ + public SetColourSpawn(SpawnSet spawnSet){ this.spawnSet = spawnSet; } @Override @@ -66,11 +66,6 @@ public class SetFFAS extends TBMCCommandBase{ return false; } @Override - public String GetCommandPath() { - // TODO Auto-generated method stub - return "setFFAS"; - } - @Override public String[] GetHelpText(String arg0) { // TODO Auto-generated method stub return null; diff --git a/src/alisolarflare/minigames/freeforall/data/SpawnSet.java b/src/alisolarflare/minigames/data/SpawnSet.java similarity index 92% rename from src/alisolarflare/minigames/freeforall/data/SpawnSet.java rename to src/alisolarflare/minigames/data/SpawnSet.java index 79d29de..40fd0ae 100644 --- a/src/alisolarflare/minigames/freeforall/data/SpawnSet.java +++ b/src/alisolarflare/minigames/data/SpawnSet.java @@ -1,4 +1,4 @@ -package alisolarflare.minigames.freeforall.data; +package alisolarflare.minigames.data; import org.bukkit.Location; diff --git a/src/alisolarflare/minigames/entities/Fighter.java b/src/alisolarflare/minigames/entities/Fighter.java new file mode 100644 index 0000000..557c1ae --- /dev/null +++ b/src/alisolarflare/minigames/entities/Fighter.java @@ -0,0 +1,11 @@ +package alisolarflare.minigames.entities; + +import org.bukkit.entity.Player; + +public class Fighter { + public Player player; + public String colour; + public Fighter(Player player, String colour){ + this.colour = colour; + } +} diff --git a/src/alisolarflare/minigames/freeforall/FreeForAllModule.java b/src/alisolarflare/minigames/freeforall/FreeForAllModule.java deleted file mode 100644 index 5560929..0000000 --- a/src/alisolarflare/minigames/freeforall/FreeForAllModule.java +++ /dev/null @@ -1,24 +0,0 @@ -package alisolarflare.minigames.freeforall; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.minigames.freeforall.commands.SetFFAS; -import alisolarflare.minigames.freeforall.data.SpawnSet; - -public class FreeForAllModule extends Module{ - public SpawnSet spawnSet; - private int GameState; - - @Override - public void register(JavaPlugin plugin) { - this.spawnSet = new SpawnSet(); - registerCommand(plugin, new SetFFAS(spawnSet)); - - } - - public int getGameState() {return GameState;} - public void setGameState(int gameState) {GameState = gameState;} - - -} diff --git a/src/alisolarflare/minigames/freeforall/data/Data.java b/src/alisolarflare/minigames/freeforall/data/Data.java deleted file mode 100644 index 29ad380..0000000 --- a/src/alisolarflare/minigames/freeforall/data/Data.java +++ /dev/null @@ -1,8 +0,0 @@ -package alisolarflare.minigames.freeforall.data; - -public class Data { - public SpawnSet spawnset; - public Data(){ - spawnset = new SpawnSet(); - } -} diff --git a/src/alisolarflare/minigames/freeforall/entities/Fighter.java b/src/alisolarflare/minigames/freeforall/entities/Fighter.java deleted file mode 100644 index 98aea3a..0000000 --- a/src/alisolarflare/minigames/freeforall/entities/Fighter.java +++ /dev/null @@ -1,17 +0,0 @@ -package alisolarflare.minigames.freeforall.entities; - -import org.bukkit.entity.Player; - -public class Fighter { - public Player player; - public String colour; - public Fighter(Player player){ - this.player = player; - } - public Fighter(Player player, String colour){ - this.colour = colour; - } - public String ToString(){ - return player.toString() +": " + colour.toString(); - } -} diff --git a/src/alisolarflare/minigames/lobby/LobbyModule.java b/src/alisolarflare/minigames/lobby/LobbyModule.java deleted file mode 100644 index 63f74e6..0000000 --- a/src/alisolarflare/minigames/lobby/LobbyModule.java +++ /dev/null @@ -1,20 +0,0 @@ -package alisolarflare.minigames.lobby; - -import java.util.List; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.minigames.lobby.commands.ButtonFight; -import alisolarflare.minigames.lobby.commands.ButtonLeave; -import alisolarflare.minigames.lobby.commands.ListFighters; - -public class LobbyModule extends Module{ - public List fighters; - - public void register(JavaPlugin plugin){ - registerCommand(plugin, new ButtonFight(this)); - registerCommand(plugin, new ButtonLeave(this)); - registerCommand(plugin, new ListFighters(this)); - } -} diff --git a/src/alisolarflare/minigames/lobby/commands/ButtonFight.java b/src/alisolarflare/minigames/lobby/commands/ButtonFight.java deleted file mode 100644 index 25fdb44..0000000 --- a/src/alisolarflare/minigames/lobby/commands/ButtonFight.java +++ /dev/null @@ -1,51 +0,0 @@ -package alisolarflare.minigames.lobby.commands; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.minigames.lobby.LobbyModule; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class ButtonFight extends TBMCCommandBase { - private LobbyModule lobby; - - public ButtonFight(LobbyModule lobby) { - this.lobby = lobby; - } - - @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - - Player player = (Player) sender; - player.sendMessage(player.toString()); - String name = player.getName(); - if (lobby.fighters.contains(name)) { - player.sendMessage("You are already in the button fight!"); - return false; - } - - lobby.fighters.add(name); - - if (lobby.fighters.contains(name)) { - player.sendMessage("You have joined the fighters category!"); - } - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - return false; - } - -} diff --git a/src/alisolarflare/minigames/lobby/commands/ButtonLeave.java b/src/alisolarflare/minigames/lobby/commands/ButtonLeave.java deleted file mode 100644 index 2882075..0000000 --- a/src/alisolarflare/minigames/lobby/commands/ButtonLeave.java +++ /dev/null @@ -1,48 +0,0 @@ -package alisolarflare.minigames.lobby.commands; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.minigames.lobby.LobbyModule; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class ButtonLeave extends TBMCCommandBase { - - private LobbyModule lobby; - - public ButtonLeave(LobbyModule lobby) { - this.lobby = lobby; - } - - @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - Player player = (Player) sender; - String name = player.getName(); - if (!(lobby.fighters.contains(name))) { - player.sendMessage("You are not fighting!"); - return false; - } - lobby.fighters.remove(name); - if (!(lobby.fighters.contains(name))) { - player.sendMessage("You have left the fighters category!"); - } - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - return false; - } - -} diff --git a/src/alisolarflare/townylearn/MainPlugin.java b/src/alisolarflare/townylearn/MainPlugin.java deleted file mode 100644 index 1adf4dd..0000000 --- a/src/alisolarflare/townylearn/MainPlugin.java +++ /dev/null @@ -1,34 +0,0 @@ -package alisolarflare.townylearn; - -import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.townylearn.commands.Cbgm0; -import alisolarflare.townylearn.commands.Cbgm1; -import alisolarflare.townylearn.commands.SetDickmode; - - -public class MainPlugin extends JavaPlugin{ - public boolean dickmode; - public void onEnable(){ - registerCommands(); - registerEvents(); - } - public void registerCommands(){ - getCommand("cbgm1").setExecutor(new Cbgm1()); - getCommand("cbgm0").setExecutor(new Cbgm0()); - getCommand("setdickmode").setExecutor(new SetDickmode(this)); - } - public void registerEvents(){ - PlotChangeListener plotChangeListener = new PlotChangeListener(this); - - getServer().getPluginManager().registerEvents(plotChangeListener, this); - } - public void setDickmode(boolean YES){ - dickmode = YES; - this.getConfig().set("dickmode", YES); - } - public boolean getDickmode(){ - boolean dickmode = this.getConfig().getBoolean("dickmode"); - this.dickmode = dickmode; - return dickmode; - } -} diff --git a/src/alisolarflare/townylearn/commands/Cbgm0.java b/src/alisolarflare/townylearn/commands/Cbgm0.java deleted file mode 100644 index 12a0bc1..0000000 --- a/src/alisolarflare/townylearn/commands/Cbgm0.java +++ /dev/null @@ -1,23 +0,0 @@ -package alisolarflare.townylearn.commands; - -import org.bukkit.GameMode; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -public class Cbgm0 implements CommandExecutor{ - - @Override - public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - return false; - } - - Player player = (Player) sender; - player.setGameMode(GameMode.SURVIVAL); - return false; - } - -} diff --git a/src/alisolarflare/townylearn/commands/Cbgm1.java b/src/alisolarflare/townylearn/commands/Cbgm1.java deleted file mode 100644 index 4a3f2ac..0000000 --- a/src/alisolarflare/townylearn/commands/Cbgm1.java +++ /dev/null @@ -1,53 +0,0 @@ -package alisolarflare.townylearn.commands; - -import org.bukkit.GameMode; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; -import com.palmergames.bukkit.towny.object.*; - -public class Cbgm1 implements CommandExecutor { - - @Override - public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) { - - if (!(sender instanceof Player)) { - sender.sendMessage("You must be a player to use this command!"); - return false; - } - - Player player = (Player) sender; - - TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); - if (tb == null) { - player.sendMessage("§cYou aren't standing in a town or some other error occured."); - player.sendMessage("§cTownBlock is null."); - return false; - } - Town town; - try { - town = tb.getTown(); - } catch (NotRegisteredException e) { - player.sendMessage("§cYou aren't standing in a town or some other error occured."); - player.sendMessage("§cTownBlock's town is not registered."); - return false; - } - if (town == null) { - player.sendMessage("§cERROR: The town you're standing in is Null."); - return false; - } - - for(Resident res : town.getResidents()){ - if (res.getName().toString().equals(player.getName().toString())){ - player.setGameMode(GameMode.CREATIVE); - return true; - } - } - player.sendMessage("Sorry, you're not part of this town"); - return false; - } - -} diff --git a/src/alisolarflare/townylearn/commands/SetDickmode.java b/src/alisolarflare/townylearn/commands/SetDickmode.java deleted file mode 100644 index a83a019..0000000 --- a/src/alisolarflare/townylearn/commands/SetDickmode.java +++ /dev/null @@ -1,37 +0,0 @@ -package alisolarflare.townylearn.commands; - -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; - -import alisolarflare.townylearn.MainPlugin; - -public class SetDickmode implements CommandExecutor{ - private MainPlugin plugin; - - public SetDickmode(MainPlugin plugin){ - this.plugin = plugin; - } - - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (sender.getName().equals("Alisolarflare") || sender.getName().equals("iie")){ - if(args[0] == null){ - sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); - return false; - } - if(args[0].equalsIgnoreCase("TRUE") || args[0].equalsIgnoreCase("1")){ - sender.sendMessage("Dickmode has been turned on!"); - plugin.setDickmode(true); - return true; - } - if(args[0].equalsIgnoreCase("FALSE") || args[0].equalsIgnoreCase("0")){ - sender.sendMessage("Dickmode has been turned off!"); - plugin.setDickmode(false); - return true; - } - return false; - } - return false; - } -} diff --git a/src/alisolarflare/events/uhc/UHCModule.java b/src/alisolarflare/uhc/UHCModule.java similarity index 66% rename from src/alisolarflare/events/uhc/UHCModule.java rename to src/alisolarflare/uhc/UHCModule.java index 51f6891..db50588 100644 --- a/src/alisolarflare/events/uhc/UHCModule.java +++ b/src/alisolarflare/uhc/UHCModule.java @@ -1,17 +1,19 @@ -package alisolarflare.events.uhc; +package alisolarflare.uhc; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; -import alisolarflare.events.uhc.commands.AddToUHC; -import alisolarflare.events.uhc.commands.StartMatch; -import alisolarflare.events.uhc.memory.MatchState; -import alisolarflare.events.uhc.memory.UHCMatch; +import alisolarflare.uhc.commands.AddToUHC; +import alisolarflare.uhc.commands.StartMatch; +import alisolarflare.uhc.memory.MatchState; +import alisolarflare.uhc.memory.UHCMatch; public class UHCModule extends Module { public UHCMatch match; public void register(JavaPlugin plugin) { + + if (plugin.getConfig().contains("UHCMatchState")){ match = new UHCMatch(plugin.getConfig(), MatchState.valueOf(plugin.getConfig().getString("UHCMatchState"))); }else{ diff --git a/src/alisolarflare/events/uhc/commands/AddToUHC.java b/src/alisolarflare/uhc/commands/AddToUHC.java similarity index 89% rename from src/alisolarflare/events/uhc/commands/AddToUHC.java rename to src/alisolarflare/uhc/commands/AddToUHC.java index ba51a83..ab31de7 100644 --- a/src/alisolarflare/events/uhc/commands/AddToUHC.java +++ b/src/alisolarflare/uhc/commands/AddToUHC.java @@ -1,9 +1,9 @@ -package alisolarflare.events.uhc.commands; +package alisolarflare.uhc.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.events.uhc.memory.UHCMatch; +import alisolarflare.uhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCCommandBase; /** diff --git a/src/alisolarflare/events/uhc/commands/StartMatch.java b/src/alisolarflare/uhc/commands/StartMatch.java similarity index 89% rename from src/alisolarflare/events/uhc/commands/StartMatch.java rename to src/alisolarflare/uhc/commands/StartMatch.java index 29f8a54..901fccf 100644 --- a/src/alisolarflare/events/uhc/commands/StartMatch.java +++ b/src/alisolarflare/uhc/commands/StartMatch.java @@ -1,8 +1,8 @@ -package alisolarflare.events.uhc.commands; +package alisolarflare.uhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.events.uhc.memory.UHCMatch; +import alisolarflare.uhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCCommandBase; public class StartMatch extends TBMCCommandBase { diff --git a/src/alisolarflare/events/uhc/listeners/MatchCyclingListener.java b/src/alisolarflare/uhc/listeners/MatchCyclingListener.java similarity index 89% rename from src/alisolarflare/events/uhc/listeners/MatchCyclingListener.java rename to src/alisolarflare/uhc/listeners/MatchCyclingListener.java index 892eb07..62265c2 100644 --- a/src/alisolarflare/events/uhc/listeners/MatchCyclingListener.java +++ b/src/alisolarflare/uhc/listeners/MatchCyclingListener.java @@ -1,4 +1,4 @@ -package alisolarflare.events.uhc.listeners; +package alisolarflare.uhc.listeners; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; diff --git a/src/alisolarflare/events/uhc/listeners/MatchMainLoop.java b/src/alisolarflare/uhc/listeners/MatchMainLoop.java similarity index 71% rename from src/alisolarflare/events/uhc/listeners/MatchMainLoop.java rename to src/alisolarflare/uhc/listeners/MatchMainLoop.java index 5fc3887..2e42cae 100644 --- a/src/alisolarflare/events/uhc/listeners/MatchMainLoop.java +++ b/src/alisolarflare/uhc/listeners/MatchMainLoop.java @@ -1,4 +1,4 @@ -package alisolarflare.events.uhc.listeners; +package alisolarflare.uhc.listeners; import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/alisolarflare/events/uhc/memory/MatchState.java b/src/alisolarflare/uhc/memory/MatchState.java similarity index 64% rename from src/alisolarflare/events/uhc/memory/MatchState.java rename to src/alisolarflare/uhc/memory/MatchState.java index 0838048..83aadaf 100644 --- a/src/alisolarflare/events/uhc/memory/MatchState.java +++ b/src/alisolarflare/uhc/memory/MatchState.java @@ -1,4 +1,4 @@ -package alisolarflare.events.uhc.memory; +package alisolarflare.uhc.memory; public enum MatchState { IDLE, WAITING, SETUP, INTRO, PEACE, TENSION, POWER, END diff --git a/src/alisolarflare/events/uhc/memory/UHCMatch.java b/src/alisolarflare/uhc/memory/UHCMatch.java similarity index 90% rename from src/alisolarflare/events/uhc/memory/UHCMatch.java rename to src/alisolarflare/uhc/memory/UHCMatch.java index 0461d3f..8338edd 100644 --- a/src/alisolarflare/events/uhc/memory/UHCMatch.java +++ b/src/alisolarflare/uhc/memory/UHCMatch.java @@ -1,4 +1,4 @@ -package alisolarflare.events.uhc.memory; +package alisolarflare.uhc.memory; import java.util.ArrayList; import java.util.List; From 5ec330baf88c5e7a4143f1a2066dd303f0c06c8d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 4 Nov 2016 23:16:39 -0400 Subject: [PATCH 071/263] Fixed bug where boom bow *repaired* durability instead of reduced --- .../components/gpowers/{gPowerMemory.java => GPowerMemory.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/alisolarflare/components/gpowers/{gPowerMemory.java => GPowerMemory.java} (100%) diff --git a/src/alisolarflare/components/gpowers/gPowerMemory.java b/src/alisolarflare/components/gpowers/GPowerMemory.java similarity index 100% rename from src/alisolarflare/components/gpowers/gPowerMemory.java rename to src/alisolarflare/components/gpowers/GPowerMemory.java From 7cc32b84a4540628afb77e3d829ce792dc069fcd Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 4 Nov 2016 23:18:35 -0400 Subject: [PATCH 072/263] Mystery Commit. I have no idea where this came from --- .../components/gpowers/GPowerMemory.java | 83 ++++--------------- .../components/gpowers/GPowerModule.java | 5 +- .../components/gpowers/commands/GPower.java | 8 +- .../gpowers/listeners/gPowerApplyingTask.java | 29 +++++-- .../gpowers/listeners/gPowerListener.java | 30 ++----- .../magic/tricks/BoomBowListener.java | 2 +- 6 files changed, 52 insertions(+), 105 deletions(-) diff --git a/src/alisolarflare/components/gpowers/GPowerMemory.java b/src/alisolarflare/components/gpowers/GPowerMemory.java index f37fd7a..5a99b16 100644 --- a/src/alisolarflare/components/gpowers/GPowerMemory.java +++ b/src/alisolarflare/components/gpowers/GPowerMemory.java @@ -6,76 +6,34 @@ import java.util.UUID; import org.bukkit.entity.Player; -import alisolarflare.AliPresents; - -public class gPowerMemory{ - @SuppressWarnings("unused") - private static AliPresents plugin; - @SuppressWarnings("unused") - private static boolean debugMode = true; - public gPowerMemory(AliPresents plugin){ - gPowerMemory.plugin = plugin; - } - //SHORT TERM MEMORY STORAGE - public static Map PlayerMap = new HashMap(); +public class GPowerMemory{ + public Map poweredPlayerList = new HashMap(); - //POWER ACTIVATION - public static void PowerUpPlayer(Player player, String colour){ - //debug("POWERRRED UP"); - player.sendMessage("POWERRED UP!"); - PlayerMap.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); + public void PowerUpPlayer(Player player, String colour){ + poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); } - public static void PowerUpPlayer(Player player){ - //debug("POWERRRED UP"); - player.sendMessage("POWERRED UP!"); - if(PlayerMap.containsKey(player.getUniqueId())){ - PlayerMap.get(player.getUniqueId()).isPowersActive = true; + public void PowerUpPlayer(Player player){ + if(poweredPlayerList.containsKey(player.getUniqueId())){ + poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; }else{ - player.sendMessage("You must instantiate your power settings using /gpowercommand"); + player.sendMessage("You must instantiate your power settings using /GPower"); } } - //POWER DEACTIVATION - public static void PowerDownPlayer(Player player){ - //debug("POWERRRED DOWN"); - if (PlayerMap.containsKey(player.getUniqueId())){ - PlayerMap.get(player.getUniqueId()).isPowersActive = false; + public void PowerDownPlayer(Player player){ + if (poweredPlayerList.containsKey(player.getUniqueId())){ + poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; }else{ return; } } - public static void PowerDownPlayer(UUID UniqueID){ - //debug("POWEERRED DOWN"); - if (PlayerMap.containsKey(UniqueID)){ - PlayerMap.get(UniqueID).isPowersActive = false; - }else{ - return; - } - } - public static boolean isPlayerPowered(UUID UniqueID){ - //debug("IS PLAYER POWERED?"); - if (PlayerMap.containsKey(UniqueID)){ - return PlayerMap.get(UniqueID).isPowersActive; - }else{ - return false; - } - } - public static boolean isPlayerPowered(Player player){ - //debug("IS PLAYER POWERED?"); - if (PlayerMap.containsKey(player.getUniqueId())){ - return PlayerMap.get(player.getUniqueId()).isPowersActive; - }else{ - return false; - } - } - //MEMORY UNIT - public static class poweredPlayer{ - public static UUID uuid; + + public class poweredPlayer{ + public UUID uuid; public String colour; public Boolean isPowersActive; - @SuppressWarnings("static-access") public poweredPlayer(UUID uuid, String colour, Boolean activated){ this.uuid = (uuid); this.colour = (colour); @@ -85,18 +43,5 @@ public class gPowerMemory{ return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; } } - - public void saveMemoryState(){ - @SuppressWarnings("unused") - Map PlayerMap = new HashMap(); - //for (UUID uuidKey:PlayerMap.keySet()){ - - //UUID uuidToSave = poweredPlayer.uuid; - - //} - } - public void loadMemoryState(){ - - } } diff --git a/src/alisolarflare/components/gpowers/GPowerModule.java b/src/alisolarflare/components/gpowers/GPowerModule.java index b46d651..c3c4a53 100644 --- a/src/alisolarflare/components/gpowers/GPowerModule.java +++ b/src/alisolarflare/components/gpowers/GPowerModule.java @@ -10,9 +10,10 @@ public class GPowerModule extends Module { @Override public void register(JavaPlugin plugin) { - registerCommand(plugin, new GPower()); + GPowerMemory gPowerMemory = new GPowerMemory(); + registerCommand(plugin, new GPower(gPowerMemory)); - registerListener(plugin, new gPowerListener(plugin)); + registerListener(plugin, new gPowerListener(plugin, gPowerMemory)); } } diff --git a/src/alisolarflare/components/gpowers/commands/GPower.java b/src/alisolarflare/components/gpowers/commands/GPower.java index e37d2b7..6c2fcd9 100644 --- a/src/alisolarflare/components/gpowers/commands/GPower.java +++ b/src/alisolarflare/components/gpowers/commands/GPower.java @@ -3,11 +3,17 @@ package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.components.gpowers.gPowerMemory; +import alisolarflare.components.gpowers.GPowerMemory; import buttondevteam.lib.chat.TBMCCommandBase; public class GPower extends TBMCCommandBase { + private GPowerMemory gPowerMemory; + + public GPower(GPowerMemory gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { sender.sendMessage("G power activate!"); diff --git a/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java index 60f2709..d966e63 100644 --- a/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java @@ -1,51 +1,64 @@ package alisolarflare.components.gpowers.listeners; +import java.util.Map; +import java.util.UUID; + import org.bukkit.Color; +import org.bukkit.Server; import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitRunnable; -import alisolarflare.components.gpowers.gPowerMemory; +import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; public class gPowerApplyingTask extends BukkitRunnable{ - private JavaPlugin plugin; + private Server server; + private Map poweredPlayerList; - public gPowerApplyingTask(JavaPlugin plugin) { - this.plugin = plugin; + public gPowerApplyingTask(Server server, Map poweredPlayerList) { + this.server = server; + this.poweredPlayerList = poweredPlayerList; } //REPEATS EVERY 5 SECONDS @Override public void run() { - for (Player player : plugin.getServer().getOnlinePlayers()){ - if(gPowerMemory.PlayerMap.containsKey(player.getUniqueId())){ - activatePower(player, gPowerMemory.PlayerMap.get(player.getUniqueId()).colour); + for (Player player : server.getOnlinePlayers()){ + if(poweredPlayerList.containsKey(player.getUniqueId())){ + activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); } } } private void activatePower(Player player, String colour) { + //GREY if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.GRAY)); player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 0, true, false, Color.GRAY)); + //RED }else if (colour.startsWith("r")){ player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0, true, false, Color.RED)); + //ORANGE }else if (colour.startsWith("o")){ player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); + //YELLOW }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.YELLOW)); + //GREEN }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 200, 1, true, false, Color.GREEN)); player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 200, 0, true, false, Color.GREEN)); + //BLUE }else if (colour.startsWith("b")){ player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1, true, false, Color.BLUE)); player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 200, 0, true, false, Color.BLUE)); + //PURPLE }else if (colour.startsWith("p")){ player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 0, true, false, Color.PURPLE)); + //NULL }else{ } } diff --git a/src/alisolarflare/components/gpowers/listeners/gPowerListener.java b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java index 5ec3780..1b71481 100644 --- a/src/alisolarflare/components/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java @@ -2,30 +2,12 @@ package alisolarflare.components.gpowers.listeners; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.scheduler.BukkitTask; + +import alisolarflare.components.gpowers.GPowerMemory; public class gPowerListener implements Listener{ - private JavaPlugin plugin; - public gPowerApplyingTask powerApplyingTask; - public BukkitTask bukkitTask; - public gPowerListener(JavaPlugin plugin){ - this.plugin = plugin; - this.powerApplyingTask = new gPowerApplyingTask(this.plugin); - bukkitTask = powerApplyingTask.runTaskTimer(plugin, 190, 190); - } - -} -/* - * public class CyclicalDisplayListener implements Listener{ - private final ButtonRebirthPlugin plugin; - public CyclicalDisplayTask cyclicalDisplayTask; - public BukkitTask bukkitTask; - - public CyclicalDisplayListener (ButtonRebirthPlugin initPlugin){ - plugin = initPlugin; - cyclicalDisplayTask = new CyclicalDisplayTask (this.plugin); - bukkitTask = cyclicalDisplayTask.runTaskTimer(this.plugin, 20, 20); - } -} - */ \ No newline at end of file + public gPowerListener(JavaPlugin plugin, GPowerMemory gPowerMemory){ + new gPowerApplyingTask(plugin.getServer(), gPowerMemory.poweredPlayerList).runTaskTimer(plugin, 190, 190); + } +} \ No newline at end of file diff --git a/src/alisolarflare/magic/tricks/BoomBowListener.java b/src/alisolarflare/magic/tricks/BoomBowListener.java index a7f6a3b..47a02d7 100644 --- a/src/alisolarflare/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowListener.java @@ -92,7 +92,7 @@ public class BoomBowListener implements Listener { player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); event.getPlayer().getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); player.damage(9.0, player); - player.getItemInHand().setDurability((short) (player.getItemInHand().getDurability() - 3)); + player.getItemInHand().setDurability((short) (player.getItemInHand().getDurability() + 3)); From f151c54c98c32ccaee37eaf4fda9ad603db750c2 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 4 Nov 2016 23:49:30 -0400 Subject: [PATCH 073/263] Fixed #9 --- .../magic/tricks/BoomBowListener.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/alisolarflare/magic/tricks/BoomBowListener.java b/src/alisolarflare/magic/tricks/BoomBowListener.java index 47a02d7..aba5ece 100644 --- a/src/alisolarflare/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowListener.java @@ -54,7 +54,7 @@ public class BoomBowListener implements Listener { if(tntStack.getAmount() > 3){ tntStack.setAmount(tntStack.getAmount()-3); }else{ - tntStack.setAmount(0);; + player.getInventory().remove(tntStack); } }else{ @@ -63,12 +63,12 @@ public class BoomBowListener implements Listener { } - - @SuppressWarnings("deprecation") + public void Activate(PlayerInteractEvent event){ //INIT - Player variables Player player = event.getPlayer(); Location playerLocation = player.getLocation(); + ItemStack boomBow = player.getInventory().getItemInMainHand(); //TODO: NERF - boomDecay //TODO: NERF - endCrystal @@ -85,19 +85,19 @@ public class BoomBowListener implements Listener { //SET - Player Velocity - player.setVelocity(event.getPlayer().getLocation().getDirection().normalize().multiply(2.5)); - player.sendMessage("" + event.getPlayer().getVelocity().length()); + player.setVelocity(playerLocation.getDirection().normalize().multiply(2.5)); //CREATE - Explosion + damage player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); - event.getPlayer().getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); + player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); player.damage(9.0, player); - player.getItemInHand().setDurability((short) (player.getItemInHand().getDurability() + 3)); + boomBow.setDurability((short) (boomBow.getDurability() + 3)); } + @EventHandler public void FlyBowBoostDeath(PlayerDeathEvent event){ event.getEntity().getServer().broadcastMessage("[boombow debug]: "+event.getEntity().getLastDamageCause().getCause().toString()); From 3801b4fc404fda7d5bccd5dd72c7ddf2499a795d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 4 Nov 2016 23:59:55 -0400 Subject: [PATCH 074/263] Fixed a thing? --- src/alisolarflare/magic/tricks/BoomBowListener.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/alisolarflare/magic/tricks/BoomBowListener.java b/src/alisolarflare/magic/tricks/BoomBowListener.java index aba5ece..6e97525 100644 --- a/src/alisolarflare/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowListener.java @@ -85,19 +85,18 @@ public class BoomBowListener implements Listener { //SET - Player Velocity - player.setVelocity(playerLocation.getDirection().normalize().multiply(2.5)); + player.setVelocity(playerLocation.getDirection().normalize().multiply(3.0)); //CREATE - Explosion + damage player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); - player.damage(9.0, player); + player.damage(7.0, player); boomBow.setDurability((short) (boomBow.getDurability() + 3)); } - @EventHandler public void FlyBowBoostDeath(PlayerDeathEvent event){ event.getEntity().getServer().broadcastMessage("[boombow debug]: "+event.getEntity().getLastDamageCause().getCause().toString()); From f60952ee3f87f985d9054dfb53f283b771214622 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 05:17:13 -0400 Subject: [PATCH 075/263] Added Death Listener --- src/alisolarflare/magic/MagicModule.java | 2 ++ .../magic/tricks/AliArrowDeathListener.java | 17 +++++++++++++++++ .../magic/tricks/BoomBowListener.java | 12 ++++-------- 3 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 src/alisolarflare/magic/tricks/AliArrowDeathListener.java diff --git a/src/alisolarflare/magic/MagicModule.java b/src/alisolarflare/magic/MagicModule.java index 2b37e22..fff9034 100644 --- a/src/alisolarflare/magic/MagicModule.java +++ b/src/alisolarflare/magic/MagicModule.java @@ -3,6 +3,7 @@ package alisolarflare.magic; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; +import alisolarflare.magic.tricks.AliArrowDeathListener; import alisolarflare.magic.tricks.AliArrowListener; import alisolarflare.magic.tricks.BoomBowListener; @@ -11,6 +12,7 @@ public class MagicModule extends Module{ @Override public void register(JavaPlugin plugin) { registerListener(plugin, new AliArrowListener(plugin)); + registerListener(plugin, new AliArrowDeathListener()); registerListener(plugin, new BoomBowListener()); } } diff --git a/src/alisolarflare/magic/tricks/AliArrowDeathListener.java b/src/alisolarflare/magic/tricks/AliArrowDeathListener.java new file mode 100644 index 0000000..388e1e1 --- /dev/null +++ b/src/alisolarflare/magic/tricks/AliArrowDeathListener.java @@ -0,0 +1,17 @@ +package alisolarflare.magic.tricks; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.PlayerDeathEvent; + +public class AliArrowDeathListener implements Listener{ + @EventHandler + public void onBoomBowDeath(PlayerDeathEvent event){ + Player player = event.getEntity(); + if (player.getKiller() != player) + return; + player.sendMessage(player.getLastDamageCause().toString()); + player.sendMessage(event.getEventName()); + } +} diff --git a/src/alisolarflare/magic/tricks/BoomBowListener.java b/src/alisolarflare/magic/tricks/BoomBowListener.java index 6e97525..dbbc977 100644 --- a/src/alisolarflare/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowListener.java @@ -10,7 +10,6 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; -import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; @@ -92,13 +91,10 @@ public class BoomBowListener implements Listener { player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); player.damage(7.0, player); boomBow.setDurability((short) (boomBow.getDurability() + 3)); - - - - - } - public void FlyBowBoostDeath(PlayerDeathEvent event){ - event.getEntity().getServer().broadcastMessage("[boombow debug]: "+event.getEntity().getLastDamageCause().getCause().toString()); + if(boomBow.getDurability() < 0){ + player.getInventory().setItemInMainHand(null); + player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0); + } } } From d18533f0f6dec11c448d58b588658347c283bbdb Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 05:30:24 -0400 Subject: [PATCH 076/263] Coded Death Listener --- src/alisolarflare/magic/MagicModule.java | 4 ++-- .../magic/tricks/AliArrowDeathListener.java | 17 ----------------- .../magic/tricks/BoomBowDeathListener.java | 18 ++++++++++++++++++ .../magic/tricks/BoomBowListener.java | 2 +- 4 files changed, 21 insertions(+), 20 deletions(-) delete mode 100644 src/alisolarflare/magic/tricks/AliArrowDeathListener.java create mode 100644 src/alisolarflare/magic/tricks/BoomBowDeathListener.java diff --git a/src/alisolarflare/magic/MagicModule.java b/src/alisolarflare/magic/MagicModule.java index fff9034..82e3802 100644 --- a/src/alisolarflare/magic/MagicModule.java +++ b/src/alisolarflare/magic/MagicModule.java @@ -3,8 +3,8 @@ package alisolarflare.magic; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; -import alisolarflare.magic.tricks.AliArrowDeathListener; import alisolarflare.magic.tricks.AliArrowListener; +import alisolarflare.magic.tricks.BoomBowDeathListener; import alisolarflare.magic.tricks.BoomBowListener; public class MagicModule extends Module{ @@ -12,7 +12,7 @@ public class MagicModule extends Module{ @Override public void register(JavaPlugin plugin) { registerListener(plugin, new AliArrowListener(plugin)); - registerListener(plugin, new AliArrowDeathListener()); + registerListener(plugin, new BoomBowDeathListener()); registerListener(plugin, new BoomBowListener()); } } diff --git a/src/alisolarflare/magic/tricks/AliArrowDeathListener.java b/src/alisolarflare/magic/tricks/AliArrowDeathListener.java deleted file mode 100644 index 388e1e1..0000000 --- a/src/alisolarflare/magic/tricks/AliArrowDeathListener.java +++ /dev/null @@ -1,17 +0,0 @@ -package alisolarflare.magic.tricks; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.PlayerDeathEvent; - -public class AliArrowDeathListener implements Listener{ - @EventHandler - public void onBoomBowDeath(PlayerDeathEvent event){ - Player player = event.getEntity(); - if (player.getKiller() != player) - return; - player.sendMessage(player.getLastDamageCause().toString()); - player.sendMessage(event.getEventName()); - } -} diff --git a/src/alisolarflare/magic/tricks/BoomBowDeathListener.java b/src/alisolarflare/magic/tricks/BoomBowDeathListener.java new file mode 100644 index 0000000..d62986d --- /dev/null +++ b/src/alisolarflare/magic/tricks/BoomBowDeathListener.java @@ -0,0 +1,18 @@ +package alisolarflare.magic.tricks; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.PlayerDeathEvent; + +public class BoomBowDeathListener implements Listener{ + @EventHandler + public void onBoomBowDeath(PlayerDeathEvent event){ + Player player = event.getEntity(); + if (player.getLastDamage() == 7.000042) + event.setDeathMessage(player.getCustomName() + player.getDisplayName() + player.getPlayerListName() + player.getName() + "got trigger happy with the Boom Bow"); + if (player.getLastDamage() < 7.000041 || player.getLastDamage() > 7.000043) + player.sendMessage("meaning of lyyyyyyfffe"); + + } +} diff --git a/src/alisolarflare/magic/tricks/BoomBowListener.java b/src/alisolarflare/magic/tricks/BoomBowListener.java index dbbc977..a5fb608 100644 --- a/src/alisolarflare/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowListener.java @@ -89,7 +89,7 @@ public class BoomBowListener implements Listener { //CREATE - Explosion + damage player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); - player.damage(7.0, player); + player.damage(7.000042, player); boomBow.setDurability((short) (boomBow.getDurability() + 3)); if(boomBow.getDurability() < 0){ player.getInventory().setItemInMainHand(null); From a925a7117f2c4655fa886dcb367d9b8c5faba23e Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 05:50:39 -0400 Subject: [PATCH 077/263] Started on Boom Bow Rule: Boom Decay --- src/alisolarflare/magic/MagicModule.java | 2 +- .../magic/tricks/BoomBowDeathListener.java | 4 ++- .../magic/tricks/BoomBowListener.java | 9 +++++-- .../magic/tricks/BoomBowRule.java | 6 ++++- .../magic/tricks/BoomDecayTask.java | 25 +++++++++++++++++++ 5 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 src/alisolarflare/magic/tricks/BoomDecayTask.java diff --git a/src/alisolarflare/magic/MagicModule.java b/src/alisolarflare/magic/MagicModule.java index 82e3802..616b179 100644 --- a/src/alisolarflare/magic/MagicModule.java +++ b/src/alisolarflare/magic/MagicModule.java @@ -13,6 +13,6 @@ public class MagicModule extends Module{ public void register(JavaPlugin plugin) { registerListener(plugin, new AliArrowListener(plugin)); registerListener(plugin, new BoomBowDeathListener()); - registerListener(plugin, new BoomBowListener()); + registerListener(plugin, new BoomBowListener(plugin)); } } diff --git a/src/alisolarflare/magic/tricks/BoomBowDeathListener.java b/src/alisolarflare/magic/tricks/BoomBowDeathListener.java index d62986d..b742f16 100644 --- a/src/alisolarflare/magic/tricks/BoomBowDeathListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowDeathListener.java @@ -10,9 +10,11 @@ public class BoomBowDeathListener implements Listener{ public void onBoomBowDeath(PlayerDeathEvent event){ Player player = event.getEntity(); if (player.getLastDamage() == 7.000042) - event.setDeathMessage(player.getCustomName() + player.getDisplayName() + player.getPlayerListName() + player.getName() + "got trigger happy with the Boom Bow"); + player.sendMessage("42!"); + event.setDeathMessage(player.getName() + "got trigger happy with the Boom Bow"); if (player.getLastDamage() < 7.000041 || player.getLastDamage() > 7.000043) player.sendMessage("meaning of lyyyyyyfffe"); + player.sendMessage(player.getCustomName() + player.getDisplayName() + player.getPlayerListName() + player.getName()); } } diff --git a/src/alisolarflare/magic/tricks/BoomBowListener.java b/src/alisolarflare/magic/tricks/BoomBowListener.java index a5fb608..caad9d1 100644 --- a/src/alisolarflare/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowListener.java @@ -12,11 +12,15 @@ import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; public class BoomBowListener implements Listener { - + JavaPlugin plugin; + public BoomBowListener(JavaPlugin plugin){ + this.plugin = plugin; + } @EventHandler public void ClickEvent(PlayerInteractEvent event){ FlyBowBoost(event); @@ -74,7 +78,8 @@ public class BoomBowListener implements Listener { //TODO: NERF - healthReduction //TODO: NERF - localized - if(BoomBowRule.boomDecay); + if(BoomBowRule.boomDecay) + new BoomDecayTask(player).runTaskTimer(plugin, 1, 1); if(BoomBowRule.endCrystal){ } if(BoomBowRule.healthReduction){ diff --git a/src/alisolarflare/magic/tricks/BoomBowRule.java b/src/alisolarflare/magic/tricks/BoomBowRule.java index b1131c6..bbfbf8f 100644 --- a/src/alisolarflare/magic/tricks/BoomBowRule.java +++ b/src/alisolarflare/magic/tricks/BoomBowRule.java @@ -23,7 +23,11 @@ public class BoomBowRule extends TBMCCommandBase{ } if (args.length < 2){ player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); - player.sendMessage("Rule settings: boomDecay, healthReduction, endCrystal, localized"); + player.sendMessage("Rules:"); + player.sendMessage("boomDecay" + boomDecay); + player.sendMessage("healthReduction" + healthReduction); + player.sendMessage("endCrystal" + endCrystal); + player.sendMessage("localized" + localized); return false; } if(!(args[1].startsWith("t")|| args[1].startsWith("f"))){ diff --git a/src/alisolarflare/magic/tricks/BoomDecayTask.java b/src/alisolarflare/magic/tricks/BoomDecayTask.java new file mode 100644 index 0000000..5f1875c --- /dev/null +++ b/src/alisolarflare/magic/tricks/BoomDecayTask.java @@ -0,0 +1,25 @@ +package alisolarflare.magic.tricks; + +import org.bukkit.entity.Player; +import org.bukkit.scheduler.BukkitRunnable; + +public class BoomDecayTask extends BukkitRunnable{ + Player player; + private int ticksSinceStart = 0; + private final int effectLength = 20; + public BoomDecayTask(Player player){ + this.player = player; + } + //runs every tick + @Override + public void run() { + if (ticksSinceStart > effectLength){ + this.cancel(); + } + player.sendMessage(player.getVelocity().toString()); + + ticksSinceStart++; + + } + +} From 788943f50b1ddab5315c50c4588ca8bd0ae67705 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 06:26:03 -0400 Subject: [PATCH 078/263] CreativeBoundaries: Started work on protecting natural creatives --- .../PlotChangeListener.java | 63 ++++++++++++------- .../creativeboundaries/commands/Cbgm1.java | 10 +-- 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/src/alisolarflare/creativeboundaries/PlotChangeListener.java b/src/alisolarflare/creativeboundaries/PlotChangeListener.java index e815539..0a5820e 100644 --- a/src/alisolarflare/creativeboundaries/PlotChangeListener.java +++ b/src/alisolarflare/creativeboundaries/PlotChangeListener.java @@ -1,6 +1,10 @@ package alisolarflare.creativeboundaries; +import java.util.ArrayList; +import java.util.List; + import org.bukkit.GameMode; +import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -11,37 +15,48 @@ import com.palmergames.bukkit.towny.object.Town; import com.palmergames.bukkit.towny.object.TownBlock; public class PlotChangeListener implements Listener{ - public boolean isInTown; + private boolean dickmode; public CreativeBoundariesModule plugin; + public List cbCreatives = new ArrayList(); public PlotChangeListener(CreativeBoundariesModule plugin){ this.plugin = plugin; + this.dickmode = plugin.dickmode; } @EventHandler public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ - if (plugin.dickmode == false){ + if (dickmode == false) + return; + if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE) + return; + if (!(cbCreatives.contains(plotEvent.getPlayer()))) + return; + + Player player = plotEvent.getPlayer(); + Resident currentResident = new Resident(player.getName()); + Town town; + try { + debug(player, "1"+plotEvent.toString()); + debug(player, "2"+plotEvent.getTo().toString()); + debug(player, "3"+plotEvent.getTo().getTownBlock().toString()); + debug(player, "4"+Boolean.toString(plotEvent.getTo().getTownBlock().hasTown())); + debug(player, "5"+plotEvent.getTo().getTownBlock().getTown().toString()); + if (plotEvent.getTo().getTownBlock().hasTown()) + town = plotEvent.getTo().getTownBlock().getTown(); + else{ + player.setGameMode(GameMode.SURVIVAL); + return; + } + } catch (NotRegisteredException e) { + e.printStackTrace(); + debug(player, "6"+e.toString()); return; } - try{ - Resident currentResident = new Resident(plotEvent.getPlayer().getName().toLowerCase()); - TownBlock plot = plotEvent.getTo().getTownBlock(); - - if(plot.hasTown()){ - Town plotTown = plot.getTown(); - - if(!(plotTown.hasResident(currentResident))){ - plotEvent.getPlayer().setGameMode(GameMode.SURVIVAL); - - } - - } else { - plotEvent.getPlayer().setGameMode(GameMode.SURVIVAL); - } - - }catch(NotRegisteredException e){ - //thrown by plotEvent.getTo().getTownBlock() - //thrown by plotEvent.getTo().getTownBlock().getTown(); - plotEvent.getPlayer().setGameMode(GameMode.SURVIVAL); - - } + debug(player, "7"+currentResident.toString()); + if(!(town.hasResident(currentResident))) + player.setGameMode(GameMode.SURVIVAL); + } + private void debug(Player player, String string){ + if (player.getName() == "alisolarflare") + player.sendMessage(string); } } diff --git a/src/alisolarflare/creativeboundaries/commands/Cbgm1.java b/src/alisolarflare/creativeboundaries/commands/Cbgm1.java index 09753cc..14c69ce 100644 --- a/src/alisolarflare/creativeboundaries/commands/Cbgm1.java +++ b/src/alisolarflare/creativeboundaries/commands/Cbgm1.java @@ -26,20 +26,20 @@ public class Cbgm1 extends TBMCCommandBase { TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); if (tb == null) { - player.sendMessage("�cYou aren't standing in a town or some other error occured."); - player.sendMessage("�cTownBlock is null."); + player.sendMessage("You aren't standing in a town or some other error occured."); + player.sendMessage("TownBlock is null."); return false; } Town town; try { town = tb.getTown(); } catch (NotRegisteredException e) { - player.sendMessage("�cYou aren't standing in a town or some other error occured."); - player.sendMessage("�cTownBlock's town is not registered."); + player.sendMessage("You aren't standing in a town or some other error occured."); + player.sendMessage("TownBlock's town is not registered."); return false; } if (town == null) { - player.sendMessage("�cERROR: The town you're standing in is Null."); + player.sendMessage("ERROR: The town you're standing in is Null."); return false; } From 2756c00f37c3e1b1ae1d4c0267e5d19cb8ea9c09 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 06:40:03 -0400 Subject: [PATCH 079/263] Minor Adjustments I actually forgot what I did --- src/alisolarflare/creativeboundaries/PlotChangeListener.java | 1 - src/alisolarflare/magic/tricks/BoomBowListener.java | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alisolarflare/creativeboundaries/PlotChangeListener.java b/src/alisolarflare/creativeboundaries/PlotChangeListener.java index 0a5820e..41c5e5b 100644 --- a/src/alisolarflare/creativeboundaries/PlotChangeListener.java +++ b/src/alisolarflare/creativeboundaries/PlotChangeListener.java @@ -12,7 +12,6 @@ import com.palmergames.bukkit.towny.event.PlayerChangePlotEvent; import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; import com.palmergames.bukkit.towny.object.Resident; import com.palmergames.bukkit.towny.object.Town; -import com.palmergames.bukkit.towny.object.TownBlock; public class PlotChangeListener implements Listener{ private boolean dickmode; diff --git a/src/alisolarflare/magic/tricks/BoomBowListener.java b/src/alisolarflare/magic/tricks/BoomBowListener.java index caad9d1..130cf88 100644 --- a/src/alisolarflare/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowListener.java @@ -81,6 +81,7 @@ public class BoomBowListener implements Listener { if(BoomBowRule.boomDecay) new BoomDecayTask(player).runTaskTimer(plugin, 1, 1); if(BoomBowRule.endCrystal){ + //BoomBowCyrstalSpawn } if(BoomBowRule.healthReduction){ player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1)); From dd2dca05441117a0f0d2d14e52d979287a354e80 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 06:57:10 -0400 Subject: [PATCH 080/263] Started work on UHC Staging --- src/alisolarflare/minigames/GameState.java | 5 +++ .../minigames/MinigameModule.java | 6 ++-- .../minigames/commands/JoinMinigame.java | 12 +++---- .../minigames/commands/LeaveMinigame.java | 16 ++++----- .../minigames/commands/ListFighters.java | 4 +-- .../uhc/commands/ConfigureMatch.java | 33 +++++++++++++++++++ .../uhc/commands/ScheduleMatch.java | 33 +++++++++++++++++++ .../uhc/commands/StartMatch.java | 4 ++- src/alisolarflare/uhc/memory/MatchState.java | 9 ++++- src/alisolarflare/uhc/memory/UHCMatch.java | 1 + 10 files changed, 101 insertions(+), 22 deletions(-) create mode 100644 src/alisolarflare/minigames/GameState.java create mode 100644 src/alisolarflare/uhc/commands/ConfigureMatch.java create mode 100644 src/alisolarflare/uhc/commands/ScheduleMatch.java diff --git a/src/alisolarflare/minigames/GameState.java b/src/alisolarflare/minigames/GameState.java new file mode 100644 index 0000000..5c63bf3 --- /dev/null +++ b/src/alisolarflare/minigames/GameState.java @@ -0,0 +1,5 @@ +package alisolarflare.minigames; + +public enum GameState { + Idle, FreeForAll, Heroes; +} diff --git a/src/alisolarflare/minigames/MinigameModule.java b/src/alisolarflare/minigames/MinigameModule.java index 72827b3..fe8712c 100644 --- a/src/alisolarflare/minigames/MinigameModule.java +++ b/src/alisolarflare/minigames/MinigameModule.java @@ -13,8 +13,8 @@ import alisolarflare.minigames.data.SpawnSet; public class MinigameModule extends Module{ public SpawnSet spawnSet; - private int GameState; public List fighters; + private GameState gameState; @Override public void register(JavaPlugin plugin) { @@ -26,8 +26,8 @@ public class MinigameModule extends Module{ } - public int getGameState() {return GameState;} - public void setGameState(int gameState) {GameState = gameState;} + public GameState getGameState() {return gameState;} + public void setGameState(GameState gameState) {this.gameState = gameState;} } diff --git a/src/alisolarflare/minigames/commands/JoinMinigame.java b/src/alisolarflare/minigames/commands/JoinMinigame.java index f0afa6f..fc194cd 100644 --- a/src/alisolarflare/minigames/commands/JoinMinigame.java +++ b/src/alisolarflare/minigames/commands/JoinMinigame.java @@ -7,10 +7,10 @@ import alisolarflare.minigames.MinigameModule; import buttondevteam.lib.chat.TBMCCommandBase; public class JoinMinigame extends TBMCCommandBase { - private MinigameModule minigame; + private MinigameModule module; - public JoinMinigame(MinigameModule minigame) { - this.minigame = minigame; + public JoinMinigame(MinigameModule module) { + this.module = module; } @Override @@ -21,14 +21,14 @@ public class JoinMinigame extends TBMCCommandBase { } String name = sender.getName(); - if (minigame.fighters.contains(name)) { + if (module.fighters.contains(name)) { sender.sendMessage("You are already in the minigame!"); return false; } - minigame.fighters.add(name); + module.fighters.add(name); - if (minigame.fighters.contains(name)) { + if (module.fighters.contains(name)) { sender.sendMessage("You have joined the minigame!"); } return false; diff --git a/src/alisolarflare/minigames/commands/LeaveMinigame.java b/src/alisolarflare/minigames/commands/LeaveMinigame.java index 844ed07..f234a32 100644 --- a/src/alisolarflare/minigames/commands/LeaveMinigame.java +++ b/src/alisolarflare/minigames/commands/LeaveMinigame.java @@ -8,26 +8,26 @@ import buttondevteam.lib.chat.TBMCCommandBase; public class LeaveMinigame extends TBMCCommandBase { - private MinigameModule lobby; + private MinigameModule module; - public LeaveMinigame(MinigameModule lobby) { - this.lobby = lobby; + public LeaveMinigame(MinigameModule module) { + this.module = module; } @Override public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - if(!(sender instanceof Player)){ + if(!(sender instanceof Player)) sender.sendMessage("You must be a player to use this command!"); - } + String name = sender.getName(); - if (!(lobby.fighters.contains(name))) { + if (!(module.fighters.contains(name))) { sender.sendMessage("You are not fighting!"); return false; } - while(lobby.fighters.contains(name)){ - lobby.fighters.remove(name); + while(module.fighters.contains(name)){ + module.fighters.remove(name); } sender.sendMessage("You have left the fighters category!"); diff --git a/src/alisolarflare/minigames/commands/ListFighters.java b/src/alisolarflare/minigames/commands/ListFighters.java index 209d9f8..6dda457 100644 --- a/src/alisolarflare/minigames/commands/ListFighters.java +++ b/src/alisolarflare/minigames/commands/ListFighters.java @@ -1,7 +1,5 @@ package alisolarflare.minigames.commands; -import java.util.stream.Collectors; - import org.bukkit.command.CommandSender; import alisolarflare.minigames.MinigameModule; @@ -16,7 +14,7 @@ public class ListFighters extends TBMCCommandBase { @Override public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - sender.sendMessage(lobby.fighters.stream().map(Object::toString).collect(Collectors.joining(", "))); + sender.sendMessage(lobby.fighters.toString()); return false; } diff --git a/src/alisolarflare/uhc/commands/ConfigureMatch.java b/src/alisolarflare/uhc/commands/ConfigureMatch.java new file mode 100644 index 0000000..d85e01a --- /dev/null +++ b/src/alisolarflare/uhc/commands/ConfigureMatch.java @@ -0,0 +1,33 @@ +package alisolarflare.uhc.commands; + +import org.bukkit.command.CommandSender; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class ConfigureMatch extends TBMCCommandBase{ + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/uhc/commands/ScheduleMatch.java b/src/alisolarflare/uhc/commands/ScheduleMatch.java new file mode 100644 index 0000000..0bf2662 --- /dev/null +++ b/src/alisolarflare/uhc/commands/ScheduleMatch.java @@ -0,0 +1,33 @@ +package alisolarflare.uhc.commands; + +import org.bukkit.command.CommandSender; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class ScheduleMatch extends TBMCCommandBase{ + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/uhc/commands/StartMatch.java b/src/alisolarflare/uhc/commands/StartMatch.java index 901fccf..753edda 100644 --- a/src/alisolarflare/uhc/commands/StartMatch.java +++ b/src/alisolarflare/uhc/commands/StartMatch.java @@ -2,6 +2,7 @@ package alisolarflare.uhc.commands; import org.bukkit.command.CommandSender; +import alisolarflare.uhc.memory.MatchState; import alisolarflare.uhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCCommandBase; @@ -23,6 +24,7 @@ public class StartMatch extends TBMCCommandBase { switch(match.getMatchState()){ case IDLE: sender.sendMessage("There is currently a match ready... Activating..."); + match.setMatchState(MatchState.INTRO); break; case WAITING: @@ -30,7 +32,7 @@ public class StartMatch extends TBMCCommandBase { break; case END: - sender.sendMessage("The match has ended! Would you like to restart?"); + sender.sendMessage("The match has ended! Would you like to restart using current settings?"); break; default: diff --git a/src/alisolarflare/uhc/memory/MatchState.java b/src/alisolarflare/uhc/memory/MatchState.java index 83aadaf..bf6d77d 100644 --- a/src/alisolarflare/uhc/memory/MatchState.java +++ b/src/alisolarflare/uhc/memory/MatchState.java @@ -1,5 +1,12 @@ package alisolarflare.uhc.memory; public enum MatchState { - IDLE, WAITING, SETUP, INTRO, PEACE, TENSION, POWER, END + IDLE, //Idle: Configure Match, Wait: Schedule Match, Intro: Start Match + WAITING, //SETUP: Scheduled Time, INTRO: No Setup + SETUP, //INTRO: Done + INTRO, //Peace: Done, and players ready + PEACE, //Tension: Timer, End: All dead + TENSION, //Power: Timer, End: All dead + POWER, //End: All dead + END//IDLE: Ceremony over } diff --git a/src/alisolarflare/uhc/memory/UHCMatch.java b/src/alisolarflare/uhc/memory/UHCMatch.java index 8338edd..42b0484 100644 --- a/src/alisolarflare/uhc/memory/UHCMatch.java +++ b/src/alisolarflare/uhc/memory/UHCMatch.java @@ -24,4 +24,5 @@ public class UHCMatch { matchState = newMS; fileConfiguration.set("UHCMatchState", newMS.toString()); } + } From c802d8db9b8c1c9cc49d60b71a33597ce5af4442 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 07:06:20 -0400 Subject: [PATCH 081/263] Added commands to plugin.yml --- plugin.yml | 26 ++++++++++++++++--- src/alisolarflare/uhc/UHCModule.java | 4 +++ .../uhc/commands/ConfigureMatch.java | 5 ++++ .../uhc/commands/ScheduleMatch.java | 5 ++++ 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/plugin.yml b/plugin.yml index 20ff168..a8632ae 100644 --- a/plugin.yml +++ b/plugin.yml @@ -3,10 +3,6 @@ name: AliPresents version: 2.0.1 commands: - pressalilink: - description: Presses an Ali Link pressalilink frequency - setalilink: - description: Creates an Ali Link setalilink frequency flairme: description: Activates the Flair Me Command. Ask Ali, she was fucking tired when writing this description gpower: @@ -15,7 +11,29 @@ commands: description: Official g-power command that activates the ghostie powerups powerdown: description: Offical g-power command that deactivates the ghostie powerups + pressalilink: + description: Presses an Ali Link pressalilink frequency + setalilink: + description: Creates an Ali Link setalilink frequency + cbgm0: + description: Creative Boundaries Gamemode 0, allows players to return to survival + cbgm1: + description: Creative Boundaries Gamemode 1, allows players to access creative within their towns. Creative is removed outside of towns, so be careful + setdickmode: + description: Should players automatically return to creative when outside town borders? Dickmode says yes. + joinminigame: + description: Join a Button Minigame + leaveminigame: + description: Leave a button minigame + listfighters: + description: List all fighters currently in a button minigame + setcolourspawn: + description: sets the spawn points for each colour in a button minigame addtouhc: description: Adds a player to the UltraHardcore match + configurematch: + description: Configures an UltraHardcore match + schedulematch: + description: Schedules an UltraHardcore match startmatch: description: Starts an UltraHardcore match \ No newline at end of file diff --git a/src/alisolarflare/uhc/UHCModule.java b/src/alisolarflare/uhc/UHCModule.java index db50588..3ddfd0a 100644 --- a/src/alisolarflare/uhc/UHCModule.java +++ b/src/alisolarflare/uhc/UHCModule.java @@ -4,6 +4,8 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; import alisolarflare.uhc.commands.AddToUHC; +import alisolarflare.uhc.commands.ConfigureMatch; +import alisolarflare.uhc.commands.ScheduleMatch; import alisolarflare.uhc.commands.StartMatch; import alisolarflare.uhc.memory.MatchState; import alisolarflare.uhc.memory.UHCMatch; @@ -22,5 +24,7 @@ public class UHCModule extends Module { registerCommand(plugin, new AddToUHC(match)); registerCommand(plugin, new StartMatch(match)); + registerCommand(plugin, new ConfigureMatch(match)); + registerCommand(plugin, new ScheduleMatch(match)); } } diff --git a/src/alisolarflare/uhc/commands/ConfigureMatch.java b/src/alisolarflare/uhc/commands/ConfigureMatch.java index d85e01a..c696b87 100644 --- a/src/alisolarflare/uhc/commands/ConfigureMatch.java +++ b/src/alisolarflare/uhc/commands/ConfigureMatch.java @@ -2,10 +2,15 @@ package alisolarflare.uhc.commands; import org.bukkit.command.CommandSender; +import alisolarflare.uhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCCommandBase; public class ConfigureMatch extends TBMCCommandBase{ + public ConfigureMatch(UHCMatch match) { + // TODO Auto-generated constructor stub + } + @Override public String[] GetHelpText(String alias) { // TODO Auto-generated method stub diff --git a/src/alisolarflare/uhc/commands/ScheduleMatch.java b/src/alisolarflare/uhc/commands/ScheduleMatch.java index 0bf2662..455c2fb 100644 --- a/src/alisolarflare/uhc/commands/ScheduleMatch.java +++ b/src/alisolarflare/uhc/commands/ScheduleMatch.java @@ -2,10 +2,15 @@ package alisolarflare.uhc.commands; import org.bukkit.command.CommandSender; +import alisolarflare.uhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCCommandBase; public class ScheduleMatch extends TBMCCommandBase{ + public ScheduleMatch(UHCMatch match) { + // TODO Auto-generated constructor stub + } + @Override public String[] GetHelpText(String alias) { // TODO Auto-generated method stub From 48a30f8c7f6b606d4ef0f9c89eb385304d6c4353 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 07:18:53 -0400 Subject: [PATCH 082/263] Swallowed The Button Rebirth ahhhh, the good old first project of mine. I can smell the bad code from here --- plugin.yml | 2 +- .../shulker}/SetFlairDoorColour.java | 2 +- .../thebuttonrebirth/ButtonRebirthPlugin.java | 70 +++++ .../thebuttonrebirth/admin/CreateShrine.java | 128 +++++++++ .../thebuttonrebirth/commands/ShowBars.java | 30 +++ .../listeners/CyclicalDisplayListener.java | 19 ++ .../listeners/MidnightListener.java | 19 ++ .../listeners/StealChestListener.java | 18 ++ .../tasks/CheckChestTask.java | 169 ++++++++++++ .../tasks/CyclicalDisplayTask.java | 245 ++++++++++++++++++ .../tasks/StealChestTask.java | 200 ++++++++++++++ 11 files changed, 900 insertions(+), 2 deletions(-) rename src/{alisolarflare/components/flairdoor/commands => graveyard/shulker}/SetFlairDoorColour.java (94%) create mode 100644 src/graveyard/shulker/thebuttonrebirth/ButtonRebirthPlugin.java create mode 100644 src/graveyard/shulker/thebuttonrebirth/admin/CreateShrine.java create mode 100644 src/graveyard/shulker/thebuttonrebirth/commands/ShowBars.java create mode 100644 src/graveyard/shulker/thebuttonrebirth/listeners/CyclicalDisplayListener.java create mode 100644 src/graveyard/shulker/thebuttonrebirth/listeners/MidnightListener.java create mode 100644 src/graveyard/shulker/thebuttonrebirth/listeners/StealChestListener.java create mode 100644 src/graveyard/shulker/thebuttonrebirth/tasks/CheckChestTask.java create mode 100644 src/graveyard/shulker/thebuttonrebirth/tasks/CyclicalDisplayTask.java create mode 100644 src/graveyard/shulker/thebuttonrebirth/tasks/StealChestTask.java diff --git a/plugin.yml b/plugin.yml index a8632ae..067b94c 100644 --- a/plugin.yml +++ b/plugin.yml @@ -4,7 +4,7 @@ version: 2.0.1 commands: flairme: - description: Activates the Flair Me Command. Ask Ali, she was fucking tired when writing this description + description: Activates the Flair Me Command. Ask Ali, she was tired when writing this description gpower: description: Testing command for ghostie powers powerup: diff --git a/src/alisolarflare/components/flairdoor/commands/SetFlairDoorColour.java b/src/graveyard/shulker/SetFlairDoorColour.java similarity index 94% rename from src/alisolarflare/components/flairdoor/commands/SetFlairDoorColour.java rename to src/graveyard/shulker/SetFlairDoorColour.java index 9447abb..83eceff 100644 --- a/src/alisolarflare/components/flairdoor/commands/SetFlairDoorColour.java +++ b/src/graveyard/shulker/SetFlairDoorColour.java @@ -1,4 +1,4 @@ -package alisolarflare.components.flairdoor.commands; +package graveyard.shulker; import java.util.Arrays; import java.util.List; diff --git a/src/graveyard/shulker/thebuttonrebirth/ButtonRebirthPlugin.java b/src/graveyard/shulker/thebuttonrebirth/ButtonRebirthPlugin.java new file mode 100644 index 0000000..210bca4 --- /dev/null +++ b/src/graveyard/shulker/thebuttonrebirth/ButtonRebirthPlugin.java @@ -0,0 +1,70 @@ +package graveyard.shulker.thebuttonrebirth; + +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Logger; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.plugin.PluginDescriptionFile; +import org.bukkit.plugin.java.JavaPlugin; + +import graveyard.shulker.thebuttonrebirth.admin.CreateShrine; +import graveyard.shulker.thebuttonrebirth.listeners.CyclicalDisplayListener; +import graveyard.shulker.thebuttonrebirth.listeners.MidnightListener; +import graveyard.shulker.thebuttonrebirth.listeners.StealChestListener; + +public class ButtonRebirthPlugin extends JavaPlugin{ + public PluginDescriptionFile pdfFile; + public Logger logger; + + public List compactRequest = new ArrayList(); + public List barsHidden = new ArrayList(); + public CyclicalDisplayListener cyclicalDisplayListener; + + public void onEnable(){ + //Logs "Plugin Enabled: + pdfFile = getDescription(); + logger = getLogger(); + + + logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); + + registerCommands(); + registerEvents(); + + logger.info(pdfFile.getName() + " has been Enabled (V." + pdfFile.getVersion()+ ")."); + + + } + + public void onDisable(){ + logger.info(pdfFile.getName() + " has been Disabled (V." + pdfFile.getVersion()+ ")."); + } + private void registerCommands(){ + //Button + getCommand("createShrine").setExecutor(new CreateShrine(this)); + + } + + private void registerEvents(){ + //INIT - Listeners + MidnightListener midnightListener = new MidnightListener(this); + cyclicalDisplayListener = new CyclicalDisplayListener(this); + StealChestListener stealChestListener = new StealChestListener(this); + + //REGISTER - Listeners + getServer().getPluginManager().registerEvents(midnightListener, this); + getServer().getPluginManager().registerEvents(cyclicalDisplayListener,this); + getServer().getPluginManager().registerEvents(stealChestListener, this); + + } + public void createShrine(){ + int chestX = this.getConfig().getInt("chestX"); + int chestY = this.getConfig().getInt("chestY"); + int chestZ = this.getConfig().getInt("chestZ"); + + CreateShrine shrineCreator = new CreateShrine(this); + shrineCreator.createShrine(chestX, chestY, chestZ, 10, Material.BEDROCK); + } +} diff --git a/src/graveyard/shulker/thebuttonrebirth/admin/CreateShrine.java b/src/graveyard/shulker/thebuttonrebirth/admin/CreateShrine.java new file mode 100644 index 0000000..6e8ded2 --- /dev/null +++ b/src/graveyard/shulker/thebuttonrebirth/admin/CreateShrine.java @@ -0,0 +1,128 @@ +package graveyard.shulker.thebuttonrebirth.admin; + +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; +import net.md_5.bungee.api.ChatColor; + +public class CreateShrine implements CommandExecutor{ + + private ButtonRebirthPlugin plugin; + private World world; + + private int chestX; + private int chestY; + private int chestZ; + private int shrineRadius; + + public CreateShrine(ButtonRebirthPlugin initPlugin){ + plugin = initPlugin; + world = plugin.getServer().getWorld(plugin.getConfig().getString("world")); + chestX = plugin.getConfig().getInt("chestX"); + chestY = plugin.getConfig().getInt("chestY"); + chestZ = plugin.getConfig().getInt("chestZ"); + shrineRadius = plugin.getConfig().getInt("shrineRadius"); + } + + private void createCube(int x, int y, int z, int radius, Material material){ + //Creates a Cube under the Pyramid under the Chest + + //---Parameters--- + //Accepts x,y,z coordinates of the top center face, radius from center to edge, and BlockType + //Blocks placed by Radius does not include center block + //radius = 0 creates a single block + //radius = 1 creates a 9x9 cube + //Places down the cube + + //---Variables--- + //layer variable: layer being worked on, from the top + //layer[0] = top layer of cube + //layer[height] = bottom layer of cube + //row variable: relative value from center + //column variable:relative value from center + for (int layer = 0; layer <= radius; layer++){ + for (int row = -radius; row <= radius; row++){ + for (int column = -radius; column <= radius; column++){ + world.getBlockAt(x+row,y-layer,z+column).setType(material); + } + } + } + } + private void createPyramid(int x, int y, int z, int height, Material material){ + //creates a pyramid under the chest + + //sets the Top Block + //Places down the rest of the layers + //layer variable: layer being worked on, from the top + //layer[0] = top block of pyramid + //row variable: relative value from center + //column variable:relative value from center + + //SET - top block, rest of the blocks + world.getBlockAt(x,y,z).setType(material); + for (int layer = 1; layer < height; layer++){ + int radius = layer; + for (int row = -radius; row <= radius; row++){ + for (int column = -radius; column <= radius; column++){ + world.getBlockAt(x+row,y-layer,z+column).setType(material); + } + } + } + } + + public void createShrine(int x, int y, int z, int radius, Material material){ + //Creates Chest + world.getBlockAt(x, y, z).setType(Material.CHEST); + createPyramid(x, y-1, z, radius, material); + createCube(x, y-radius-1, z, radius, material); + + + } + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (sender instanceof Player){ + sender.sendMessage("You can't be a player to use this command"); + return false; + } + + try{ + world = plugin.getServer().getWorld(plugin.getConfig().getString("world")); + }catch(Exception e){ + //Sends Error message to the Player + sender.sendMessage("Error in CreateShrine Class: No world defined in config..."); + sender.sendMessage("Defining world based on player location."); + + /* + //Changes world variable in config file + if (sender instanceof Player){ + Player player = (Player) sender; + plugin.getConfig().set("world", player.getWorld().getName()); + plugin.saveConfig(); + world = player.getWorld(); + + //Sends player the result of the change + sender.sendMessage("World variable set to " + player.getWorld().getName() + "in config file"); + } + */ + } + /* + if (!(player.hasPermission("Moderator") || player.hasPermission("Admin"))){ + player.sendMessage(ChatColor.RED + "You must be in the group Moderator or Admin to access this command!"); + return false; + } + */ + chestX = plugin.getConfig().getInt("chestX"); + chestY = plugin.getConfig().getInt("chestY"); + chestZ = plugin.getConfig().getInt("chestZ"); + shrineRadius = plugin.getConfig().getInt("shrineRadius"); + + createShrine(chestX,chestY,chestZ,shrineRadius, Material.BEDROCK); + sender.sendMessage(ChatColor.AQUA + "Everything worked!"); + + return false; + } +} diff --git a/src/graveyard/shulker/thebuttonrebirth/commands/ShowBars.java b/src/graveyard/shulker/thebuttonrebirth/commands/ShowBars.java new file mode 100644 index 0000000..b375603 --- /dev/null +++ b/src/graveyard/shulker/thebuttonrebirth/commands/ShowBars.java @@ -0,0 +1,30 @@ +package graveyard.shulker.thebuttonrebirth.commands; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; + + +public class ShowBars implements CommandExecutor{ + private ButtonRebirthPlugin plugin; + + public ShowBars(ButtonRebirthPlugin initPlugin){ + plugin = initPlugin; + } + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + + if (!(sender instanceof Player)) { + sender.sendMessage("You must be a player to use this command"); + return false; + } + + Player player = (Player) sender; + plugin.barsHidden.remove(player); + return false; + } + +} diff --git a/src/graveyard/shulker/thebuttonrebirth/listeners/CyclicalDisplayListener.java b/src/graveyard/shulker/thebuttonrebirth/listeners/CyclicalDisplayListener.java new file mode 100644 index 0000000..8b2c9ee --- /dev/null +++ b/src/graveyard/shulker/thebuttonrebirth/listeners/CyclicalDisplayListener.java @@ -0,0 +1,19 @@ +package graveyard.shulker.thebuttonrebirth.listeners; + +import org.bukkit.event.Listener; +import org.bukkit.scheduler.BukkitTask; + +import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; +import graveyard.shulker.thebuttonrebirth.tasks.CyclicalDisplayTask; + +public class CyclicalDisplayListener implements Listener{ + private final ButtonRebirthPlugin plugin; + public CyclicalDisplayTask cyclicalDisplayTask; + public BukkitTask bukkitTask; + + public CyclicalDisplayListener (ButtonRebirthPlugin initPlugin){ + plugin = initPlugin; + cyclicalDisplayTask = new CyclicalDisplayTask (this.plugin); + bukkitTask = cyclicalDisplayTask.runTaskTimer(this.plugin, 20, 20); + } +} diff --git a/src/graveyard/shulker/thebuttonrebirth/listeners/MidnightListener.java b/src/graveyard/shulker/thebuttonrebirth/listeners/MidnightListener.java new file mode 100644 index 0000000..48afb1d --- /dev/null +++ b/src/graveyard/shulker/thebuttonrebirth/listeners/MidnightListener.java @@ -0,0 +1,19 @@ +package graveyard.shulker.thebuttonrebirth.listeners; + +import org.bukkit.event.Listener; +import org.bukkit.scheduler.BukkitTask; + +import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; +import graveyard.shulker.thebuttonrebirth.tasks.CheckChestTask; + + +public class MidnightListener implements Listener{ + private final ButtonRebirthPlugin plugin; + public BukkitTask checkChestTask; + + public MidnightListener(ButtonRebirthPlugin initPlugin){ + plugin = initPlugin; + + checkChestTask = new CheckChestTask(this.plugin).runTaskTimer(this.plugin, 20, 60); + } +} diff --git a/src/graveyard/shulker/thebuttonrebirth/listeners/StealChestListener.java b/src/graveyard/shulker/thebuttonrebirth/listeners/StealChestListener.java new file mode 100644 index 0000000..062a592 --- /dev/null +++ b/src/graveyard/shulker/thebuttonrebirth/listeners/StealChestListener.java @@ -0,0 +1,18 @@ +package graveyard.shulker.thebuttonrebirth.listeners; + +import org.bukkit.event.Listener; +import org.bukkit.scheduler.BukkitTask; + +import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; +import graveyard.shulker.thebuttonrebirth.tasks.StealChestTask; + + +public class StealChestListener implements Listener{ + private final ButtonRebirthPlugin plugin; + public BukkitTask stealChestTask; + + public StealChestListener(ButtonRebirthPlugin initPlugin){ + plugin = initPlugin; + stealChestTask = new StealChestTask(this.plugin).runTaskTimer(this.plugin, 20, 20); + } +} diff --git a/src/graveyard/shulker/thebuttonrebirth/tasks/CheckChestTask.java b/src/graveyard/shulker/thebuttonrebirth/tasks/CheckChestTask.java new file mode 100644 index 0000000..0fd2e7a --- /dev/null +++ b/src/graveyard/shulker/thebuttonrebirth/tasks/CheckChestTask.java @@ -0,0 +1,169 @@ +package graveyard.shulker.thebuttonrebirth.tasks; + +import java.time.Clock; +import java.time.LocalDateTime; + +import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.block.Chest; +import org.bukkit.inventory.Inventory; +import org.bukkit.scheduler.BukkitRunnable; + +import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; +import graveyard.shulker.thebuttonrebirth.admin.CreateShrine; + +public class CheckChestTask extends BukkitRunnable{ + //Plugin + private final ButtonRebirthPlugin BRplugin; + private World world; + + //Chest + private int chestX; + private int chestY; + private int chestZ; + private Block chestBlock; + private Chest shrineChest; + private Inventory shrineInventory; + + //Time + private LocalDateTime currentTime; + private LocalDateTime configTime; + + private int minimumDiamondBlocks; + private int diamondsInserted; + + public CheckChestTask(ButtonRebirthPlugin initBRplugin){ + //INIT - plugin + this.BRplugin = initBRplugin; + + //INIT - chestX, chestY, chestZ + chestX = BRplugin.getConfig().getInt("chestX"); + chestY = BRplugin.getConfig().getInt("chestY"); + chestZ = BRplugin.getConfig().getInt("chestZ"); + + //INIT - World + world = BRplugin.getServer().getWorld(BRplugin.getConfig().getString("world")); + } + + @Override + public void run(){ + //run() activates every 20 server ticks. + + //CHECK - Plugin is Enabled + if (BRplugin.isEnabled() == false){ + this.cancel(); + } + //CHECK - World Exists + if (!(BRplugin.getServer().getWorlds().contains(BRplugin.getServer().getWorld(BRplugin.getConfig().getString("world"))))) { + BRplugin.logger.info("Error: Config world does not exist in Server."); + BRplugin.logger.info("Server Worlds: " + BRplugin.getServer().getWorlds().toString()); + BRplugin.logger.info("Config World: " + BRplugin.getConfig().getString("world")); + BRplugin.logger.info("Turning off Display..."); + this.cancel(); + return; + } + + //INIT - currentTime, configTime + currentTime = LocalDateTime.now(Clock.systemUTC()); + configTime = LocalDateTime.parse(BRplugin.getConfig().getString("lastCheckChestTime")); + + //TIME - Current Time after Config Time + if (currentTime.isAfter(configTime)){ + + //SANITIZE "world" + if (BRplugin.getConfig().getString("world") == null) BRplugin.getServer().broadcastMessage("Error: No world defined in config file."); + if (BRplugin.getServer().getWorlds() == null) BRplugin.getServer().broadcastMessage("Error: plugin.getServer().getWorlds() returns null"); + + //INIT - world, chestBlock + chestBlock = world.getBlockAt(chestX, chestY, chestZ); + + //SANITIZE - chestBlock + if (!(chestBlock.getType() == Material.CHEST)){ + damageShrine(); + reconstructShrine(); + return; + } + + //INIT - shrineChest, shrineInventory + shrineChest = (Chest) chestBlock.getState(); + shrineInventory = shrineChest.getInventory(); + + + //UPDATE - configTime + BRplugin.getConfig().set("lastCheckChestTime", currentTime.plusMinutes(BRplugin.getConfig().getInt("barDuration")).toString()); + BRplugin.saveConfig(); + + //INIT - minimumDiamondBlocks, diamondsInserted + minimumDiamondBlocks = BRplugin.getConfig().getInt("minimumDiamondBlocks"); + diamondsInserted = BRplugin.getConfig().getInt("diamondsInserted"); + + //CHECK - chest for diamonds + if(diamondsInserted > minimumDiamondBlocks || shrineInventory.contains(Material.DIAMOND_BLOCK, (minimumDiamondBlocks - diamondsInserted))){ + //INVENTORY SUCCESS + + //CHECK - First Time + if (minimumDiamondBlocks == 0){ + broadcastExperimentHasBegun(); + }else{ + broadcastButtonRefuled(); + } + + //UPDATE minimumDiamondBlocks + minimumDiamondBlocks++; + BRplugin.getConfig().set("minimumDiamondBlocks", minimumDiamondBlocks); + BRplugin.getConfig().set("diamondsInserted", 0); + BRplugin.saveConfig(); + }else{ + //INVENTORY FAILURE + damageShrine(); + } + + //RESET - shrine, shrineInventory + reconstructShrine(); + shrineInventory.clear(); + BRplugin.getConfig().set("diamondsInserted",0); + + }else{ + //currentTime is before config time. + //therefore wait. + } + + } + private void damageShrine(){ + //UPDATE - buttonHealth + int buttonHealth = BRplugin.getConfig().getInt("buttonHealth"); + buttonHealth--; + BRplugin.getConfig().set("buttonHealth", buttonHealth); + + //DISPLAY AND MAKE SOUND + BRplugin.getServer().broadcastMessage(ChatColor.DARK_RED + "--------------------------"); + BRplugin.getServer().broadcastMessage(ChatColor.DARK_RED + "----- BUTTON DAMAGED -----"); + BRplugin.getServer().broadcastMessage(ChatColor.DARK_RED + "--------------------------"); + BRplugin.getServer().broadcastMessage(ChatColor.RED + " " + buttonHealth + "s of Health left"); + world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_ENDERDRAGON_DEATH,50,1); + world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_LIGHTNING_THUNDER,50,1); + world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_GENERIC_EXPLODE,50,50); + } + private void reconstructShrine(){ + CreateShrine shrineConstructor= new CreateShrine(BRplugin); + shrineConstructor.createShrine(chestX, chestY, chestZ, 10, Material.BEDROCK); + } + private void broadcastExperimentHasBegun(){ + BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "------------------------------------"); + BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "----- THE EXPERIMENT HAS BEGUN -----"); + BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "------------------------------------"); + BRplugin.getServer().broadcastMessage(ChatColor.BLUE + " " + minimumDiamondBlocks + " Blocks required"); + world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_WITHER_SPAWN,50,10); + } + private void broadcastButtonRefuled(){ + BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "--------------------------"); + BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "----- BUTTON REFULED -----"); + BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "--------------------------"); + BRplugin.getServer().broadcastMessage(ChatColor.BLUE + " " + minimumDiamondBlocks + " Blocks required"); + world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_WITHER_SPAWN,50,10); + } +} diff --git a/src/graveyard/shulker/thebuttonrebirth/tasks/CyclicalDisplayTask.java b/src/graveyard/shulker/thebuttonrebirth/tasks/CyclicalDisplayTask.java new file mode 100644 index 0000000..fec8ece --- /dev/null +++ b/src/graveyard/shulker/thebuttonrebirth/tasks/CyclicalDisplayTask.java @@ -0,0 +1,245 @@ +package graveyard.shulker.thebuttonrebirth.tasks; + +import java.time.Clock; +import java.time.Duration; +import java.time.LocalDateTime; +import java.time.temporal.ChronoUnit; +import java.util.List; + +import org.bukkit.Material; +import org.bukkit.Server; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.block.Chest; +import org.bukkit.boss.BarColor; +import org.bukkit.boss.BarStyle; +import org.bukkit.boss.BossBar; +import org.bukkit.entity.Player; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.scheduler.BukkitRunnable; + +import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; + +public class CyclicalDisplayTask extends BukkitRunnable{ + //Pointers + private ButtonRebirthPlugin plugin; + private Server server; + private World world; + + //Config Variables + public int buttonHealth; + public int minimumDiamondBlocks; + public String lastCheckChestTime; + + //Boss bars + private BossBar buttonBar; + private BossBar diamondBar; + private BossBar timeBar; + + //Time + private LocalDateTime currentTime; + private LocalDateTime configTime; + private Duration timeDifference; + + //Chest + private int chestX; + private int chestY; + private int chestZ; + private Block chestBlock; + private Chest shrineChest; + private Inventory shrineInventory; + private ItemStack[] chestContents; + private int diamondsInserted; + + //Players + private List playerList; + + public List healthBlocked; + public List diamondBlocked; + public List timeBlocked; + private int totalDiamonds; + private int currentBar; + private int barCycleDuration = 20; + + public CyclicalDisplayTask(ButtonRebirthPlugin initPlugin){ + //INIT - plugin,server + plugin = initPlugin; + server = plugin.getServer(); + + //INIT - buttonBar,diamondBar,timeBar + buttonBar = server.createBossBar("INIT Easter Egg!", BarColor.PURPLE, BarStyle.SEGMENTED_20); + diamondBar = server.createBossBar("INIT Easter Egg!", BarColor.BLUE, BarStyle.SOLID); + timeBar = server.createBossBar("INIT Easter Egg!", BarColor.RED, BarStyle.SOLID); + + //INIT - chestX, chestY, chestZ, diamondsInserted + chestX = plugin.getConfig().getInt("chestX"); + chestY = plugin.getConfig().getInt("chestY"); + chestZ = plugin.getConfig().getInt("chestZ"); + diamondsInserted = plugin.getConfig().getInt("diamondsInserted"); + + currentBar = 0; + + } + + @Override + public void run() { + //CHECK - Plugin is Enabled + if (plugin.isEnabled() == false){ + this.cancel(); + } + + //CHECK - World Exists + if (!(plugin.getServer().getWorlds().contains(plugin.getServer().getWorld(plugin.getConfig().getString("world"))))) { + plugin.logger.info("Error: Config world does not exist in Server."); + plugin.logger.info("Server Worlds: " + plugin.getServer().getWorlds().toString()); + plugin.logger.info("Config World: " + plugin.getConfig().getString("world")); + plugin.logger.info("Turning off Display..."); + this.cancel(); + return; + } + + //INIT - world,buttonHealth,minimumDiamondBlocks, diamondsInserted + world = plugin.getServer().getWorld(plugin.getConfig().getString("world")); + buttonHealth = plugin.getConfig().getInt("buttonHealth"); + minimumDiamondBlocks = plugin.getConfig().getInt("minimumDiamondBlocks"); + diamondsInserted = plugin.getConfig().getInt("diamondsInserted"); + + //INIT - currentTime, configTime, timeDifference + currentTime = LocalDateTime.now(Clock.systemUTC()); + configTime = LocalDateTime.parse(plugin.getConfig().getString("lastCheckChestTime")); + timeDifference = Duration.of(currentTime.until(configTime, ChronoUnit.NANOS), ChronoUnit.NANOS); + + + setBarTitles(); + setButtonBarProgress(); + setDiamondBarProgress(); + setTimeBarProgress(); + + //INIT - playerList,buttonPlayers,diamondPlayers,timePlayers + playerList = world.getPlayers(); + + //Bar Switching + currentBar++; + if (currentBar < barCycleDuration){ + + //Health Case + diamondBar.removeAll(); + timeBar.removeAll(); + for(Player player: playerList) buttonBar.addPlayer(player); + + } else if (currentBar < barCycleDuration*2){ + + //Diamond Case + buttonBar.removeAll(); + timeBar.removeAll(); + + for(Player player: playerList) diamondBar.addPlayer(player); + + } else if (currentBar < barCycleDuration*3){ + + //Time Case + buttonBar.removeAll(); + diamondBar.removeAll(); + + for(Player player: playerList) timeBar.addPlayer(player); + + } else { + + buttonBar.removeAll(); + diamondBar.removeAll(); + + for(Player player: playerList) timeBar.addPlayer(player); + currentBar = 0; + } + } + public void setBarTitles(){ + //SET TITLE - buttonBar,diamondBar,timeBar + + if (buttonHealth >= 50){ buttonBar.setColor(BarColor.PURPLE);} + else if (buttonHealth >= 40) {buttonBar.setColor(BarColor.BLUE); } + else if (buttonHealth >= 30) {buttonBar.setColor(BarColor.GREEN); } + else if (buttonHealth >= 20) {buttonBar.setColor(BarColor.YELLOW); } + else if (buttonHealth >= 10) {buttonBar.setColor(BarColor.WHITE); } + else if (buttonHealth >= 00) {buttonBar.setColor(BarColor.RED); } + else{ + buttonBar.setColor(BarColor.WHITE); + } + + + + buttonBar.setTitle("Button Health: "+ buttonHealth + "HP"); + diamondBar.setTitle("Diamonds Needed At ("+chestX+","+chestY+","+chestZ+ "): " + (diamondsInserted) + "/" + minimumDiamondBlocks); + timeBar.setTitle("Button Damage in: " + timeDifference.toHours()+":"+ timeDifference.toMinutes()%60 +":"+ (int)Math.floor(timeDifference.toMillis()%60000/1000)); + } + public void setButtonBarProgress(){ + //SET PROGRESS - buttonBar + if (buttonHealth < 0){ + buttonBar.setProgress(0.0); + }else if (buttonHealth > 60){ + buttonBar.setProgress(1.0); + }else{ + buttonBar.setProgress((double)buttonHealth/60.0); + } + } + public void setDiamondBarProgress(){ + //SET PROGRESS - diamomndBar + if (minimumDiamondBlocks < 1 || diamondsInserted > minimumDiamondBlocks){ + diamondBar.setProgress(1.0); + }else if(diamondsInserted < 0){ + diamondBar.setProgress(0.0); + }else{ + + //GET - chestBlock + chestBlock = world.getBlockAt(chestX, chestY, chestZ); + + //SANITIZE - chestBlock + if (!(chestBlock.getType() == Material.CHEST)) return; + + //INIT - shrineChest, shrineInventory + shrineChest = (Chest) chestBlock.getState(); + shrineInventory = shrineChest.getInventory(); + + //SET PROGRESS - diamondBar + if(shrineInventory.contains(Material.DIAMOND_BLOCK, (minimumDiamondBlocks - diamondsInserted))){ + diamondBar.setProgress(1.0); + }else{ + //INIT - chestContents,totalDiamonds + chestContents = shrineInventory.getContents(); + totalDiamonds = 0; + //CALCULATE - totalDiamonds + for (ItemStack stack: chestContents){ + try{ + if (stack.getType() == Material.DIAMOND_BLOCK){ + totalDiamonds += stack.getAmount(); + } + }catch(Exception e){/*stack isn't a diamond block*/} + } + + diamondBar.setProgress((diamondsInserted+totalDiamonds)/(double)minimumDiamondBlocks); + } + } + } + public void setTimeBarProgress(){ + //Time Progress Setting + Duration barMinutes = Duration.of(plugin.getConfig().getInt("barDuration"),ChronoUnit.MINUTES); + long timeDifferenceMillis = timeDifference.toMillis(); + long barMinutesMilis = barMinutes.toMillis(); + double durationRatio = (double)timeDifferenceMillis /(double)barMinutesMilis; + + //SET PROGRESS - timeBar + if (durationRatio > 1){ + timeBar.setProgress(1.0); + }else if(durationRatio < 0){ + timeBar.setProgress(0.0); + }else{ + timeBar.setProgress(durationRatio); + } + } + public void setBar(int bar){ + if (bar < 0){ + return; + } + currentBar = barCycleDuration * (bar); + } +} diff --git a/src/graveyard/shulker/thebuttonrebirth/tasks/StealChestTask.java b/src/graveyard/shulker/thebuttonrebirth/tasks/StealChestTask.java new file mode 100644 index 0000000..92778bc --- /dev/null +++ b/src/graveyard/shulker/thebuttonrebirth/tasks/StealChestTask.java @@ -0,0 +1,200 @@ +package graveyard.shulker.thebuttonrebirth.tasks; + +import java.time.Clock; +import java.time.LocalDateTime; + +import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.block.Chest; +import org.bukkit.entity.Player; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.scheduler.BukkitRunnable; + +import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; + + +public class StealChestTask extends BukkitRunnable{ + private ButtonRebirthPlugin plugin; + private World world; + private int diamondsInserted; + private int chestX; + private int chestY; + private int chestZ; + private Block chestBlock; + private Inventory shrineInventory; + + private LocalDateTime currentTime; + private LocalDateTime configTime; + private LocalDateTime messageAllowedTime; + private int noRefuelMessagePeriod = 1;//minutes + private Player presserPlayer; + private String presserName; + + public StealChestTask(ButtonRebirthPlugin initPlugin){ + //INIT - plugin,server,world + plugin = initPlugin; + diamondsInserted = plugin.getConfig().getInt("diamondsInserted"); + + //INIT - chestX, chestY, chestZ + chestX = plugin.getConfig().getInt("chestX"); + chestY = plugin.getConfig().getInt("chestY"); + chestZ = plugin.getConfig().getInt("chestZ"); + + world = plugin.getServer().getWorld(plugin.getConfig().getString("world")); + } + + @Override + public void run() { + //CHECK - Plugin is Enabled + if (plugin.isEnabled() == false){ + this.cancel(); + } + + //CHECK - World Exists + if (!(plugin.getServer().getWorlds().contains(plugin.getServer().getWorld(plugin.getConfig().getString("world"))))) { + plugin.logger.info("Error: Config world does not exist in Server."); + plugin.logger.info("Server Worlds: " + plugin.getServer().getWorlds().toString()); + plugin.logger.info("Config World: " + plugin.getConfig().getString("world")); + plugin.logger.info("Turning off StealChest Task..."); + this.cancel(); + return; + } + + //INIT - diamondsInserted + diamondsInserted = plugin.getConfig().getInt("diamondsInserted"); + + //SANITIZE - world + if (plugin.getConfig().getString("world") == null) { + plugin.logger.info("Error: No world defined in config file."); + return; + } + if (plugin.getServer().getWorlds() == null) { + plugin.logger.info("plugin.getServer().getWorlds() returns null"); + return; + } + + //INIT - chestBlock + chestBlock = world.getBlockAt(chestX, chestY, chestZ); + + //SANITIZE - chestBlock + if (!(chestBlock.getType() == Material.CHEST)){ + return; + } + + //INIT - shrineInventory, minimumDiamondBlocks + shrineInventory = ((Chest) chestBlock.getState()).getInventory(); + + //STEAL - from shrine chest, put into button health + int totalDiamonds = 0; + ItemStack[] chestContents = shrineInventory.getContents(); + //CALCULATE - totalDiamonds + for (ItemStack stack: chestContents){ + try{ + if (stack.getType() == Material.DIAMOND_BLOCK){ + totalDiamonds += (stack.getAmount() *9); + + }else if (stack.getType() == Material.DIAMOND){ + totalDiamonds += (stack.getAmount() *1); + + }else if (stack.getType() == Material.DIAMOND_ORE){ + totalDiamonds += (stack.getAmount() *1); + + }else if (stack.getType() == Material.DIAMOND_SWORD){ + totalDiamonds += (stack.getAmount() *2); + + }else if(stack.getType() == Material.DIAMOND_PICKAXE){ + totalDiamonds += (stack.getAmount() *3); + + }else if (stack.getType() == Material.DIAMOND_HELMET){ + totalDiamonds += (stack.getAmount() *5); + + }else if (stack.getType() == Material.DIAMOND_CHESTPLATE){ + totalDiamonds += (stack.getAmount() *8); + + }else if (stack.getType() == Material.DIAMOND_LEGGINGS){ + totalDiamonds += (stack.getAmount() *7); + + }else if(stack.getType() == Material.DIAMOND_BOOTS){ + totalDiamonds += (stack.getAmount() *4); + + }else if(stack.getType() == Material.DIAMOND_AXE){ + totalDiamonds += (stack.getAmount() *3); + + }else if(stack.getType() == Material.DIAMOND_HOE){ + totalDiamonds += (stack.getAmount() *2); + + }else if(stack.getType() == Material.DIAMOND_SPADE){ + totalDiamonds += (stack.getAmount() *1); + + }else if(stack.getType() == Material.DIAMOND_BARDING){ + totalDiamonds += (stack.getAmount() *1); + + } + }catch(Exception e){/*stack is empty*/} + } + shrineInventory.clear(); + diamondsInserted += totalDiamonds; + plugin.getConfig().set("diamondsInserted", diamondsInserted); + plugin.saveConfig(); + //RESET TIMER CHECK + if (plugin.getConfig().getInt("diamondsInserted") >= plugin.getConfig().getInt("minimumDiamondBlocks")){ + + plugin.getConfig().set("diamondsInserted", 0); + plugin.saveConfig(); + + currentTime = LocalDateTime.now(Clock.systemUTC()); + configTime = LocalDateTime.parse(plugin.getConfig().getString("lastCheckChestTime")); + + plugin.getConfig().set("lastCheckChestTime", currentTime.plusMinutes(plugin.getConfig().getInt("barDuration")).toString()); + plugin.saveConfig(); + + messageAllowedTime = configTime.minusMinutes(plugin.getConfig().getInt("barDuration")).plusMinutes(noRefuelMessagePeriod); + + if(currentTime.isAfter(messageAllowedTime)){ + + try {presserPlayer = getNearestPresser();} catch(Exception noPlayers) {return;} + + presserName = presserPlayer.getDisplayName(); + plugin.getServer().broadcastMessage(ChatColor.AQUA + "--------------------------"); + plugin.getServer().broadcastMessage(ChatColor.AQUA + "SHRINE REFULED BY " + presserName); + plugin.getServer().broadcastMessage(ChatColor.AQUA + "--------------------------"); + for (Player player: plugin.getServer().getOnlinePlayers()){ + Location tempLocation = player.getLocation(); + world.playSound(tempLocation, Sound.ENTITY_WITHER_SPAWN,30,10); + } + + }else{ + + try {presserPlayer = getNearestPresser();} catch(Exception noPlayers) {return;} + + presserPlayer.sendMessage(ChatColor.AQUA + "---------------"); + presserPlayer.sendMessage(ChatColor.AQUA + "SHRINE REFUELED"); + presserPlayer.sendMessage(ChatColor.AQUA + "---------------"); + } + world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_WITHER_SPAWN,50,10); + ((CyclicalDisplayTask) plugin.cyclicalDisplayListener.cyclicalDisplayTask).setBar(2); + } + } + + private Player getNearestPresser() throws Exception{ + if (plugin.getServer().getOnlinePlayers().isEmpty()) throw new Exception(); + Player closestPlayer = null; + int closestDistance = 0; + for (Player player: plugin.getServer().getOnlinePlayers()){ + int distance = (int) player.getLocation().distance(new Location(world, chestX,chestY,chestZ)); + if (closestPlayer == null){ + closestPlayer = player; + closestDistance = distance; + }else if(distance < closestDistance){ + closestPlayer = player; + closestDistance = distance; + } + } + return closestPlayer; + } +} From 0a01494c4ab55b29cd4aaa4c134a33fe082228f9 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 07:59:35 -0400 Subject: [PATCH 083/263] Linked GPowers and refactored FlairDoors --- .../flairdoor/listeners/PortalListener.java | 67 ++++++++++--------- .../components/gpowers/GPowerMemory.java | 2 +- .../components/gpowers/GPowerModule.java | 4 ++ .../components/gpowers/commands/GPower.java | 17 +++-- .../gpowers/commands/PowerDown.java | 15 ++++- .../components/gpowers/commands/PowerUp.java | 13 +++- 6 files changed, 72 insertions(+), 46 deletions(-) diff --git a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java index a41d3bb..a905dbd 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -1,12 +1,9 @@ package alisolarflare.components.flairdoor.listeners; -import java.util.AbstractMap; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import org.bukkit.DyeColor; -import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Player; @@ -18,12 +15,9 @@ import org.bukkit.material.Wool; import org.bukkit.plugin.java.JavaPlugin; public class PortalListener implements Listener{ - AbstractMap portalMap = new HashMap(); public static List playersToBeFlaired = new ArrayList(); public JavaPlugin plugin; - //TODO: CREATE - LIST OF PORTALS (only x-z values) - public PortalListener(JavaPlugin plugin) { this.plugin = plugin; @@ -95,47 +89,54 @@ public class PortalListener implements Listener{ player.sendMessage("Recolouring Player as..." + dyecolour.toString()); String name = player.getName(); player.sendMessage("name:" + name); + String tempName = ""; for(int i = 0; i < name.length(); i++){ - if (name.charAt(i) == '&'){ - //TODO: Remove all &* symbols - name = name.substring(0, i) + name.substring(i + 1, name.length()); - + if (name.charAt(i) != '&'){ + tempName += name.charAt(i); + }else{ + i++; } } + name = tempName; player.sendMessage("Adjusted Name: " + name); - if(dyecolour == DyeColor.GRAY){ + switch(dyecolour){ + case GRAY: player.sendMessage("Adding GRAY"); - player.setCustomName("&7" + name); - - }else if(dyecolour == DyeColor.RED){ + name = "&7" + name; + break; + case RED: player.sendMessage("Adding RED"); - player.setCustomName("&4" + name); - - }else if(dyecolour == DyeColor.ORANGE){ + name = "&4" + name; + break; + case ORANGE: player.sendMessage("Adding ORANGE"); - player.setCustomName("&6" + name); - - }else if(dyecolour == DyeColor.YELLOW){ + name = "&6" + name; + break; + case YELLOW: player.sendMessage("Adding YELLOW"); - player.setCustomName("&e" + name); - - }else if(dyecolour == DyeColor.GREEN){ + name = "&e" + name; + break; + case LIME: + case GREEN: player.sendMessage("Adding GREEN"); - player.setCustomName("&a" + name); - - }else if(dyecolour == DyeColor.BLUE){ + name = "&a" + name; + break; + case CYAN: + case LIGHT_BLUE: + case BLUE: player.sendMessage("Adding BLUE"); - player.setCustomName("&9" + name); - - }else if(dyecolour == DyeColor.PURPLE){ + name = "&9" + name; + break; + case PURPLE: player.sendMessage("Adding PURPLE"); - player.setCustomName("&5" + name); - - }else{ + name = "&5" + name; + break; + default: player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); - return; + break; } + player.setCustomName(name); player.sendMessage("Your name is now: " + player.getCustomName() +"! Removing you from playersToBeFlaired..."); playersToBeFlaired.remove(player.getName()); } diff --git a/src/alisolarflare/components/gpowers/GPowerMemory.java b/src/alisolarflare/components/gpowers/GPowerMemory.java index 5a99b16..0dda7b9 100644 --- a/src/alisolarflare/components/gpowers/GPowerMemory.java +++ b/src/alisolarflare/components/gpowers/GPowerMemory.java @@ -9,7 +9,7 @@ import org.bukkit.entity.Player; public class GPowerMemory{ public Map poweredPlayerList = new HashMap(); - public void PowerUpPlayer(Player player, String colour){ + public void configurePlayer(Player player, String colour, boolean powerIsActive){ poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); } public void PowerUpPlayer(Player player){ diff --git a/src/alisolarflare/components/gpowers/GPowerModule.java b/src/alisolarflare/components/gpowers/GPowerModule.java index c3c4a53..3148ee0 100644 --- a/src/alisolarflare/components/gpowers/GPowerModule.java +++ b/src/alisolarflare/components/gpowers/GPowerModule.java @@ -4,6 +4,8 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; import alisolarflare.components.gpowers.commands.GPower; +import alisolarflare.components.gpowers.commands.PowerDown; +import alisolarflare.components.gpowers.commands.PowerUp; import alisolarflare.components.gpowers.listeners.gPowerListener; public class GPowerModule extends Module { @@ -12,6 +14,8 @@ public class GPowerModule extends Module { public void register(JavaPlugin plugin) { GPowerMemory gPowerMemory = new GPowerMemory(); registerCommand(plugin, new GPower(gPowerMemory)); + registerCommand(plugin, new PowerUp(gPowerMemory)); + registerCommand(plugin, new PowerDown(gPowerMemory)); registerListener(plugin, new gPowerListener(plugin, gPowerMemory)); } diff --git a/src/alisolarflare/components/gpowers/commands/GPower.java b/src/alisolarflare/components/gpowers/commands/GPower.java index 6c2fcd9..4b68ff0 100644 --- a/src/alisolarflare/components/gpowers/commands/GPower.java +++ b/src/alisolarflare/components/gpowers/commands/GPower.java @@ -3,6 +3,8 @@ package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import com.mysql.fabric.xmlrpc.base.Data; + import alisolarflare.components.gpowers.GPowerMemory; import buttondevteam.lib.chat.TBMCCommandBase; @@ -24,13 +26,12 @@ public class GPower extends TBMCCommandBase { return false; } String colour; - player.sendMessage("Checking terms..."); if (args[0].startsWith("r") || args[0].startsWith("o") || args[0].startsWith("y") || args[0].startsWith("g") || args[0].startsWith("b") || args[0].startsWith("p")) { colour = args[0]; } else { - player.sendMessage("Term Fail: COLOUR. Proper Usage to test G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]"); return false; } boolean isActive; @@ -39,16 +40,14 @@ public class GPower extends TBMCCommandBase { } else if (args[1].startsWith("f")) { isActive = false; } else { - player.sendMessage("Term Fail: ACTIVE. Proper Usage to test G-Powers:"); + player.sendMessage("error: active. Proper Usage to configure G-Powers:"); player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); return false; } player.sendMessage("Terms Vaild!"); - if (isActive) { - gPowerMemory.PowerUpPlayer(player, colour); - } else { - gPowerMemory.PowerDownPlayer(player); - } + player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); + gPowerMemory.configurePlayer(player, colour, isActive); + return false; } diff --git a/src/alisolarflare/components/gpowers/commands/PowerDown.java b/src/alisolarflare/components/gpowers/commands/PowerDown.java index d94c407..8f3467b 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/components/gpowers/commands/PowerDown.java @@ -1,14 +1,25 @@ package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import alisolarflare.components.gpowers.GPowerMemory; import buttondevteam.lib.chat.TBMCCommandBase; public class PowerDown extends TBMCCommandBase { + private GPowerMemory gPowerMemory; + + public PowerDown(GPowerMemory gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + @Override - public boolean OnCommand(CommandSender arg0, String arg2, String[] arg3) { - // TODO Auto-generated method stub + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (!(sender instanceof Player)) + sender.sendMessage("You must be a player to use this command! Contact dev/ali if you think this is wrong"); + Player player = (Player) sender; + gPowerMemory.PowerDownPlayer(player); return false; } diff --git a/src/alisolarflare/components/gpowers/commands/PowerUp.java b/src/alisolarflare/components/gpowers/commands/PowerUp.java index 4392bbe..2e50db8 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/components/gpowers/commands/PowerUp.java @@ -1,14 +1,25 @@ package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import alisolarflare.components.gpowers.GPowerMemory; import buttondevteam.lib.chat.TBMCCommandBase; public class PowerUp extends TBMCCommandBase { + private GPowerMemory gPowerMemory; + + public PowerUp(GPowerMemory gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { - // gPowerMemory.PowerUpPlayer(player, colour); + if (!(sender instanceof Player)) + sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong"); + Player player = (Player) sender; + gPowerMemory.PowerUpPlayer(player); return false; } From 405fb19111a33886ea529d13837fed38e63a9db8 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 08:37:27 -0400 Subject: [PATCH 084/263] Finally finished flairdoors --- pom.xml | 155 +++++++++--------- .../flairdoor/listeners/PortalListener.java | 16 +- .../components/gpowers/commands/GPower.java | 5 +- 3 files changed, 97 insertions(+), 79 deletions(-) diff --git a/pom.xml b/pom.xml index 81da534..ee690c6 100644 --- a/pom.xml +++ b/pom.xml @@ -1,73 +1,82 @@ - - 4.0.0 - com.github.tbmcplugins - AliPresents - 0.0.1-SNAPSHOT - AliPresents - A bucket of aaall the stuff Ali makes. It's a bit smelly. - - src - - - src - - **/*.java - - - - . - - *.yml - - - - - - maven-compiler-plugin - 3.3 - - 1.8 - 1.8 - - - - - - UTF-8 - - - - - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots/ - - - jcenter - http://jcenter.bintray.com - - - jitpack.io - https://jitpack.io - - - - - - org.spigotmc - spigot-api - 1.9.2-R0.1-SNAPSHOT - - - - org.apache.commons - commons-lang3 - 3.4 - - - com.github.TBMCPlugins.ButtonCore - ButtonCore - master-SNAPSHOT - - - + + 4.0.0 + com.github.tbmcplugins + AliPresents + 0.0.1-SNAPSHOT + AliPresents + A bucket of aaall the stuff Ali makes. It's a bit smelly. + + src + + + src + + **/*.java + + + + . + + *.yml + + + + + + maven-compiler-plugin + 3.3 + + 1.8 + 1.8 + + + + + + UTF-8 + + + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + jcenter + http://jcenter.bintray.com + + + jitpack.io + https://jitpack.io + + + ess-repo + http://repo.ess3.net + + + + + + org.spigotmc + spigot-api + 1.9.2-R0.1-SNAPSHOT + + + + org.apache.commons + commons-lang3 + 3.4 + + + com.github.TBMCPlugins.ButtonCore + ButtonCore + master-SNAPSHOT + + + net.ess3 + Essentials + 2.13.1 + + + diff --git a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java index a905dbd..9058bd7 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -3,6 +3,7 @@ package alisolarflare.components.flairdoor.listeners; import java.util.ArrayList; import java.util.List; +import org.bukkit.Bukkit; import org.bukkit.DyeColor; import org.bukkit.Material; import org.bukkit.block.Block; @@ -14,13 +15,18 @@ import org.bukkit.material.MaterialData; import org.bukkit.material.Wool; import org.bukkit.plugin.java.JavaPlugin; +import com.earth2me.essentials.Essentials; +import com.earth2me.essentials.User; + public class PortalListener implements Listener{ public static List playersToBeFlaired = new ArrayList(); public JavaPlugin plugin; - + + Essentials essentials; public PortalListener(JavaPlugin plugin) { this.plugin = plugin; + this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials")); } @EventHandler public void onPortalEnter(PlayerPortalEvent event){ @@ -86,8 +92,10 @@ public class PortalListener implements Listener{ } public void recolourPlayer(Player player, DyeColor dyecolour){ + User user = essentials.getUser(player); + player.sendMessage("Recolouring Player as..." + dyecolour.toString()); - String name = player.getName(); + String name = user.getNickname(); player.sendMessage("name:" + name); String tempName = ""; for(int i = 0; i < name.length(); i++){ @@ -136,8 +144,8 @@ public class PortalListener implements Listener{ player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); break; } - player.setCustomName(name); - player.sendMessage("Your name is now: " + player.getCustomName() +"! Removing you from playersToBeFlaired..."); + user.setNickname(name); + player.sendMessage("Your name is now: " + user.getNickname() +"! Removing you from playersToBeFlaired..."); playersToBeFlaired.remove(player.getName()); } } diff --git a/src/alisolarflare/components/gpowers/commands/GPower.java b/src/alisolarflare/components/gpowers/commands/GPower.java index 4b68ff0..4a90d21 100644 --- a/src/alisolarflare/components/gpowers/commands/GPower.java +++ b/src/alisolarflare/components/gpowers/commands/GPower.java @@ -3,8 +3,6 @@ package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.mysql.fabric.xmlrpc.base.Data; - import alisolarflare.components.gpowers.GPowerMemory; import buttondevteam.lib.chat.TBMCCommandBase; @@ -19,6 +17,9 @@ public class GPower extends TBMCCommandBase { @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { sender.sendMessage("G power activate!"); + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command! Talk to a dev/ali if you think this is wrong"); + } Player player = (Player) sender; if (args.length < 2) { player.sendMessage("Proper Usage to test G-Powers:"); From d3bf21c626b83a50b1136353ac34fe17e38f6ec4 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 08:54:40 -0400 Subject: [PATCH 085/263] Changed repository to original repository --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ee690c6..3561116 100644 --- a/pom.xml +++ b/pom.xml @@ -51,8 +51,8 @@ https://jitpack.io - ess-repo - http://repo.ess3.net + ess-repo + http://repo.ess3.net/content/groups/essentials From 5c86a21767d7e1beae6f79bfe241b23d00950d6f Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 09:00:31 -0400 Subject: [PATCH 086/263] added debug message --- .../components/flairdoor/listeners/PortalListener.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java index 9058bd7..58af6f5 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -99,7 +99,9 @@ public class PortalListener implements Listener{ player.sendMessage("name:" + name); String tempName = ""; for(int i = 0; i < name.length(); i++){ + player.sendMessage("|"+name.charAt(i)+"|"); if (name.charAt(i) != '&'){ + tempName += name.charAt(i); }else{ i++; From a83683b68e8d3a58df23d0d6b5256a437a5928e7 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 09:08:06 -0400 Subject: [PATCH 087/263] =?UTF-8?q?Added=20=C2=A7=20instead=20of=20&.=20(w?= =?UTF-8?q?onders=20whether=20this=20message=20will=20break=20github}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flairdoor/listeners/PortalListener.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java index 58af6f5..edf7866 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -95,12 +95,12 @@ public class PortalListener implements Listener{ User user = essentials.getUser(player); player.sendMessage("Recolouring Player as..." + dyecolour.toString()); - String name = user.getNickname(); + String name = user._getNickname(); player.sendMessage("name:" + name); String tempName = ""; for(int i = 0; i < name.length(); i++){ player.sendMessage("|"+name.charAt(i)+"|"); - if (name.charAt(i) != '&'){ + if (name.charAt(i) != '§'){ tempName += name.charAt(i); }else{ @@ -113,34 +113,34 @@ public class PortalListener implements Listener{ switch(dyecolour){ case GRAY: player.sendMessage("Adding GRAY"); - name = "&7" + name; + name = "§7" + name; break; case RED: player.sendMessage("Adding RED"); - name = "&4" + name; + name = "§4" + name; break; case ORANGE: player.sendMessage("Adding ORANGE"); - name = "&6" + name; + name = "§6" + name; break; case YELLOW: player.sendMessage("Adding YELLOW"); - name = "&e" + name; + name = "§e" + name; break; case LIME: case GREEN: player.sendMessage("Adding GREEN"); - name = "&a" + name; + name = "§a" + name; break; case CYAN: case LIGHT_BLUE: case BLUE: player.sendMessage("Adding BLUE"); - name = "&9" + name; + name = "§9" + name; break; case PURPLE: player.sendMessage("Adding PURPLE"); - name = "&5" + name; + name = "§5" + name; break; default: player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); From c5d2772eae14185c886b36f3666b477e97436a4c Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 09:36:19 -0400 Subject: [PATCH 088/263] started discriminating against CB Creatives --- .../flairdoor/listeners/PortalListener.java | 14 +++----------- .../CreativeBoundariesModule.java | 7 ++++++- .../creativeboundaries/PlotChangeListener.java | 3 ++- .../creativeboundaries/commands/Cbgm1.java | 8 ++++++++ .../creativeboundaries/commands/SetDickmode.java | 10 +++++----- 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java index edf7866..82d186d 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -43,7 +43,6 @@ public class PortalListener implements Listener{ return; } player.sendMessage("-MAY THE FLAIRING COMMENCE-"); - player.sendMessage("Deactivating regular portal behaviour..."); event.setTo(player.getLocation()); //INIT - x,y,z @@ -52,14 +51,9 @@ public class PortalListener implements Listener{ int z = player.getLocation().getBlockZ(); //INIT - Blocks Under Portal - Block HigherBlock = player.getWorld().getBlockAt(x,y-1,z); - Block MiddleBlock = player.getWorld().getBlockAt(x,y-2,z); - Block BottomBlock = player.getWorld().getBlockAt(x,y-3,z); - - player.sendMessage("Blocks being inspected:"); - player.sendMessage(HigherBlock.toString()); - player.sendMessage(MiddleBlock.toString()); - player.sendMessage(BottomBlock.toString()); + Block HigherBlock = player.getWorld().getBlockAt(x,y-2,z); + Block MiddleBlock = player.getWorld().getBlockAt(x,y-3,z); + Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); //RECOLOUR PLAYER if(HigherBlock.getType() == Material.STONE){ @@ -77,9 +71,7 @@ public class PortalListener implements Listener{ player.sendMessage("WOOL DETECTED M"); MaterialData mData = MiddleBlock.getState().getData(); - player.sendMessage("MATERIAL DATA COLLECTED: "+ mData.toString()); Wool wool = (Wool) mData; - player.sendMessage("WOOL DATA CONVERTED: "+ wool.toString()); recolourPlayer(player, wool.getColor()); diff --git a/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java b/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java index 09b6639..6a36180 100644 --- a/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java +++ b/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java @@ -1,5 +1,9 @@ package alisolarflare.creativeboundaries; +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; @@ -10,9 +14,10 @@ import alisolarflare.creativeboundaries.commands.SetDickmode; public class CreativeBoundariesModule extends Module{ public boolean dickmode; + public List cbCreatives = new ArrayList(); @Override public void register(JavaPlugin plugin) { - registerCommand(plugin, new Cbgm1()); + registerCommand(plugin, new Cbgm1(this)); registerCommand(plugin, new Cbgm0()); registerCommand(plugin, new SetDickmode(this)); diff --git a/src/alisolarflare/creativeboundaries/PlotChangeListener.java b/src/alisolarflare/creativeboundaries/PlotChangeListener.java index 41c5e5b..c230356 100644 --- a/src/alisolarflare/creativeboundaries/PlotChangeListener.java +++ b/src/alisolarflare/creativeboundaries/PlotChangeListener.java @@ -15,11 +15,12 @@ import com.palmergames.bukkit.towny.object.Town; public class PlotChangeListener implements Listener{ private boolean dickmode; + private List cbCreatives = new ArrayList(); public CreativeBoundariesModule plugin; - public List cbCreatives = new ArrayList(); public PlotChangeListener(CreativeBoundariesModule plugin){ this.plugin = plugin; this.dickmode = plugin.dickmode; + this.cbCreatives = plugin.cbCreatives; } @EventHandler public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ diff --git a/src/alisolarflare/creativeboundaries/commands/Cbgm1.java b/src/alisolarflare/creativeboundaries/commands/Cbgm1.java index 14c69ce..04fba33 100644 --- a/src/alisolarflare/creativeboundaries/commands/Cbgm1.java +++ b/src/alisolarflare/creativeboundaries/commands/Cbgm1.java @@ -10,10 +10,17 @@ import com.palmergames.bukkit.towny.object.Town; import com.palmergames.bukkit.towny.object.TownBlock; import com.palmergames.bukkit.towny.object.TownyUniverse; +import alisolarflare.creativeboundaries.CreativeBoundariesModule; import buttondevteam.lib.chat.TBMCCommandBase; public class Cbgm1 extends TBMCCommandBase { + private CreativeBoundariesModule module; + + public Cbgm1(CreativeBoundariesModule module) { + this.module = module; + } + @Override public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { @@ -46,6 +53,7 @@ public class Cbgm1 extends TBMCCommandBase { for(Resident res : town.getResidents()){ if (res.getName().toString().equals(player.getName().toString())){ player.setGameMode(GameMode.CREATIVE); + module.cbCreatives.add(player); return true; } } diff --git a/src/alisolarflare/creativeboundaries/commands/SetDickmode.java b/src/alisolarflare/creativeboundaries/commands/SetDickmode.java index 5cb3b14..3b1654b 100644 --- a/src/alisolarflare/creativeboundaries/commands/SetDickmode.java +++ b/src/alisolarflare/creativeboundaries/commands/SetDickmode.java @@ -6,10 +6,10 @@ import alisolarflare.creativeboundaries.CreativeBoundariesModule; import buttondevteam.lib.chat.TBMCCommandBase; public class SetDickmode extends TBMCCommandBase{ - private CreativeBoundariesModule plugin; + private CreativeBoundariesModule module; - public SetDickmode(CreativeBoundariesModule plugin){ - this.plugin = plugin; + public SetDickmode(CreativeBoundariesModule module){ + this.module = module; } @Override @@ -21,12 +21,12 @@ public class SetDickmode extends TBMCCommandBase{ } if(args[0].equalsIgnoreCase("TRUE") || args[0].equalsIgnoreCase("1")){ sender.sendMessage("Dickmode has been turned on!"); - plugin.dickmode=(true); + module.dickmode=(true); return true; } if(args[0].equalsIgnoreCase("FALSE") || args[0].equalsIgnoreCase("0")){ sender.sendMessage("Dickmode has been turned off!"); - plugin.dickmode=(false); + module.dickmode=(false); return true; } return false; From 76bef40b0b29ba2306362dea474046e0420f65c5 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 09:43:16 -0400 Subject: [PATCH 089/263] added debug --- .../PlotChangeListener.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/alisolarflare/creativeboundaries/PlotChangeListener.java b/src/alisolarflare/creativeboundaries/PlotChangeListener.java index c230356..7ce331a 100644 --- a/src/alisolarflare/creativeboundaries/PlotChangeListener.java +++ b/src/alisolarflare/creativeboundaries/PlotChangeListener.java @@ -24,14 +24,20 @@ public class PlotChangeListener implements Listener{ } @EventHandler public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ - if (dickmode == false) - return; - if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE) - return; - if (!(cbCreatives.contains(plotEvent.getPlayer()))) - return; - Player player = plotEvent.getPlayer(); + if (dickmode == false){ + debug(player, "dickies"); + return; + } + if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){ + debug(player, "cray cray"); + return; + } + if (!(cbCreatives.contains(plotEvent.getPlayer()))){ + debug(player, "racism"); + return; + } + Resident currentResident = new Resident(player.getName()); Town town; try { From 26be2979724b05a5ff7921f88d16f810f5d10261 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 09:50:03 -0400 Subject: [PATCH 090/263] Super duper minor change --- .../creativeboundaries/PlotChangeListener.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/alisolarflare/creativeboundaries/PlotChangeListener.java b/src/alisolarflare/creativeboundaries/PlotChangeListener.java index 7ce331a..5692cca 100644 --- a/src/alisolarflare/creativeboundaries/PlotChangeListener.java +++ b/src/alisolarflare/creativeboundaries/PlotChangeListener.java @@ -25,6 +25,7 @@ public class PlotChangeListener implements Listener{ @EventHandler public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ Player player = plotEvent.getPlayer(); + player.sendMessage("PING"); if (dickmode == false){ debug(player, "dickies"); return; @@ -37,18 +38,21 @@ public class PlotChangeListener implements Listener{ debug(player, "racism"); return; } - + player.sendMessage("PONG"); Resident currentResident = new Resident(player.getName()); Town town; try { + player.sendMessage("PYONG"); debug(player, "1"+plotEvent.toString()); debug(player, "2"+plotEvent.getTo().toString()); debug(player, "3"+plotEvent.getTo().getTownBlock().toString()); debug(player, "4"+Boolean.toString(plotEvent.getTo().getTownBlock().hasTown())); debug(player, "5"+plotEvent.getTo().getTownBlock().getTown().toString()); - if (plotEvent.getTo().getTownBlock().hasTown()) + player.sendMessage("-"); + if (plotEvent.getTo().getTownBlock().hasTown()){ + player.sendMessage("YANG"); town = plotEvent.getTo().getTownBlock().getTown(); - else{ + }else{ player.setGameMode(GameMode.SURVIVAL); return; } @@ -62,7 +66,7 @@ public class PlotChangeListener implements Listener{ player.setGameMode(GameMode.SURVIVAL); } private void debug(Player player, String string){ - if (player.getName() == "alisolarflare") + if (player.getName().equalsIgnoreCase("alisolarflare")) player.sendMessage(string); } } From b53bcc041c84ce1b021dee9b98bba3dcaf93de58 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 09:58:14 -0400 Subject: [PATCH 091/263] adjusted dickmode check --- src/alisolarflare/creativeboundaries/PlotChangeListener.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/alisolarflare/creativeboundaries/PlotChangeListener.java b/src/alisolarflare/creativeboundaries/PlotChangeListener.java index 5692cca..c354daf 100644 --- a/src/alisolarflare/creativeboundaries/PlotChangeListener.java +++ b/src/alisolarflare/creativeboundaries/PlotChangeListener.java @@ -14,19 +14,17 @@ import com.palmergames.bukkit.towny.object.Resident; import com.palmergames.bukkit.towny.object.Town; public class PlotChangeListener implements Listener{ - private boolean dickmode; private List cbCreatives = new ArrayList(); public CreativeBoundariesModule plugin; public PlotChangeListener(CreativeBoundariesModule plugin){ this.plugin = plugin; - this.dickmode = plugin.dickmode; this.cbCreatives = plugin.cbCreatives; } @EventHandler public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ Player player = plotEvent.getPlayer(); player.sendMessage("PING"); - if (dickmode == false){ + if (plugin.dickmode == false){ debug(player, "dickies"); return; } From 6b4a21d2ca9e49941ff065d17a4813ec84bf6200 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 10:20:02 -0400 Subject: [PATCH 092/263] Took code from cbgm1, moved it to plotChange --- .../PlotChangeListener.java | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/src/alisolarflare/creativeboundaries/PlotChangeListener.java b/src/alisolarflare/creativeboundaries/PlotChangeListener.java index c354daf..e0b7aa1 100644 --- a/src/alisolarflare/creativeboundaries/PlotChangeListener.java +++ b/src/alisolarflare/creativeboundaries/PlotChangeListener.java @@ -12,6 +12,8 @@ import com.palmergames.bukkit.towny.event.PlayerChangePlotEvent; import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; import com.palmergames.bukkit.towny.object.Resident; import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.towny.object.TownBlock; +import com.palmergames.bukkit.towny.object.TownyUniverse; public class PlotChangeListener implements Listener{ private List cbCreatives = new ArrayList(); @@ -37,31 +39,35 @@ public class PlotChangeListener implements Listener{ return; } player.sendMessage("PONG"); - Resident currentResident = new Resident(player.getName()); - Town town; - try { - player.sendMessage("PYONG"); - debug(player, "1"+plotEvent.toString()); - debug(player, "2"+plotEvent.getTo().toString()); - debug(player, "3"+plotEvent.getTo().getTownBlock().toString()); - debug(player, "4"+Boolean.toString(plotEvent.getTo().getTownBlock().hasTown())); - debug(player, "5"+plotEvent.getTo().getTownBlock().getTown().toString()); - player.sendMessage("-"); - if (plotEvent.getTo().getTownBlock().hasTown()){ - player.sendMessage("YANG"); - town = plotEvent.getTo().getTownBlock().getTown(); - }else{ - player.setGameMode(GameMode.SURVIVAL); - return; - } - } catch (NotRegisteredException e) { - e.printStackTrace(); - debug(player, "6"+e.toString()); + TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); + if (tb == null) { + player.sendMessage("You aren't standing in a town or some other error occured."); + player.sendMessage("TownBlock is null."); return; } - debug(player, "7"+currentResident.toString()); - if(!(town.hasResident(currentResident))) + Town town; + try { + town = tb.getTown(); + } catch (NotRegisteredException e) { + player.sendMessage("You aren't standing in a town or some other error occured."); + player.sendMessage("TownBlock's town is not registered."); + return; + } + if (town == null) { + player.sendMessage("ERROR: The town you're standing in is Null."); + return; + } + + boolean townHasRes = false; + for(Resident res : town.getResidents()){ + if (res.getName().toString().equals(player.getName().toString())){ + player.sendMessage("DINGDINGDING"); + townHasRes = true; + } + } + if (!townHasRes){ player.setGameMode(GameMode.SURVIVAL); + } } private void debug(Player player, String string){ if (player.getName().equalsIgnoreCase("alisolarflare")) From c8cda48209069c0aa299ece073cc2e99cceecd7f Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 10:32:52 -0400 Subject: [PATCH 093/263] Cleaned up Creative Boundaries for public use --- .../CreativeBoundariesModule.java | 2 +- .../PlotChangeListener.java | 47 ++++++++----------- .../creativeboundaries/commands/Cbgm0.java | 8 ++++ 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java b/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java index 6a36180..6de650f 100644 --- a/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java +++ b/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java @@ -18,7 +18,7 @@ public class CreativeBoundariesModule extends Module{ @Override public void register(JavaPlugin plugin) { registerCommand(plugin, new Cbgm1(this)); - registerCommand(plugin, new Cbgm0()); + registerCommand(plugin, new Cbgm0(this)); registerCommand(plugin, new SetDickmode(this)); diff --git a/src/alisolarflare/creativeboundaries/PlotChangeListener.java b/src/alisolarflare/creativeboundaries/PlotChangeListener.java index e0b7aa1..ddd69b4 100644 --- a/src/alisolarflare/creativeboundaries/PlotChangeListener.java +++ b/src/alisolarflare/creativeboundaries/PlotChangeListener.java @@ -1,8 +1,5 @@ package alisolarflare.creativeboundaries; -import java.util.ArrayList; -import java.util.List; - import org.bukkit.GameMode; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -16,61 +13,55 @@ import com.palmergames.bukkit.towny.object.TownBlock; import com.palmergames.bukkit.towny.object.TownyUniverse; public class PlotChangeListener implements Listener{ - private List cbCreatives = new ArrayList(); - public CreativeBoundariesModule plugin; - public PlotChangeListener(CreativeBoundariesModule plugin){ - this.plugin = plugin; - this.cbCreatives = plugin.cbCreatives; + public CreativeBoundariesModule module; + public PlotChangeListener(CreativeBoundariesModule module){ + this.module = module; } @EventHandler public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ Player player = plotEvent.getPlayer(); - player.sendMessage("PING"); - if (plugin.dickmode == false){ - debug(player, "dickies"); + if (module.dickmode == false){ return; } if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){ - debug(player, "cray cray"); return; } - if (!(cbCreatives.contains(plotEvent.getPlayer()))){ - debug(player, "racism"); + if (!(module.cbCreatives.contains(plotEvent.getPlayer()))){ return; } - player.sendMessage("PONG"); TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); if (tb == null) { - player.sendMessage("You aren't standing in a town or some other error occured."); - player.sendMessage("TownBlock is null."); + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!"); + module.cbCreatives.remove(player); return; } Town town; try { town = tb.getTown(); } catch (NotRegisteredException e) { - player.sendMessage("You aren't standing in a town or some other error occured."); - player.sendMessage("TownBlock's town is not registered."); - return; - } - if (town == null) { - player.sendMessage("ERROR: The town you're standing in is Null."); + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!!"); + module.cbCreatives.remove(player); return; } + if (town == null) { + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!!!"); + module.cbCreatives.remove(player); + return; + } boolean townHasRes = false; for(Resident res : town.getResidents()){ if (res.getName().toString().equals(player.getName().toString())){ - player.sendMessage("DINGDINGDING"); townHasRes = true; } } if (!townHasRes){ player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!!!!"); + module.cbCreatives.remove(player); } } - private void debug(Player player, String string){ - if (player.getName().equalsIgnoreCase("alisolarflare")) - player.sendMessage(string); - } } diff --git a/src/alisolarflare/creativeboundaries/commands/Cbgm0.java b/src/alisolarflare/creativeboundaries/commands/Cbgm0.java index 88ba03a..6e5fd2a 100644 --- a/src/alisolarflare/creativeboundaries/commands/Cbgm0.java +++ b/src/alisolarflare/creativeboundaries/commands/Cbgm0.java @@ -4,9 +4,16 @@ import org.bukkit.GameMode; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import alisolarflare.creativeboundaries.CreativeBoundariesModule; import buttondevteam.lib.chat.TBMCCommandBase; public class Cbgm0 extends TBMCCommandBase{ + + private CreativeBoundariesModule module; + + public Cbgm0(CreativeBoundariesModule module) { + this.module = module; + } @Override public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { @@ -17,6 +24,7 @@ public class Cbgm0 extends TBMCCommandBase{ Player player = (Player) sender; player.setGameMode(GameMode.SURVIVAL); + module.cbCreatives.remove(player); return false; } From 21fcc3fb65e5e3f321bfbee488c2ff1778803eca Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 13:45:38 -0400 Subject: [PATCH 094/263] Update README.md --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 23e0aaf..f811335 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,16 @@ # AliPresents -Something for IIe +A plugin that contains most of Ali's Projects + +Components: +- Flairdoors +- GhostiePowers +- AliLinks + +CreativeBoundaries + +Magic: +- BoomBow +- AliArrowTrails + +ButtonMinigames +Ultrahardcore From 64080eaf42e1b41e90e31fa049b3b649e4ed8335 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 13:46:13 -0400 Subject: [PATCH 095/263] Worked on the IDLE phase of UHC --- src/alisolarflare/uhc/UHCModule.java | 10 +- .../uhc/{commands => idle}/AddToUHC.java | 124 ++++++++-------- src/alisolarflare/uhc/idle/JoinUHC.java | 39 +++++ .../{commands => intro}/ConfigureMatch.java | 76 +++++----- .../{commands => intro}/ScheduleMatch.java | 76 +++++----- .../uhc/{commands => intro}/StartMatch.java | 140 +++++++++--------- 6 files changed, 253 insertions(+), 212 deletions(-) rename src/alisolarflare/uhc/{commands => idle}/AddToUHC.java (82%) create mode 100644 src/alisolarflare/uhc/idle/JoinUHC.java rename src/alisolarflare/uhc/{commands => intro}/ConfigureMatch.java (90%) rename src/alisolarflare/uhc/{commands => intro}/ScheduleMatch.java (90%) rename src/alisolarflare/uhc/{commands => intro}/StartMatch.java (93%) diff --git a/src/alisolarflare/uhc/UHCModule.java b/src/alisolarflare/uhc/UHCModule.java index 3ddfd0a..a27aa14 100644 --- a/src/alisolarflare/uhc/UHCModule.java +++ b/src/alisolarflare/uhc/UHCModule.java @@ -3,10 +3,11 @@ package alisolarflare.uhc; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; -import alisolarflare.uhc.commands.AddToUHC; -import alisolarflare.uhc.commands.ConfigureMatch; -import alisolarflare.uhc.commands.ScheduleMatch; -import alisolarflare.uhc.commands.StartMatch; +import alisolarflare.uhc.idle.AddToUHC; +import alisolarflare.uhc.idle.JoinUHC; +import alisolarflare.uhc.intro.ConfigureMatch; +import alisolarflare.uhc.intro.ScheduleMatch; +import alisolarflare.uhc.intro.StartMatch; import alisolarflare.uhc.memory.MatchState; import alisolarflare.uhc.memory.UHCMatch; @@ -23,6 +24,7 @@ public class UHCModule extends Module { } registerCommand(plugin, new AddToUHC(match)); + registerCommand(plugin, new JoinUHC(match)); registerCommand(plugin, new StartMatch(match)); registerCommand(plugin, new ConfigureMatch(match)); registerCommand(plugin, new ScheduleMatch(match)); diff --git a/src/alisolarflare/uhc/commands/AddToUHC.java b/src/alisolarflare/uhc/idle/AddToUHC.java similarity index 82% rename from src/alisolarflare/uhc/commands/AddToUHC.java rename to src/alisolarflare/uhc/idle/AddToUHC.java index ab31de7..0f92cb3 100644 --- a/src/alisolarflare/uhc/commands/AddToUHC.java +++ b/src/alisolarflare/uhc/idle/AddToUHC.java @@ -1,62 +1,62 @@ -package alisolarflare.uhc.commands; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.uhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCCommandBase; - -/** - * This class handles the specific command /addToUHC which, in-game, adds a player to a specific UltraHardcore match, that is defined by the constructor: {@linkplain #AddToUHC(UHCMatch)} - * - * @author Alisolarflare - */ -public class AddToUHC extends TBMCCommandBase { - private UHCMatch match; - - public AddToUHC(UHCMatch match) { - this.match = match; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - // INPUT SANITATION - Player player = (Player) sender; - if (player.getName() != "alisolarflare") { - sender.sendMessage("You must be Ali to use this command, send her a message to change the permissions"); - return false; - } - if (args.length <= 1) { - sender.sendMessage("You must supply at least one playername"); - } - - // Adds players to memory - for (int i = 0; i > args.length; i++) { - match.playerList.add(player.getName()); - } - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "addtouhc"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.uhc.idle; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.uhc.memory.UHCMatch; +import buttondevteam.lib.chat.TBMCCommandBase; + +/** + * This class handles the specific command /addToUHC which, in-game, adds a player to a specific UltraHardcore match, that is defined by the constructor: {@linkplain #AddToUHC(UHCMatch)} + * + * @author Alisolarflare + */ +public class AddToUHC extends TBMCCommandBase { + private UHCMatch match; + + public AddToUHC(UHCMatch match) { + this.match = match; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + // INPUT SANITATION + Player player = (Player) sender; + if (!player.getName().equalsIgnoreCase("alisolarflare") && !player.getName().equalsIgnoreCase("Arsen_Derby_FTW")) { + sender.sendMessage("You must be Ali to add someone else to a UHC, send her a message to change the permissions"); + return false; + } + if (args.length <= 1) { + sender.sendMessage("You must supply at least one playername"); + } + + // Adds players to memory + for (int i = 0; i > args.length; i++) { + match.playerList.add(player.getName()); + } + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "addtouhc"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/uhc/idle/JoinUHC.java b/src/alisolarflare/uhc/idle/JoinUHC.java new file mode 100644 index 0000000..190b285 --- /dev/null +++ b/src/alisolarflare/uhc/idle/JoinUHC.java @@ -0,0 +1,39 @@ +package alisolarflare.uhc.idle; + +import org.bukkit.command.CommandSender; + +import alisolarflare.uhc.memory.UHCMatch; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class JoinUHC extends TBMCCommandBase{ + + private UHCMatch match; + + public JoinUHC(UHCMatch match) { + this.match = match; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + return false; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/uhc/commands/ConfigureMatch.java b/src/alisolarflare/uhc/intro/ConfigureMatch.java similarity index 90% rename from src/alisolarflare/uhc/commands/ConfigureMatch.java rename to src/alisolarflare/uhc/intro/ConfigureMatch.java index c696b87..6f383bb 100644 --- a/src/alisolarflare/uhc/commands/ConfigureMatch.java +++ b/src/alisolarflare/uhc/intro/ConfigureMatch.java @@ -1,38 +1,38 @@ -package alisolarflare.uhc.commands; - -import org.bukkit.command.CommandSender; - -import alisolarflare.uhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class ConfigureMatch extends TBMCCommandBase{ - - public ConfigureMatch(UHCMatch match) { - // TODO Auto-generated constructor stub - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.uhc.intro; + +import org.bukkit.command.CommandSender; + +import alisolarflare.uhc.memory.UHCMatch; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class ConfigureMatch extends TBMCCommandBase{ + + public ConfigureMatch(UHCMatch match) { + // TODO Auto-generated constructor stub + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/uhc/commands/ScheduleMatch.java b/src/alisolarflare/uhc/intro/ScheduleMatch.java similarity index 90% rename from src/alisolarflare/uhc/commands/ScheduleMatch.java rename to src/alisolarflare/uhc/intro/ScheduleMatch.java index 455c2fb..6e292c2 100644 --- a/src/alisolarflare/uhc/commands/ScheduleMatch.java +++ b/src/alisolarflare/uhc/intro/ScheduleMatch.java @@ -1,38 +1,38 @@ -package alisolarflare.uhc.commands; - -import org.bukkit.command.CommandSender; - -import alisolarflare.uhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class ScheduleMatch extends TBMCCommandBase{ - - public ScheduleMatch(UHCMatch match) { - // TODO Auto-generated constructor stub - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.uhc.intro; + +import org.bukkit.command.CommandSender; + +import alisolarflare.uhc.memory.UHCMatch; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class ScheduleMatch extends TBMCCommandBase{ + + public ScheduleMatch(UHCMatch match) { + // TODO Auto-generated constructor stub + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/uhc/commands/StartMatch.java b/src/alisolarflare/uhc/intro/StartMatch.java similarity index 93% rename from src/alisolarflare/uhc/commands/StartMatch.java rename to src/alisolarflare/uhc/intro/StartMatch.java index 753edda..0b96652 100644 --- a/src/alisolarflare/uhc/commands/StartMatch.java +++ b/src/alisolarflare/uhc/intro/StartMatch.java @@ -1,70 +1,70 @@ -package alisolarflare.uhc.commands; - -import org.bukkit.command.CommandSender; - -import alisolarflare.uhc.memory.MatchState; -import alisolarflare.uhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class StartMatch extends TBMCCommandBase { - private UHCMatch match; - - public StartMatch(UHCMatch match) { - this.match = match; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - - if (!sender.hasPermission("moderator") && !(sender.getName() == "")) - sender.sendMessage("You must be a moderator or Arsenalis to use this command! " - + "Contact a TBMC dev if you think this is wrong"); - - //ACTIVATES MATCH - switch(match.getMatchState()){ - case IDLE: - sender.sendMessage("There is currently a match ready... Activating..."); - match.setMatchState(MatchState.INTRO); - break; - - case WAITING: - sender.sendMessage("There currently a match planned for: TIME:TIME:TIME"); - break; - - case END: - sender.sendMessage("The match has ended! Would you like to restart using current settings?"); - break; - - default: - sender.sendMessage("You cannot start a match now, one is already in progress!"); - - - } - - return false; - - - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "startmatch"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } -} +package alisolarflare.uhc.intro; + +import org.bukkit.command.CommandSender; + +import alisolarflare.uhc.memory.MatchState; +import alisolarflare.uhc.memory.UHCMatch; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class StartMatch extends TBMCCommandBase { + private UHCMatch match; + + public StartMatch(UHCMatch match) { + this.match = match; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + + if (!sender.hasPermission("moderator") && !(sender.getName() == "")) + sender.sendMessage("You must be a moderator or Arsenalis to use this command! " + + "Contact a TBMC dev if you think this is wrong"); + + //ACTIVATES MATCH + switch(match.getMatchState()){ + case IDLE: + sender.sendMessage("There is currently a match ready... Activating..."); + match.setMatchState(MatchState.INTRO); + break; + + case WAITING: + sender.sendMessage("There currently a match planned for: TIME:TIME:TIME"); + break; + + case END: + sender.sendMessage("The match has ended! Would you like to restart using current settings?"); + break; + + default: + sender.sendMessage("You cannot start a match now, one is already in progress!"); + + + } + + return false; + + + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "startmatch"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } +} From a4ce25924930c6be5d4e677a1a758be4b880200e Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 13:58:13 -0400 Subject: [PATCH 096/263] Changed up Boom Bow detection --- src/alisolarflare/magic/tricks/BoomBowDeathListener.java | 8 ++++---- src/alisolarflare/magic/tricks/BoomBowListener.java | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/alisolarflare/magic/tricks/BoomBowDeathListener.java b/src/alisolarflare/magic/tricks/BoomBowDeathListener.java index b742f16..c436a97 100644 --- a/src/alisolarflare/magic/tricks/BoomBowDeathListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowDeathListener.java @@ -9,12 +9,12 @@ public class BoomBowDeathListener implements Listener{ @EventHandler public void onBoomBowDeath(PlayerDeathEvent event){ Player player = event.getEntity(); - if (player.getLastDamage() == 7.000042) + if (player.getLastDamage() == 7.000042){ player.sendMessage("42!"); event.setDeathMessage(player.getName() + "got trigger happy with the Boom Bow"); - if (player.getLastDamage() < 7.000041 || player.getLastDamage() > 7.000043) + } + if (player.getLastDamage() < 7.000041 || player.getLastDamage() > 7.000043){ player.sendMessage("meaning of lyyyyyyfffe"); - player.sendMessage(player.getCustomName() + player.getDisplayName() + player.getPlayerListName() + player.getName()); - + } } } diff --git a/src/alisolarflare/magic/tricks/BoomBowListener.java b/src/alisolarflare/magic/tricks/BoomBowListener.java index 130cf88..a2560c6 100644 --- a/src/alisolarflare/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowListener.java @@ -96,6 +96,7 @@ public class BoomBowListener implements Listener { player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); player.damage(7.000042, player); + player.sendMessage(player.getLastDamage() + ""); boomBow.setDurability((short) (boomBow.getDurability() + 3)); if(boomBow.getDurability() < 0){ player.getInventory().setItemInMainHand(null); From c493df42c2f2e2a25b7ac2b364c3357f087b7d1d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 14:05:31 -0400 Subject: [PATCH 097/263] The fix --- src/alisolarflare/magic/tricks/BoomBowDeathListener.java | 6 ++---- src/alisolarflare/magic/tricks/BoomBowListener.java | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/alisolarflare/magic/tricks/BoomBowDeathListener.java b/src/alisolarflare/magic/tricks/BoomBowDeathListener.java index c436a97..4380414 100644 --- a/src/alisolarflare/magic/tricks/BoomBowDeathListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowDeathListener.java @@ -9,12 +9,10 @@ public class BoomBowDeathListener implements Listener{ @EventHandler public void onBoomBowDeath(PlayerDeathEvent event){ Player player = event.getEntity(); - if (player.getLastDamage() == 7.000042){ + + if (player.getLastDamage() > 7.42420 && player.getLastDamage() < 7.42429){ player.sendMessage("42!"); event.setDeathMessage(player.getName() + "got trigger happy with the Boom Bow"); } - if (player.getLastDamage() < 7.000041 || player.getLastDamage() > 7.000043){ - player.sendMessage("meaning of lyyyyyyfffe"); - } } } diff --git a/src/alisolarflare/magic/tricks/BoomBowListener.java b/src/alisolarflare/magic/tricks/BoomBowListener.java index a2560c6..5e74bd8 100644 --- a/src/alisolarflare/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowListener.java @@ -95,7 +95,7 @@ public class BoomBowListener implements Listener { //CREATE - Explosion + damage player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); - player.damage(7.000042, player); + player.damage(7.42425, player); player.sendMessage(player.getLastDamage() + ""); boomBow.setDurability((short) (boomBow.getDurability() + 3)); if(boomBow.getDurability() < 0){ From 6cc48f2a5bba96d103a980146e314659647ab512 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 14:28:09 -0400 Subject: [PATCH 098/263] Added joinuhc to plugin.yml --- plugin.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin.yml b/plugin.yml index 067b94c..bc68779 100644 --- a/plugin.yml +++ b/plugin.yml @@ -31,6 +31,8 @@ commands: description: sets the spawn points for each colour in a button minigame addtouhc: description: Adds a player to the UltraHardcore match + joinuhc: + description: This command allows you to join an UltraHardcore match configurematch: description: Configures an UltraHardcore match schedulematch: From a68d39a784de99e13b0ee90fdff24c0a71b284b8 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 14:28:23 -0400 Subject: [PATCH 099/263] Started coding up IDLE commands --- src/alisolarflare/uhc/idle/AddToUHC.java | 135 ++++++++++++----------- src/alisolarflare/uhc/idle/JoinUHC.java | 106 +++++++++++------- 2 files changed, 140 insertions(+), 101 deletions(-) diff --git a/src/alisolarflare/uhc/idle/AddToUHC.java b/src/alisolarflare/uhc/idle/AddToUHC.java index 0f92cb3..0af6b88 100644 --- a/src/alisolarflare/uhc/idle/AddToUHC.java +++ b/src/alisolarflare/uhc/idle/AddToUHC.java @@ -1,62 +1,73 @@ -package alisolarflare.uhc.idle; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.uhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCCommandBase; - -/** - * This class handles the specific command /addToUHC which, in-game, adds a player to a specific UltraHardcore match, that is defined by the constructor: {@linkplain #AddToUHC(UHCMatch)} - * - * @author Alisolarflare - */ -public class AddToUHC extends TBMCCommandBase { - private UHCMatch match; - - public AddToUHC(UHCMatch match) { - this.match = match; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - // INPUT SANITATION - Player player = (Player) sender; - if (!player.getName().equalsIgnoreCase("alisolarflare") && !player.getName().equalsIgnoreCase("Arsen_Derby_FTW")) { - sender.sendMessage("You must be Ali to add someone else to a UHC, send her a message to change the permissions"); - return false; - } - if (args.length <= 1) { - sender.sendMessage("You must supply at least one playername"); - } - - // Adds players to memory - for (int i = 0; i > args.length; i++) { - match.playerList.add(player.getName()); - } - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "addtouhc"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.uhc.idle; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.uhc.memory.UHCMatch; +import buttondevteam.lib.chat.TBMCCommandBase; + +/** + * This class handles the specific command /addToUHC which, in-game, adds a player to a specific UltraHardcore match, that is defined by the constructor: {@linkplain #AddToUHC(UHCMatch)} + * + * @author Alisolarflare + */ +public class AddToUHC extends TBMCCommandBase { + private UHCMatch match; + + public AddToUHC(UHCMatch match) { + this.match = match; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + // INPUT SANITATION + Player player = (Player) sender; + if (!player.getName().equalsIgnoreCase("alisolarflare") && !player.getName().equalsIgnoreCase("Arsen_Derby_FTW")) { + sender.sendMessage("You must be Ali to add someone else to a UHC, send her a message to change the permissions"); + return false; + } + if (args.length <= 1) { + sender.sendMessage("You must supply at least one playername"); + } + + switch(match.getMatchState()){ + case IDLE: + case WAITING: + case SETUP: + case INTRO: + case PEACE: + case TENSION: + case POWER: + case END: + } + + // Adds players to memory + for (int i = 0; i > args.length; i++) { + match.playerList.add(player.getName()); + } + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "addtouhc"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/uhc/idle/JoinUHC.java b/src/alisolarflare/uhc/idle/JoinUHC.java index 190b285..5ebcb69 100644 --- a/src/alisolarflare/uhc/idle/JoinUHC.java +++ b/src/alisolarflare/uhc/idle/JoinUHC.java @@ -1,39 +1,67 @@ -package alisolarflare.uhc.idle; - -import org.bukkit.command.CommandSender; - -import alisolarflare.uhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class JoinUHC extends TBMCCommandBase{ - - private UHCMatch match; - - public JoinUHC(UHCMatch match) { - this.match = match; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - return false; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.uhc.idle; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.uhc.memory.UHCMatch; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class JoinUHC extends TBMCCommandBase{ + + private UHCMatch match; + + public JoinUHC(UHCMatch match) { + this.match = match; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + if (!(sender instanceof Player)) + return false; + Player player = (Player) sender; + player.sendMessage("Adding you to the UltraHardcore match!"); + switch(match.getMatchState()){ + + //Before the game + case IDLE: + case WAITING: + case SETUP: + case INTRO: + player.sendMessage("Adding you to the UltraHardcore match!"); + match.playerList.add(player.getName()); + break; + + //During the game + case PEACE: + case TENSION: + case POWER: + player.sendMessage("There is currently an UltraHardcore match going on! #POINTTOSPECTATORMODE, tell Ali asap if you see this"); + + //After the game + case END: + player.sendMessage("There is currently an ending ceremony going on! #POINTTOCEREMONY, tell Ali ASAP if you see this"); + + } + + return false; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} From 64f5fb90166a1c5b9f756be9b21baf7f538ff7ba Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 5 Nov 2016 15:42:41 -0400 Subject: [PATCH 100/263] Added ome stuff to Intro --- src/alisolarflare/AliPresents.java | 2 +- src/alisolarflare/uhc/idle/AddToUHC.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 14da8b4..b86142c 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -21,7 +21,7 @@ public class AliPresents extends JavaPlugin{ Logger logger = getLogger(); logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); - + new FlairDoorModule().register(this); new GPowerModule().register(this); new AliLinkModule().register(this); diff --git a/src/alisolarflare/uhc/idle/AddToUHC.java b/src/alisolarflare/uhc/idle/AddToUHC.java index 0af6b88..f4e2dad 100644 --- a/src/alisolarflare/uhc/idle/AddToUHC.java +++ b/src/alisolarflare/uhc/idle/AddToUHC.java @@ -35,16 +35,20 @@ public class AddToUHC extends TBMCCommandBase { case WAITING: case SETUP: case INTRO: + // Adds players to memory + sender.sendMessage("Adding Players to matchList!"); + for (int i = 0; i > args.length; i++) { + match.playerList.add(args[i]); + }sender.sendMessage("Finished!"); case PEACE: case TENSION: case POWER: case END: + sender.sendMessage("There is already a match going on!"); } - // Adds players to memory - for (int i = 0; i > args.length; i++) { - match.playerList.add(player.getName()); - } + + return false; } From 45b88354e59daa5377919e0f1d227f42ca8efaee Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 6 Nov 2016 16:44:56 -0500 Subject: [PATCH 101/263] Pretty much the command equivalent to hard coding --- src/alisolarflare/AliPresents.java | 3 +- src/alisolarflare/Module.java | 26 ++++--- .../CreativeBoundariesModule.java | 4 +- .../listeners/ItemRestrictionListener.java | 26 +++++++ .../{ => listeners}/PlotChangeListener.java | 4 +- .../magic/tricks/BoomBowDeathListener.java | 2 +- src/alisolarflare/uhc/UHCModule.java | 3 + .../uhc/controller/SetMatchState.java | 76 +++++++++++++++++++ 8 files changed, 128 insertions(+), 16 deletions(-) create mode 100644 src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java rename src/alisolarflare/creativeboundaries/{ => listeners}/PlotChangeListener.java (91%) create mode 100644 src/alisolarflare/uhc/controller/SetMatchState.java diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index b86142c..947c41b 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -18,10 +18,10 @@ public class AliPresents extends JavaPlugin{ public void onEnable(){ PluginDescriptionFile pdfFile = getDescription(); - Logger logger = getLogger(); logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); + new FlairDoorModule().register(this); new GPowerModule().register(this); new AliLinkModule().register(this); @@ -30,6 +30,7 @@ public class AliPresents extends JavaPlugin{ new MinigameModule().register(this); new CreativeBoundariesModule().register(this); + logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); diff --git a/src/alisolarflare/Module.java b/src/alisolarflare/Module.java index ad674d1..3fe900b 100644 --- a/src/alisolarflare/Module.java +++ b/src/alisolarflare/Module.java @@ -8,10 +8,10 @@ import buttondevteam.lib.chat.TBMCChatAPI; import buttondevteam.lib.chat.TBMCCommandBase; /** - * A Module class is a helper class that allows the compacting of projects into one single package. - * Each feature, whether game, arrow trail listener, or command tool, can have its command and listener - * registration coded into the Module class, as well as any other pointers to memory units, or other - * classes in the package. + * A Module class allows the compacting of projects into one single package. + * + * Each feature can have its commands and listeners coded into the Module class, + * as well as any other pointers to memory units, or other classes in the package. * * This package can then be moved from eclipse project to eclipse project smoothly, * as long as the destination project has the Module abstract class, and as long as all dependencies are either @@ -21,19 +21,14 @@ import buttondevteam.lib.chat.TBMCCommandBase; */ public abstract class Module{ /** - * Registers the project, when called by the Main JavaPlugin class that handles - * the main plugin. + * Registers the module, when called by the JavaPlugin class. Call + * registerCommand() and registerListener() within this method. * - * To register a command, call plugin.getCommand(//label).setExecutor(//commandExecutor); where - * label is a string containing the name of the command in plugin.yml, and where commandExecutor - * is a class implementing command executor - * - * To register a listener, * @param plugin Plugin class called to register commands and listeners */ public abstract void register(JavaPlugin plugin); /** - * Lazy route to type plugin.getCommand("label").setExecutor + * Registers a TBMCCommand to the plugin * @param plugin Main plugin responsible for stuff * @param label Name of the command in plugin.yml * @param commandExecutor Custom coded CommandExecutor class @@ -41,8 +36,15 @@ public abstract class Module{ protected void registerCommand(JavaPlugin plugin, TBMCCommandBase commandBase){ TBMCChatAPI.AddCommand(plugin, commandBase); } + /** + * Registers a Listener to this plugin + * @param plugin Main plugin responsible for stuff + * @param label Name of the command in plugin.yml + * @param commandExecutor Custom coded CommandExecutor class + */ protected Listener registerListener(JavaPlugin plugin, Listener listener){ TBMCCoreAPI.RegisterEventsForExceptions(listener, plugin); return listener; } + } diff --git a/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java b/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java index 6de650f..39dac19 100644 --- a/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java +++ b/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java @@ -10,6 +10,8 @@ import alisolarflare.Module; import alisolarflare.creativeboundaries.commands.Cbgm0; import alisolarflare.creativeboundaries.commands.Cbgm1; import alisolarflare.creativeboundaries.commands.SetDickmode; +import alisolarflare.creativeboundaries.listeners.ItemRestrictionListener; +import alisolarflare.creativeboundaries.listeners.PlotChangeListener; public class CreativeBoundariesModule extends Module{ @@ -21,8 +23,8 @@ public class CreativeBoundariesModule extends Module{ registerCommand(plugin, new Cbgm0(this)); registerCommand(plugin, new SetDickmode(this)); - registerListener(plugin, new PlotChangeListener(this)); + //registerListener(plugin, new ItemRestrictionListener(this)); } } diff --git a/src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java b/src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java new file mode 100644 index 0000000..9023755 --- /dev/null +++ b/src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java @@ -0,0 +1,26 @@ +package alisolarflare.creativeboundaries.listeners; + +import java.util.List; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.InventoryCreativeEvent; + +import alisolarflare.creativeboundaries.CreativeBoundariesModule; + +public class ItemRestrictionListener implements Listener { + + private CreativeBoundariesModule module; + + public ItemRestrictionListener(CreativeBoundariesModule module) { + this.module = module; + } + + @EventHandler + public void onItemTake(InventoryCreativeEvent event){ + List cbCreatives = module.cbCreatives; + + } + +} diff --git a/src/alisolarflare/creativeboundaries/PlotChangeListener.java b/src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java similarity index 91% rename from src/alisolarflare/creativeboundaries/PlotChangeListener.java rename to src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java index ddd69b4..e911b98 100644 --- a/src/alisolarflare/creativeboundaries/PlotChangeListener.java +++ b/src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java @@ -1,4 +1,4 @@ -package alisolarflare.creativeboundaries; +package alisolarflare.creativeboundaries.listeners; import org.bukkit.GameMode; import org.bukkit.entity.Player; @@ -12,6 +12,8 @@ import com.palmergames.bukkit.towny.object.Town; import com.palmergames.bukkit.towny.object.TownBlock; import com.palmergames.bukkit.towny.object.TownyUniverse; +import alisolarflare.creativeboundaries.CreativeBoundariesModule; + public class PlotChangeListener implements Listener{ public CreativeBoundariesModule module; public PlotChangeListener(CreativeBoundariesModule module){ diff --git a/src/alisolarflare/magic/tricks/BoomBowDeathListener.java b/src/alisolarflare/magic/tricks/BoomBowDeathListener.java index 4380414..427537e 100644 --- a/src/alisolarflare/magic/tricks/BoomBowDeathListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowDeathListener.java @@ -12,7 +12,7 @@ public class BoomBowDeathListener implements Listener{ if (player.getLastDamage() > 7.42420 && player.getLastDamage() < 7.42429){ player.sendMessage("42!"); - event.setDeathMessage(player.getName() + "got trigger happy with the Boom Bow"); + event.setDeathMessage(player.getName() + " got trigger happy with the [Boom Bow]"); } } } diff --git a/src/alisolarflare/uhc/UHCModule.java b/src/alisolarflare/uhc/UHCModule.java index a27aa14..eebbb43 100644 --- a/src/alisolarflare/uhc/UHCModule.java +++ b/src/alisolarflare/uhc/UHCModule.java @@ -3,6 +3,7 @@ package alisolarflare.uhc; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; +import alisolarflare.uhc.controller.SetMatchState; import alisolarflare.uhc.idle.AddToUHC; import alisolarflare.uhc.idle.JoinUHC; import alisolarflare.uhc.intro.ConfigureMatch; @@ -23,6 +24,8 @@ public class UHCModule extends Module { match = new UHCMatch(plugin.getConfig(), MatchState.IDLE); } + + registerCommand(plugin, new SetMatchState(match)); registerCommand(plugin, new AddToUHC(match)); registerCommand(plugin, new JoinUHC(match)); registerCommand(plugin, new StartMatch(match)); diff --git a/src/alisolarflare/uhc/controller/SetMatchState.java b/src/alisolarflare/uhc/controller/SetMatchState.java new file mode 100644 index 0000000..f646b50 --- /dev/null +++ b/src/alisolarflare/uhc/controller/SetMatchState.java @@ -0,0 +1,76 @@ +package alisolarflare.uhc.controller; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.uhc.memory.MatchState; +import alisolarflare.uhc.memory.UHCMatch; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class SetMatchState extends TBMCCommandBase{ + + UHCMatch match; + public SetMatchState(UHCMatch match) { + this.match = match; + } + + @Override + public String[] GetHelpText(String alias) { + return null; + } + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + return false; + } + + Player player = (Player) sender; + + if (player.getName().equalsIgnoreCase("alisolarflare") && player.getName().equalsIgnoreCase("Arsen_Derby_FTW")){ + sender.sendMessage("You must be either Ali or Arsen to use this command!"); + return false; + } + + + if(args.length < 1 ){ + player.sendMessage("Usage: /setMatchState [stateToBeSet]"); + player.sendMessage("States: IDLE, WAITING, SETUP, INTRO, PEACE, POWER, TENSION, END"); + return false; + } + + String inputState = args[0]; + boolean inputIsValidState = false; + for (MatchState defaultMatchState : MatchState.values()){ + if(inputState.equalsIgnoreCase(defaultMatchState.toString())){ + inputIsValidState = true; + } + } + + if (inputIsValidState){ + match.setMatchState(MatchState.valueOf(inputState)); + player.sendMessage("Match State set to: " + match.getMatchState().toString() + "!"); + }else{ + player.sendMessage("Error, could not parse state."); + player.sendMessage("Valid States: IDLE, WAITING, SETUP, INTRO, PEACE, POWER, TENSION, END"); + return false; + } + + + return false; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} From bbacdc3529485d4e1db7ba765b03ca0072aa9b33 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 6 Nov 2016 17:12:24 -0500 Subject: [PATCH 102/263] Tried to fix up powerup --- plugin.yml | 2 ++ .../components/flairdoor/FlairDoorModule.java | 1 - .../flairdoor/commands/FlairMe.java | 3 +- .../flairdoor/listeners/PortalListener.java | 29 +++++++------------ .../components/gpowers/GPowerMemory.java | 5 ++++ .../components/gpowers/commands/PowerUp.java | 1 + .../uhc/intro/IntroductionCutscene.java | 5 ++++ src/alisolarflare/uhc/memory/UHCMatch.java | 4 +++ 8 files changed, 29 insertions(+), 21 deletions(-) create mode 100644 src/alisolarflare/uhc/intro/IntroductionCutscene.java diff --git a/plugin.yml b/plugin.yml index bc68779..2bf7be2 100644 --- a/plugin.yml +++ b/plugin.yml @@ -29,6 +29,8 @@ commands: description: List all fighters currently in a button minigame setcolourspawn: description: sets the spawn points for each colour in a button minigame + setmatchstate: + description: sets the current state of the ultrahardcore game. addtouhc: description: Adds a player to the UltraHardcore match joinuhc: diff --git a/src/alisolarflare/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/components/flairdoor/FlairDoorModule.java index c7e266a..1c5cddb 100644 --- a/src/alisolarflare/components/flairdoor/FlairDoorModule.java +++ b/src/alisolarflare/components/flairdoor/FlairDoorModule.java @@ -10,7 +10,6 @@ public class FlairDoorModule extends Module { @Override public void register(JavaPlugin plugin) { registerCommand(plugin, new FlairMe()); - registerListener(plugin, new PortalListener(plugin)); } } diff --git a/src/alisolarflare/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java index 548fe9a..963da82 100644 --- a/src/alisolarflare/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -9,9 +9,8 @@ public class FlairMe extends TBMCCommandBase { @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { - sender.sendMessage("Flairing..." + sender.getName()); PortalListener.playersToBeFlaired.add(sender.getName()); - sender.sendMessage("Finished Preparation! Walk through a portal to get your flair"); + sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); return false; } diff --git a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java index 82d186d..4ce684a 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -57,19 +57,15 @@ public class PortalListener implements Listener{ //RECOLOUR PLAYER if(HigherBlock.getType() == Material.STONE){ - player.sendMessage("STONE DETECTED"); recolourPlayer(player, DyeColor.GRAY); //TOP BLOCK IS WOOL? }else if(HigherBlock.getType() == Material.WOOL){ - player.sendMessage("WOOL DETECTED T"); Wool wool = (Wool) HigherBlock.getState().getData(); recolourPlayer(player, wool.getColor()); //MIDDLE BLOCK IS WOOL? }else if(MiddleBlock.getType() == Material.WOOL){ - - player.sendMessage("WOOL DETECTED M"); MaterialData mData = MiddleBlock.getState().getData(); Wool wool = (Wool) mData; @@ -77,7 +73,6 @@ public class PortalListener implements Listener{ //BOTTOM BLOCK IS WOOL? }else if (BottomBlock.getType() == Material.WOOL){ - player.sendMessage("WOOL DETECTED B"); Wool wool = (Wool) BottomBlock.getState().getData(); recolourPlayer(player, wool.getColor()); } @@ -86,60 +81,58 @@ public class PortalListener implements Listener{ public void recolourPlayer(Player player, DyeColor dyecolour){ User user = essentials.getUser(player); - player.sendMessage("Recolouring Player as..." + dyecolour.toString()); String name = user._getNickname(); - player.sendMessage("name:" + name); String tempName = ""; for(int i = 0; i < name.length(); i++){ - player.sendMessage("|"+name.charAt(i)+"|"); if (name.charAt(i) != '§'){ - tempName += name.charAt(i); }else{ i++; } } name = tempName; - player.sendMessage("Adjusted Name: " + name); switch(dyecolour){ case GRAY: - player.sendMessage("Adding GRAY"); + player.sendMessage("Adding §7GRAY!§f"); name = "§7" + name; break; case RED: - player.sendMessage("Adding RED"); + player.sendMessage("Adding §4RED!§f"); name = "§4" + name; break; case ORANGE: - player.sendMessage("Adding ORANGE"); + player.sendMessage("Adding §6ORANGE!§f"); name = "§6" + name; break; case YELLOW: - player.sendMessage("Adding YELLOW"); + player.sendMessage("Adding §eYELLOW!§f"); name = "§e" + name; break; case LIME: case GREEN: - player.sendMessage("Adding GREEN"); + player.sendMessage("Adding §aGREEN!§f"); name = "§a" + name; break; case CYAN: case LIGHT_BLUE: case BLUE: - player.sendMessage("Adding BLUE"); + player.sendMessage("Adding §9BLUE!§f"); name = "§9" + name; break; case PURPLE: - player.sendMessage("Adding PURPLE"); + player.sendMessage("Adding §5PURPLE!§f"); name = "§5" + name; break; + case WHITE: + player.sendMessage("Adding §fWHITE!§f"); + name = "§f" + name; default: player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); break; } user.setNickname(name); - player.sendMessage("Your name is now: " + user.getNickname() +"! Removing you from playersToBeFlaired..."); + player.sendMessage("Your name is now: " + user.getNickname() +"!"); playersToBeFlaired.remove(player.getName()); } } diff --git a/src/alisolarflare/components/gpowers/GPowerMemory.java b/src/alisolarflare/components/gpowers/GPowerMemory.java index 0dda7b9..44e0089 100644 --- a/src/alisolarflare/components/gpowers/GPowerMemory.java +++ b/src/alisolarflare/components/gpowers/GPowerMemory.java @@ -13,17 +13,22 @@ public class GPowerMemory{ poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); } public void PowerUpPlayer(Player player){ + player.sendMessage("Powering up!"); if(poweredPlayerList.containsKey(player.getUniqueId())){ poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; + player.sendMessage("Powered up!"); }else{ player.sendMessage("You must instantiate your power settings using /GPower"); } } public void PowerDownPlayer(Player player){ + player.sendMessage("Powering down!"); if (poweredPlayerList.containsKey(player.getUniqueId())){ + player.sendMessage("Powered down!"); poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; }else{ + player.sendMessage("P down!"); return; } diff --git a/src/alisolarflare/components/gpowers/commands/PowerUp.java b/src/alisolarflare/components/gpowers/commands/PowerUp.java index 2e50db8..84670f3 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/components/gpowers/commands/PowerUp.java @@ -18,6 +18,7 @@ public class PowerUp extends TBMCCommandBase { public boolean OnCommand(CommandSender sender, String label, String[] args) { if (!(sender instanceof Player)) sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong"); + Player player = (Player) sender; gPowerMemory.PowerUpPlayer(player); return false; diff --git a/src/alisolarflare/uhc/intro/IntroductionCutscene.java b/src/alisolarflare/uhc/intro/IntroductionCutscene.java new file mode 100644 index 0000000..6ff7ce5 --- /dev/null +++ b/src/alisolarflare/uhc/intro/IntroductionCutscene.java @@ -0,0 +1,5 @@ +package alisolarflare.uhc.intro; + +public class IntroductionCutscene { + //TODO: Teleport all players to the area. +} diff --git a/src/alisolarflare/uhc/memory/UHCMatch.java b/src/alisolarflare/uhc/memory/UHCMatch.java index 42b0484..4c4049a 100644 --- a/src/alisolarflare/uhc/memory/UHCMatch.java +++ b/src/alisolarflare/uhc/memory/UHCMatch.java @@ -23,6 +23,10 @@ public class UHCMatch { public void setMatchState(MatchState newMS){ matchState = newMS; fileConfiguration.set("UHCMatchState", newMS.toString()); + switch(newMS){ + default: + break; + } } } From 7bbcb7e5a01d6ab908663d14edbfe52f75260ae2 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 6 Nov 2016 17:39:21 -0500 Subject: [PATCH 103/263] eclipse's being glitchy --- src/alisolarflare/uhc/UHCModule.java | 1 + src/alisolarflare/uhc/idle/AddToUHC.java | 2 +- src/alisolarflare/uhc/idle/JoinUHC.java | 2 +- src/alisolarflare/uhc/memory/UHCMatch.java | 34 +++++++++++++++++++--- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/alisolarflare/uhc/UHCModule.java b/src/alisolarflare/uhc/UHCModule.java index eebbb43..1f1b5e4 100644 --- a/src/alisolarflare/uhc/UHCModule.java +++ b/src/alisolarflare/uhc/UHCModule.java @@ -31,5 +31,6 @@ public class UHCModule extends Module { registerCommand(plugin, new StartMatch(match)); registerCommand(plugin, new ConfigureMatch(match)); registerCommand(plugin, new ScheduleMatch(match)); + } } diff --git a/src/alisolarflare/uhc/idle/AddToUHC.java b/src/alisolarflare/uhc/idle/AddToUHC.java index f4e2dad..92f2b44 100644 --- a/src/alisolarflare/uhc/idle/AddToUHC.java +++ b/src/alisolarflare/uhc/idle/AddToUHC.java @@ -38,7 +38,7 @@ public class AddToUHC extends TBMCCommandBase { // Adds players to memory sender.sendMessage("Adding Players to matchList!"); for (int i = 0; i > args.length; i++) { - match.playerList.add(args[i]); + match.getPlayerList().add(args[i]); }sender.sendMessage("Finished!"); case PEACE: case TENSION: diff --git a/src/alisolarflare/uhc/idle/JoinUHC.java b/src/alisolarflare/uhc/idle/JoinUHC.java index 5ebcb69..1f61fea 100644 --- a/src/alisolarflare/uhc/idle/JoinUHC.java +++ b/src/alisolarflare/uhc/idle/JoinUHC.java @@ -34,7 +34,7 @@ public class JoinUHC extends TBMCCommandBase{ case SETUP: case INTRO: player.sendMessage("Adding you to the UltraHardcore match!"); - match.playerList.add(player.getName()); + match.getPlayerList().add(player.getName()); break; //During the game diff --git a/src/alisolarflare/uhc/memory/UHCMatch.java b/src/alisolarflare/uhc/memory/UHCMatch.java index 4c4049a..1583eef 100644 --- a/src/alisolarflare/uhc/memory/UHCMatch.java +++ b/src/alisolarflare/uhc/memory/UHCMatch.java @@ -3,16 +3,25 @@ package alisolarflare.uhc.memory; import java.util.ArrayList; import java.util.List; +import org.bukkit.Location; +import org.bukkit.World; import org.bukkit.configuration.file.FileConfiguration; public class UHCMatch { - public List playerList = new ArrayList(); + private FileConfiguration config; private MatchState matchState = MatchState.IDLE; - private FileConfiguration fileConfiguration; + private List playerList = new ArrayList(); + private Location lobbyLocation; + private Location spawnLocation; + + private World ultraHardcoreWorld; + + private int worldBorderMaxRadius; + private int worldBorderMinRadius; public UHCMatch(FileConfiguration fileConfiguration, MatchState state) { - this.fileConfiguration = fileConfiguration; + this.config = fileConfiguration; this.matchState = state; } @@ -22,11 +31,28 @@ public class UHCMatch { public void setMatchState(MatchState newMS){ matchState = newMS; - fileConfiguration.set("UHCMatchState", newMS.toString()); + config.set("UHCMatchState", newMS.toString()); switch(newMS){ default: break; } } + + public List getPlayerList() { + return playerList; + } + + public void setPlayerList(List playerList) { + this.playerList = playerList; + } + + public Location getLobbyLocation() { + + return lobbyLocation; + } + + public void setLobbyLocation(Location lobbyLocation) { + this.lobbyLocation = lobbyLocation; + } } From a81c0ceb7678d831ef0e7cd4d1bd5358751c26f8 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 6 Nov 2016 18:23:27 -0500 Subject: [PATCH 104/263] Completely trashed UHC progress, re-organized Using finite state machines is *so much harder* than simply creating commands that a player or admin uses as the match goes on. I can always make UHC automatic later --- src/alisolarflare/AliPresents.java | 4 +- src/alisolarflare/autouhc/UHCModule.java | 36 +++++ .../controller/SetMatchState.java | 6 +- .../{uhc => autouhc}/idle/AddToUHC.java | 4 +- .../{uhc => autouhc}/idle/JoinUHC.java | 4 +- .../intro/ConfigureMatch.java | 76 +++++----- .../intro/IntroductionCutscene.java | 2 +- .../{uhc => autouhc}/intro/ScheduleMatch.java | 76 +++++----- .../{uhc => autouhc}/intro/StartMatch.java | 140 +++++++++--------- .../listeners/MatchCyclingListener.java | 2 +- .../listeners/MatchMainLoop.java | 2 +- .../{uhc => autouhc}/memory/MatchState.java | 2 +- .../{uhc => autouhc}/memory/UHCMatch.java | 2 +- src/alisolarflare/easyuhc/EasyUHCModule.java | 24 +++ .../easyuhc/commands/ActivatePowers.java | 33 +++++ .../easyuhc/commands/SetupWorldBorders.java | 33 +++++ .../easyuhc/commands/ShrinkWorldBorders.java | 33 +++++ .../easyuhc/commands/SpreadPlayers.java | 33 +++++ .../easyuhc/commands/StartTimer.java | 33 +++++ .../easyuhc/commands/StartUHC.java | 33 +++++ .../easyuhc/commands/TeleportToUHC.java | 33 +++++ src/alisolarflare/uhc/UHCModule.java | 36 ----- 22 files changed, 451 insertions(+), 196 deletions(-) create mode 100644 src/alisolarflare/autouhc/UHCModule.java rename src/alisolarflare/{uhc => autouhc}/controller/SetMatchState.java (93%) rename src/alisolarflare/{uhc => autouhc}/idle/AddToUHC.java (91%) rename src/alisolarflare/{uhc => autouhc}/idle/JoinUHC.java (90%) rename src/alisolarflare/{uhc => autouhc}/intro/ConfigureMatch.java (85%) rename src/alisolarflare/{uhc => autouhc}/intro/IntroductionCutscene.java (68%) rename src/alisolarflare/{uhc => autouhc}/intro/ScheduleMatch.java (85%) rename src/alisolarflare/{uhc => autouhc}/intro/StartMatch.java (87%) rename src/alisolarflare/{uhc => autouhc}/listeners/MatchCyclingListener.java (89%) rename src/alisolarflare/{uhc => autouhc}/listeners/MatchMainLoop.java (72%) rename src/alisolarflare/{uhc => autouhc}/memory/MatchState.java (87%) rename src/alisolarflare/{uhc => autouhc}/memory/UHCMatch.java (92%) create mode 100644 src/alisolarflare/easyuhc/EasyUHCModule.java create mode 100644 src/alisolarflare/easyuhc/commands/ActivatePowers.java create mode 100644 src/alisolarflare/easyuhc/commands/SetupWorldBorders.java create mode 100644 src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java create mode 100644 src/alisolarflare/easyuhc/commands/SpreadPlayers.java create mode 100644 src/alisolarflare/easyuhc/commands/StartTimer.java create mode 100644 src/alisolarflare/easyuhc/commands/StartUHC.java create mode 100644 src/alisolarflare/easyuhc/commands/TeleportToUHC.java delete mode 100644 src/alisolarflare/uhc/UHCModule.java diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 947c41b..2af4284 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -10,9 +10,9 @@ import alisolarflare.components.flairdoor.FlairDoorModule; import alisolarflare.components.gpowers.GPowerModule; import alisolarflare.components.links.AliLinkModule; import alisolarflare.creativeboundaries.CreativeBoundariesModule; +import alisolarflare.easyuhc.EasyUHCModule; import alisolarflare.magic.MagicModule; import alisolarflare.minigames.MinigameModule; -import alisolarflare.uhc.UHCModule; public class AliPresents extends JavaPlugin{ public void onEnable(){ @@ -25,7 +25,7 @@ public class AliPresents extends JavaPlugin{ new FlairDoorModule().register(this); new GPowerModule().register(this); new AliLinkModule().register(this); - new UHCModule().register(this); + new EasyUHCModule().register(this); new MagicModule().register(this); new MinigameModule().register(this); new CreativeBoundariesModule().register(this); diff --git a/src/alisolarflare/autouhc/UHCModule.java b/src/alisolarflare/autouhc/UHCModule.java new file mode 100644 index 0000000..3c0c2d8 --- /dev/null +++ b/src/alisolarflare/autouhc/UHCModule.java @@ -0,0 +1,36 @@ +package alisolarflare.autouhc; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.autouhc.controller.SetMatchState; +import alisolarflare.autouhc.idle.AddToUHC; +import alisolarflare.autouhc.idle.JoinUHC; +import alisolarflare.autouhc.intro.ConfigureMatch; +import alisolarflare.autouhc.intro.ScheduleMatch; +import alisolarflare.autouhc.intro.StartMatch; +import alisolarflare.autouhc.memory.MatchState; +import alisolarflare.autouhc.memory.UHCMatch; + +public class UHCModule extends Module { + public UHCMatch match; + + public void register(JavaPlugin plugin) { + + + if (plugin.getConfig().contains("UHCMatchState")){ + match = new UHCMatch(plugin.getConfig(), MatchState.valueOf(plugin.getConfig().getString("UHCMatchState"))); + }else{ + match = new UHCMatch(plugin.getConfig(), MatchState.IDLE); + } + + + //registerCommand(plugin, new SetMatchState(match)); + //registerCommand(plugin, new AddToUHC(match)); + //registerCommand(plugin, new JoinUHC(match)); + //registerCommand(plugin, new StartMatch(match)); + //registerCommand(plugin, new ConfigureMatch(match)); + //registerCommand(plugin, new ScheduleMatch(match)); + + } +} diff --git a/src/alisolarflare/uhc/controller/SetMatchState.java b/src/alisolarflare/autouhc/controller/SetMatchState.java similarity index 93% rename from src/alisolarflare/uhc/controller/SetMatchState.java rename to src/alisolarflare/autouhc/controller/SetMatchState.java index f646b50..0945cc7 100644 --- a/src/alisolarflare/uhc/controller/SetMatchState.java +++ b/src/alisolarflare/autouhc/controller/SetMatchState.java @@ -1,10 +1,10 @@ -package alisolarflare.uhc.controller; +package alisolarflare.autouhc.controller; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.uhc.memory.MatchState; -import alisolarflare.uhc.memory.UHCMatch; +import alisolarflare.autouhc.memory.MatchState; +import alisolarflare.autouhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCCommandBase; public class SetMatchState extends TBMCCommandBase{ diff --git a/src/alisolarflare/uhc/idle/AddToUHC.java b/src/alisolarflare/autouhc/idle/AddToUHC.java similarity index 91% rename from src/alisolarflare/uhc/idle/AddToUHC.java rename to src/alisolarflare/autouhc/idle/AddToUHC.java index 92f2b44..b27ace6 100644 --- a/src/alisolarflare/uhc/idle/AddToUHC.java +++ b/src/alisolarflare/autouhc/idle/AddToUHC.java @@ -1,9 +1,9 @@ -package alisolarflare.uhc.idle; +package alisolarflare.autouhc.idle; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.uhc.memory.UHCMatch; +import alisolarflare.autouhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCCommandBase; /** diff --git a/src/alisolarflare/uhc/idle/JoinUHC.java b/src/alisolarflare/autouhc/idle/JoinUHC.java similarity index 90% rename from src/alisolarflare/uhc/idle/JoinUHC.java rename to src/alisolarflare/autouhc/idle/JoinUHC.java index 1f61fea..764a2da 100644 --- a/src/alisolarflare/uhc/idle/JoinUHC.java +++ b/src/alisolarflare/autouhc/idle/JoinUHC.java @@ -1,9 +1,9 @@ -package alisolarflare.uhc.idle; +package alisolarflare.autouhc.idle; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.uhc.memory.UHCMatch; +import alisolarflare.autouhc.memory.UHCMatch; import buttondevteam.lib.chat.TBMCCommandBase; public class JoinUHC extends TBMCCommandBase{ diff --git a/src/alisolarflare/uhc/intro/ConfigureMatch.java b/src/alisolarflare/autouhc/intro/ConfigureMatch.java similarity index 85% rename from src/alisolarflare/uhc/intro/ConfigureMatch.java rename to src/alisolarflare/autouhc/intro/ConfigureMatch.java index 6f383bb..958e571 100644 --- a/src/alisolarflare/uhc/intro/ConfigureMatch.java +++ b/src/alisolarflare/autouhc/intro/ConfigureMatch.java @@ -1,38 +1,38 @@ -package alisolarflare.uhc.intro; - -import org.bukkit.command.CommandSender; - -import alisolarflare.uhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class ConfigureMatch extends TBMCCommandBase{ - - public ConfigureMatch(UHCMatch match) { - // TODO Auto-generated constructor stub - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.autouhc.intro; + +import org.bukkit.command.CommandSender; + +import alisolarflare.autouhc.memory.UHCMatch; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class ConfigureMatch extends TBMCCommandBase{ + + public ConfigureMatch(UHCMatch match) { + // TODO Auto-generated constructor stub + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/uhc/intro/IntroductionCutscene.java b/src/alisolarflare/autouhc/intro/IntroductionCutscene.java similarity index 68% rename from src/alisolarflare/uhc/intro/IntroductionCutscene.java rename to src/alisolarflare/autouhc/intro/IntroductionCutscene.java index 6ff7ce5..7921231 100644 --- a/src/alisolarflare/uhc/intro/IntroductionCutscene.java +++ b/src/alisolarflare/autouhc/intro/IntroductionCutscene.java @@ -1,4 +1,4 @@ -package alisolarflare.uhc.intro; +package alisolarflare.autouhc.intro; public class IntroductionCutscene { //TODO: Teleport all players to the area. diff --git a/src/alisolarflare/uhc/intro/ScheduleMatch.java b/src/alisolarflare/autouhc/intro/ScheduleMatch.java similarity index 85% rename from src/alisolarflare/uhc/intro/ScheduleMatch.java rename to src/alisolarflare/autouhc/intro/ScheduleMatch.java index 6e292c2..d1d904f 100644 --- a/src/alisolarflare/uhc/intro/ScheduleMatch.java +++ b/src/alisolarflare/autouhc/intro/ScheduleMatch.java @@ -1,38 +1,38 @@ -package alisolarflare.uhc.intro; - -import org.bukkit.command.CommandSender; - -import alisolarflare.uhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class ScheduleMatch extends TBMCCommandBase{ - - public ScheduleMatch(UHCMatch match) { - // TODO Auto-generated constructor stub - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.autouhc.intro; + +import org.bukkit.command.CommandSender; + +import alisolarflare.autouhc.memory.UHCMatch; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class ScheduleMatch extends TBMCCommandBase{ + + public ScheduleMatch(UHCMatch match) { + // TODO Auto-generated constructor stub + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/uhc/intro/StartMatch.java b/src/alisolarflare/autouhc/intro/StartMatch.java similarity index 87% rename from src/alisolarflare/uhc/intro/StartMatch.java rename to src/alisolarflare/autouhc/intro/StartMatch.java index 0b96652..08932e8 100644 --- a/src/alisolarflare/uhc/intro/StartMatch.java +++ b/src/alisolarflare/autouhc/intro/StartMatch.java @@ -1,70 +1,70 @@ -package alisolarflare.uhc.intro; - -import org.bukkit.command.CommandSender; - -import alisolarflare.uhc.memory.MatchState; -import alisolarflare.uhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class StartMatch extends TBMCCommandBase { - private UHCMatch match; - - public StartMatch(UHCMatch match) { - this.match = match; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - - if (!sender.hasPermission("moderator") && !(sender.getName() == "")) - sender.sendMessage("You must be a moderator or Arsenalis to use this command! " - + "Contact a TBMC dev if you think this is wrong"); - - //ACTIVATES MATCH - switch(match.getMatchState()){ - case IDLE: - sender.sendMessage("There is currently a match ready... Activating..."); - match.setMatchState(MatchState.INTRO); - break; - - case WAITING: - sender.sendMessage("There currently a match planned for: TIME:TIME:TIME"); - break; - - case END: - sender.sendMessage("The match has ended! Would you like to restart using current settings?"); - break; - - default: - sender.sendMessage("You cannot start a match now, one is already in progress!"); - - - } - - return false; - - - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "startmatch"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } -} +package alisolarflare.autouhc.intro; + +import org.bukkit.command.CommandSender; + +import alisolarflare.autouhc.memory.MatchState; +import alisolarflare.autouhc.memory.UHCMatch; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class StartMatch extends TBMCCommandBase { + private UHCMatch match; + + public StartMatch(UHCMatch match) { + this.match = match; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + + if (!sender.hasPermission("moderator") && !(sender.getName() == "")) + sender.sendMessage("You must be a moderator or Arsenalis to use this command! " + + "Contact a TBMC dev if you think this is wrong"); + + //ACTIVATES MATCH + switch(match.getMatchState()){ + case IDLE: + sender.sendMessage("There is currently a match ready... Activating..."); + match.setMatchState(MatchState.INTRO); + break; + + case WAITING: + sender.sendMessage("There currently a match planned for: TIME:TIME:TIME"); + break; + + case END: + sender.sendMessage("The match has ended! Would you like to restart using current settings?"); + break; + + default: + sender.sendMessage("You cannot start a match now, one is already in progress!"); + + + } + + return false; + + + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "startmatch"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } +} diff --git a/src/alisolarflare/uhc/listeners/MatchCyclingListener.java b/src/alisolarflare/autouhc/listeners/MatchCyclingListener.java similarity index 89% rename from src/alisolarflare/uhc/listeners/MatchCyclingListener.java rename to src/alisolarflare/autouhc/listeners/MatchCyclingListener.java index 62265c2..e11fc9b 100644 --- a/src/alisolarflare/uhc/listeners/MatchCyclingListener.java +++ b/src/alisolarflare/autouhc/listeners/MatchCyclingListener.java @@ -1,4 +1,4 @@ -package alisolarflare.uhc.listeners; +package alisolarflare.autouhc.listeners; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; diff --git a/src/alisolarflare/uhc/listeners/MatchMainLoop.java b/src/alisolarflare/autouhc/listeners/MatchMainLoop.java similarity index 72% rename from src/alisolarflare/uhc/listeners/MatchMainLoop.java rename to src/alisolarflare/autouhc/listeners/MatchMainLoop.java index 2e42cae..41c3b06 100644 --- a/src/alisolarflare/uhc/listeners/MatchMainLoop.java +++ b/src/alisolarflare/autouhc/listeners/MatchMainLoop.java @@ -1,4 +1,4 @@ -package alisolarflare.uhc.listeners; +package alisolarflare.autouhc.listeners; import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/alisolarflare/uhc/memory/MatchState.java b/src/alisolarflare/autouhc/memory/MatchState.java similarity index 87% rename from src/alisolarflare/uhc/memory/MatchState.java rename to src/alisolarflare/autouhc/memory/MatchState.java index bf6d77d..f25c350 100644 --- a/src/alisolarflare/uhc/memory/MatchState.java +++ b/src/alisolarflare/autouhc/memory/MatchState.java @@ -1,4 +1,4 @@ -package alisolarflare.uhc.memory; +package alisolarflare.autouhc.memory; public enum MatchState { IDLE, //Idle: Configure Match, Wait: Schedule Match, Intro: Start Match diff --git a/src/alisolarflare/uhc/memory/UHCMatch.java b/src/alisolarflare/autouhc/memory/UHCMatch.java similarity index 92% rename from src/alisolarflare/uhc/memory/UHCMatch.java rename to src/alisolarflare/autouhc/memory/UHCMatch.java index 1583eef..ee8911d 100644 --- a/src/alisolarflare/uhc/memory/UHCMatch.java +++ b/src/alisolarflare/autouhc/memory/UHCMatch.java @@ -1,4 +1,4 @@ -package alisolarflare.uhc.memory; +package alisolarflare.autouhc.memory; import java.util.ArrayList; import java.util.List; diff --git a/src/alisolarflare/easyuhc/EasyUHCModule.java b/src/alisolarflare/easyuhc/EasyUHCModule.java new file mode 100644 index 0000000..408e909 --- /dev/null +++ b/src/alisolarflare/easyuhc/EasyUHCModule.java @@ -0,0 +1,24 @@ +package alisolarflare.easyuhc; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.easyuhc.commands.ActivatePowers; +import alisolarflare.easyuhc.commands.SetupWorldBorders; +import alisolarflare.easyuhc.commands.SpreadPlayers; +import alisolarflare.easyuhc.commands.StartTimer; +import alisolarflare.easyuhc.commands.StartUHC; +import alisolarflare.easyuhc.commands.TeleportToUHC; + +public class EasyUHCModule extends Module{ + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new ActivatePowers()); + registerCommand(plugin, new SetupWorldBorders()); + registerCommand(plugin, new SetupWorldBorders()); + registerCommand(plugin, new SpreadPlayers()); + registerCommand(plugin, new StartTimer()); + registerCommand(plugin, new StartUHC()); + registerCommand(plugin, new TeleportToUHC()); + } +} diff --git a/src/alisolarflare/easyuhc/commands/ActivatePowers.java b/src/alisolarflare/easyuhc/commands/ActivatePowers.java new file mode 100644 index 0000000..737ac72 --- /dev/null +++ b/src/alisolarflare/easyuhc/commands/ActivatePowers.java @@ -0,0 +1,33 @@ +package alisolarflare.easyuhc.commands; + +import org.bukkit.command.CommandSender; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class ActivatePowers extends TBMCCommandBase{ + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/easyuhc/commands/SetupWorldBorders.java b/src/alisolarflare/easyuhc/commands/SetupWorldBorders.java new file mode 100644 index 0000000..ef90ae8 --- /dev/null +++ b/src/alisolarflare/easyuhc/commands/SetupWorldBorders.java @@ -0,0 +1,33 @@ +package alisolarflare.easyuhc.commands; + +import org.bukkit.command.CommandSender; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class SetupWorldBorders extends TBMCCommandBase { + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java b/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java new file mode 100644 index 0000000..bd083a6 --- /dev/null +++ b/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java @@ -0,0 +1,33 @@ +package alisolarflare.easyuhc.commands; + +import org.bukkit.command.CommandSender; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class ShrinkWorldBorders extends TBMCCommandBase { + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/easyuhc/commands/SpreadPlayers.java b/src/alisolarflare/easyuhc/commands/SpreadPlayers.java new file mode 100644 index 0000000..a5798ac --- /dev/null +++ b/src/alisolarflare/easyuhc/commands/SpreadPlayers.java @@ -0,0 +1,33 @@ +package alisolarflare.easyuhc.commands; + +import org.bukkit.command.CommandSender; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class SpreadPlayers extends TBMCCommandBase{ + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/easyuhc/commands/StartTimer.java b/src/alisolarflare/easyuhc/commands/StartTimer.java new file mode 100644 index 0000000..927344e --- /dev/null +++ b/src/alisolarflare/easyuhc/commands/StartTimer.java @@ -0,0 +1,33 @@ +package alisolarflare.easyuhc.commands; + +import org.bukkit.command.CommandSender; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class StartTimer extends TBMCCommandBase{ + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/easyuhc/commands/StartUHC.java b/src/alisolarflare/easyuhc/commands/StartUHC.java new file mode 100644 index 0000000..2a06889 --- /dev/null +++ b/src/alisolarflare/easyuhc/commands/StartUHC.java @@ -0,0 +1,33 @@ +package alisolarflare.easyuhc.commands; + +import org.bukkit.command.CommandSender; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class StartUHC extends TBMCCommandBase{ + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/easyuhc/commands/TeleportToUHC.java b/src/alisolarflare/easyuhc/commands/TeleportToUHC.java new file mode 100644 index 0000000..5a5c6d0 --- /dev/null +++ b/src/alisolarflare/easyuhc/commands/TeleportToUHC.java @@ -0,0 +1,33 @@ +package alisolarflare.easyuhc.commands; + +import org.bukkit.command.CommandSender; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class TeleportToUHC extends TBMCCommandBase{ + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/uhc/UHCModule.java b/src/alisolarflare/uhc/UHCModule.java deleted file mode 100644 index 1f1b5e4..0000000 --- a/src/alisolarflare/uhc/UHCModule.java +++ /dev/null @@ -1,36 +0,0 @@ -package alisolarflare.uhc; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.uhc.controller.SetMatchState; -import alisolarflare.uhc.idle.AddToUHC; -import alisolarflare.uhc.idle.JoinUHC; -import alisolarflare.uhc.intro.ConfigureMatch; -import alisolarflare.uhc.intro.ScheduleMatch; -import alisolarflare.uhc.intro.StartMatch; -import alisolarflare.uhc.memory.MatchState; -import alisolarflare.uhc.memory.UHCMatch; - -public class UHCModule extends Module { - public UHCMatch match; - - public void register(JavaPlugin plugin) { - - - if (plugin.getConfig().contains("UHCMatchState")){ - match = new UHCMatch(plugin.getConfig(), MatchState.valueOf(plugin.getConfig().getString("UHCMatchState"))); - }else{ - match = new UHCMatch(plugin.getConfig(), MatchState.IDLE); - } - - - registerCommand(plugin, new SetMatchState(match)); - registerCommand(plugin, new AddToUHC(match)); - registerCommand(plugin, new JoinUHC(match)); - registerCommand(plugin, new StartMatch(match)); - registerCommand(plugin, new ConfigureMatch(match)); - registerCommand(plugin, new ScheduleMatch(match)); - - } -} From 125a3c01e8a18a880406b8ff49265c9514c31f03 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 6 Nov 2016 18:51:09 -0500 Subject: [PATCH 105/263] Comit to Uncommit --- .../FlairMe.java => Command_FlairMe.java} | 77 +++-- .../components/flairdoor/FlairDoorModule.java | 15 - ...rtalListener.java => Listener_Portal.java} | 276 ++++++++--------- .../flairdoor/Module_FlairDoor.java | 13 + .../GPower.java => Command_GPower.java} | 151 +++++----- .../PowerDown.java => Command_PowerDown.java} | 97 +++--- .../PowerUp.java => Command_PowerUp.java} | 97 +++--- .../components/gpowers/GPowerModule.java | 23 -- .../gpowers/Listener_PowerLooper.java | 11 + .../{GPowerMemory.java => Memory_GPower.java} | 104 +++---- .../components/gpowers/Module_GPower.java | 19 ++ ...plyingTask.java => Task_PowerApplier.java} | 132 ++++----- .../gpowers/listeners/gPowerListener.java | 13 - .../components/links/AliLinkModule.java | 33 --- ...AliLink.java => Command_PressAliLink.java} | 119 ++++---- ...etAliLink.java => Command_SetAliLink.java} | 278 +++++++++--------- .../{entities/Link.java => Memory_Link.java} | 80 +++-- .../components/links/Module_AliLink.java | 30 ++ ...UnpressTask.java => Task_UnpressTask.java} | 42 +-- .../links/serializer/Deserializer.java | 42 --- .../links/serializer/Serializer.java | 38 --- .../Cbgm0.java => Command_Cbgm0.java} | 97 +++--- .../Cbgm1.java => Command_Cbgm1.java} | 163 +++++----- ...Dickmode.java => Command_SetDickmode.java} | 107 ++++--- .../CreativeBoundariesModule.java | 30 -- ...ner.java => Listener_ItemRestriction.java} | 50 ++-- ...Listener.java => Listener_PlotChange.java} | 136 +++++---- .../Module_CreativeBoundaries.java | 25 ++ ...owers.java => Command_ActivatePowers.java} | 4 +- ...rs.java => Command_SetupWorldBorders.java} | 4 +- ...s.java => Command_ShrinkWorldBorders.java} | 4 +- ...layers.java => Command_SpreadPlayers.java} | 4 +- ...tartTimer.java => Command_StartTimer.java} | 4 +- .../StartUHC.java => Command_StartUHC.java} | 4 +- ...tToUHC.java => Command_TeleportToUHC.java} | 4 +- src/alisolarflare/easyuhc/EasyUHCModule.java | 24 -- src/alisolarflare/easyuhc/Module_EasyUHC.java | 18 ++ .../magic/{tricks => }/AliArrowListener.java | 76 ++--- .../magic/{tricks => }/AliArrowTask.java | 80 ++--- .../{tricks => }/BoomBowDeathListener.java | 36 +-- .../magic/{tricks => }/BoomBowListener.java | 214 +++++++------- .../magic/{tricks => }/BoomBowRule.java | 168 +++++------ .../magic/{tricks => }/BoomDecayTask.java | 50 ++-- src/alisolarflare/magic/MagicModule.java | 3 - 44 files changed, 1437 insertions(+), 1558 deletions(-) rename src/alisolarflare/components/flairdoor/{commands/FlairMe.java => Command_FlairMe.java} (69%) delete mode 100644 src/alisolarflare/components/flairdoor/FlairDoorModule.java rename src/alisolarflare/components/flairdoor/{listeners/PortalListener.java => Listener_Portal.java} (92%) create mode 100644 src/alisolarflare/components/flairdoor/Module_FlairDoor.java rename src/alisolarflare/components/gpowers/{commands/GPower.java => Command_GPower.java} (86%) rename src/alisolarflare/components/gpowers/{commands/PowerDown.java => Command_PowerDown.java} (75%) rename src/alisolarflare/components/gpowers/{commands/PowerUp.java => Command_PowerUp.java} (75%) delete mode 100644 src/alisolarflare/components/gpowers/GPowerModule.java create mode 100644 src/alisolarflare/components/gpowers/Listener_PowerLooper.java rename src/alisolarflare/components/gpowers/{GPowerMemory.java => Memory_GPower.java} (95%) create mode 100644 src/alisolarflare/components/gpowers/Module_GPower.java rename src/alisolarflare/components/gpowers/{listeners/gPowerApplyingTask.java => Task_PowerApplier.java} (88%) delete mode 100644 src/alisolarflare/components/gpowers/listeners/gPowerListener.java delete mode 100644 src/alisolarflare/components/links/AliLinkModule.java rename src/alisolarflare/components/links/{commands/PressAliLink.java => Command_PressAliLink.java} (75%) rename src/alisolarflare/components/links/{commands/SetAliLink.java => Command_SetAliLink.java} (80%) rename src/alisolarflare/components/links/{entities/Link.java => Memory_Link.java} (74%) create mode 100644 src/alisolarflare/components/links/Module_AliLink.java rename src/alisolarflare/components/links/{tasks/UnpressTask.java => Task_UnpressTask.java} (68%) delete mode 100644 src/alisolarflare/components/links/serializer/Deserializer.java delete mode 100644 src/alisolarflare/components/links/serializer/Serializer.java rename src/alisolarflare/creativeboundaries/{commands/Cbgm0.java => Command_Cbgm0.java} (73%) rename src/alisolarflare/creativeboundaries/{commands/Cbgm1.java => Command_Cbgm1.java} (85%) rename src/alisolarflare/creativeboundaries/{commands/SetDickmode.java => Command_SetDickmode.java} (78%) delete mode 100644 src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java rename src/alisolarflare/creativeboundaries/{listeners/ItemRestrictionListener.java => Listener_ItemRestriction.java} (52%) rename src/alisolarflare/creativeboundaries/{listeners/PlotChangeListener.java => Listener_PlotChange.java} (84%) create mode 100644 src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java rename src/alisolarflare/easyuhc/{commands/ActivatePowers.java => Command_ActivatePowers.java} (85%) rename src/alisolarflare/easyuhc/{commands/SetupWorldBorders.java => Command_SetupWorldBorders.java} (85%) rename src/alisolarflare/easyuhc/{commands/ShrinkWorldBorders.java => Command_ShrinkWorldBorders.java} (85%) rename src/alisolarflare/easyuhc/{commands/SpreadPlayers.java => Command_SpreadPlayers.java} (85%) rename src/alisolarflare/easyuhc/{commands/StartTimer.java => Command_StartTimer.java} (86%) rename src/alisolarflare/easyuhc/{commands/StartUHC.java => Command_StartUHC.java} (86%) rename src/alisolarflare/easyuhc/{commands/TeleportToUHC.java => Command_TeleportToUHC.java} (85%) delete mode 100644 src/alisolarflare/easyuhc/EasyUHCModule.java create mode 100644 src/alisolarflare/easyuhc/Module_EasyUHC.java rename src/alisolarflare/magic/{tricks => }/AliArrowListener.java (92%) rename src/alisolarflare/magic/{tricks => }/AliArrowTask.java (92%) rename src/alisolarflare/magic/{tricks => }/BoomBowDeathListener.java (90%) rename src/alisolarflare/magic/{tricks => }/BoomBowListener.java (95%) rename src/alisolarflare/magic/{tricks => }/BoomBowRule.java (95%) rename src/alisolarflare/magic/{tricks => }/BoomDecayTask.java (88%) diff --git a/src/alisolarflare/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/Command_FlairMe.java similarity index 69% rename from src/alisolarflare/components/flairdoor/commands/FlairMe.java rename to src/alisolarflare/components/flairdoor/Command_FlairMe.java index 963da82..819ed54 100644 --- a/src/alisolarflare/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/Command_FlairMe.java @@ -1,39 +1,38 @@ -package alisolarflare.components.flairdoor.commands; - -import org.bukkit.command.CommandSender; - -import alisolarflare.components.flairdoor.listeners.PortalListener; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class FlairMe extends TBMCCommandBase { - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - PortalListener.playersToBeFlaired.add(sender.getName()); - sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); - - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return new String[] { "" }; - } - - @Override - public String GetCommandPath() { - return "flairme"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - return false; - } - -} +package alisolarflare.components.flairdoor; + +import org.bukkit.command.CommandSender; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_FlairMe extends TBMCCommandBase { + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + Listener_Portal.playersToBeFlaired.add(sender.getName()); + sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); + + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return new String[] { "" }; + } + + @Override + public String GetCommandPath() { + return "flairme"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + return false; + } + +} diff --git a/src/alisolarflare/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/components/flairdoor/FlairDoorModule.java deleted file mode 100644 index 1c5cddb..0000000 --- a/src/alisolarflare/components/flairdoor/FlairDoorModule.java +++ /dev/null @@ -1,15 +0,0 @@ -package alisolarflare.components.flairdoor; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.components.flairdoor.commands.FlairMe; -import alisolarflare.components.flairdoor.listeners.PortalListener; - -public class FlairDoorModule extends Module { - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new FlairMe()); - registerListener(plugin, new PortalListener(plugin)); - } -} diff --git a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/Listener_Portal.java similarity index 92% rename from src/alisolarflare/components/flairdoor/listeners/PortalListener.java rename to src/alisolarflare/components/flairdoor/Listener_Portal.java index 4ce684a..59791d4 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/Listener_Portal.java @@ -1,138 +1,138 @@ -package alisolarflare.components.flairdoor.listeners; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.Bukkit; -import org.bukkit.DyeColor; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerPortalEvent; -import org.bukkit.material.MaterialData; -import org.bukkit.material.Wool; -import org.bukkit.plugin.java.JavaPlugin; - -import com.earth2me.essentials.Essentials; -import com.earth2me.essentials.User; - -public class PortalListener implements Listener{ - public static List playersToBeFlaired = new ArrayList(); - public JavaPlugin plugin; - - Essentials essentials; - - public PortalListener(JavaPlugin plugin) { - this.plugin = plugin; - this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials")); - } - @EventHandler - public void onPortalEnter(PlayerPortalEvent event){ - //SANITATION - Player - if(!(event.getPlayer() instanceof Player)){ - return; - } - - //INIT - Player - Player player = event.getPlayer(); - - //SANITATION - PlayersToBeFlaired - if(!(playersToBeFlaired.contains(player.getName()))){ - return; - } - player.sendMessage("-MAY THE FLAIRING COMMENCE-"); - event.setTo(player.getLocation()); - - //INIT - x,y,z - int x = player.getLocation().getBlockX(); - int y = player.getLocation().getBlockY(); - int z = player.getLocation().getBlockZ(); - - //INIT - Blocks Under Portal - Block HigherBlock = player.getWorld().getBlockAt(x,y-2,z); - Block MiddleBlock = player.getWorld().getBlockAt(x,y-3,z); - Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); - - //RECOLOUR PLAYER - if(HigherBlock.getType() == Material.STONE){ - recolourPlayer(player, DyeColor.GRAY); - - //TOP BLOCK IS WOOL? - }else if(HigherBlock.getType() == Material.WOOL){ - Wool wool = (Wool) HigherBlock.getState().getData(); - recolourPlayer(player, wool.getColor()); - - //MIDDLE BLOCK IS WOOL? - }else if(MiddleBlock.getType() == Material.WOOL){ - MaterialData mData = MiddleBlock.getState().getData(); - Wool wool = (Wool) mData; - - recolourPlayer(player, wool.getColor()); - - //BOTTOM BLOCK IS WOOL? - }else if (BottomBlock.getType() == Material.WOOL){ - Wool wool = (Wool) BottomBlock.getState().getData(); - recolourPlayer(player, wool.getColor()); - } - - } - public void recolourPlayer(Player player, DyeColor dyecolour){ - User user = essentials.getUser(player); - - String name = user._getNickname(); - String tempName = ""; - for(int i = 0; i < name.length(); i++){ - if (name.charAt(i) != '§'){ - tempName += name.charAt(i); - }else{ - i++; - } - } - name = tempName; - - switch(dyecolour){ - case GRAY: - player.sendMessage("Adding §7GRAY!§f"); - name = "§7" + name; - break; - case RED: - player.sendMessage("Adding §4RED!§f"); - name = "§4" + name; - break; - case ORANGE: - player.sendMessage("Adding §6ORANGE!§f"); - name = "§6" + name; - break; - case YELLOW: - player.sendMessage("Adding §eYELLOW!§f"); - name = "§e" + name; - break; - case LIME: - case GREEN: - player.sendMessage("Adding §aGREEN!§f"); - name = "§a" + name; - break; - case CYAN: - case LIGHT_BLUE: - case BLUE: - player.sendMessage("Adding §9BLUE!§f"); - name = "§9" + name; - break; - case PURPLE: - player.sendMessage("Adding §5PURPLE!§f"); - name = "§5" + name; - break; - case WHITE: - player.sendMessage("Adding §fWHITE!§f"); - name = "§f" + name; - default: - player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); - break; - } - user.setNickname(name); - player.sendMessage("Your name is now: " + user.getNickname() +"!"); - playersToBeFlaired.remove(player.getName()); - } -} +package alisolarflare.components.flairdoor; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Bukkit; +import org.bukkit.DyeColor; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerPortalEvent; +import org.bukkit.material.MaterialData; +import org.bukkit.material.Wool; +import org.bukkit.plugin.java.JavaPlugin; + +import com.earth2me.essentials.Essentials; +import com.earth2me.essentials.User; + +public class Listener_Portal implements Listener{ + public static List playersToBeFlaired = new ArrayList(); + public JavaPlugin plugin; + + Essentials essentials; + + public Listener_Portal(JavaPlugin plugin) { + this.plugin = plugin; + this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials")); + } + @EventHandler + public void onPortalEnter(PlayerPortalEvent event){ + //SANITATION - Player + if(!(event.getPlayer() instanceof Player)){ + return; + } + + //INIT - Player + Player player = event.getPlayer(); + + //SANITATION - PlayersToBeFlaired + if(!(playersToBeFlaired.contains(player.getName()))){ + return; + } + player.sendMessage("-MAY THE FLAIRING COMMENCE-"); + event.setTo(player.getLocation()); + + //INIT - x,y,z + int x = player.getLocation().getBlockX(); + int y = player.getLocation().getBlockY(); + int z = player.getLocation().getBlockZ(); + + //INIT - Blocks Under Portal + Block HigherBlock = player.getWorld().getBlockAt(x,y-2,z); + Block MiddleBlock = player.getWorld().getBlockAt(x,y-3,z); + Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); + + //RECOLOUR PLAYER + if(HigherBlock.getType() == Material.STONE){ + recolourPlayer(player, DyeColor.GRAY); + + //TOP BLOCK IS WOOL? + }else if(HigherBlock.getType() == Material.WOOL){ + Wool wool = (Wool) HigherBlock.getState().getData(); + recolourPlayer(player, wool.getColor()); + + //MIDDLE BLOCK IS WOOL? + }else if(MiddleBlock.getType() == Material.WOOL){ + MaterialData mData = MiddleBlock.getState().getData(); + Wool wool = (Wool) mData; + + recolourPlayer(player, wool.getColor()); + + //BOTTOM BLOCK IS WOOL? + }else if (BottomBlock.getType() == Material.WOOL){ + Wool wool = (Wool) BottomBlock.getState().getData(); + recolourPlayer(player, wool.getColor()); + } + + } + public void recolourPlayer(Player player, DyeColor dyecolour){ + User user = essentials.getUser(player); + + String name = user._getNickname(); + String tempName = ""; + for(int i = 0; i < name.length(); i++){ + if (name.charAt(i) != '§'){ + tempName += name.charAt(i); + }else{ + i++; + } + } + name = tempName; + + switch(dyecolour){ + case GRAY: + player.sendMessage("Adding §7GRAY!§f"); + name = "§7" + name; + break; + case RED: + player.sendMessage("Adding §4RED!§f"); + name = "§4" + name; + break; + case ORANGE: + player.sendMessage("Adding §6ORANGE!§f"); + name = "§6" + name; + break; + case YELLOW: + player.sendMessage("Adding §eYELLOW!§f"); + name = "§e" + name; + break; + case LIME: + case GREEN: + player.sendMessage("Adding §aGREEN!§f"); + name = "§a" + name; + break; + case CYAN: + case LIGHT_BLUE: + case BLUE: + player.sendMessage("Adding §9BLUE!§f"); + name = "§9" + name; + break; + case PURPLE: + player.sendMessage("Adding §5PURPLE!§f"); + name = "§5" + name; + break; + case WHITE: + player.sendMessage("Adding §fWHITE!§f"); + name = "§f" + name; + default: + player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); + break; + } + user.setNickname(name); + player.sendMessage("Your name is now: " + user.getNickname() +"!"); + playersToBeFlaired.remove(player.getName()); + } +} diff --git a/src/alisolarflare/components/flairdoor/Module_FlairDoor.java b/src/alisolarflare/components/flairdoor/Module_FlairDoor.java new file mode 100644 index 0000000..ca893a7 --- /dev/null +++ b/src/alisolarflare/components/flairdoor/Module_FlairDoor.java @@ -0,0 +1,13 @@ +package alisolarflare.components.flairdoor; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; + +public class Module_FlairDoor extends Module { + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new Command_FlairMe()); + registerListener(plugin, new Listener_Portal(plugin)); + } +} diff --git a/src/alisolarflare/components/gpowers/commands/GPower.java b/src/alisolarflare/components/gpowers/Command_GPower.java similarity index 86% rename from src/alisolarflare/components/gpowers/commands/GPower.java rename to src/alisolarflare/components/gpowers/Command_GPower.java index 4a90d21..a244e8c 100644 --- a/src/alisolarflare/components/gpowers/commands/GPower.java +++ b/src/alisolarflare/components/gpowers/Command_GPower.java @@ -1,76 +1,75 @@ -package alisolarflare.components.gpowers.commands; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.components.gpowers.GPowerMemory; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class GPower extends TBMCCommandBase { - - private GPowerMemory gPowerMemory; - - public GPower(GPowerMemory gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - sender.sendMessage("G power activate!"); - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command! Talk to a dev/ali if you think this is wrong"); - } - Player player = (Player) sender; - if (args.length < 2) { - player.sendMessage("Proper Usage to test G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); - return false; - } - String colour; - if (args[0].startsWith("r") || args[0].startsWith("o") || args[0].startsWith("y") || args[0].startsWith("g") - || args[0].startsWith("b") || args[0].startsWith("p")) { - colour = args[0]; - } else { - player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]"); - return false; - } - boolean isActive; - if (args[1].startsWith("t")) { - isActive = true; - } else if (args[1].startsWith("f")) { - isActive = false; - } else { - player.sendMessage("error: active. Proper Usage to configure G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); - return false; - } - player.sendMessage("Terms Vaild!"); - player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); - gPowerMemory.configurePlayer(player, colour, isActive); - - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return new String[] { "" }; - } - - @Override - public String GetCommandPath() { - return "gpower"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - return false; - } - -} +package alisolarflare.components.gpowers; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_GPower extends TBMCCommandBase { + + private Memory_GPower gPowerMemory; + + public Command_GPower(Memory_GPower gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + sender.sendMessage("G power activate!"); + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command! Talk to a dev/ali if you think this is wrong"); + } + Player player = (Player) sender; + if (args.length < 2) { + player.sendMessage("Proper Usage to test G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + String colour; + if (args[0].startsWith("r") || args[0].startsWith("o") || args[0].startsWith("y") || args[0].startsWith("g") + || args[0].startsWith("b") || args[0].startsWith("p")) { + colour = args[0]; + } else { + player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]"); + return false; + } + boolean isActive; + if (args[1].startsWith("t")) { + isActive = true; + } else if (args[1].startsWith("f")) { + isActive = false; + } else { + player.sendMessage("error: active. Proper Usage to configure G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + player.sendMessage("Terms Vaild!"); + player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); + gPowerMemory.configurePlayer(player, colour, isActive); + + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return new String[] { "" }; + } + + @Override + public String GetCommandPath() { + return "gpower"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + return false; + } + +} diff --git a/src/alisolarflare/components/gpowers/commands/PowerDown.java b/src/alisolarflare/components/gpowers/Command_PowerDown.java similarity index 75% rename from src/alisolarflare/components/gpowers/commands/PowerDown.java rename to src/alisolarflare/components/gpowers/Command_PowerDown.java index 8f3467b..9204c29 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/components/gpowers/Command_PowerDown.java @@ -1,49 +1,48 @@ -package alisolarflare.components.gpowers.commands; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.components.gpowers.GPowerMemory; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class PowerDown extends TBMCCommandBase { - - private GPowerMemory gPowerMemory; - - public PowerDown(GPowerMemory gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (!(sender instanceof Player)) - sender.sendMessage("You must be a player to use this command! Contact dev/ali if you think this is wrong"); - Player player = (Player) sender; - gPowerMemory.PowerDownPlayer(player); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "powerdown"; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.gpowers; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_PowerDown extends TBMCCommandBase { + + private Memory_GPower gPowerMemory; + + public Command_PowerDown(Memory_GPower gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (!(sender instanceof Player)) + sender.sendMessage("You must be a player to use this command! Contact dev/ali if you think this is wrong"); + Player player = (Player) sender; + gPowerMemory.PowerDownPlayer(player); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "powerdown"; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/gpowers/commands/PowerUp.java b/src/alisolarflare/components/gpowers/Command_PowerUp.java similarity index 75% rename from src/alisolarflare/components/gpowers/commands/PowerUp.java rename to src/alisolarflare/components/gpowers/Command_PowerUp.java index 84670f3..171961c 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/components/gpowers/Command_PowerUp.java @@ -1,49 +1,48 @@ -package alisolarflare.components.gpowers.commands; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.components.gpowers.GPowerMemory; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class PowerUp extends TBMCCommandBase { - - private GPowerMemory gPowerMemory; - - public PowerUp(GPowerMemory gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (!(sender instanceof Player)) - sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong"); - - Player player = (Player) sender; - gPowerMemory.PowerUpPlayer(player); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "powerup"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.gpowers; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_PowerUp extends TBMCCommandBase { + + private Memory_GPower gPowerMemory; + + public Command_PowerUp(Memory_GPower gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (!(sender instanceof Player)) + sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong"); + + Player player = (Player) sender; + gPowerMemory.PowerUpPlayer(player); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "powerup"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/gpowers/GPowerModule.java b/src/alisolarflare/components/gpowers/GPowerModule.java deleted file mode 100644 index 3148ee0..0000000 --- a/src/alisolarflare/components/gpowers/GPowerModule.java +++ /dev/null @@ -1,23 +0,0 @@ -package alisolarflare.components.gpowers; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.components.gpowers.commands.GPower; -import alisolarflare.components.gpowers.commands.PowerDown; -import alisolarflare.components.gpowers.commands.PowerUp; -import alisolarflare.components.gpowers.listeners.gPowerListener; - -public class GPowerModule extends Module { - - @Override - public void register(JavaPlugin plugin) { - GPowerMemory gPowerMemory = new GPowerMemory(); - registerCommand(plugin, new GPower(gPowerMemory)); - registerCommand(plugin, new PowerUp(gPowerMemory)); - registerCommand(plugin, new PowerDown(gPowerMemory)); - - registerListener(plugin, new gPowerListener(plugin, gPowerMemory)); - } - -} diff --git a/src/alisolarflare/components/gpowers/Listener_PowerLooper.java b/src/alisolarflare/components/gpowers/Listener_PowerLooper.java new file mode 100644 index 0000000..8b9c299 --- /dev/null +++ b/src/alisolarflare/components/gpowers/Listener_PowerLooper.java @@ -0,0 +1,11 @@ +package alisolarflare.components.gpowers; + +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; + +public class Listener_PowerLooper implements Listener{ + + public Listener_PowerLooper(JavaPlugin plugin, Memory_GPower gPowerMemory){ + new Task_PowerApplier(plugin.getServer(), gPowerMemory.poweredPlayerList).runTaskTimer(plugin, 190, 190); + } +} \ No newline at end of file diff --git a/src/alisolarflare/components/gpowers/GPowerMemory.java b/src/alisolarflare/components/gpowers/Memory_GPower.java similarity index 95% rename from src/alisolarflare/components/gpowers/GPowerMemory.java rename to src/alisolarflare/components/gpowers/Memory_GPower.java index 44e0089..b1ef0fc 100644 --- a/src/alisolarflare/components/gpowers/GPowerMemory.java +++ b/src/alisolarflare/components/gpowers/Memory_GPower.java @@ -1,52 +1,52 @@ -package alisolarflare.components.gpowers; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.bukkit.entity.Player; - -public class GPowerMemory{ - public Map poweredPlayerList = new HashMap(); - - public void configurePlayer(Player player, String colour, boolean powerIsActive){ - poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); - } - public void PowerUpPlayer(Player player){ - player.sendMessage("Powering up!"); - if(poweredPlayerList.containsKey(player.getUniqueId())){ - poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; - player.sendMessage("Powered up!"); - }else{ - player.sendMessage("You must instantiate your power settings using /GPower"); - } - } - - public void PowerDownPlayer(Player player){ - player.sendMessage("Powering down!"); - if (poweredPlayerList.containsKey(player.getUniqueId())){ - player.sendMessage("Powered down!"); - poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; - }else{ - player.sendMessage("P down!"); - return; - } - - } - - public class poweredPlayer{ - public UUID uuid; - public String colour; - public Boolean isPowersActive; - - public poweredPlayer(UUID uuid, String colour, Boolean activated){ - this.uuid = (uuid); - this.colour = (colour); - this.isPowersActive = (activated); - } - public String toString(){ - return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; - } - } -} - +package alisolarflare.components.gpowers; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.bukkit.entity.Player; + +public class Memory_GPower{ + public Map poweredPlayerList = new HashMap(); + + public void configurePlayer(Player player, String colour, boolean powerIsActive){ + poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); + } + public void PowerUpPlayer(Player player){ + player.sendMessage("Powering up!"); + if(poweredPlayerList.containsKey(player.getUniqueId())){ + poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; + player.sendMessage("Powered up!"); + }else{ + player.sendMessage("You must instantiate your power settings using /GPower"); + } + } + + public void PowerDownPlayer(Player player){ + player.sendMessage("Powering down!"); + if (poweredPlayerList.containsKey(player.getUniqueId())){ + player.sendMessage("Powered down!"); + poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; + }else{ + player.sendMessage("P down!"); + return; + } + + } + + public class poweredPlayer{ + public UUID uuid; + public String colour; + public Boolean isPowersActive; + + public poweredPlayer(UUID uuid, String colour, Boolean activated){ + this.uuid = (uuid); + this.colour = (colour); + this.isPowersActive = (activated); + } + public String toString(){ + return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; + } + } +} + diff --git a/src/alisolarflare/components/gpowers/Module_GPower.java b/src/alisolarflare/components/gpowers/Module_GPower.java new file mode 100644 index 0000000..814d9bd --- /dev/null +++ b/src/alisolarflare/components/gpowers/Module_GPower.java @@ -0,0 +1,19 @@ +package alisolarflare.components.gpowers; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; + +public class Module_GPower extends Module { + + @Override + public void register(JavaPlugin plugin) { + Memory_GPower gPowerMemory = new Memory_GPower(); + registerCommand(plugin, new Command_GPower(gPowerMemory)); + registerCommand(plugin, new Command_PowerUp(gPowerMemory)); + registerCommand(plugin, new Command_PowerDown(gPowerMemory)); + + registerListener(plugin, new Listener_PowerLooper(plugin, gPowerMemory)); + } + +} diff --git a/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/components/gpowers/Task_PowerApplier.java similarity index 88% rename from src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java rename to src/alisolarflare/components/gpowers/Task_PowerApplier.java index d966e63..f9d82e3 100644 --- a/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/components/gpowers/Task_PowerApplier.java @@ -1,66 +1,66 @@ -package alisolarflare.components.gpowers.listeners; - -import java.util.Map; -import java.util.UUID; - -import org.bukkit.Color; -import org.bukkit.Server; -import org.bukkit.entity.Player; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; - -public class gPowerApplyingTask extends BukkitRunnable{ - - private Server server; - private Map poweredPlayerList; - - public gPowerApplyingTask(Server server, Map poweredPlayerList) { - this.server = server; - this.poweredPlayerList = poweredPlayerList; - } - - //REPEATS EVERY 5 SECONDS - @Override - public void run() { - for (Player player : server.getOnlinePlayers()){ - if(poweredPlayerList.containsKey(player.getUniqueId())){ - activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); - } - } - } - - private void activatePower(Player player, String colour) { - //GREY - if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.GRAY)); - player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 0, true, false, Color.GRAY)); - //RED - }else if (colour.startsWith("r")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0, true, false, Color.RED)); - //ORANGE - }else if (colour.startsWith("o")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); - player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); - //YELLOW - }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.YELLOW)); - //GREEN - }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 200, 1, true, false, Color.GREEN)); - player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 200, 0, true, false, Color.GREEN)); - //BLUE - }else if (colour.startsWith("b")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1, true, false, Color.BLUE)); - player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 200, 0, true, false, Color.BLUE)); - //PURPLE - }else if (colour.startsWith("p")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 0, true, false, Color.PURPLE)); - //NULL - }else{ - } - } - -} +package alisolarflare.components.gpowers; + +import java.util.Map; +import java.util.UUID; + +import org.bukkit.Color; +import org.bukkit.Server; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +import alisolarflare.components.gpowers.Memory_GPower.poweredPlayer; + +public class Task_PowerApplier extends BukkitRunnable{ + + private Server server; + private Map poweredPlayerList; + + public Task_PowerApplier(Server server, Map poweredPlayerList) { + this.server = server; + this.poweredPlayerList = poweredPlayerList; + } + + //REPEATS EVERY 5 SECONDS + @Override + public void run() { + for (Player player : server.getOnlinePlayers()){ + if(poweredPlayerList.containsKey(player.getUniqueId())){ + activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); + } + } + } + + private void activatePower(Player player, String colour) { + //GREY + if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 0, true, false, Color.GRAY)); + //RED + }else if (colour.startsWith("r")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0, true, false, Color.RED)); + //ORANGE + }else if (colour.startsWith("o")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); + player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); + //YELLOW + }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.YELLOW)); + //GREEN + }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 200, 1, true, false, Color.GREEN)); + player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 200, 0, true, false, Color.GREEN)); + //BLUE + }else if (colour.startsWith("b")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1, true, false, Color.BLUE)); + player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 200, 0, true, false, Color.BLUE)); + //PURPLE + }else if (colour.startsWith("p")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 0, true, false, Color.PURPLE)); + //NULL + }else{ + } + } + +} diff --git a/src/alisolarflare/components/gpowers/listeners/gPowerListener.java b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java deleted file mode 100644 index 1b71481..0000000 --- a/src/alisolarflare/components/gpowers/listeners/gPowerListener.java +++ /dev/null @@ -1,13 +0,0 @@ -package alisolarflare.components.gpowers.listeners; - -import org.bukkit.event.Listener; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.components.gpowers.GPowerMemory; - -public class gPowerListener implements Listener{ - - public gPowerListener(JavaPlugin plugin, GPowerMemory gPowerMemory){ - new gPowerApplyingTask(plugin.getServer(), gPowerMemory.poweredPlayerList).runTaskTimer(plugin, 190, 190); - } -} \ No newline at end of file diff --git a/src/alisolarflare/components/links/AliLinkModule.java b/src/alisolarflare/components/links/AliLinkModule.java deleted file mode 100644 index a6d44a9..0000000 --- a/src/alisolarflare/components/links/AliLinkModule.java +++ /dev/null @@ -1,33 +0,0 @@ -package alisolarflare.components.links; - -import java.util.List; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.components.links.commands.PressAliLink; -import alisolarflare.components.links.commands.SetAliLink; -import alisolarflare.components.links.entities.Link; - -public class AliLinkModule extends Module { - private SetAliLink setAliLink; - - @Override - public void register(JavaPlugin plugin) { - setAliLink = new SetAliLink(plugin); - - registerCommand(plugin, new PressAliLink(plugin, setAliLink)); - registerCommand(plugin, setAliLink); - - } - - public void saveLinkList(JavaPlugin plugin) { - plugin.getConfig().set("aliLinkList", setAliLink.linkList); - } - - @SuppressWarnings("unchecked") - public List loadLinkList(JavaPlugin plugin) { - return (List) plugin.getConfig().getList("aliLinkList"); - } - -} diff --git a/src/alisolarflare/components/links/commands/PressAliLink.java b/src/alisolarflare/components/links/Command_PressAliLink.java similarity index 75% rename from src/alisolarflare/components/links/commands/PressAliLink.java rename to src/alisolarflare/components/links/Command_PressAliLink.java index da21f6d..9619449 100644 --- a/src/alisolarflare/components/links/commands/PressAliLink.java +++ b/src/alisolarflare/components/links/Command_PressAliLink.java @@ -1,60 +1,59 @@ -package alisolarflare.components.links.commands; - -import org.bukkit.command.CommandSender; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.components.links.entities.Link; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class PressAliLink extends TBMCCommandBase { - private JavaPlugin plugin; - private SetAliLink setAliLink; - - public PressAliLink(JavaPlugin plugin, SetAliLink setAliLink) { - this.plugin = plugin; - this.setAliLink = setAliLink; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - - sender.getServer().broadcastMessage(setAliLink.linkList.toString() + "over."); - - if (args.length < 1) { - sender.sendMessage("You must specify a link frequency"); - sender.sendMessage("/pressalilink [frequency]"); - } - for (Link link : setAliLink.linkList) { - for (String inputlink : args) { - if (inputlink.equals(link.frequency)) { - link.press(plugin); - } - } - } - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "pressalilink"; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.links; + +import org.bukkit.command.CommandSender; +import org.bukkit.plugin.java.JavaPlugin; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_PressAliLink extends TBMCCommandBase { + private JavaPlugin plugin; + private Command_SetAliLink setAliLink; + + public Command_PressAliLink(JavaPlugin plugin, Command_SetAliLink setAliLink) { + this.plugin = plugin; + this.setAliLink = setAliLink; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + + sender.getServer().broadcastMessage(setAliLink.linkList.toString() + "over."); + + if (args.length < 1) { + sender.sendMessage("You must specify a link frequency"); + sender.sendMessage("/pressalilink [frequency]"); + } + for (Memory_Link link : setAliLink.linkList) { + for (String inputlink : args) { + if (inputlink.equals(link.frequency)) { + link.press(plugin); + } + } + } + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "pressalilink"; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/links/commands/SetAliLink.java b/src/alisolarflare/components/links/Command_SetAliLink.java similarity index 80% rename from src/alisolarflare/components/links/commands/SetAliLink.java rename to src/alisolarflare/components/links/Command_SetAliLink.java index 03c4e57..2b78235 100644 --- a/src/alisolarflare/components/links/commands/SetAliLink.java +++ b/src/alisolarflare/components/links/Command_SetAliLink.java @@ -1,140 +1,138 @@ -package alisolarflare.components.links.commands; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; -import org.bukkit.Location; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.components.links.AliLinkModule; -import alisolarflare.components.links.entities.Link; -import buttondevteam.lib.chat.TBMCCommandBase; - -/** - * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, a location in a world that when called on by {@link PressAliLink}, creates a temporary redstone - * block, enabling wireless redstone - * - * @see PressAliLink - * @author Alisolarflare - * - */ -public class SetAliLink extends TBMCCommandBase { - public List linkList = new ArrayList(); - AliLinkModule subplugin; - private JavaPlugin plugin; - - /** - * Constructs the SetAliLink class - * - * @param plugin - * The plugin that contains the configuration file of SetAliLink - */ - public SetAliLink(JavaPlugin plugin) { - this.plugin = plugin; - load(); - } - - /** - * This command creates an Ali-Link which, when activated by the command /PressAliLink, creates a temporary redstone block if and only if /PressAliLink [frequency] matches the frequency saved when - * /SetAliLink [frequency] is called. - * - * @see Class#PressAliLink - * @param sender - * Player who sent the command - * @param command - * Command Object created - * @param label - * Name of the command - * @param args - * Arguments: [frequency] [x-coordinate] [y-coordinate] [z-coordinate], where the coordinates point to the intended location of the Ali-Link - */ - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - sender.sendMessage("you pressed shit"); - if (args == null || args.length < 1) { - sender.sendMessage("You must specify a link frequency"); - sender.sendMessage("/pressalilink [name]"); - return false; - } - Player player = (Player) sender; - if (args.length < 4) { - player.sendMessage("short"); - linkList.add(new Link(args[0], player.getLocation())); - save(player); - player.sendMessage("end"); - return false; - } - if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) - && StringUtils.isNumericSpace(args[3])) { - player.sendMessage("CUUUSTOM"); - linkList.add(new Link(args[0], new Location(player.getWorld(), Double.parseDouble(args[1]), - Double.parseDouble(args[2]), Double.parseDouble(args[3])))); - save(player); - player.sendMessage("FINISHED"); - } else { - player.sendMessage("UNCUSTOOM"); - linkList.add(new Link(args[0], player.getLocation())); - save(player); - player.sendMessage("UNFINISHED"); - return false; - } - return false; - } - - /** - * Tries to save the entire SetAliLink class into memory, which includes all of the current Ali-links saved and in use. - * - * @param player - */ - private void save(Player player) { - player.sendMessage("SAAAVING"); - player.sendMessage("SAVE FAILED: TELL ALI TO FIX THE SAVE AND UN-COMMENT THE PARAGRAPH SHE COMMENTED"); - player.sendMessage("Link will only last until next server restart"); - return; - /* - * subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); try { player.sendMessage("SAVIN"); subplugin.plugin.saveConfig(); player.sendMessage("GOOD SAVE"); } catch (Exception e) - * { player.sendMessage("YOU FUCKED STUFF UP"); // TODO Auto-generated catch block e.printStackTrace(); } - */ - } - - /** - * Attempts to load the previous saved state of AliLinks, from the plugin configuration file - */ - @SuppressWarnings("unchecked") - private void load() { - try { - linkList = (List) plugin.getConfig().getList("aliLinkList"); - if (linkList == null || linkList.isEmpty()) { - linkList = new ArrayList(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "setalilink"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.links; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.bukkit.Location; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import buttondevteam.lib.chat.TBMCCommandBase; + +/** + * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, a location in a world that when called on by {@link Command_PressAliLink}, creates a temporary redstone + * block, enabling wireless redstone + * + * @see Command_PressAliLink + * @author Alisolarflare + * + */ +public class Command_SetAliLink extends TBMCCommandBase { + public List linkList = new ArrayList(); + Module_AliLink subplugin; + private JavaPlugin plugin; + + /** + * Constructs the SetAliLink class + * + * @param plugin + * The plugin that contains the configuration file of SetAliLink + */ + public Command_SetAliLink(JavaPlugin plugin) { + this.plugin = plugin; + load(); + } + + /** + * This command creates an Ali-Link which, when activated by the command /PressAliLink, creates a temporary redstone block if and only if /PressAliLink [frequency] matches the frequency saved when + * /SetAliLink [frequency] is called. + * + * @see Class#PressAliLink + * @param sender + * Player who sent the command + * @param command + * Command Object created + * @param label + * Name of the command + * @param args + * Arguments: [frequency] [x-coordinate] [y-coordinate] [z-coordinate], where the coordinates point to the intended location of the Ali-Link + */ + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + sender.sendMessage("you pressed shit"); + if (args == null || args.length < 1) { + sender.sendMessage("You must specify a link frequency"); + sender.sendMessage("/pressalilink [name]"); + return false; + } + Player player = (Player) sender; + if (args.length < 4) { + player.sendMessage("short"); + linkList.add(new Memory_Link(args[0], player.getLocation())); + save(player); + player.sendMessage("end"); + return false; + } + if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) + && StringUtils.isNumericSpace(args[3])) { + player.sendMessage("CUUUSTOM"); + linkList.add(new Memory_Link(args[0], new Location(player.getWorld(), Double.parseDouble(args[1]), + Double.parseDouble(args[2]), Double.parseDouble(args[3])))); + save(player); + player.sendMessage("FINISHED"); + } else { + player.sendMessage("UNCUSTOOM"); + linkList.add(new Memory_Link(args[0], player.getLocation())); + save(player); + player.sendMessage("UNFINISHED"); + return false; + } + return false; + } + + /** + * Tries to save the entire SetAliLink class into memory, which includes all of the current Ali-links saved and in use. + * + * @param player + */ + private void save(Player player) { + player.sendMessage("SAAAVING"); + player.sendMessage("SAVE FAILED: TELL ALI TO FIX THE SAVE AND UN-COMMENT THE PARAGRAPH SHE COMMENTED"); + player.sendMessage("Link will only last until next server restart"); + return; + /* + * subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); try { player.sendMessage("SAVIN"); subplugin.plugin.saveConfig(); player.sendMessage("GOOD SAVE"); } catch (Exception e) + * { player.sendMessage("YOU FUCKED STUFF UP"); // TODO Auto-generated catch block e.printStackTrace(); } + */ + } + + /** + * Attempts to load the previous saved state of AliLinks, from the plugin configuration file + */ + @SuppressWarnings("unchecked") + private void load() { + try { + linkList = (List) plugin.getConfig().getList("aliLinkList"); + if (linkList == null || linkList.isEmpty()) { + linkList = new ArrayList(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "setalilink"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/links/entities/Link.java b/src/alisolarflare/components/links/Memory_Link.java similarity index 74% rename from src/alisolarflare/components/links/entities/Link.java rename to src/alisolarflare/components/links/Memory_Link.java index f55bfc8..2043b7a 100644 --- a/src/alisolarflare/components/links/entities/Link.java +++ b/src/alisolarflare/components/links/Memory_Link.java @@ -1,41 +1,39 @@ -package alisolarflare.components.links.entities; - -import java.io.Serializable; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.components.links.tasks.UnpressTask; - -public class Link implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - public String frequency; - public String world; - public String x; - public String y; - public String z; - - - public Link(String frequency, Location location){ - this.frequency = frequency; - this.world = location.getWorld().getName(); - this.x = "" + location.getBlockX(); - this.y = "" + location.getBlockY(); - this.z = "" + location.getBlockZ(); - //plugin.plugin.getConfig().set("frequency", 10); - } - /** - * Activates the Ali-Link - * @param plugin - */ - public void press(JavaPlugin plugin) { - Location location = new Location(plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); - location.getBlock().setType(Material.REDSTONE_BLOCK); - UnpressTask unPressTask = new UnpressTask(location); - unPressTask.runTaskTimer(plugin, 2, 1); - } -} +package alisolarflare.components.links; + +import java.io.Serializable; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.plugin.java.JavaPlugin; + +public class Memory_Link implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + public String frequency; + public String world; + public String x; + public String y; + public String z; + + + public Memory_Link(String frequency, Location location){ + this.frequency = frequency; + this.world = location.getWorld().getName(); + this.x = "" + location.getBlockX(); + this.y = "" + location.getBlockY(); + this.z = "" + location.getBlockZ(); + //plugin.plugin.getConfig().set("frequency", 10); + } + /** + * Activates the Ali-Link + * @param plugin + */ + public void press(JavaPlugin plugin) { + Location location = new Location(plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); + location.getBlock().setType(Material.REDSTONE_BLOCK); + Task_UnpressTask unPressTask = new Task_UnpressTask(location); + unPressTask.runTaskTimer(plugin, 2, 1); + } +} diff --git a/src/alisolarflare/components/links/Module_AliLink.java b/src/alisolarflare/components/links/Module_AliLink.java new file mode 100644 index 0000000..a16b47b --- /dev/null +++ b/src/alisolarflare/components/links/Module_AliLink.java @@ -0,0 +1,30 @@ +package alisolarflare.components.links; + +import java.util.List; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; + +public class Module_AliLink extends Module { + private Command_SetAliLink setAliLink; + + @Override + public void register(JavaPlugin plugin) { + setAliLink = new Command_SetAliLink(plugin); + + registerCommand(plugin, new Command_PressAliLink(plugin, setAliLink)); + registerCommand(plugin, setAliLink); + + } + + public void saveLinkList(JavaPlugin plugin) { + plugin.getConfig().set("aliLinkList", setAliLink.linkList); + } + + @SuppressWarnings("unchecked") + public List loadLinkList(JavaPlugin plugin) { + return (List) plugin.getConfig().getList("aliLinkList"); + } + +} diff --git a/src/alisolarflare/components/links/tasks/UnpressTask.java b/src/alisolarflare/components/links/Task_UnpressTask.java similarity index 68% rename from src/alisolarflare/components/links/tasks/UnpressTask.java rename to src/alisolarflare/components/links/Task_UnpressTask.java index 769f4f1..17c59c8 100644 --- a/src/alisolarflare/components/links/tasks/UnpressTask.java +++ b/src/alisolarflare/components/links/Task_UnpressTask.java @@ -1,21 +1,21 @@ -package alisolarflare.components.links.tasks; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.scheduler.BukkitRunnable; - -public class UnpressTask extends BukkitRunnable { - private Location location; - public UnpressTask(Location location){ - this.location = location; - } - - @SuppressWarnings("deprecation") - @Override - public void run() { - location.getBlock().setType(Material.STAINED_CLAY); - location.getBlock().setData((byte) 14); - this.cancel(); - } - -} +package alisolarflare.components.links; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.scheduler.BukkitRunnable; + +public class Task_UnpressTask extends BukkitRunnable { + private Location location; + public Task_UnpressTask(Location location){ + this.location = location; + } + + @SuppressWarnings("deprecation") + @Override + public void run() { + location.getBlock().setType(Material.STAINED_CLAY); + location.getBlock().setData((byte) 14); + this.cancel(); + } + +} diff --git a/src/alisolarflare/components/links/serializer/Deserializer.java b/src/alisolarflare/components/links/serializer/Deserializer.java deleted file mode 100644 index cfc1786..0000000 --- a/src/alisolarflare/components/links/serializer/Deserializer.java +++ /dev/null @@ -1,42 +0,0 @@ -package alisolarflare.components.links.serializer; - - -import java.io.FileInputStream; -import java.io.ObjectInputStream; -import java.util.List; - -import alisolarflare.components.links.entities.Link; - -/** - * @deprecated - * @author Alisolarflare - * - */ -public class Deserializer{ - - public static void main (String args[]) { - - //Deserializer deserializer = new Deserializer(); - //List aliLink = deserializer.loadLink(aliLink); - //System.out.println(aliLink); - } - - /**@deprecated*/ - @SuppressWarnings("unchecked") - public List loadLinkList(){ - List aliLinkList; - try{ - - FileInputStream fin = new FileInputStream("AliLinkList.ser"); - ObjectInputStream ois = new ObjectInputStream(fin); - aliLinkList = (List) ois.readObject(); - ois.close(); - - return aliLinkList; - - }catch(Exception ex){ - ex.printStackTrace(); - return null; - } - } -} diff --git a/src/alisolarflare/components/links/serializer/Serializer.java b/src/alisolarflare/components/links/serializer/Serializer.java deleted file mode 100644 index fe4efef..0000000 --- a/src/alisolarflare/components/links/serializer/Serializer.java +++ /dev/null @@ -1,38 +0,0 @@ -package alisolarflare.components.links.serializer; - - -import java.io.FileOutputStream; -import java.io.ObjectOutputStream; -import java.util.List; - -import alisolarflare.components.links.entities.Link; - -/** - * @deprecated - * @author Alisolarflare - * - */ -public class Serializer { - - public static void main (String args[]) { - - //Serializer serializer = new Serializer(); - //serializer.saveLink(plugin, frequency, location) - } - /**@deprecated*/ - public void saveLinkList(List aliLinkList){ - //saves link - - try{ - - FileOutputStream fout = new FileOutputStream("AliLinkList.ser"); - ObjectOutputStream oos = new ObjectOutputStream(fout); - oos.writeObject(aliLinkList); - oos.close(); - System.out.println("Done"); - - }catch(Exception ex){ - ex.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/src/alisolarflare/creativeboundaries/commands/Cbgm0.java b/src/alisolarflare/creativeboundaries/Command_Cbgm0.java similarity index 73% rename from src/alisolarflare/creativeboundaries/commands/Cbgm0.java rename to src/alisolarflare/creativeboundaries/Command_Cbgm0.java index 6e5fd2a..afa0aa9 100644 --- a/src/alisolarflare/creativeboundaries/commands/Cbgm0.java +++ b/src/alisolarflare/creativeboundaries/Command_Cbgm0.java @@ -1,49 +1,48 @@ -package alisolarflare.creativeboundaries.commands; - -import org.bukkit.GameMode; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.creativeboundaries.CreativeBoundariesModule; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Cbgm0 extends TBMCCommandBase{ - - private CreativeBoundariesModule module; - - public Cbgm0(CreativeBoundariesModule module) { - this.module = module; - } - - @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - return false; - } - - Player player = (Player) sender; - player.setGameMode(GameMode.SURVIVAL); - module.cbCreatives.remove(player); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.creativeboundaries; + +import org.bukkit.GameMode; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_Cbgm0 extends TBMCCommandBase{ + + private Module_CreativeBoundaries module; + + public Command_Cbgm0(Module_CreativeBoundaries module) { + this.module = module; + } + + @Override + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + return false; + } + + Player player = (Player) sender; + player.setGameMode(GameMode.SURVIVAL); + module.cbCreatives.remove(player); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/creativeboundaries/commands/Cbgm1.java b/src/alisolarflare/creativeboundaries/Command_Cbgm1.java similarity index 85% rename from src/alisolarflare/creativeboundaries/commands/Cbgm1.java rename to src/alisolarflare/creativeboundaries/Command_Cbgm1.java index 04fba33..c63e430 100644 --- a/src/alisolarflare/creativeboundaries/commands/Cbgm1.java +++ b/src/alisolarflare/creativeboundaries/Command_Cbgm1.java @@ -1,82 +1,81 @@ -package alisolarflare.creativeboundaries.commands; - -import org.bukkit.GameMode; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; -import com.palmergames.bukkit.towny.object.Resident; -import com.palmergames.bukkit.towny.object.Town; -import com.palmergames.bukkit.towny.object.TownBlock; -import com.palmergames.bukkit.towny.object.TownyUniverse; - -import alisolarflare.creativeboundaries.CreativeBoundariesModule; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Cbgm1 extends TBMCCommandBase { - - private CreativeBoundariesModule module; - - public Cbgm1(CreativeBoundariesModule module) { - this.module = module; - } - - @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - - if (!(sender instanceof Player)) { - sender.sendMessage("You must be a player to use this command!"); - return false; - } - - Player player = (Player) sender; - - TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); - if (tb == null) { - player.sendMessage("You aren't standing in a town or some other error occured."); - player.sendMessage("TownBlock is null."); - return false; - } - Town town; - try { - town = tb.getTown(); - } catch (NotRegisteredException e) { - player.sendMessage("You aren't standing in a town or some other error occured."); - player.sendMessage("TownBlock's town is not registered."); - return false; - } - if (town == null) { - player.sendMessage("ERROR: The town you're standing in is Null."); - return false; - } - - for(Resident res : town.getResidents()){ - if (res.getName().toString().equals(player.getName().toString())){ - player.setGameMode(GameMode.CREATIVE); - module.cbCreatives.add(player); - return true; - } - } - player.sendMessage("Sorry, you're not part of this town"); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.creativeboundaries; + +import org.bukkit.GameMode; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.Resident; +import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.towny.object.TownBlock; +import com.palmergames.bukkit.towny.object.TownyUniverse; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_Cbgm1 extends TBMCCommandBase { + + private Module_CreativeBoundaries module; + + public Command_Cbgm1(Module_CreativeBoundaries module) { + this.module = module; + } + + @Override + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { + + if (!(sender instanceof Player)) { + sender.sendMessage("You must be a player to use this command!"); + return false; + } + + Player player = (Player) sender; + + TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); + if (tb == null) { + player.sendMessage("You aren't standing in a town or some other error occured."); + player.sendMessage("TownBlock is null."); + return false; + } + Town town; + try { + town = tb.getTown(); + } catch (NotRegisteredException e) { + player.sendMessage("You aren't standing in a town or some other error occured."); + player.sendMessage("TownBlock's town is not registered."); + return false; + } + if (town == null) { + player.sendMessage("ERROR: The town you're standing in is Null."); + return false; + } + + for(Resident res : town.getResidents()){ + if (res.getName().toString().equals(player.getName().toString())){ + player.setGameMode(GameMode.CREATIVE); + module.cbCreatives.add(player); + return true; + } + } + player.sendMessage("Sorry, you're not part of this town"); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/creativeboundaries/commands/SetDickmode.java b/src/alisolarflare/creativeboundaries/Command_SetDickmode.java similarity index 78% rename from src/alisolarflare/creativeboundaries/commands/SetDickmode.java rename to src/alisolarflare/creativeboundaries/Command_SetDickmode.java index 3b1654b..fb0aa8d 100644 --- a/src/alisolarflare/creativeboundaries/commands/SetDickmode.java +++ b/src/alisolarflare/creativeboundaries/Command_SetDickmode.java @@ -1,54 +1,53 @@ -package alisolarflare.creativeboundaries.commands; - -import org.bukkit.command.CommandSender; - -import alisolarflare.creativeboundaries.CreativeBoundariesModule; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class SetDickmode extends TBMCCommandBase{ - private CreativeBoundariesModule module; - - public SetDickmode(CreativeBoundariesModule module){ - this.module = module; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (sender.getName().equals("Alisolarflare") || sender.getName().equals("iie")){ - if(args[0] == null){ - sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); - return false; - } - if(args[0].equalsIgnoreCase("TRUE") || args[0].equalsIgnoreCase("1")){ - sender.sendMessage("Dickmode has been turned on!"); - module.dickmode=(true); - return true; - } - if(args[0].equalsIgnoreCase("FALSE") || args[0].equalsIgnoreCase("0")){ - sender.sendMessage("Dickmode has been turned off!"); - module.dickmode=(false); - return true; - } - return false; - } - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } -} +package alisolarflare.creativeboundaries; + +import org.bukkit.command.CommandSender; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_SetDickmode extends TBMCCommandBase{ + private Module_CreativeBoundaries module; + + public Command_SetDickmode(Module_CreativeBoundaries module){ + this.module = module; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (sender.getName().equals("Alisolarflare") || sender.getName().equals("iie")){ + if(args[0] == null){ + sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); + return false; + } + if(args[0].equalsIgnoreCase("TRUE") || args[0].equalsIgnoreCase("1")){ + sender.sendMessage("Dickmode has been turned on!"); + module.dickmode=(true); + return true; + } + if(args[0].equalsIgnoreCase("FALSE") || args[0].equalsIgnoreCase("0")){ + sender.sendMessage("Dickmode has been turned off!"); + module.dickmode=(false); + return true; + } + return false; + } + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } +} diff --git a/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java b/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java deleted file mode 100644 index 39dac19..0000000 --- a/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java +++ /dev/null @@ -1,30 +0,0 @@ -package alisolarflare.creativeboundaries; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.creativeboundaries.commands.Cbgm0; -import alisolarflare.creativeboundaries.commands.Cbgm1; -import alisolarflare.creativeboundaries.commands.SetDickmode; -import alisolarflare.creativeboundaries.listeners.ItemRestrictionListener; -import alisolarflare.creativeboundaries.listeners.PlotChangeListener; - - -public class CreativeBoundariesModule extends Module{ - public boolean dickmode; - public List cbCreatives = new ArrayList(); - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new Cbgm1(this)); - registerCommand(plugin, new Cbgm0(this)); - registerCommand(plugin, new SetDickmode(this)); - - registerListener(plugin, new PlotChangeListener(this)); - //registerListener(plugin, new ItemRestrictionListener(this)); - } - -} diff --git a/src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java b/src/alisolarflare/creativeboundaries/Listener_ItemRestriction.java similarity index 52% rename from src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java rename to src/alisolarflare/creativeboundaries/Listener_ItemRestriction.java index 9023755..37d5ac7 100644 --- a/src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java +++ b/src/alisolarflare/creativeboundaries/Listener_ItemRestriction.java @@ -1,26 +1,24 @@ -package alisolarflare.creativeboundaries.listeners; - -import java.util.List; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.InventoryCreativeEvent; - -import alisolarflare.creativeboundaries.CreativeBoundariesModule; - -public class ItemRestrictionListener implements Listener { - - private CreativeBoundariesModule module; - - public ItemRestrictionListener(CreativeBoundariesModule module) { - this.module = module; - } - - @EventHandler - public void onItemTake(InventoryCreativeEvent event){ - List cbCreatives = module.cbCreatives; - - } - -} +package alisolarflare.creativeboundaries; + +import java.util.List; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.InventoryCreativeEvent; + +public class Listener_ItemRestriction implements Listener { + + private Module_CreativeBoundaries module; + + public Listener_ItemRestriction(Module_CreativeBoundaries module) { + this.module = module; + } + + @EventHandler + public void onItemTake(InventoryCreativeEvent event){ + List cbCreatives = module.cbCreatives; + + } + +} diff --git a/src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java b/src/alisolarflare/creativeboundaries/Listener_PlotChange.java similarity index 84% rename from src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java rename to src/alisolarflare/creativeboundaries/Listener_PlotChange.java index e911b98..980bdb6 100644 --- a/src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java +++ b/src/alisolarflare/creativeboundaries/Listener_PlotChange.java @@ -1,69 +1,67 @@ -package alisolarflare.creativeboundaries.listeners; - -import org.bukkit.GameMode; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; - -import com.palmergames.bukkit.towny.event.PlayerChangePlotEvent; -import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; -import com.palmergames.bukkit.towny.object.Resident; -import com.palmergames.bukkit.towny.object.Town; -import com.palmergames.bukkit.towny.object.TownBlock; -import com.palmergames.bukkit.towny.object.TownyUniverse; - -import alisolarflare.creativeboundaries.CreativeBoundariesModule; - -public class PlotChangeListener implements Listener{ - public CreativeBoundariesModule module; - public PlotChangeListener(CreativeBoundariesModule module){ - this.module = module; - } - @EventHandler - public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ - Player player = plotEvent.getPlayer(); - if (module.dickmode == false){ - return; - } - if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){ - return; - } - if (!(module.cbCreatives.contains(plotEvent.getPlayer()))){ - return; - } - TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); - if (tb == null) { - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!"); - module.cbCreatives.remove(player); - return; - } - Town town; - try { - town = tb.getTown(); - } catch (NotRegisteredException e) { - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!!"); - module.cbCreatives.remove(player); - return; - } - - if (town == null) { - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!!!"); - module.cbCreatives.remove(player); - return; - } - boolean townHasRes = false; - for(Resident res : town.getResidents()){ - if (res.getName().toString().equals(player.getName().toString())){ - townHasRes = true; - } - } - if (!townHasRes){ - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!!!!"); - module.cbCreatives.remove(player); - } - } -} +package alisolarflare.creativeboundaries; + +import org.bukkit.GameMode; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; + +import com.palmergames.bukkit.towny.event.PlayerChangePlotEvent; +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.Resident; +import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.towny.object.TownBlock; +import com.palmergames.bukkit.towny.object.TownyUniverse; + +public class Listener_PlotChange implements Listener{ + public Module_CreativeBoundaries module; + public Listener_PlotChange(Module_CreativeBoundaries module){ + this.module = module; + } + @EventHandler + public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ + Player player = plotEvent.getPlayer(); + if (module.dickmode == false){ + return; + } + if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){ + return; + } + if (!(module.cbCreatives.contains(plotEvent.getPlayer()))){ + return; + } + TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); + if (tb == null) { + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!"); + module.cbCreatives.remove(player); + return; + } + Town town; + try { + town = tb.getTown(); + } catch (NotRegisteredException e) { + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!!"); + module.cbCreatives.remove(player); + return; + } + + if (town == null) { + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!!!"); + module.cbCreatives.remove(player); + return; + } + boolean townHasRes = false; + for(Resident res : town.getResidents()){ + if (res.getName().toString().equals(player.getName().toString())){ + townHasRes = true; + } + } + if (!townHasRes){ + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!!!!"); + module.cbCreatives.remove(player); + } + } +} diff --git a/src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java b/src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java new file mode 100644 index 0000000..fcd58da --- /dev/null +++ b/src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java @@ -0,0 +1,25 @@ +package alisolarflare.creativeboundaries; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; + + +public class Module_CreativeBoundaries extends Module{ + public boolean dickmode; + public List cbCreatives = new ArrayList(); + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new Command_Cbgm1(this)); + registerCommand(plugin, new Command_Cbgm0(this)); + registerCommand(plugin, new Command_SetDickmode(this)); + + registerListener(plugin, new Listener_PlotChange(this)); + //registerListener(plugin, new ItemRestrictionListener(this)); + } + +} diff --git a/src/alisolarflare/easyuhc/commands/ActivatePowers.java b/src/alisolarflare/easyuhc/Command_ActivatePowers.java similarity index 85% rename from src/alisolarflare/easyuhc/commands/ActivatePowers.java rename to src/alisolarflare/easyuhc/Command_ActivatePowers.java index 737ac72..26789ce 100644 --- a/src/alisolarflare/easyuhc/commands/ActivatePowers.java +++ b/src/alisolarflare/easyuhc/Command_ActivatePowers.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.easyuhc; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class ActivatePowers extends TBMCCommandBase{ +public class Command_ActivatePowers extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/SetupWorldBorders.java b/src/alisolarflare/easyuhc/Command_SetupWorldBorders.java similarity index 85% rename from src/alisolarflare/easyuhc/commands/SetupWorldBorders.java rename to src/alisolarflare/easyuhc/Command_SetupWorldBorders.java index ef90ae8..db45dc0 100644 --- a/src/alisolarflare/easyuhc/commands/SetupWorldBorders.java +++ b/src/alisolarflare/easyuhc/Command_SetupWorldBorders.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.easyuhc; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class SetupWorldBorders extends TBMCCommandBase { +public class Command_SetupWorldBorders extends TBMCCommandBase { @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java b/src/alisolarflare/easyuhc/Command_ShrinkWorldBorders.java similarity index 85% rename from src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java rename to src/alisolarflare/easyuhc/Command_ShrinkWorldBorders.java index bd083a6..b25bf11 100644 --- a/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java +++ b/src/alisolarflare/easyuhc/Command_ShrinkWorldBorders.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.easyuhc; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class ShrinkWorldBorders extends TBMCCommandBase { +public class Command_ShrinkWorldBorders extends TBMCCommandBase { @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/SpreadPlayers.java b/src/alisolarflare/easyuhc/Command_SpreadPlayers.java similarity index 85% rename from src/alisolarflare/easyuhc/commands/SpreadPlayers.java rename to src/alisolarflare/easyuhc/Command_SpreadPlayers.java index a5798ac..f83e70a 100644 --- a/src/alisolarflare/easyuhc/commands/SpreadPlayers.java +++ b/src/alisolarflare/easyuhc/Command_SpreadPlayers.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.easyuhc; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class SpreadPlayers extends TBMCCommandBase{ +public class Command_SpreadPlayers extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/StartTimer.java b/src/alisolarflare/easyuhc/Command_StartTimer.java similarity index 86% rename from src/alisolarflare/easyuhc/commands/StartTimer.java rename to src/alisolarflare/easyuhc/Command_StartTimer.java index 927344e..96dad6f 100644 --- a/src/alisolarflare/easyuhc/commands/StartTimer.java +++ b/src/alisolarflare/easyuhc/Command_StartTimer.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.easyuhc; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class StartTimer extends TBMCCommandBase{ +public class Command_StartTimer extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/StartUHC.java b/src/alisolarflare/easyuhc/Command_StartUHC.java similarity index 86% rename from src/alisolarflare/easyuhc/commands/StartUHC.java rename to src/alisolarflare/easyuhc/Command_StartUHC.java index 2a06889..7cc116d 100644 --- a/src/alisolarflare/easyuhc/commands/StartUHC.java +++ b/src/alisolarflare/easyuhc/Command_StartUHC.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.easyuhc; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class StartUHC extends TBMCCommandBase{ +public class Command_StartUHC extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/TeleportToUHC.java b/src/alisolarflare/easyuhc/Command_TeleportToUHC.java similarity index 85% rename from src/alisolarflare/easyuhc/commands/TeleportToUHC.java rename to src/alisolarflare/easyuhc/Command_TeleportToUHC.java index 5a5c6d0..3f46306 100644 --- a/src/alisolarflare/easyuhc/commands/TeleportToUHC.java +++ b/src/alisolarflare/easyuhc/Command_TeleportToUHC.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.easyuhc; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class TeleportToUHC extends TBMCCommandBase{ +public class Command_TeleportToUHC extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/EasyUHCModule.java b/src/alisolarflare/easyuhc/EasyUHCModule.java deleted file mode 100644 index 408e909..0000000 --- a/src/alisolarflare/easyuhc/EasyUHCModule.java +++ /dev/null @@ -1,24 +0,0 @@ -package alisolarflare.easyuhc; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.easyuhc.commands.ActivatePowers; -import alisolarflare.easyuhc.commands.SetupWorldBorders; -import alisolarflare.easyuhc.commands.SpreadPlayers; -import alisolarflare.easyuhc.commands.StartTimer; -import alisolarflare.easyuhc.commands.StartUHC; -import alisolarflare.easyuhc.commands.TeleportToUHC; - -public class EasyUHCModule extends Module{ - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new ActivatePowers()); - registerCommand(plugin, new SetupWorldBorders()); - registerCommand(plugin, new SetupWorldBorders()); - registerCommand(plugin, new SpreadPlayers()); - registerCommand(plugin, new StartTimer()); - registerCommand(plugin, new StartUHC()); - registerCommand(plugin, new TeleportToUHC()); - } -} diff --git a/src/alisolarflare/easyuhc/Module_EasyUHC.java b/src/alisolarflare/easyuhc/Module_EasyUHC.java new file mode 100644 index 0000000..4ad1b1a --- /dev/null +++ b/src/alisolarflare/easyuhc/Module_EasyUHC.java @@ -0,0 +1,18 @@ +package alisolarflare.easyuhc; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; + +public class Module_EasyUHC extends Module{ + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new Command_ActivatePowers()); + registerCommand(plugin, new Command_SetupWorldBorders()); + registerCommand(plugin, new Command_SetupWorldBorders()); + registerCommand(plugin, new Command_SpreadPlayers()); + registerCommand(plugin, new Command_StartTimer()); + registerCommand(plugin, new Command_StartUHC()); + registerCommand(plugin, new Command_TeleportToUHC()); + } +} diff --git a/src/alisolarflare/magic/tricks/AliArrowListener.java b/src/alisolarflare/magic/AliArrowListener.java similarity index 92% rename from src/alisolarflare/magic/tricks/AliArrowListener.java rename to src/alisolarflare/magic/AliArrowListener.java index 36b8e12..ecd79e6 100644 --- a/src/alisolarflare/magic/tricks/AliArrowListener.java +++ b/src/alisolarflare/magic/AliArrowListener.java @@ -1,39 +1,39 @@ -package alisolarflare.magic.tricks; - -import org.bukkit.entity.Arrow; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.ProjectileLaunchEvent; -import org.bukkit.plugin.java.JavaPlugin; - -public class AliArrowListener implements Listener { - private final JavaPlugin plugin; - - public AliArrowListener(JavaPlugin plugin){ - this.plugin = plugin; - } - - @EventHandler - public void onProjectileLaunch(ProjectileLaunchEvent event){ - if(event.getEntity().getType() != EntityType.ARROW){ - return; - } - Arrow arrow = (Arrow) event.getEntity(); - if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player)){ - return; - } - - String user = ((Player) arrow.getShooter()).getName(); - - for (String permittedUser : AliArrowTask.permittedUsers){ - if(permittedUser.equalsIgnoreCase(user)){ - new AliArrowTask(arrow,user).runTaskTimer(plugin, 2, 1); - break; - } - } - return; - - } +package alisolarflare.magic; + +import org.bukkit.entity.Arrow; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.ProjectileLaunchEvent; +import org.bukkit.plugin.java.JavaPlugin; + +public class AliArrowListener implements Listener { + private final JavaPlugin plugin; + + public AliArrowListener(JavaPlugin plugin){ + this.plugin = plugin; + } + + @EventHandler + public void onProjectileLaunch(ProjectileLaunchEvent event){ + if(event.getEntity().getType() != EntityType.ARROW){ + return; + } + Arrow arrow = (Arrow) event.getEntity(); + if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player)){ + return; + } + + String user = ((Player) arrow.getShooter()).getName(); + + for (String permittedUser : AliArrowTask.permittedUsers){ + if(permittedUser.equalsIgnoreCase(user)){ + new AliArrowTask(arrow,user).runTaskTimer(plugin, 2, 1); + break; + } + } + return; + + } } \ No newline at end of file diff --git a/src/alisolarflare/magic/tricks/AliArrowTask.java b/src/alisolarflare/magic/AliArrowTask.java similarity index 92% rename from src/alisolarflare/magic/tricks/AliArrowTask.java rename to src/alisolarflare/magic/AliArrowTask.java index 10252b8..055a4fd 100644 --- a/src/alisolarflare/magic/tricks/AliArrowTask.java +++ b/src/alisolarflare/magic/AliArrowTask.java @@ -1,40 +1,40 @@ -package alisolarflare.magic.tricks; - -import org.bukkit.Particle; -import org.bukkit.entity.Arrow; -import org.bukkit.scheduler.BukkitRunnable; - -public class AliArrowTask extends BukkitRunnable { - static String[] permittedUsers = {"alisolarflare", "Zanthr", "NorbiPeti"}; - String name; - Arrow arrow; - - public AliArrowTask(Arrow arrow, String name) { - this.name = name; - this.arrow = arrow; - } - - @Override - public void run() { - if (arrow.isOnGround() || arrow.isDead()) { - this.cancel(); - } - - switch(name.toLowerCase()){ - case "alisolarflare": - arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1); - break; - - case "zanthr": - arrow.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, arrow.getLocation(), 1); - arrow.getWorld().spawnParticle(Particle.FLAME, arrow.getLocation(), 1); - break; - - case "norbipeti": - arrow.getWorld().spawnParticle(Particle.LAVA, arrow.getLocation(), 1); - break; - } - - } - -} +package alisolarflare.magic; + +import org.bukkit.Particle; +import org.bukkit.entity.Arrow; +import org.bukkit.scheduler.BukkitRunnable; + +public class AliArrowTask extends BukkitRunnable { + static String[] permittedUsers = {"alisolarflare", "Zanthr", "NorbiPeti"}; + String name; + Arrow arrow; + + public AliArrowTask(Arrow arrow, String name) { + this.name = name; + this.arrow = arrow; + } + + @Override + public void run() { + if (arrow.isOnGround() || arrow.isDead()) { + this.cancel(); + } + + switch(name.toLowerCase()){ + case "alisolarflare": + arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1); + break; + + case "zanthr": + arrow.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, arrow.getLocation(), 1); + arrow.getWorld().spawnParticle(Particle.FLAME, arrow.getLocation(), 1); + break; + + case "norbipeti": + arrow.getWorld().spawnParticle(Particle.LAVA, arrow.getLocation(), 1); + break; + } + + } + +} diff --git a/src/alisolarflare/magic/tricks/BoomBowDeathListener.java b/src/alisolarflare/magic/BoomBowDeathListener.java similarity index 90% rename from src/alisolarflare/magic/tricks/BoomBowDeathListener.java rename to src/alisolarflare/magic/BoomBowDeathListener.java index 427537e..f16d3c1 100644 --- a/src/alisolarflare/magic/tricks/BoomBowDeathListener.java +++ b/src/alisolarflare/magic/BoomBowDeathListener.java @@ -1,18 +1,18 @@ -package alisolarflare.magic.tricks; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.PlayerDeathEvent; - -public class BoomBowDeathListener implements Listener{ - @EventHandler - public void onBoomBowDeath(PlayerDeathEvent event){ - Player player = event.getEntity(); - - if (player.getLastDamage() > 7.42420 && player.getLastDamage() < 7.42429){ - player.sendMessage("42!"); - event.setDeathMessage(player.getName() + " got trigger happy with the [Boom Bow]"); - } - } -} +package alisolarflare.magic; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.PlayerDeathEvent; + +public class BoomBowDeathListener implements Listener{ + @EventHandler + public void onBoomBowDeath(PlayerDeathEvent event){ + Player player = event.getEntity(); + + if (player.getLastDamage() > 7.42420 && player.getLastDamage() < 7.42429){ + player.sendMessage("42!"); + event.setDeathMessage(player.getName() + " got trigger happy with the [Boom Bow]"); + } + } +} diff --git a/src/alisolarflare/magic/tricks/BoomBowListener.java b/src/alisolarflare/magic/BoomBowListener.java similarity index 95% rename from src/alisolarflare/magic/tricks/BoomBowListener.java rename to src/alisolarflare/magic/BoomBowListener.java index 5e74bd8..8381927 100644 --- a/src/alisolarflare/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/magic/BoomBowListener.java @@ -1,107 +1,107 @@ -package alisolarflare.magic.tricks; - -import org.bukkit.GameMode; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Particle; -import org.bukkit.Sound; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; - -public class BoomBowListener implements Listener { - JavaPlugin plugin; - public BoomBowListener(JavaPlugin plugin){ - this.plugin = plugin; - } - @EventHandler - public void ClickEvent(PlayerInteractEvent event){ - FlyBowBoost(event); - - } - public void FlyBowBoost(PlayerInteractEvent event){ - - //ACTION SANITATION - if(!(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK)) return; - if(!(event.getPlayer().isGliding())) return; - if(!(event.getMaterial() == Material.BOW)) return; - - //BOW SANITATION - ItemStack bow = event.getItem(); - if(!(bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK))) return; - if(!(bow.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) == 3)) return; - if(!(bow.getItemMeta().getDisplayName().contains("BOOM BOW"))) return; - - //PLAYER SANITATION - Player player = event.getPlayer(); - if(player.getGameMode().equals(GameMode.CREATIVE))return; - - if(bow.containsEnchantment(Enchantment.ARROW_INFINITE)){ - //HAS INIFINITY - Activate(event); - - }else if((player.getInventory().contains(Material.TNT))){ - //HAS TNT - Activate(event); - - //Reduce tnt by 1 - int tntSlot = player.getInventory().first(Material.TNT); - ItemStack tntStack = player.getInventory().getItem(tntSlot); - if(tntStack.getAmount() > 3){ - tntStack.setAmount(tntStack.getAmount()-3); - }else{ - player.getInventory().remove(tntStack); - } - - }else{ - return; - } - } - - - - public void Activate(PlayerInteractEvent event){ - //INIT - Player variables - Player player = event.getPlayer(); - Location playerLocation = player.getLocation(); - ItemStack boomBow = player.getInventory().getItemInMainHand(); - - //TODO: NERF - boomDecay - //TODO: NERF - endCrystal - //TODO: NERF - healthReduction - //TODO: NERF - localized - - if(BoomBowRule.boomDecay) - new BoomDecayTask(player).runTaskTimer(plugin, 1, 1); - if(BoomBowRule.endCrystal){ - //BoomBowCyrstalSpawn - } - if(BoomBowRule.healthReduction){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1)); - } - if(BoomBowRule.localized); - - - //SET - Player Velocity - player.setVelocity(playerLocation.getDirection().normalize().multiply(3.0)); - - //CREATE - Explosion + damage - player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); - player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); - player.damage(7.42425, player); - player.sendMessage(player.getLastDamage() + ""); - boomBow.setDurability((short) (boomBow.getDurability() + 3)); - if(boomBow.getDurability() < 0){ - player.getInventory().setItemInMainHand(null); - player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0); - } - - } -} +package alisolarflare.magic; + +import org.bukkit.GameMode; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Particle; +import org.bukkit.Sound; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +public class BoomBowListener implements Listener { + JavaPlugin plugin; + public BoomBowListener(JavaPlugin plugin){ + this.plugin = plugin; + } + @EventHandler + public void ClickEvent(PlayerInteractEvent event){ + FlyBowBoost(event); + + } + public void FlyBowBoost(PlayerInteractEvent event){ + + //ACTION SANITATION + if(!(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK)) return; + if(!(event.getPlayer().isGliding())) return; + if(!(event.getMaterial() == Material.BOW)) return; + + //BOW SANITATION + ItemStack bow = event.getItem(); + if(!(bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK))) return; + if(!(bow.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) == 3)) return; + if(!(bow.getItemMeta().getDisplayName().contains("BOOM BOW"))) return; + + //PLAYER SANITATION + Player player = event.getPlayer(); + if(player.getGameMode().equals(GameMode.CREATIVE))return; + + if(bow.containsEnchantment(Enchantment.ARROW_INFINITE)){ + //HAS INIFINITY + Activate(event); + + }else if((player.getInventory().contains(Material.TNT))){ + //HAS TNT + Activate(event); + + //Reduce tnt by 1 + int tntSlot = player.getInventory().first(Material.TNT); + ItemStack tntStack = player.getInventory().getItem(tntSlot); + if(tntStack.getAmount() > 3){ + tntStack.setAmount(tntStack.getAmount()-3); + }else{ + player.getInventory().remove(tntStack); + } + + }else{ + return; + } + } + + + + public void Activate(PlayerInteractEvent event){ + //INIT - Player variables + Player player = event.getPlayer(); + Location playerLocation = player.getLocation(); + ItemStack boomBow = player.getInventory().getItemInMainHand(); + + //TODO: NERF - boomDecay + //TODO: NERF - endCrystal + //TODO: NERF - healthReduction + //TODO: NERF - localized + + if(BoomBowRule.boomDecay) + new BoomDecayTask(player).runTaskTimer(plugin, 1, 1); + if(BoomBowRule.endCrystal){ + //BoomBowCyrstalSpawn + } + if(BoomBowRule.healthReduction){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1)); + } + if(BoomBowRule.localized); + + + //SET - Player Velocity + player.setVelocity(playerLocation.getDirection().normalize().multiply(3.0)); + + //CREATE - Explosion + damage + player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); + player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); + player.damage(7.42425, player); + player.sendMessage(player.getLastDamage() + ""); + boomBow.setDurability((short) (boomBow.getDurability() + 3)); + if(boomBow.getDurability() < 0){ + player.getInventory().setItemInMainHand(null); + player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0); + } + + } +} diff --git a/src/alisolarflare/magic/tricks/BoomBowRule.java b/src/alisolarflare/magic/BoomBowRule.java similarity index 95% rename from src/alisolarflare/magic/tricks/BoomBowRule.java rename to src/alisolarflare/magic/BoomBowRule.java index bbfbf8f..caa0256 100644 --- a/src/alisolarflare/magic/tricks/BoomBowRule.java +++ b/src/alisolarflare/magic/BoomBowRule.java @@ -1,84 +1,84 @@ -package alisolarflare.magic.tricks; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import buttondevteam.lib.chat.TBMCCommandBase; -//HEHEHHEHEH EAASSSTER EGGS -public class BoomBowRule extends TBMCCommandBase{ - public static boolean boomDecay; - public static boolean healthReduction; - public static boolean endCrystal; - public static boolean localized;; - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (sender instanceof Player == false){ - sender.sendMessage("You must be a player to use this command"); - return false; - } - Player player = (Player) sender; - if (player.getName().equals("alisolarflare") == false){ - player.sendMessage("You must be alisolarflare to use this command"); - return false; - } - if (args.length < 2){ - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); - player.sendMessage("Rules:"); - player.sendMessage("boomDecay" + boomDecay); - player.sendMessage("healthReduction" + healthReduction); - player.sendMessage("endCrystal" + endCrystal); - player.sendMessage("localized" + localized); - return false; - } - if(!(args[1].startsWith("t")|| args[1].startsWith("f"))){ - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); - return false; - } - boolean gameRule = false; - if(args[1].startsWith("t") || args[1].startsWith("T")){ - gameRule = true; - } - switch(args[0]){ - case "boomDecay": - boomDecay = gameRule; - break; - case "healthReduction": - healthReduction = gameRule; - break; - case "endCrystal": - endCrystal = gameRule; - break; - case "localized": - localized = gameRule; - break; - default: - player.sendMessage("Error: "+args[0]+" not defined as a rule"); - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); - player.sendMessage("Rule settings: boomDecay, healthReduction, endCrystal, localized"); - break; - } - - return false; - } - @Override - public String GetCommandPath() { - // TODO Auto-generated method stub - return null; - } - @Override - public String[] GetHelpText(String arg0) { - // TODO Auto-generated method stub - return null; - } - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.magic; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import buttondevteam.lib.chat.TBMCCommandBase; +//HEHEHHEHEH EAASSSTER EGGS +public class BoomBowRule extends TBMCCommandBase{ + public static boolean boomDecay; + public static boolean healthReduction; + public static boolean endCrystal; + public static boolean localized;; + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (sender instanceof Player == false){ + sender.sendMessage("You must be a player to use this command"); + return false; + } + Player player = (Player) sender; + if (player.getName().equals("alisolarflare") == false){ + player.sendMessage("You must be alisolarflare to use this command"); + return false; + } + if (args.length < 2){ + player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); + player.sendMessage("Rules:"); + player.sendMessage("boomDecay" + boomDecay); + player.sendMessage("healthReduction" + healthReduction); + player.sendMessage("endCrystal" + endCrystal); + player.sendMessage("localized" + localized); + return false; + } + if(!(args[1].startsWith("t")|| args[1].startsWith("f"))){ + player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); + return false; + } + boolean gameRule = false; + if(args[1].startsWith("t") || args[1].startsWith("T")){ + gameRule = true; + } + switch(args[0]){ + case "boomDecay": + boomDecay = gameRule; + break; + case "healthReduction": + healthReduction = gameRule; + break; + case "endCrystal": + endCrystal = gameRule; + break; + case "localized": + localized = gameRule; + break; + default: + player.sendMessage("Error: "+args[0]+" not defined as a rule"); + player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); + player.sendMessage("Rule settings: boomDecay, healthReduction, endCrystal, localized"); + break; + } + + return false; + } + @Override + public String GetCommandPath() { + // TODO Auto-generated method stub + return null; + } + @Override + public String[] GetHelpText(String arg0) { + // TODO Auto-generated method stub + return null; + } + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/magic/tricks/BoomDecayTask.java b/src/alisolarflare/magic/BoomDecayTask.java similarity index 88% rename from src/alisolarflare/magic/tricks/BoomDecayTask.java rename to src/alisolarflare/magic/BoomDecayTask.java index 5f1875c..2d128f9 100644 --- a/src/alisolarflare/magic/tricks/BoomDecayTask.java +++ b/src/alisolarflare/magic/BoomDecayTask.java @@ -1,25 +1,25 @@ -package alisolarflare.magic.tricks; - -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; - -public class BoomDecayTask extends BukkitRunnable{ - Player player; - private int ticksSinceStart = 0; - private final int effectLength = 20; - public BoomDecayTask(Player player){ - this.player = player; - } - //runs every tick - @Override - public void run() { - if (ticksSinceStart > effectLength){ - this.cancel(); - } - player.sendMessage(player.getVelocity().toString()); - - ticksSinceStart++; - - } - -} +package alisolarflare.magic; + +import org.bukkit.entity.Player; +import org.bukkit.scheduler.BukkitRunnable; + +public class BoomDecayTask extends BukkitRunnable{ + Player player; + private int ticksSinceStart = 0; + private final int effectLength = 20; + public BoomDecayTask(Player player){ + this.player = player; + } + //runs every tick + @Override + public void run() { + if (ticksSinceStart > effectLength){ + this.cancel(); + } + player.sendMessage(player.getVelocity().toString()); + + ticksSinceStart++; + + } + +} diff --git a/src/alisolarflare/magic/MagicModule.java b/src/alisolarflare/magic/MagicModule.java index 616b179..9a83bd0 100644 --- a/src/alisolarflare/magic/MagicModule.java +++ b/src/alisolarflare/magic/MagicModule.java @@ -3,9 +3,6 @@ package alisolarflare.magic; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; -import alisolarflare.magic.tricks.AliArrowListener; -import alisolarflare.magic.tricks.BoomBowDeathListener; -import alisolarflare.magic.tricks.BoomBowListener; public class MagicModule extends Module{ From fc862a670ef33bfe353d5f289b0cf093ecaadfee Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 6 Nov 2016 18:51:31 -0500 Subject: [PATCH 106/263] Revert "Comit to Uncommit" This reverts commit 125a3c01e8a18a880406b8ff49265c9514c31f03. --- .../components/flairdoor/FlairDoorModule.java | 15 + .../flairdoor/Module_FlairDoor.java | 13 - .../FlairMe.java} | 77 ++--- .../PortalListener.java} | 276 ++++++++--------- .../{Memory_GPower.java => GPowerMemory.java} | 104 +++---- .../components/gpowers/GPowerModule.java | 23 ++ .../gpowers/Listener_PowerLooper.java | 11 - .../components/gpowers/Module_GPower.java | 19 -- .../GPower.java} | 151 +++++----- .../PowerDown.java} | 97 +++--- .../PowerUp.java} | 97 +++--- .../gPowerApplyingTask.java} | 132 ++++----- .../gpowers/listeners/gPowerListener.java | 13 + .../components/links/AliLinkModule.java | 33 +++ .../components/links/Module_AliLink.java | 30 -- .../PressAliLink.java} | 119 ++++---- .../SetAliLink.java} | 278 +++++++++--------- .../{Memory_Link.java => entities/Link.java} | 80 ++--- .../links/serializer/Deserializer.java | 42 +++ .../links/serializer/Serializer.java | 38 +++ .../UnpressTask.java} | 42 +-- .../CreativeBoundariesModule.java | 30 ++ .../Module_CreativeBoundaries.java | 25 -- .../Cbgm0.java} | 97 +++--- .../Cbgm1.java} | 163 +++++----- .../SetDickmode.java} | 107 +++---- .../ItemRestrictionListener.java} | 50 ++-- .../PlotChangeListener.java} | 136 ++++----- src/alisolarflare/easyuhc/EasyUHCModule.java | 24 ++ src/alisolarflare/easyuhc/Module_EasyUHC.java | 18 -- .../ActivatePowers.java} | 4 +- .../SetupWorldBorders.java} | 4 +- .../ShrinkWorldBorders.java} | 4 +- .../SpreadPlayers.java} | 4 +- .../StartTimer.java} | 4 +- .../StartUHC.java} | 4 +- .../TeleportToUHC.java} | 4 +- src/alisolarflare/magic/MagicModule.java | 3 + .../magic/{ => tricks}/AliArrowListener.java | 76 ++--- .../magic/{ => tricks}/AliArrowTask.java | 80 ++--- .../{ => tricks}/BoomBowDeathListener.java | 36 +-- .../magic/{ => tricks}/BoomBowListener.java | 214 +++++++------- .../magic/{ => tricks}/BoomBowRule.java | 168 +++++------ .../magic/{ => tricks}/BoomDecayTask.java | 50 ++-- 44 files changed, 1558 insertions(+), 1437 deletions(-) create mode 100644 src/alisolarflare/components/flairdoor/FlairDoorModule.java delete mode 100644 src/alisolarflare/components/flairdoor/Module_FlairDoor.java rename src/alisolarflare/components/flairdoor/{Command_FlairMe.java => commands/FlairMe.java} (69%) rename src/alisolarflare/components/flairdoor/{Listener_Portal.java => listeners/PortalListener.java} (92%) rename src/alisolarflare/components/gpowers/{Memory_GPower.java => GPowerMemory.java} (95%) create mode 100644 src/alisolarflare/components/gpowers/GPowerModule.java delete mode 100644 src/alisolarflare/components/gpowers/Listener_PowerLooper.java delete mode 100644 src/alisolarflare/components/gpowers/Module_GPower.java rename src/alisolarflare/components/gpowers/{Command_GPower.java => commands/GPower.java} (86%) rename src/alisolarflare/components/gpowers/{Command_PowerDown.java => commands/PowerDown.java} (75%) rename src/alisolarflare/components/gpowers/{Command_PowerUp.java => commands/PowerUp.java} (75%) rename src/alisolarflare/components/gpowers/{Task_PowerApplier.java => listeners/gPowerApplyingTask.java} (88%) create mode 100644 src/alisolarflare/components/gpowers/listeners/gPowerListener.java create mode 100644 src/alisolarflare/components/links/AliLinkModule.java delete mode 100644 src/alisolarflare/components/links/Module_AliLink.java rename src/alisolarflare/components/links/{Command_PressAliLink.java => commands/PressAliLink.java} (75%) rename src/alisolarflare/components/links/{Command_SetAliLink.java => commands/SetAliLink.java} (80%) rename src/alisolarflare/components/links/{Memory_Link.java => entities/Link.java} (74%) create mode 100644 src/alisolarflare/components/links/serializer/Deserializer.java create mode 100644 src/alisolarflare/components/links/serializer/Serializer.java rename src/alisolarflare/components/links/{Task_UnpressTask.java => tasks/UnpressTask.java} (68%) create mode 100644 src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java delete mode 100644 src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java rename src/alisolarflare/creativeboundaries/{Command_Cbgm0.java => commands/Cbgm0.java} (73%) rename src/alisolarflare/creativeboundaries/{Command_Cbgm1.java => commands/Cbgm1.java} (85%) rename src/alisolarflare/creativeboundaries/{Command_SetDickmode.java => commands/SetDickmode.java} (78%) rename src/alisolarflare/creativeboundaries/{Listener_ItemRestriction.java => listeners/ItemRestrictionListener.java} (52%) rename src/alisolarflare/creativeboundaries/{Listener_PlotChange.java => listeners/PlotChangeListener.java} (84%) create mode 100644 src/alisolarflare/easyuhc/EasyUHCModule.java delete mode 100644 src/alisolarflare/easyuhc/Module_EasyUHC.java rename src/alisolarflare/easyuhc/{Command_ActivatePowers.java => commands/ActivatePowers.java} (85%) rename src/alisolarflare/easyuhc/{Command_SetupWorldBorders.java => commands/SetupWorldBorders.java} (85%) rename src/alisolarflare/easyuhc/{Command_ShrinkWorldBorders.java => commands/ShrinkWorldBorders.java} (85%) rename src/alisolarflare/easyuhc/{Command_SpreadPlayers.java => commands/SpreadPlayers.java} (85%) rename src/alisolarflare/easyuhc/{Command_StartTimer.java => commands/StartTimer.java} (86%) rename src/alisolarflare/easyuhc/{Command_StartUHC.java => commands/StartUHC.java} (86%) rename src/alisolarflare/easyuhc/{Command_TeleportToUHC.java => commands/TeleportToUHC.java} (85%) rename src/alisolarflare/magic/{ => tricks}/AliArrowListener.java (92%) rename src/alisolarflare/magic/{ => tricks}/AliArrowTask.java (92%) rename src/alisolarflare/magic/{ => tricks}/BoomBowDeathListener.java (90%) rename src/alisolarflare/magic/{ => tricks}/BoomBowListener.java (95%) rename src/alisolarflare/magic/{ => tricks}/BoomBowRule.java (95%) rename src/alisolarflare/magic/{ => tricks}/BoomDecayTask.java (88%) diff --git a/src/alisolarflare/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/components/flairdoor/FlairDoorModule.java new file mode 100644 index 0000000..1c5cddb --- /dev/null +++ b/src/alisolarflare/components/flairdoor/FlairDoorModule.java @@ -0,0 +1,15 @@ +package alisolarflare.components.flairdoor; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.components.flairdoor.commands.FlairMe; +import alisolarflare.components.flairdoor.listeners.PortalListener; + +public class FlairDoorModule extends Module { + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new FlairMe()); + registerListener(plugin, new PortalListener(plugin)); + } +} diff --git a/src/alisolarflare/components/flairdoor/Module_FlairDoor.java b/src/alisolarflare/components/flairdoor/Module_FlairDoor.java deleted file mode 100644 index ca893a7..0000000 --- a/src/alisolarflare/components/flairdoor/Module_FlairDoor.java +++ /dev/null @@ -1,13 +0,0 @@ -package alisolarflare.components.flairdoor; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; - -public class Module_FlairDoor extends Module { - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new Command_FlairMe()); - registerListener(plugin, new Listener_Portal(plugin)); - } -} diff --git a/src/alisolarflare/components/flairdoor/Command_FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java similarity index 69% rename from src/alisolarflare/components/flairdoor/Command_FlairMe.java rename to src/alisolarflare/components/flairdoor/commands/FlairMe.java index 819ed54..963da82 100644 --- a/src/alisolarflare/components/flairdoor/Command_FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -1,38 +1,39 @@ -package alisolarflare.components.flairdoor; - -import org.bukkit.command.CommandSender; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_FlairMe extends TBMCCommandBase { - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - Listener_Portal.playersToBeFlaired.add(sender.getName()); - sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); - - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return new String[] { "" }; - } - - @Override - public String GetCommandPath() { - return "flairme"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - return false; - } - -} +package alisolarflare.components.flairdoor.commands; + +import org.bukkit.command.CommandSender; + +import alisolarflare.components.flairdoor.listeners.PortalListener; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class FlairMe extends TBMCCommandBase { + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + PortalListener.playersToBeFlaired.add(sender.getName()); + sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); + + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return new String[] { "" }; + } + + @Override + public String GetCommandPath() { + return "flairme"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + return false; + } + +} diff --git a/src/alisolarflare/components/flairdoor/Listener_Portal.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java similarity index 92% rename from src/alisolarflare/components/flairdoor/Listener_Portal.java rename to src/alisolarflare/components/flairdoor/listeners/PortalListener.java index 59791d4..4ce684a 100644 --- a/src/alisolarflare/components/flairdoor/Listener_Portal.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -1,138 +1,138 @@ -package alisolarflare.components.flairdoor; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.Bukkit; -import org.bukkit.DyeColor; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerPortalEvent; -import org.bukkit.material.MaterialData; -import org.bukkit.material.Wool; -import org.bukkit.plugin.java.JavaPlugin; - -import com.earth2me.essentials.Essentials; -import com.earth2me.essentials.User; - -public class Listener_Portal implements Listener{ - public static List playersToBeFlaired = new ArrayList(); - public JavaPlugin plugin; - - Essentials essentials; - - public Listener_Portal(JavaPlugin plugin) { - this.plugin = plugin; - this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials")); - } - @EventHandler - public void onPortalEnter(PlayerPortalEvent event){ - //SANITATION - Player - if(!(event.getPlayer() instanceof Player)){ - return; - } - - //INIT - Player - Player player = event.getPlayer(); - - //SANITATION - PlayersToBeFlaired - if(!(playersToBeFlaired.contains(player.getName()))){ - return; - } - player.sendMessage("-MAY THE FLAIRING COMMENCE-"); - event.setTo(player.getLocation()); - - //INIT - x,y,z - int x = player.getLocation().getBlockX(); - int y = player.getLocation().getBlockY(); - int z = player.getLocation().getBlockZ(); - - //INIT - Blocks Under Portal - Block HigherBlock = player.getWorld().getBlockAt(x,y-2,z); - Block MiddleBlock = player.getWorld().getBlockAt(x,y-3,z); - Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); - - //RECOLOUR PLAYER - if(HigherBlock.getType() == Material.STONE){ - recolourPlayer(player, DyeColor.GRAY); - - //TOP BLOCK IS WOOL? - }else if(HigherBlock.getType() == Material.WOOL){ - Wool wool = (Wool) HigherBlock.getState().getData(); - recolourPlayer(player, wool.getColor()); - - //MIDDLE BLOCK IS WOOL? - }else if(MiddleBlock.getType() == Material.WOOL){ - MaterialData mData = MiddleBlock.getState().getData(); - Wool wool = (Wool) mData; - - recolourPlayer(player, wool.getColor()); - - //BOTTOM BLOCK IS WOOL? - }else if (BottomBlock.getType() == Material.WOOL){ - Wool wool = (Wool) BottomBlock.getState().getData(); - recolourPlayer(player, wool.getColor()); - } - - } - public void recolourPlayer(Player player, DyeColor dyecolour){ - User user = essentials.getUser(player); - - String name = user._getNickname(); - String tempName = ""; - for(int i = 0; i < name.length(); i++){ - if (name.charAt(i) != '§'){ - tempName += name.charAt(i); - }else{ - i++; - } - } - name = tempName; - - switch(dyecolour){ - case GRAY: - player.sendMessage("Adding §7GRAY!§f"); - name = "§7" + name; - break; - case RED: - player.sendMessage("Adding §4RED!§f"); - name = "§4" + name; - break; - case ORANGE: - player.sendMessage("Adding §6ORANGE!§f"); - name = "§6" + name; - break; - case YELLOW: - player.sendMessage("Adding §eYELLOW!§f"); - name = "§e" + name; - break; - case LIME: - case GREEN: - player.sendMessage("Adding §aGREEN!§f"); - name = "§a" + name; - break; - case CYAN: - case LIGHT_BLUE: - case BLUE: - player.sendMessage("Adding §9BLUE!§f"); - name = "§9" + name; - break; - case PURPLE: - player.sendMessage("Adding §5PURPLE!§f"); - name = "§5" + name; - break; - case WHITE: - player.sendMessage("Adding §fWHITE!§f"); - name = "§f" + name; - default: - player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); - break; - } - user.setNickname(name); - player.sendMessage("Your name is now: " + user.getNickname() +"!"); - playersToBeFlaired.remove(player.getName()); - } -} +package alisolarflare.components.flairdoor.listeners; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Bukkit; +import org.bukkit.DyeColor; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerPortalEvent; +import org.bukkit.material.MaterialData; +import org.bukkit.material.Wool; +import org.bukkit.plugin.java.JavaPlugin; + +import com.earth2me.essentials.Essentials; +import com.earth2me.essentials.User; + +public class PortalListener implements Listener{ + public static List playersToBeFlaired = new ArrayList(); + public JavaPlugin plugin; + + Essentials essentials; + + public PortalListener(JavaPlugin plugin) { + this.plugin = plugin; + this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials")); + } + @EventHandler + public void onPortalEnter(PlayerPortalEvent event){ + //SANITATION - Player + if(!(event.getPlayer() instanceof Player)){ + return; + } + + //INIT - Player + Player player = event.getPlayer(); + + //SANITATION - PlayersToBeFlaired + if(!(playersToBeFlaired.contains(player.getName()))){ + return; + } + player.sendMessage("-MAY THE FLAIRING COMMENCE-"); + event.setTo(player.getLocation()); + + //INIT - x,y,z + int x = player.getLocation().getBlockX(); + int y = player.getLocation().getBlockY(); + int z = player.getLocation().getBlockZ(); + + //INIT - Blocks Under Portal + Block HigherBlock = player.getWorld().getBlockAt(x,y-2,z); + Block MiddleBlock = player.getWorld().getBlockAt(x,y-3,z); + Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); + + //RECOLOUR PLAYER + if(HigherBlock.getType() == Material.STONE){ + recolourPlayer(player, DyeColor.GRAY); + + //TOP BLOCK IS WOOL? + }else if(HigherBlock.getType() == Material.WOOL){ + Wool wool = (Wool) HigherBlock.getState().getData(); + recolourPlayer(player, wool.getColor()); + + //MIDDLE BLOCK IS WOOL? + }else if(MiddleBlock.getType() == Material.WOOL){ + MaterialData mData = MiddleBlock.getState().getData(); + Wool wool = (Wool) mData; + + recolourPlayer(player, wool.getColor()); + + //BOTTOM BLOCK IS WOOL? + }else if (BottomBlock.getType() == Material.WOOL){ + Wool wool = (Wool) BottomBlock.getState().getData(); + recolourPlayer(player, wool.getColor()); + } + + } + public void recolourPlayer(Player player, DyeColor dyecolour){ + User user = essentials.getUser(player); + + String name = user._getNickname(); + String tempName = ""; + for(int i = 0; i < name.length(); i++){ + if (name.charAt(i) != '§'){ + tempName += name.charAt(i); + }else{ + i++; + } + } + name = tempName; + + switch(dyecolour){ + case GRAY: + player.sendMessage("Adding §7GRAY!§f"); + name = "§7" + name; + break; + case RED: + player.sendMessage("Adding §4RED!§f"); + name = "§4" + name; + break; + case ORANGE: + player.sendMessage("Adding §6ORANGE!§f"); + name = "§6" + name; + break; + case YELLOW: + player.sendMessage("Adding §eYELLOW!§f"); + name = "§e" + name; + break; + case LIME: + case GREEN: + player.sendMessage("Adding §aGREEN!§f"); + name = "§a" + name; + break; + case CYAN: + case LIGHT_BLUE: + case BLUE: + player.sendMessage("Adding §9BLUE!§f"); + name = "§9" + name; + break; + case PURPLE: + player.sendMessage("Adding §5PURPLE!§f"); + name = "§5" + name; + break; + case WHITE: + player.sendMessage("Adding §fWHITE!§f"); + name = "§f" + name; + default: + player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); + break; + } + user.setNickname(name); + player.sendMessage("Your name is now: " + user.getNickname() +"!"); + playersToBeFlaired.remove(player.getName()); + } +} diff --git a/src/alisolarflare/components/gpowers/Memory_GPower.java b/src/alisolarflare/components/gpowers/GPowerMemory.java similarity index 95% rename from src/alisolarflare/components/gpowers/Memory_GPower.java rename to src/alisolarflare/components/gpowers/GPowerMemory.java index b1ef0fc..44e0089 100644 --- a/src/alisolarflare/components/gpowers/Memory_GPower.java +++ b/src/alisolarflare/components/gpowers/GPowerMemory.java @@ -1,52 +1,52 @@ -package alisolarflare.components.gpowers; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.bukkit.entity.Player; - -public class Memory_GPower{ - public Map poweredPlayerList = new HashMap(); - - public void configurePlayer(Player player, String colour, boolean powerIsActive){ - poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); - } - public void PowerUpPlayer(Player player){ - player.sendMessage("Powering up!"); - if(poweredPlayerList.containsKey(player.getUniqueId())){ - poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; - player.sendMessage("Powered up!"); - }else{ - player.sendMessage("You must instantiate your power settings using /GPower"); - } - } - - public void PowerDownPlayer(Player player){ - player.sendMessage("Powering down!"); - if (poweredPlayerList.containsKey(player.getUniqueId())){ - player.sendMessage("Powered down!"); - poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; - }else{ - player.sendMessage("P down!"); - return; - } - - } - - public class poweredPlayer{ - public UUID uuid; - public String colour; - public Boolean isPowersActive; - - public poweredPlayer(UUID uuid, String colour, Boolean activated){ - this.uuid = (uuid); - this.colour = (colour); - this.isPowersActive = (activated); - } - public String toString(){ - return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; - } - } -} - +package alisolarflare.components.gpowers; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.bukkit.entity.Player; + +public class GPowerMemory{ + public Map poweredPlayerList = new HashMap(); + + public void configurePlayer(Player player, String colour, boolean powerIsActive){ + poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); + } + public void PowerUpPlayer(Player player){ + player.sendMessage("Powering up!"); + if(poweredPlayerList.containsKey(player.getUniqueId())){ + poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; + player.sendMessage("Powered up!"); + }else{ + player.sendMessage("You must instantiate your power settings using /GPower"); + } + } + + public void PowerDownPlayer(Player player){ + player.sendMessage("Powering down!"); + if (poweredPlayerList.containsKey(player.getUniqueId())){ + player.sendMessage("Powered down!"); + poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; + }else{ + player.sendMessage("P down!"); + return; + } + + } + + public class poweredPlayer{ + public UUID uuid; + public String colour; + public Boolean isPowersActive; + + public poweredPlayer(UUID uuid, String colour, Boolean activated){ + this.uuid = (uuid); + this.colour = (colour); + this.isPowersActive = (activated); + } + public String toString(){ + return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; + } + } +} + diff --git a/src/alisolarflare/components/gpowers/GPowerModule.java b/src/alisolarflare/components/gpowers/GPowerModule.java new file mode 100644 index 0000000..3148ee0 --- /dev/null +++ b/src/alisolarflare/components/gpowers/GPowerModule.java @@ -0,0 +1,23 @@ +package alisolarflare.components.gpowers; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.components.gpowers.commands.GPower; +import alisolarflare.components.gpowers.commands.PowerDown; +import alisolarflare.components.gpowers.commands.PowerUp; +import alisolarflare.components.gpowers.listeners.gPowerListener; + +public class GPowerModule extends Module { + + @Override + public void register(JavaPlugin plugin) { + GPowerMemory gPowerMemory = new GPowerMemory(); + registerCommand(plugin, new GPower(gPowerMemory)); + registerCommand(plugin, new PowerUp(gPowerMemory)); + registerCommand(plugin, new PowerDown(gPowerMemory)); + + registerListener(plugin, new gPowerListener(plugin, gPowerMemory)); + } + +} diff --git a/src/alisolarflare/components/gpowers/Listener_PowerLooper.java b/src/alisolarflare/components/gpowers/Listener_PowerLooper.java deleted file mode 100644 index 8b9c299..0000000 --- a/src/alisolarflare/components/gpowers/Listener_PowerLooper.java +++ /dev/null @@ -1,11 +0,0 @@ -package alisolarflare.components.gpowers; - -import org.bukkit.event.Listener; -import org.bukkit.plugin.java.JavaPlugin; - -public class Listener_PowerLooper implements Listener{ - - public Listener_PowerLooper(JavaPlugin plugin, Memory_GPower gPowerMemory){ - new Task_PowerApplier(plugin.getServer(), gPowerMemory.poweredPlayerList).runTaskTimer(plugin, 190, 190); - } -} \ No newline at end of file diff --git a/src/alisolarflare/components/gpowers/Module_GPower.java b/src/alisolarflare/components/gpowers/Module_GPower.java deleted file mode 100644 index 814d9bd..0000000 --- a/src/alisolarflare/components/gpowers/Module_GPower.java +++ /dev/null @@ -1,19 +0,0 @@ -package alisolarflare.components.gpowers; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; - -public class Module_GPower extends Module { - - @Override - public void register(JavaPlugin plugin) { - Memory_GPower gPowerMemory = new Memory_GPower(); - registerCommand(plugin, new Command_GPower(gPowerMemory)); - registerCommand(plugin, new Command_PowerUp(gPowerMemory)); - registerCommand(plugin, new Command_PowerDown(gPowerMemory)); - - registerListener(plugin, new Listener_PowerLooper(plugin, gPowerMemory)); - } - -} diff --git a/src/alisolarflare/components/gpowers/Command_GPower.java b/src/alisolarflare/components/gpowers/commands/GPower.java similarity index 86% rename from src/alisolarflare/components/gpowers/Command_GPower.java rename to src/alisolarflare/components/gpowers/commands/GPower.java index a244e8c..4a90d21 100644 --- a/src/alisolarflare/components/gpowers/Command_GPower.java +++ b/src/alisolarflare/components/gpowers/commands/GPower.java @@ -1,75 +1,76 @@ -package alisolarflare.components.gpowers; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_GPower extends TBMCCommandBase { - - private Memory_GPower gPowerMemory; - - public Command_GPower(Memory_GPower gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - sender.sendMessage("G power activate!"); - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command! Talk to a dev/ali if you think this is wrong"); - } - Player player = (Player) sender; - if (args.length < 2) { - player.sendMessage("Proper Usage to test G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); - return false; - } - String colour; - if (args[0].startsWith("r") || args[0].startsWith("o") || args[0].startsWith("y") || args[0].startsWith("g") - || args[0].startsWith("b") || args[0].startsWith("p")) { - colour = args[0]; - } else { - player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]"); - return false; - } - boolean isActive; - if (args[1].startsWith("t")) { - isActive = true; - } else if (args[1].startsWith("f")) { - isActive = false; - } else { - player.sendMessage("error: active. Proper Usage to configure G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); - return false; - } - player.sendMessage("Terms Vaild!"); - player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); - gPowerMemory.configurePlayer(player, colour, isActive); - - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return new String[] { "" }; - } - - @Override - public String GetCommandPath() { - return "gpower"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - return false; - } - -} +package alisolarflare.components.gpowers.commands; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.components.gpowers.GPowerMemory; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class GPower extends TBMCCommandBase { + + private GPowerMemory gPowerMemory; + + public GPower(GPowerMemory gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + sender.sendMessage("G power activate!"); + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command! Talk to a dev/ali if you think this is wrong"); + } + Player player = (Player) sender; + if (args.length < 2) { + player.sendMessage("Proper Usage to test G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + String colour; + if (args[0].startsWith("r") || args[0].startsWith("o") || args[0].startsWith("y") || args[0].startsWith("g") + || args[0].startsWith("b") || args[0].startsWith("p")) { + colour = args[0]; + } else { + player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]"); + return false; + } + boolean isActive; + if (args[1].startsWith("t")) { + isActive = true; + } else if (args[1].startsWith("f")) { + isActive = false; + } else { + player.sendMessage("error: active. Proper Usage to configure G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + player.sendMessage("Terms Vaild!"); + player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); + gPowerMemory.configurePlayer(player, colour, isActive); + + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return new String[] { "" }; + } + + @Override + public String GetCommandPath() { + return "gpower"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + return false; + } + +} diff --git a/src/alisolarflare/components/gpowers/Command_PowerDown.java b/src/alisolarflare/components/gpowers/commands/PowerDown.java similarity index 75% rename from src/alisolarflare/components/gpowers/Command_PowerDown.java rename to src/alisolarflare/components/gpowers/commands/PowerDown.java index 9204c29..8f3467b 100644 --- a/src/alisolarflare/components/gpowers/Command_PowerDown.java +++ b/src/alisolarflare/components/gpowers/commands/PowerDown.java @@ -1,48 +1,49 @@ -package alisolarflare.components.gpowers; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_PowerDown extends TBMCCommandBase { - - private Memory_GPower gPowerMemory; - - public Command_PowerDown(Memory_GPower gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (!(sender instanceof Player)) - sender.sendMessage("You must be a player to use this command! Contact dev/ali if you think this is wrong"); - Player player = (Player) sender; - gPowerMemory.PowerDownPlayer(player); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "powerdown"; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.gpowers.commands; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.components.gpowers.GPowerMemory; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class PowerDown extends TBMCCommandBase { + + private GPowerMemory gPowerMemory; + + public PowerDown(GPowerMemory gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (!(sender instanceof Player)) + sender.sendMessage("You must be a player to use this command! Contact dev/ali if you think this is wrong"); + Player player = (Player) sender; + gPowerMemory.PowerDownPlayer(player); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "powerdown"; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/gpowers/Command_PowerUp.java b/src/alisolarflare/components/gpowers/commands/PowerUp.java similarity index 75% rename from src/alisolarflare/components/gpowers/Command_PowerUp.java rename to src/alisolarflare/components/gpowers/commands/PowerUp.java index 171961c..84670f3 100644 --- a/src/alisolarflare/components/gpowers/Command_PowerUp.java +++ b/src/alisolarflare/components/gpowers/commands/PowerUp.java @@ -1,48 +1,49 @@ -package alisolarflare.components.gpowers; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_PowerUp extends TBMCCommandBase { - - private Memory_GPower gPowerMemory; - - public Command_PowerUp(Memory_GPower gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (!(sender instanceof Player)) - sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong"); - - Player player = (Player) sender; - gPowerMemory.PowerUpPlayer(player); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "powerup"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.gpowers.commands; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.components.gpowers.GPowerMemory; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class PowerUp extends TBMCCommandBase { + + private GPowerMemory gPowerMemory; + + public PowerUp(GPowerMemory gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (!(sender instanceof Player)) + sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong"); + + Player player = (Player) sender; + gPowerMemory.PowerUpPlayer(player); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "powerup"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/gpowers/Task_PowerApplier.java b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java similarity index 88% rename from src/alisolarflare/components/gpowers/Task_PowerApplier.java rename to src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java index f9d82e3..d966e63 100644 --- a/src/alisolarflare/components/gpowers/Task_PowerApplier.java +++ b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java @@ -1,66 +1,66 @@ -package alisolarflare.components.gpowers; - -import java.util.Map; -import java.util.UUID; - -import org.bukkit.Color; -import org.bukkit.Server; -import org.bukkit.entity.Player; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import alisolarflare.components.gpowers.Memory_GPower.poweredPlayer; - -public class Task_PowerApplier extends BukkitRunnable{ - - private Server server; - private Map poweredPlayerList; - - public Task_PowerApplier(Server server, Map poweredPlayerList) { - this.server = server; - this.poweredPlayerList = poweredPlayerList; - } - - //REPEATS EVERY 5 SECONDS - @Override - public void run() { - for (Player player : server.getOnlinePlayers()){ - if(poweredPlayerList.containsKey(player.getUniqueId())){ - activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); - } - } - } - - private void activatePower(Player player, String colour) { - //GREY - if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.GRAY)); - player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 0, true, false, Color.GRAY)); - //RED - }else if (colour.startsWith("r")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0, true, false, Color.RED)); - //ORANGE - }else if (colour.startsWith("o")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); - player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); - //YELLOW - }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.YELLOW)); - //GREEN - }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 200, 1, true, false, Color.GREEN)); - player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 200, 0, true, false, Color.GREEN)); - //BLUE - }else if (colour.startsWith("b")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1, true, false, Color.BLUE)); - player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 200, 0, true, false, Color.BLUE)); - //PURPLE - }else if (colour.startsWith("p")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 0, true, false, Color.PURPLE)); - //NULL - }else{ - } - } - -} +package alisolarflare.components.gpowers.listeners; + +import java.util.Map; +import java.util.UUID; + +import org.bukkit.Color; +import org.bukkit.Server; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; + +public class gPowerApplyingTask extends BukkitRunnable{ + + private Server server; + private Map poweredPlayerList; + + public gPowerApplyingTask(Server server, Map poweredPlayerList) { + this.server = server; + this.poweredPlayerList = poweredPlayerList; + } + + //REPEATS EVERY 5 SECONDS + @Override + public void run() { + for (Player player : server.getOnlinePlayers()){ + if(poweredPlayerList.containsKey(player.getUniqueId())){ + activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); + } + } + } + + private void activatePower(Player player, String colour) { + //GREY + if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 0, true, false, Color.GRAY)); + //RED + }else if (colour.startsWith("r")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0, true, false, Color.RED)); + //ORANGE + }else if (colour.startsWith("o")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); + player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); + //YELLOW + }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.YELLOW)); + //GREEN + }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 200, 1, true, false, Color.GREEN)); + player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 200, 0, true, false, Color.GREEN)); + //BLUE + }else if (colour.startsWith("b")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1, true, false, Color.BLUE)); + player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 200, 0, true, false, Color.BLUE)); + //PURPLE + }else if (colour.startsWith("p")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 0, true, false, Color.PURPLE)); + //NULL + }else{ + } + } + +} diff --git a/src/alisolarflare/components/gpowers/listeners/gPowerListener.java b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java new file mode 100644 index 0000000..1b71481 --- /dev/null +++ b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java @@ -0,0 +1,13 @@ +package alisolarflare.components.gpowers.listeners; + +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.gpowers.GPowerMemory; + +public class gPowerListener implements Listener{ + + public gPowerListener(JavaPlugin plugin, GPowerMemory gPowerMemory){ + new gPowerApplyingTask(plugin.getServer(), gPowerMemory.poweredPlayerList).runTaskTimer(plugin, 190, 190); + } +} \ No newline at end of file diff --git a/src/alisolarflare/components/links/AliLinkModule.java b/src/alisolarflare/components/links/AliLinkModule.java new file mode 100644 index 0000000..a6d44a9 --- /dev/null +++ b/src/alisolarflare/components/links/AliLinkModule.java @@ -0,0 +1,33 @@ +package alisolarflare.components.links; + +import java.util.List; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.components.links.commands.PressAliLink; +import alisolarflare.components.links.commands.SetAliLink; +import alisolarflare.components.links.entities.Link; + +public class AliLinkModule extends Module { + private SetAliLink setAliLink; + + @Override + public void register(JavaPlugin plugin) { + setAliLink = new SetAliLink(plugin); + + registerCommand(plugin, new PressAliLink(plugin, setAliLink)); + registerCommand(plugin, setAliLink); + + } + + public void saveLinkList(JavaPlugin plugin) { + plugin.getConfig().set("aliLinkList", setAliLink.linkList); + } + + @SuppressWarnings("unchecked") + public List loadLinkList(JavaPlugin plugin) { + return (List) plugin.getConfig().getList("aliLinkList"); + } + +} diff --git a/src/alisolarflare/components/links/Module_AliLink.java b/src/alisolarflare/components/links/Module_AliLink.java deleted file mode 100644 index a16b47b..0000000 --- a/src/alisolarflare/components/links/Module_AliLink.java +++ /dev/null @@ -1,30 +0,0 @@ -package alisolarflare.components.links; - -import java.util.List; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; - -public class Module_AliLink extends Module { - private Command_SetAliLink setAliLink; - - @Override - public void register(JavaPlugin plugin) { - setAliLink = new Command_SetAliLink(plugin); - - registerCommand(plugin, new Command_PressAliLink(plugin, setAliLink)); - registerCommand(plugin, setAliLink); - - } - - public void saveLinkList(JavaPlugin plugin) { - plugin.getConfig().set("aliLinkList", setAliLink.linkList); - } - - @SuppressWarnings("unchecked") - public List loadLinkList(JavaPlugin plugin) { - return (List) plugin.getConfig().getList("aliLinkList"); - } - -} diff --git a/src/alisolarflare/components/links/Command_PressAliLink.java b/src/alisolarflare/components/links/commands/PressAliLink.java similarity index 75% rename from src/alisolarflare/components/links/Command_PressAliLink.java rename to src/alisolarflare/components/links/commands/PressAliLink.java index 9619449..da21f6d 100644 --- a/src/alisolarflare/components/links/Command_PressAliLink.java +++ b/src/alisolarflare/components/links/commands/PressAliLink.java @@ -1,59 +1,60 @@ -package alisolarflare.components.links; - -import org.bukkit.command.CommandSender; -import org.bukkit.plugin.java.JavaPlugin; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_PressAliLink extends TBMCCommandBase { - private JavaPlugin plugin; - private Command_SetAliLink setAliLink; - - public Command_PressAliLink(JavaPlugin plugin, Command_SetAliLink setAliLink) { - this.plugin = plugin; - this.setAliLink = setAliLink; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - - sender.getServer().broadcastMessage(setAliLink.linkList.toString() + "over."); - - if (args.length < 1) { - sender.sendMessage("You must specify a link frequency"); - sender.sendMessage("/pressalilink [frequency]"); - } - for (Memory_Link link : setAliLink.linkList) { - for (String inputlink : args) { - if (inputlink.equals(link.frequency)) { - link.press(plugin); - } - } - } - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "pressalilink"; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.links.commands; + +import org.bukkit.command.CommandSender; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.links.entities.Link; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class PressAliLink extends TBMCCommandBase { + private JavaPlugin plugin; + private SetAliLink setAliLink; + + public PressAliLink(JavaPlugin plugin, SetAliLink setAliLink) { + this.plugin = plugin; + this.setAliLink = setAliLink; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + + sender.getServer().broadcastMessage(setAliLink.linkList.toString() + "over."); + + if (args.length < 1) { + sender.sendMessage("You must specify a link frequency"); + sender.sendMessage("/pressalilink [frequency]"); + } + for (Link link : setAliLink.linkList) { + for (String inputlink : args) { + if (inputlink.equals(link.frequency)) { + link.press(plugin); + } + } + } + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "pressalilink"; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/links/Command_SetAliLink.java b/src/alisolarflare/components/links/commands/SetAliLink.java similarity index 80% rename from src/alisolarflare/components/links/Command_SetAliLink.java rename to src/alisolarflare/components/links/commands/SetAliLink.java index 2b78235..03c4e57 100644 --- a/src/alisolarflare/components/links/Command_SetAliLink.java +++ b/src/alisolarflare/components/links/commands/SetAliLink.java @@ -1,138 +1,140 @@ -package alisolarflare.components.links; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; -import org.bukkit.Location; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import buttondevteam.lib.chat.TBMCCommandBase; - -/** - * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, a location in a world that when called on by {@link Command_PressAliLink}, creates a temporary redstone - * block, enabling wireless redstone - * - * @see Command_PressAliLink - * @author Alisolarflare - * - */ -public class Command_SetAliLink extends TBMCCommandBase { - public List linkList = new ArrayList(); - Module_AliLink subplugin; - private JavaPlugin plugin; - - /** - * Constructs the SetAliLink class - * - * @param plugin - * The plugin that contains the configuration file of SetAliLink - */ - public Command_SetAliLink(JavaPlugin plugin) { - this.plugin = plugin; - load(); - } - - /** - * This command creates an Ali-Link which, when activated by the command /PressAliLink, creates a temporary redstone block if and only if /PressAliLink [frequency] matches the frequency saved when - * /SetAliLink [frequency] is called. - * - * @see Class#PressAliLink - * @param sender - * Player who sent the command - * @param command - * Command Object created - * @param label - * Name of the command - * @param args - * Arguments: [frequency] [x-coordinate] [y-coordinate] [z-coordinate], where the coordinates point to the intended location of the Ali-Link - */ - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - sender.sendMessage("you pressed shit"); - if (args == null || args.length < 1) { - sender.sendMessage("You must specify a link frequency"); - sender.sendMessage("/pressalilink [name]"); - return false; - } - Player player = (Player) sender; - if (args.length < 4) { - player.sendMessage("short"); - linkList.add(new Memory_Link(args[0], player.getLocation())); - save(player); - player.sendMessage("end"); - return false; - } - if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) - && StringUtils.isNumericSpace(args[3])) { - player.sendMessage("CUUUSTOM"); - linkList.add(new Memory_Link(args[0], new Location(player.getWorld(), Double.parseDouble(args[1]), - Double.parseDouble(args[2]), Double.parseDouble(args[3])))); - save(player); - player.sendMessage("FINISHED"); - } else { - player.sendMessage("UNCUSTOOM"); - linkList.add(new Memory_Link(args[0], player.getLocation())); - save(player); - player.sendMessage("UNFINISHED"); - return false; - } - return false; - } - - /** - * Tries to save the entire SetAliLink class into memory, which includes all of the current Ali-links saved and in use. - * - * @param player - */ - private void save(Player player) { - player.sendMessage("SAAAVING"); - player.sendMessage("SAVE FAILED: TELL ALI TO FIX THE SAVE AND UN-COMMENT THE PARAGRAPH SHE COMMENTED"); - player.sendMessage("Link will only last until next server restart"); - return; - /* - * subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); try { player.sendMessage("SAVIN"); subplugin.plugin.saveConfig(); player.sendMessage("GOOD SAVE"); } catch (Exception e) - * { player.sendMessage("YOU FUCKED STUFF UP"); // TODO Auto-generated catch block e.printStackTrace(); } - */ - } - - /** - * Attempts to load the previous saved state of AliLinks, from the plugin configuration file - */ - @SuppressWarnings("unchecked") - private void load() { - try { - linkList = (List) plugin.getConfig().getList("aliLinkList"); - if (linkList == null || linkList.isEmpty()) { - linkList = new ArrayList(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "setalilink"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.links.commands; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.bukkit.Location; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.links.AliLinkModule; +import alisolarflare.components.links.entities.Link; +import buttondevteam.lib.chat.TBMCCommandBase; + +/** + * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, a location in a world that when called on by {@link PressAliLink}, creates a temporary redstone + * block, enabling wireless redstone + * + * @see PressAliLink + * @author Alisolarflare + * + */ +public class SetAliLink extends TBMCCommandBase { + public List linkList = new ArrayList(); + AliLinkModule subplugin; + private JavaPlugin plugin; + + /** + * Constructs the SetAliLink class + * + * @param plugin + * The plugin that contains the configuration file of SetAliLink + */ + public SetAliLink(JavaPlugin plugin) { + this.plugin = plugin; + load(); + } + + /** + * This command creates an Ali-Link which, when activated by the command /PressAliLink, creates a temporary redstone block if and only if /PressAliLink [frequency] matches the frequency saved when + * /SetAliLink [frequency] is called. + * + * @see Class#PressAliLink + * @param sender + * Player who sent the command + * @param command + * Command Object created + * @param label + * Name of the command + * @param args + * Arguments: [frequency] [x-coordinate] [y-coordinate] [z-coordinate], where the coordinates point to the intended location of the Ali-Link + */ + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + sender.sendMessage("you pressed shit"); + if (args == null || args.length < 1) { + sender.sendMessage("You must specify a link frequency"); + sender.sendMessage("/pressalilink [name]"); + return false; + } + Player player = (Player) sender; + if (args.length < 4) { + player.sendMessage("short"); + linkList.add(new Link(args[0], player.getLocation())); + save(player); + player.sendMessage("end"); + return false; + } + if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) + && StringUtils.isNumericSpace(args[3])) { + player.sendMessage("CUUUSTOM"); + linkList.add(new Link(args[0], new Location(player.getWorld(), Double.parseDouble(args[1]), + Double.parseDouble(args[2]), Double.parseDouble(args[3])))); + save(player); + player.sendMessage("FINISHED"); + } else { + player.sendMessage("UNCUSTOOM"); + linkList.add(new Link(args[0], player.getLocation())); + save(player); + player.sendMessage("UNFINISHED"); + return false; + } + return false; + } + + /** + * Tries to save the entire SetAliLink class into memory, which includes all of the current Ali-links saved and in use. + * + * @param player + */ + private void save(Player player) { + player.sendMessage("SAAAVING"); + player.sendMessage("SAVE FAILED: TELL ALI TO FIX THE SAVE AND UN-COMMENT THE PARAGRAPH SHE COMMENTED"); + player.sendMessage("Link will only last until next server restart"); + return; + /* + * subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); try { player.sendMessage("SAVIN"); subplugin.plugin.saveConfig(); player.sendMessage("GOOD SAVE"); } catch (Exception e) + * { player.sendMessage("YOU FUCKED STUFF UP"); // TODO Auto-generated catch block e.printStackTrace(); } + */ + } + + /** + * Attempts to load the previous saved state of AliLinks, from the plugin configuration file + */ + @SuppressWarnings("unchecked") + private void load() { + try { + linkList = (List) plugin.getConfig().getList("aliLinkList"); + if (linkList == null || linkList.isEmpty()) { + linkList = new ArrayList(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "setalilink"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/links/Memory_Link.java b/src/alisolarflare/components/links/entities/Link.java similarity index 74% rename from src/alisolarflare/components/links/Memory_Link.java rename to src/alisolarflare/components/links/entities/Link.java index 2043b7a..f55bfc8 100644 --- a/src/alisolarflare/components/links/Memory_Link.java +++ b/src/alisolarflare/components/links/entities/Link.java @@ -1,39 +1,41 @@ -package alisolarflare.components.links; - -import java.io.Serializable; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.plugin.java.JavaPlugin; - -public class Memory_Link implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - public String frequency; - public String world; - public String x; - public String y; - public String z; - - - public Memory_Link(String frequency, Location location){ - this.frequency = frequency; - this.world = location.getWorld().getName(); - this.x = "" + location.getBlockX(); - this.y = "" + location.getBlockY(); - this.z = "" + location.getBlockZ(); - //plugin.plugin.getConfig().set("frequency", 10); - } - /** - * Activates the Ali-Link - * @param plugin - */ - public void press(JavaPlugin plugin) { - Location location = new Location(plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); - location.getBlock().setType(Material.REDSTONE_BLOCK); - Task_UnpressTask unPressTask = new Task_UnpressTask(location); - unPressTask.runTaskTimer(plugin, 2, 1); - } -} +package alisolarflare.components.links.entities; + +import java.io.Serializable; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.links.tasks.UnpressTask; + +public class Link implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + public String frequency; + public String world; + public String x; + public String y; + public String z; + + + public Link(String frequency, Location location){ + this.frequency = frequency; + this.world = location.getWorld().getName(); + this.x = "" + location.getBlockX(); + this.y = "" + location.getBlockY(); + this.z = "" + location.getBlockZ(); + //plugin.plugin.getConfig().set("frequency", 10); + } + /** + * Activates the Ali-Link + * @param plugin + */ + public void press(JavaPlugin plugin) { + Location location = new Location(plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); + location.getBlock().setType(Material.REDSTONE_BLOCK); + UnpressTask unPressTask = new UnpressTask(location); + unPressTask.runTaskTimer(plugin, 2, 1); + } +} diff --git a/src/alisolarflare/components/links/serializer/Deserializer.java b/src/alisolarflare/components/links/serializer/Deserializer.java new file mode 100644 index 0000000..cfc1786 --- /dev/null +++ b/src/alisolarflare/components/links/serializer/Deserializer.java @@ -0,0 +1,42 @@ +package alisolarflare.components.links.serializer; + + +import java.io.FileInputStream; +import java.io.ObjectInputStream; +import java.util.List; + +import alisolarflare.components.links.entities.Link; + +/** + * @deprecated + * @author Alisolarflare + * + */ +public class Deserializer{ + + public static void main (String args[]) { + + //Deserializer deserializer = new Deserializer(); + //List aliLink = deserializer.loadLink(aliLink); + //System.out.println(aliLink); + } + + /**@deprecated*/ + @SuppressWarnings("unchecked") + public List loadLinkList(){ + List aliLinkList; + try{ + + FileInputStream fin = new FileInputStream("AliLinkList.ser"); + ObjectInputStream ois = new ObjectInputStream(fin); + aliLinkList = (List) ois.readObject(); + ois.close(); + + return aliLinkList; + + }catch(Exception ex){ + ex.printStackTrace(); + return null; + } + } +} diff --git a/src/alisolarflare/components/links/serializer/Serializer.java b/src/alisolarflare/components/links/serializer/Serializer.java new file mode 100644 index 0000000..fe4efef --- /dev/null +++ b/src/alisolarflare/components/links/serializer/Serializer.java @@ -0,0 +1,38 @@ +package alisolarflare.components.links.serializer; + + +import java.io.FileOutputStream; +import java.io.ObjectOutputStream; +import java.util.List; + +import alisolarflare.components.links.entities.Link; + +/** + * @deprecated + * @author Alisolarflare + * + */ +public class Serializer { + + public static void main (String args[]) { + + //Serializer serializer = new Serializer(); + //serializer.saveLink(plugin, frequency, location) + } + /**@deprecated*/ + public void saveLinkList(List aliLinkList){ + //saves link + + try{ + + FileOutputStream fout = new FileOutputStream("AliLinkList.ser"); + ObjectOutputStream oos = new ObjectOutputStream(fout); + oos.writeObject(aliLinkList); + oos.close(); + System.out.println("Done"); + + }catch(Exception ex){ + ex.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/src/alisolarflare/components/links/Task_UnpressTask.java b/src/alisolarflare/components/links/tasks/UnpressTask.java similarity index 68% rename from src/alisolarflare/components/links/Task_UnpressTask.java rename to src/alisolarflare/components/links/tasks/UnpressTask.java index 17c59c8..769f4f1 100644 --- a/src/alisolarflare/components/links/Task_UnpressTask.java +++ b/src/alisolarflare/components/links/tasks/UnpressTask.java @@ -1,21 +1,21 @@ -package alisolarflare.components.links; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.scheduler.BukkitRunnable; - -public class Task_UnpressTask extends BukkitRunnable { - private Location location; - public Task_UnpressTask(Location location){ - this.location = location; - } - - @SuppressWarnings("deprecation") - @Override - public void run() { - location.getBlock().setType(Material.STAINED_CLAY); - location.getBlock().setData((byte) 14); - this.cancel(); - } - -} +package alisolarflare.components.links.tasks; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.scheduler.BukkitRunnable; + +public class UnpressTask extends BukkitRunnable { + private Location location; + public UnpressTask(Location location){ + this.location = location; + } + + @SuppressWarnings("deprecation") + @Override + public void run() { + location.getBlock().setType(Material.STAINED_CLAY); + location.getBlock().setData((byte) 14); + this.cancel(); + } + +} diff --git a/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java b/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java new file mode 100644 index 0000000..39dac19 --- /dev/null +++ b/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java @@ -0,0 +1,30 @@ +package alisolarflare.creativeboundaries; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.creativeboundaries.commands.Cbgm0; +import alisolarflare.creativeboundaries.commands.Cbgm1; +import alisolarflare.creativeboundaries.commands.SetDickmode; +import alisolarflare.creativeboundaries.listeners.ItemRestrictionListener; +import alisolarflare.creativeboundaries.listeners.PlotChangeListener; + + +public class CreativeBoundariesModule extends Module{ + public boolean dickmode; + public List cbCreatives = new ArrayList(); + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new Cbgm1(this)); + registerCommand(plugin, new Cbgm0(this)); + registerCommand(plugin, new SetDickmode(this)); + + registerListener(plugin, new PlotChangeListener(this)); + //registerListener(plugin, new ItemRestrictionListener(this)); + } + +} diff --git a/src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java b/src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java deleted file mode 100644 index fcd58da..0000000 --- a/src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java +++ /dev/null @@ -1,25 +0,0 @@ -package alisolarflare.creativeboundaries; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; - - -public class Module_CreativeBoundaries extends Module{ - public boolean dickmode; - public List cbCreatives = new ArrayList(); - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new Command_Cbgm1(this)); - registerCommand(plugin, new Command_Cbgm0(this)); - registerCommand(plugin, new Command_SetDickmode(this)); - - registerListener(plugin, new Listener_PlotChange(this)); - //registerListener(plugin, new ItemRestrictionListener(this)); - } - -} diff --git a/src/alisolarflare/creativeboundaries/Command_Cbgm0.java b/src/alisolarflare/creativeboundaries/commands/Cbgm0.java similarity index 73% rename from src/alisolarflare/creativeboundaries/Command_Cbgm0.java rename to src/alisolarflare/creativeboundaries/commands/Cbgm0.java index afa0aa9..6e5fd2a 100644 --- a/src/alisolarflare/creativeboundaries/Command_Cbgm0.java +++ b/src/alisolarflare/creativeboundaries/commands/Cbgm0.java @@ -1,48 +1,49 @@ -package alisolarflare.creativeboundaries; - -import org.bukkit.GameMode; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_Cbgm0 extends TBMCCommandBase{ - - private Module_CreativeBoundaries module; - - public Command_Cbgm0(Module_CreativeBoundaries module) { - this.module = module; - } - - @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - return false; - } - - Player player = (Player) sender; - player.setGameMode(GameMode.SURVIVAL); - module.cbCreatives.remove(player); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.creativeboundaries.commands; + +import org.bukkit.GameMode; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.creativeboundaries.CreativeBoundariesModule; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Cbgm0 extends TBMCCommandBase{ + + private CreativeBoundariesModule module; + + public Cbgm0(CreativeBoundariesModule module) { + this.module = module; + } + + @Override + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + return false; + } + + Player player = (Player) sender; + player.setGameMode(GameMode.SURVIVAL); + module.cbCreatives.remove(player); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/creativeboundaries/Command_Cbgm1.java b/src/alisolarflare/creativeboundaries/commands/Cbgm1.java similarity index 85% rename from src/alisolarflare/creativeboundaries/Command_Cbgm1.java rename to src/alisolarflare/creativeboundaries/commands/Cbgm1.java index c63e430..04fba33 100644 --- a/src/alisolarflare/creativeboundaries/Command_Cbgm1.java +++ b/src/alisolarflare/creativeboundaries/commands/Cbgm1.java @@ -1,81 +1,82 @@ -package alisolarflare.creativeboundaries; - -import org.bukkit.GameMode; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; -import com.palmergames.bukkit.towny.object.Resident; -import com.palmergames.bukkit.towny.object.Town; -import com.palmergames.bukkit.towny.object.TownBlock; -import com.palmergames.bukkit.towny.object.TownyUniverse; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_Cbgm1 extends TBMCCommandBase { - - private Module_CreativeBoundaries module; - - public Command_Cbgm1(Module_CreativeBoundaries module) { - this.module = module; - } - - @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - - if (!(sender instanceof Player)) { - sender.sendMessage("You must be a player to use this command!"); - return false; - } - - Player player = (Player) sender; - - TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); - if (tb == null) { - player.sendMessage("You aren't standing in a town or some other error occured."); - player.sendMessage("TownBlock is null."); - return false; - } - Town town; - try { - town = tb.getTown(); - } catch (NotRegisteredException e) { - player.sendMessage("You aren't standing in a town or some other error occured."); - player.sendMessage("TownBlock's town is not registered."); - return false; - } - if (town == null) { - player.sendMessage("ERROR: The town you're standing in is Null."); - return false; - } - - for(Resident res : town.getResidents()){ - if (res.getName().toString().equals(player.getName().toString())){ - player.setGameMode(GameMode.CREATIVE); - module.cbCreatives.add(player); - return true; - } - } - player.sendMessage("Sorry, you're not part of this town"); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.creativeboundaries.commands; + +import org.bukkit.GameMode; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.Resident; +import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.towny.object.TownBlock; +import com.palmergames.bukkit.towny.object.TownyUniverse; + +import alisolarflare.creativeboundaries.CreativeBoundariesModule; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Cbgm1 extends TBMCCommandBase { + + private CreativeBoundariesModule module; + + public Cbgm1(CreativeBoundariesModule module) { + this.module = module; + } + + @Override + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { + + if (!(sender instanceof Player)) { + sender.sendMessage("You must be a player to use this command!"); + return false; + } + + Player player = (Player) sender; + + TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); + if (tb == null) { + player.sendMessage("You aren't standing in a town or some other error occured."); + player.sendMessage("TownBlock is null."); + return false; + } + Town town; + try { + town = tb.getTown(); + } catch (NotRegisteredException e) { + player.sendMessage("You aren't standing in a town or some other error occured."); + player.sendMessage("TownBlock's town is not registered."); + return false; + } + if (town == null) { + player.sendMessage("ERROR: The town you're standing in is Null."); + return false; + } + + for(Resident res : town.getResidents()){ + if (res.getName().toString().equals(player.getName().toString())){ + player.setGameMode(GameMode.CREATIVE); + module.cbCreatives.add(player); + return true; + } + } + player.sendMessage("Sorry, you're not part of this town"); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/creativeboundaries/Command_SetDickmode.java b/src/alisolarflare/creativeboundaries/commands/SetDickmode.java similarity index 78% rename from src/alisolarflare/creativeboundaries/Command_SetDickmode.java rename to src/alisolarflare/creativeboundaries/commands/SetDickmode.java index fb0aa8d..3b1654b 100644 --- a/src/alisolarflare/creativeboundaries/Command_SetDickmode.java +++ b/src/alisolarflare/creativeboundaries/commands/SetDickmode.java @@ -1,53 +1,54 @@ -package alisolarflare.creativeboundaries; - -import org.bukkit.command.CommandSender; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_SetDickmode extends TBMCCommandBase{ - private Module_CreativeBoundaries module; - - public Command_SetDickmode(Module_CreativeBoundaries module){ - this.module = module; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (sender.getName().equals("Alisolarflare") || sender.getName().equals("iie")){ - if(args[0] == null){ - sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); - return false; - } - if(args[0].equalsIgnoreCase("TRUE") || args[0].equalsIgnoreCase("1")){ - sender.sendMessage("Dickmode has been turned on!"); - module.dickmode=(true); - return true; - } - if(args[0].equalsIgnoreCase("FALSE") || args[0].equalsIgnoreCase("0")){ - sender.sendMessage("Dickmode has been turned off!"); - module.dickmode=(false); - return true; - } - return false; - } - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } -} +package alisolarflare.creativeboundaries.commands; + +import org.bukkit.command.CommandSender; + +import alisolarflare.creativeboundaries.CreativeBoundariesModule; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class SetDickmode extends TBMCCommandBase{ + private CreativeBoundariesModule module; + + public SetDickmode(CreativeBoundariesModule module){ + this.module = module; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (sender.getName().equals("Alisolarflare") || sender.getName().equals("iie")){ + if(args[0] == null){ + sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); + return false; + } + if(args[0].equalsIgnoreCase("TRUE") || args[0].equalsIgnoreCase("1")){ + sender.sendMessage("Dickmode has been turned on!"); + module.dickmode=(true); + return true; + } + if(args[0].equalsIgnoreCase("FALSE") || args[0].equalsIgnoreCase("0")){ + sender.sendMessage("Dickmode has been turned off!"); + module.dickmode=(false); + return true; + } + return false; + } + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } +} diff --git a/src/alisolarflare/creativeboundaries/Listener_ItemRestriction.java b/src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java similarity index 52% rename from src/alisolarflare/creativeboundaries/Listener_ItemRestriction.java rename to src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java index 37d5ac7..9023755 100644 --- a/src/alisolarflare/creativeboundaries/Listener_ItemRestriction.java +++ b/src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java @@ -1,24 +1,26 @@ -package alisolarflare.creativeboundaries; - -import java.util.List; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.InventoryCreativeEvent; - -public class Listener_ItemRestriction implements Listener { - - private Module_CreativeBoundaries module; - - public Listener_ItemRestriction(Module_CreativeBoundaries module) { - this.module = module; - } - - @EventHandler - public void onItemTake(InventoryCreativeEvent event){ - List cbCreatives = module.cbCreatives; - - } - -} +package alisolarflare.creativeboundaries.listeners; + +import java.util.List; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.InventoryCreativeEvent; + +import alisolarflare.creativeboundaries.CreativeBoundariesModule; + +public class ItemRestrictionListener implements Listener { + + private CreativeBoundariesModule module; + + public ItemRestrictionListener(CreativeBoundariesModule module) { + this.module = module; + } + + @EventHandler + public void onItemTake(InventoryCreativeEvent event){ + List cbCreatives = module.cbCreatives; + + } + +} diff --git a/src/alisolarflare/creativeboundaries/Listener_PlotChange.java b/src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java similarity index 84% rename from src/alisolarflare/creativeboundaries/Listener_PlotChange.java rename to src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java index 980bdb6..e911b98 100644 --- a/src/alisolarflare/creativeboundaries/Listener_PlotChange.java +++ b/src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java @@ -1,67 +1,69 @@ -package alisolarflare.creativeboundaries; - -import org.bukkit.GameMode; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; - -import com.palmergames.bukkit.towny.event.PlayerChangePlotEvent; -import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; -import com.palmergames.bukkit.towny.object.Resident; -import com.palmergames.bukkit.towny.object.Town; -import com.palmergames.bukkit.towny.object.TownBlock; -import com.palmergames.bukkit.towny.object.TownyUniverse; - -public class Listener_PlotChange implements Listener{ - public Module_CreativeBoundaries module; - public Listener_PlotChange(Module_CreativeBoundaries module){ - this.module = module; - } - @EventHandler - public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ - Player player = plotEvent.getPlayer(); - if (module.dickmode == false){ - return; - } - if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){ - return; - } - if (!(module.cbCreatives.contains(plotEvent.getPlayer()))){ - return; - } - TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); - if (tb == null) { - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!"); - module.cbCreatives.remove(player); - return; - } - Town town; - try { - town = tb.getTown(); - } catch (NotRegisteredException e) { - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!!"); - module.cbCreatives.remove(player); - return; - } - - if (town == null) { - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!!!"); - module.cbCreatives.remove(player); - return; - } - boolean townHasRes = false; - for(Resident res : town.getResidents()){ - if (res.getName().toString().equals(player.getName().toString())){ - townHasRes = true; - } - } - if (!townHasRes){ - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!!!!"); - module.cbCreatives.remove(player); - } - } -} +package alisolarflare.creativeboundaries.listeners; + +import org.bukkit.GameMode; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; + +import com.palmergames.bukkit.towny.event.PlayerChangePlotEvent; +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.Resident; +import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.towny.object.TownBlock; +import com.palmergames.bukkit.towny.object.TownyUniverse; + +import alisolarflare.creativeboundaries.CreativeBoundariesModule; + +public class PlotChangeListener implements Listener{ + public CreativeBoundariesModule module; + public PlotChangeListener(CreativeBoundariesModule module){ + this.module = module; + } + @EventHandler + public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ + Player player = plotEvent.getPlayer(); + if (module.dickmode == false){ + return; + } + if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){ + return; + } + if (!(module.cbCreatives.contains(plotEvent.getPlayer()))){ + return; + } + TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); + if (tb == null) { + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!"); + module.cbCreatives.remove(player); + return; + } + Town town; + try { + town = tb.getTown(); + } catch (NotRegisteredException e) { + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!!"); + module.cbCreatives.remove(player); + return; + } + + if (town == null) { + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!!!"); + module.cbCreatives.remove(player); + return; + } + boolean townHasRes = false; + for(Resident res : town.getResidents()){ + if (res.getName().toString().equals(player.getName().toString())){ + townHasRes = true; + } + } + if (!townHasRes){ + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!!!!"); + module.cbCreatives.remove(player); + } + } +} diff --git a/src/alisolarflare/easyuhc/EasyUHCModule.java b/src/alisolarflare/easyuhc/EasyUHCModule.java new file mode 100644 index 0000000..408e909 --- /dev/null +++ b/src/alisolarflare/easyuhc/EasyUHCModule.java @@ -0,0 +1,24 @@ +package alisolarflare.easyuhc; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.easyuhc.commands.ActivatePowers; +import alisolarflare.easyuhc.commands.SetupWorldBorders; +import alisolarflare.easyuhc.commands.SpreadPlayers; +import alisolarflare.easyuhc.commands.StartTimer; +import alisolarflare.easyuhc.commands.StartUHC; +import alisolarflare.easyuhc.commands.TeleportToUHC; + +public class EasyUHCModule extends Module{ + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new ActivatePowers()); + registerCommand(plugin, new SetupWorldBorders()); + registerCommand(plugin, new SetupWorldBorders()); + registerCommand(plugin, new SpreadPlayers()); + registerCommand(plugin, new StartTimer()); + registerCommand(plugin, new StartUHC()); + registerCommand(plugin, new TeleportToUHC()); + } +} diff --git a/src/alisolarflare/easyuhc/Module_EasyUHC.java b/src/alisolarflare/easyuhc/Module_EasyUHC.java deleted file mode 100644 index 4ad1b1a..0000000 --- a/src/alisolarflare/easyuhc/Module_EasyUHC.java +++ /dev/null @@ -1,18 +0,0 @@ -package alisolarflare.easyuhc; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; - -public class Module_EasyUHC extends Module{ - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new Command_ActivatePowers()); - registerCommand(plugin, new Command_SetupWorldBorders()); - registerCommand(plugin, new Command_SetupWorldBorders()); - registerCommand(plugin, new Command_SpreadPlayers()); - registerCommand(plugin, new Command_StartTimer()); - registerCommand(plugin, new Command_StartUHC()); - registerCommand(plugin, new Command_TeleportToUHC()); - } -} diff --git a/src/alisolarflare/easyuhc/Command_ActivatePowers.java b/src/alisolarflare/easyuhc/commands/ActivatePowers.java similarity index 85% rename from src/alisolarflare/easyuhc/Command_ActivatePowers.java rename to src/alisolarflare/easyuhc/commands/ActivatePowers.java index 26789ce..737ac72 100644 --- a/src/alisolarflare/easyuhc/Command_ActivatePowers.java +++ b/src/alisolarflare/easyuhc/commands/ActivatePowers.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc; +package alisolarflare.easyuhc.commands; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class Command_ActivatePowers extends TBMCCommandBase{ +public class ActivatePowers extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/Command_SetupWorldBorders.java b/src/alisolarflare/easyuhc/commands/SetupWorldBorders.java similarity index 85% rename from src/alisolarflare/easyuhc/Command_SetupWorldBorders.java rename to src/alisolarflare/easyuhc/commands/SetupWorldBorders.java index db45dc0..ef90ae8 100644 --- a/src/alisolarflare/easyuhc/Command_SetupWorldBorders.java +++ b/src/alisolarflare/easyuhc/commands/SetupWorldBorders.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc; +package alisolarflare.easyuhc.commands; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class Command_SetupWorldBorders extends TBMCCommandBase { +public class SetupWorldBorders extends TBMCCommandBase { @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/Command_ShrinkWorldBorders.java b/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java similarity index 85% rename from src/alisolarflare/easyuhc/Command_ShrinkWorldBorders.java rename to src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java index b25bf11..bd083a6 100644 --- a/src/alisolarflare/easyuhc/Command_ShrinkWorldBorders.java +++ b/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc; +package alisolarflare.easyuhc.commands; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class Command_ShrinkWorldBorders extends TBMCCommandBase { +public class ShrinkWorldBorders extends TBMCCommandBase { @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/Command_SpreadPlayers.java b/src/alisolarflare/easyuhc/commands/SpreadPlayers.java similarity index 85% rename from src/alisolarflare/easyuhc/Command_SpreadPlayers.java rename to src/alisolarflare/easyuhc/commands/SpreadPlayers.java index f83e70a..a5798ac 100644 --- a/src/alisolarflare/easyuhc/Command_SpreadPlayers.java +++ b/src/alisolarflare/easyuhc/commands/SpreadPlayers.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc; +package alisolarflare.easyuhc.commands; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class Command_SpreadPlayers extends TBMCCommandBase{ +public class SpreadPlayers extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/Command_StartTimer.java b/src/alisolarflare/easyuhc/commands/StartTimer.java similarity index 86% rename from src/alisolarflare/easyuhc/Command_StartTimer.java rename to src/alisolarflare/easyuhc/commands/StartTimer.java index 96dad6f..927344e 100644 --- a/src/alisolarflare/easyuhc/Command_StartTimer.java +++ b/src/alisolarflare/easyuhc/commands/StartTimer.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc; +package alisolarflare.easyuhc.commands; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class Command_StartTimer extends TBMCCommandBase{ +public class StartTimer extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/Command_StartUHC.java b/src/alisolarflare/easyuhc/commands/StartUHC.java similarity index 86% rename from src/alisolarflare/easyuhc/Command_StartUHC.java rename to src/alisolarflare/easyuhc/commands/StartUHC.java index 7cc116d..2a06889 100644 --- a/src/alisolarflare/easyuhc/Command_StartUHC.java +++ b/src/alisolarflare/easyuhc/commands/StartUHC.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc; +package alisolarflare.easyuhc.commands; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class Command_StartUHC extends TBMCCommandBase{ +public class StartUHC extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/Command_TeleportToUHC.java b/src/alisolarflare/easyuhc/commands/TeleportToUHC.java similarity index 85% rename from src/alisolarflare/easyuhc/Command_TeleportToUHC.java rename to src/alisolarflare/easyuhc/commands/TeleportToUHC.java index 3f46306..5a5c6d0 100644 --- a/src/alisolarflare/easyuhc/Command_TeleportToUHC.java +++ b/src/alisolarflare/easyuhc/commands/TeleportToUHC.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc; +package alisolarflare.easyuhc.commands; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class Command_TeleportToUHC extends TBMCCommandBase{ +public class TeleportToUHC extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/magic/MagicModule.java b/src/alisolarflare/magic/MagicModule.java index 9a83bd0..616b179 100644 --- a/src/alisolarflare/magic/MagicModule.java +++ b/src/alisolarflare/magic/MagicModule.java @@ -3,6 +3,9 @@ package alisolarflare.magic; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; +import alisolarflare.magic.tricks.AliArrowListener; +import alisolarflare.magic.tricks.BoomBowDeathListener; +import alisolarflare.magic.tricks.BoomBowListener; public class MagicModule extends Module{ diff --git a/src/alisolarflare/magic/AliArrowListener.java b/src/alisolarflare/magic/tricks/AliArrowListener.java similarity index 92% rename from src/alisolarflare/magic/AliArrowListener.java rename to src/alisolarflare/magic/tricks/AliArrowListener.java index ecd79e6..36b8e12 100644 --- a/src/alisolarflare/magic/AliArrowListener.java +++ b/src/alisolarflare/magic/tricks/AliArrowListener.java @@ -1,39 +1,39 @@ -package alisolarflare.magic; - -import org.bukkit.entity.Arrow; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.ProjectileLaunchEvent; -import org.bukkit.plugin.java.JavaPlugin; - -public class AliArrowListener implements Listener { - private final JavaPlugin plugin; - - public AliArrowListener(JavaPlugin plugin){ - this.plugin = plugin; - } - - @EventHandler - public void onProjectileLaunch(ProjectileLaunchEvent event){ - if(event.getEntity().getType() != EntityType.ARROW){ - return; - } - Arrow arrow = (Arrow) event.getEntity(); - if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player)){ - return; - } - - String user = ((Player) arrow.getShooter()).getName(); - - for (String permittedUser : AliArrowTask.permittedUsers){ - if(permittedUser.equalsIgnoreCase(user)){ - new AliArrowTask(arrow,user).runTaskTimer(plugin, 2, 1); - break; - } - } - return; - - } +package alisolarflare.magic.tricks; + +import org.bukkit.entity.Arrow; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.ProjectileLaunchEvent; +import org.bukkit.plugin.java.JavaPlugin; + +public class AliArrowListener implements Listener { + private final JavaPlugin plugin; + + public AliArrowListener(JavaPlugin plugin){ + this.plugin = plugin; + } + + @EventHandler + public void onProjectileLaunch(ProjectileLaunchEvent event){ + if(event.getEntity().getType() != EntityType.ARROW){ + return; + } + Arrow arrow = (Arrow) event.getEntity(); + if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player)){ + return; + } + + String user = ((Player) arrow.getShooter()).getName(); + + for (String permittedUser : AliArrowTask.permittedUsers){ + if(permittedUser.equalsIgnoreCase(user)){ + new AliArrowTask(arrow,user).runTaskTimer(plugin, 2, 1); + break; + } + } + return; + + } } \ No newline at end of file diff --git a/src/alisolarflare/magic/AliArrowTask.java b/src/alisolarflare/magic/tricks/AliArrowTask.java similarity index 92% rename from src/alisolarflare/magic/AliArrowTask.java rename to src/alisolarflare/magic/tricks/AliArrowTask.java index 055a4fd..10252b8 100644 --- a/src/alisolarflare/magic/AliArrowTask.java +++ b/src/alisolarflare/magic/tricks/AliArrowTask.java @@ -1,40 +1,40 @@ -package alisolarflare.magic; - -import org.bukkit.Particle; -import org.bukkit.entity.Arrow; -import org.bukkit.scheduler.BukkitRunnable; - -public class AliArrowTask extends BukkitRunnable { - static String[] permittedUsers = {"alisolarflare", "Zanthr", "NorbiPeti"}; - String name; - Arrow arrow; - - public AliArrowTask(Arrow arrow, String name) { - this.name = name; - this.arrow = arrow; - } - - @Override - public void run() { - if (arrow.isOnGround() || arrow.isDead()) { - this.cancel(); - } - - switch(name.toLowerCase()){ - case "alisolarflare": - arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1); - break; - - case "zanthr": - arrow.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, arrow.getLocation(), 1); - arrow.getWorld().spawnParticle(Particle.FLAME, arrow.getLocation(), 1); - break; - - case "norbipeti": - arrow.getWorld().spawnParticle(Particle.LAVA, arrow.getLocation(), 1); - break; - } - - } - -} +package alisolarflare.magic.tricks; + +import org.bukkit.Particle; +import org.bukkit.entity.Arrow; +import org.bukkit.scheduler.BukkitRunnable; + +public class AliArrowTask extends BukkitRunnable { + static String[] permittedUsers = {"alisolarflare", "Zanthr", "NorbiPeti"}; + String name; + Arrow arrow; + + public AliArrowTask(Arrow arrow, String name) { + this.name = name; + this.arrow = arrow; + } + + @Override + public void run() { + if (arrow.isOnGround() || arrow.isDead()) { + this.cancel(); + } + + switch(name.toLowerCase()){ + case "alisolarflare": + arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1); + break; + + case "zanthr": + arrow.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, arrow.getLocation(), 1); + arrow.getWorld().spawnParticle(Particle.FLAME, arrow.getLocation(), 1); + break; + + case "norbipeti": + arrow.getWorld().spawnParticle(Particle.LAVA, arrow.getLocation(), 1); + break; + } + + } + +} diff --git a/src/alisolarflare/magic/BoomBowDeathListener.java b/src/alisolarflare/magic/tricks/BoomBowDeathListener.java similarity index 90% rename from src/alisolarflare/magic/BoomBowDeathListener.java rename to src/alisolarflare/magic/tricks/BoomBowDeathListener.java index f16d3c1..427537e 100644 --- a/src/alisolarflare/magic/BoomBowDeathListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowDeathListener.java @@ -1,18 +1,18 @@ -package alisolarflare.magic; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.PlayerDeathEvent; - -public class BoomBowDeathListener implements Listener{ - @EventHandler - public void onBoomBowDeath(PlayerDeathEvent event){ - Player player = event.getEntity(); - - if (player.getLastDamage() > 7.42420 && player.getLastDamage() < 7.42429){ - player.sendMessage("42!"); - event.setDeathMessage(player.getName() + " got trigger happy with the [Boom Bow]"); - } - } -} +package alisolarflare.magic.tricks; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.PlayerDeathEvent; + +public class BoomBowDeathListener implements Listener{ + @EventHandler + public void onBoomBowDeath(PlayerDeathEvent event){ + Player player = event.getEntity(); + + if (player.getLastDamage() > 7.42420 && player.getLastDamage() < 7.42429){ + player.sendMessage("42!"); + event.setDeathMessage(player.getName() + " got trigger happy with the [Boom Bow]"); + } + } +} diff --git a/src/alisolarflare/magic/BoomBowListener.java b/src/alisolarflare/magic/tricks/BoomBowListener.java similarity index 95% rename from src/alisolarflare/magic/BoomBowListener.java rename to src/alisolarflare/magic/tricks/BoomBowListener.java index 8381927..5e74bd8 100644 --- a/src/alisolarflare/magic/BoomBowListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowListener.java @@ -1,107 +1,107 @@ -package alisolarflare.magic; - -import org.bukkit.GameMode; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Particle; -import org.bukkit.Sound; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; - -public class BoomBowListener implements Listener { - JavaPlugin plugin; - public BoomBowListener(JavaPlugin plugin){ - this.plugin = plugin; - } - @EventHandler - public void ClickEvent(PlayerInteractEvent event){ - FlyBowBoost(event); - - } - public void FlyBowBoost(PlayerInteractEvent event){ - - //ACTION SANITATION - if(!(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK)) return; - if(!(event.getPlayer().isGliding())) return; - if(!(event.getMaterial() == Material.BOW)) return; - - //BOW SANITATION - ItemStack bow = event.getItem(); - if(!(bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK))) return; - if(!(bow.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) == 3)) return; - if(!(bow.getItemMeta().getDisplayName().contains("BOOM BOW"))) return; - - //PLAYER SANITATION - Player player = event.getPlayer(); - if(player.getGameMode().equals(GameMode.CREATIVE))return; - - if(bow.containsEnchantment(Enchantment.ARROW_INFINITE)){ - //HAS INIFINITY - Activate(event); - - }else if((player.getInventory().contains(Material.TNT))){ - //HAS TNT - Activate(event); - - //Reduce tnt by 1 - int tntSlot = player.getInventory().first(Material.TNT); - ItemStack tntStack = player.getInventory().getItem(tntSlot); - if(tntStack.getAmount() > 3){ - tntStack.setAmount(tntStack.getAmount()-3); - }else{ - player.getInventory().remove(tntStack); - } - - }else{ - return; - } - } - - - - public void Activate(PlayerInteractEvent event){ - //INIT - Player variables - Player player = event.getPlayer(); - Location playerLocation = player.getLocation(); - ItemStack boomBow = player.getInventory().getItemInMainHand(); - - //TODO: NERF - boomDecay - //TODO: NERF - endCrystal - //TODO: NERF - healthReduction - //TODO: NERF - localized - - if(BoomBowRule.boomDecay) - new BoomDecayTask(player).runTaskTimer(plugin, 1, 1); - if(BoomBowRule.endCrystal){ - //BoomBowCyrstalSpawn - } - if(BoomBowRule.healthReduction){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1)); - } - if(BoomBowRule.localized); - - - //SET - Player Velocity - player.setVelocity(playerLocation.getDirection().normalize().multiply(3.0)); - - //CREATE - Explosion + damage - player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); - player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); - player.damage(7.42425, player); - player.sendMessage(player.getLastDamage() + ""); - boomBow.setDurability((short) (boomBow.getDurability() + 3)); - if(boomBow.getDurability() < 0){ - player.getInventory().setItemInMainHand(null); - player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0); - } - - } -} +package alisolarflare.magic.tricks; + +import org.bukkit.GameMode; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Particle; +import org.bukkit.Sound; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +public class BoomBowListener implements Listener { + JavaPlugin plugin; + public BoomBowListener(JavaPlugin plugin){ + this.plugin = plugin; + } + @EventHandler + public void ClickEvent(PlayerInteractEvent event){ + FlyBowBoost(event); + + } + public void FlyBowBoost(PlayerInteractEvent event){ + + //ACTION SANITATION + if(!(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK)) return; + if(!(event.getPlayer().isGliding())) return; + if(!(event.getMaterial() == Material.BOW)) return; + + //BOW SANITATION + ItemStack bow = event.getItem(); + if(!(bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK))) return; + if(!(bow.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) == 3)) return; + if(!(bow.getItemMeta().getDisplayName().contains("BOOM BOW"))) return; + + //PLAYER SANITATION + Player player = event.getPlayer(); + if(player.getGameMode().equals(GameMode.CREATIVE))return; + + if(bow.containsEnchantment(Enchantment.ARROW_INFINITE)){ + //HAS INIFINITY + Activate(event); + + }else if((player.getInventory().contains(Material.TNT))){ + //HAS TNT + Activate(event); + + //Reduce tnt by 1 + int tntSlot = player.getInventory().first(Material.TNT); + ItemStack tntStack = player.getInventory().getItem(tntSlot); + if(tntStack.getAmount() > 3){ + tntStack.setAmount(tntStack.getAmount()-3); + }else{ + player.getInventory().remove(tntStack); + } + + }else{ + return; + } + } + + + + public void Activate(PlayerInteractEvent event){ + //INIT - Player variables + Player player = event.getPlayer(); + Location playerLocation = player.getLocation(); + ItemStack boomBow = player.getInventory().getItemInMainHand(); + + //TODO: NERF - boomDecay + //TODO: NERF - endCrystal + //TODO: NERF - healthReduction + //TODO: NERF - localized + + if(BoomBowRule.boomDecay) + new BoomDecayTask(player).runTaskTimer(plugin, 1, 1); + if(BoomBowRule.endCrystal){ + //BoomBowCyrstalSpawn + } + if(BoomBowRule.healthReduction){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1)); + } + if(BoomBowRule.localized); + + + //SET - Player Velocity + player.setVelocity(playerLocation.getDirection().normalize().multiply(3.0)); + + //CREATE - Explosion + damage + player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); + player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); + player.damage(7.42425, player); + player.sendMessage(player.getLastDamage() + ""); + boomBow.setDurability((short) (boomBow.getDurability() + 3)); + if(boomBow.getDurability() < 0){ + player.getInventory().setItemInMainHand(null); + player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0); + } + + } +} diff --git a/src/alisolarflare/magic/BoomBowRule.java b/src/alisolarflare/magic/tricks/BoomBowRule.java similarity index 95% rename from src/alisolarflare/magic/BoomBowRule.java rename to src/alisolarflare/magic/tricks/BoomBowRule.java index caa0256..bbfbf8f 100644 --- a/src/alisolarflare/magic/BoomBowRule.java +++ b/src/alisolarflare/magic/tricks/BoomBowRule.java @@ -1,84 +1,84 @@ -package alisolarflare.magic; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import buttondevteam.lib.chat.TBMCCommandBase; -//HEHEHHEHEH EAASSSTER EGGS -public class BoomBowRule extends TBMCCommandBase{ - public static boolean boomDecay; - public static boolean healthReduction; - public static boolean endCrystal; - public static boolean localized;; - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (sender instanceof Player == false){ - sender.sendMessage("You must be a player to use this command"); - return false; - } - Player player = (Player) sender; - if (player.getName().equals("alisolarflare") == false){ - player.sendMessage("You must be alisolarflare to use this command"); - return false; - } - if (args.length < 2){ - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); - player.sendMessage("Rules:"); - player.sendMessage("boomDecay" + boomDecay); - player.sendMessage("healthReduction" + healthReduction); - player.sendMessage("endCrystal" + endCrystal); - player.sendMessage("localized" + localized); - return false; - } - if(!(args[1].startsWith("t")|| args[1].startsWith("f"))){ - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); - return false; - } - boolean gameRule = false; - if(args[1].startsWith("t") || args[1].startsWith("T")){ - gameRule = true; - } - switch(args[0]){ - case "boomDecay": - boomDecay = gameRule; - break; - case "healthReduction": - healthReduction = gameRule; - break; - case "endCrystal": - endCrystal = gameRule; - break; - case "localized": - localized = gameRule; - break; - default: - player.sendMessage("Error: "+args[0]+" not defined as a rule"); - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); - player.sendMessage("Rule settings: boomDecay, healthReduction, endCrystal, localized"); - break; - } - - return false; - } - @Override - public String GetCommandPath() { - // TODO Auto-generated method stub - return null; - } - @Override - public String[] GetHelpText(String arg0) { - // TODO Auto-generated method stub - return null; - } - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.magic.tricks; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import buttondevteam.lib.chat.TBMCCommandBase; +//HEHEHHEHEH EAASSSTER EGGS +public class BoomBowRule extends TBMCCommandBase{ + public static boolean boomDecay; + public static boolean healthReduction; + public static boolean endCrystal; + public static boolean localized;; + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (sender instanceof Player == false){ + sender.sendMessage("You must be a player to use this command"); + return false; + } + Player player = (Player) sender; + if (player.getName().equals("alisolarflare") == false){ + player.sendMessage("You must be alisolarflare to use this command"); + return false; + } + if (args.length < 2){ + player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); + player.sendMessage("Rules:"); + player.sendMessage("boomDecay" + boomDecay); + player.sendMessage("healthReduction" + healthReduction); + player.sendMessage("endCrystal" + endCrystal); + player.sendMessage("localized" + localized); + return false; + } + if(!(args[1].startsWith("t")|| args[1].startsWith("f"))){ + player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); + return false; + } + boolean gameRule = false; + if(args[1].startsWith("t") || args[1].startsWith("T")){ + gameRule = true; + } + switch(args[0]){ + case "boomDecay": + boomDecay = gameRule; + break; + case "healthReduction": + healthReduction = gameRule; + break; + case "endCrystal": + endCrystal = gameRule; + break; + case "localized": + localized = gameRule; + break; + default: + player.sendMessage("Error: "+args[0]+" not defined as a rule"); + player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); + player.sendMessage("Rule settings: boomDecay, healthReduction, endCrystal, localized"); + break; + } + + return false; + } + @Override + public String GetCommandPath() { + // TODO Auto-generated method stub + return null; + } + @Override + public String[] GetHelpText(String arg0) { + // TODO Auto-generated method stub + return null; + } + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/magic/BoomDecayTask.java b/src/alisolarflare/magic/tricks/BoomDecayTask.java similarity index 88% rename from src/alisolarflare/magic/BoomDecayTask.java rename to src/alisolarflare/magic/tricks/BoomDecayTask.java index 2d128f9..5f1875c 100644 --- a/src/alisolarflare/magic/BoomDecayTask.java +++ b/src/alisolarflare/magic/tricks/BoomDecayTask.java @@ -1,25 +1,25 @@ -package alisolarflare.magic; - -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; - -public class BoomDecayTask extends BukkitRunnable{ - Player player; - private int ticksSinceStart = 0; - private final int effectLength = 20; - public BoomDecayTask(Player player){ - this.player = player; - } - //runs every tick - @Override - public void run() { - if (ticksSinceStart > effectLength){ - this.cancel(); - } - player.sendMessage(player.getVelocity().toString()); - - ticksSinceStart++; - - } - -} +package alisolarflare.magic.tricks; + +import org.bukkit.entity.Player; +import org.bukkit.scheduler.BukkitRunnable; + +public class BoomDecayTask extends BukkitRunnable{ + Player player; + private int ticksSinceStart = 0; + private final int effectLength = 20; + public BoomDecayTask(Player player){ + this.player = player; + } + //runs every tick + @Override + public void run() { + if (ticksSinceStart > effectLength){ + this.cancel(); + } + player.sendMessage(player.getVelocity().toString()); + + ticksSinceStart++; + + } + +} From 30122d23d8f7d8a9ede7854a758a458e3da30c30 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 6 Nov 2016 18:52:59 -0500 Subject: [PATCH 107/263] Revert "Revert "Comit to Uncommit"" This reverts commit fc862a670ef33bfe353d5f289b0cf093ecaadfee. --- .../FlairMe.java => Command_FlairMe.java} | 77 +++-- .../components/flairdoor/FlairDoorModule.java | 15 - ...rtalListener.java => Listener_Portal.java} | 276 ++++++++--------- .../flairdoor/Module_FlairDoor.java | 13 + .../GPower.java => Command_GPower.java} | 151 +++++----- .../PowerDown.java => Command_PowerDown.java} | 97 +++--- .../PowerUp.java => Command_PowerUp.java} | 97 +++--- .../components/gpowers/GPowerModule.java | 23 -- .../gpowers/Listener_PowerLooper.java | 11 + .../{GPowerMemory.java => Memory_GPower.java} | 104 +++---- .../components/gpowers/Module_GPower.java | 19 ++ ...plyingTask.java => Task_PowerApplier.java} | 132 ++++----- .../gpowers/listeners/gPowerListener.java | 13 - .../components/links/AliLinkModule.java | 33 --- ...AliLink.java => Command_PressAliLink.java} | 119 ++++---- ...etAliLink.java => Command_SetAliLink.java} | 278 +++++++++--------- .../{entities/Link.java => Memory_Link.java} | 80 +++-- .../components/links/Module_AliLink.java | 30 ++ ...UnpressTask.java => Task_UnpressTask.java} | 42 +-- .../links/serializer/Deserializer.java | 42 --- .../links/serializer/Serializer.java | 38 --- .../Cbgm0.java => Command_Cbgm0.java} | 97 +++--- .../Cbgm1.java => Command_Cbgm1.java} | 163 +++++----- ...Dickmode.java => Command_SetDickmode.java} | 107 ++++--- .../CreativeBoundariesModule.java | 30 -- ...ner.java => Listener_ItemRestriction.java} | 50 ++-- ...Listener.java => Listener_PlotChange.java} | 136 +++++---- .../Module_CreativeBoundaries.java | 25 ++ ...owers.java => Command_ActivatePowers.java} | 4 +- ...rs.java => Command_SetupWorldBorders.java} | 4 +- ...s.java => Command_ShrinkWorldBorders.java} | 4 +- ...layers.java => Command_SpreadPlayers.java} | 4 +- ...tartTimer.java => Command_StartTimer.java} | 4 +- .../StartUHC.java => Command_StartUHC.java} | 4 +- ...tToUHC.java => Command_TeleportToUHC.java} | 4 +- src/alisolarflare/easyuhc/EasyUHCModule.java | 24 -- src/alisolarflare/easyuhc/Module_EasyUHC.java | 18 ++ .../magic/{tricks => }/AliArrowListener.java | 76 ++--- .../magic/{tricks => }/AliArrowTask.java | 80 ++--- .../{tricks => }/BoomBowDeathListener.java | 36 +-- .../magic/{tricks => }/BoomBowListener.java | 214 +++++++------- .../magic/{tricks => }/BoomBowRule.java | 168 +++++------ .../magic/{tricks => }/BoomDecayTask.java | 50 ++-- src/alisolarflare/magic/MagicModule.java | 3 - 44 files changed, 1437 insertions(+), 1558 deletions(-) rename src/alisolarflare/components/flairdoor/{commands/FlairMe.java => Command_FlairMe.java} (69%) delete mode 100644 src/alisolarflare/components/flairdoor/FlairDoorModule.java rename src/alisolarflare/components/flairdoor/{listeners/PortalListener.java => Listener_Portal.java} (92%) create mode 100644 src/alisolarflare/components/flairdoor/Module_FlairDoor.java rename src/alisolarflare/components/gpowers/{commands/GPower.java => Command_GPower.java} (86%) rename src/alisolarflare/components/gpowers/{commands/PowerDown.java => Command_PowerDown.java} (75%) rename src/alisolarflare/components/gpowers/{commands/PowerUp.java => Command_PowerUp.java} (75%) delete mode 100644 src/alisolarflare/components/gpowers/GPowerModule.java create mode 100644 src/alisolarflare/components/gpowers/Listener_PowerLooper.java rename src/alisolarflare/components/gpowers/{GPowerMemory.java => Memory_GPower.java} (95%) create mode 100644 src/alisolarflare/components/gpowers/Module_GPower.java rename src/alisolarflare/components/gpowers/{listeners/gPowerApplyingTask.java => Task_PowerApplier.java} (88%) delete mode 100644 src/alisolarflare/components/gpowers/listeners/gPowerListener.java delete mode 100644 src/alisolarflare/components/links/AliLinkModule.java rename src/alisolarflare/components/links/{commands/PressAliLink.java => Command_PressAliLink.java} (75%) rename src/alisolarflare/components/links/{commands/SetAliLink.java => Command_SetAliLink.java} (80%) rename src/alisolarflare/components/links/{entities/Link.java => Memory_Link.java} (74%) create mode 100644 src/alisolarflare/components/links/Module_AliLink.java rename src/alisolarflare/components/links/{tasks/UnpressTask.java => Task_UnpressTask.java} (68%) delete mode 100644 src/alisolarflare/components/links/serializer/Deserializer.java delete mode 100644 src/alisolarflare/components/links/serializer/Serializer.java rename src/alisolarflare/creativeboundaries/{commands/Cbgm0.java => Command_Cbgm0.java} (73%) rename src/alisolarflare/creativeboundaries/{commands/Cbgm1.java => Command_Cbgm1.java} (85%) rename src/alisolarflare/creativeboundaries/{commands/SetDickmode.java => Command_SetDickmode.java} (78%) delete mode 100644 src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java rename src/alisolarflare/creativeboundaries/{listeners/ItemRestrictionListener.java => Listener_ItemRestriction.java} (52%) rename src/alisolarflare/creativeboundaries/{listeners/PlotChangeListener.java => Listener_PlotChange.java} (84%) create mode 100644 src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java rename src/alisolarflare/easyuhc/{commands/ActivatePowers.java => Command_ActivatePowers.java} (85%) rename src/alisolarflare/easyuhc/{commands/SetupWorldBorders.java => Command_SetupWorldBorders.java} (85%) rename src/alisolarflare/easyuhc/{commands/ShrinkWorldBorders.java => Command_ShrinkWorldBorders.java} (85%) rename src/alisolarflare/easyuhc/{commands/SpreadPlayers.java => Command_SpreadPlayers.java} (85%) rename src/alisolarflare/easyuhc/{commands/StartTimer.java => Command_StartTimer.java} (86%) rename src/alisolarflare/easyuhc/{commands/StartUHC.java => Command_StartUHC.java} (86%) rename src/alisolarflare/easyuhc/{commands/TeleportToUHC.java => Command_TeleportToUHC.java} (85%) delete mode 100644 src/alisolarflare/easyuhc/EasyUHCModule.java create mode 100644 src/alisolarflare/easyuhc/Module_EasyUHC.java rename src/alisolarflare/magic/{tricks => }/AliArrowListener.java (92%) rename src/alisolarflare/magic/{tricks => }/AliArrowTask.java (92%) rename src/alisolarflare/magic/{tricks => }/BoomBowDeathListener.java (90%) rename src/alisolarflare/magic/{tricks => }/BoomBowListener.java (95%) rename src/alisolarflare/magic/{tricks => }/BoomBowRule.java (95%) rename src/alisolarflare/magic/{tricks => }/BoomDecayTask.java (88%) diff --git a/src/alisolarflare/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/Command_FlairMe.java similarity index 69% rename from src/alisolarflare/components/flairdoor/commands/FlairMe.java rename to src/alisolarflare/components/flairdoor/Command_FlairMe.java index 963da82..819ed54 100644 --- a/src/alisolarflare/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/Command_FlairMe.java @@ -1,39 +1,38 @@ -package alisolarflare.components.flairdoor.commands; - -import org.bukkit.command.CommandSender; - -import alisolarflare.components.flairdoor.listeners.PortalListener; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class FlairMe extends TBMCCommandBase { - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - PortalListener.playersToBeFlaired.add(sender.getName()); - sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); - - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return new String[] { "" }; - } - - @Override - public String GetCommandPath() { - return "flairme"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - return false; - } - -} +package alisolarflare.components.flairdoor; + +import org.bukkit.command.CommandSender; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_FlairMe extends TBMCCommandBase { + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + Listener_Portal.playersToBeFlaired.add(sender.getName()); + sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); + + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return new String[] { "" }; + } + + @Override + public String GetCommandPath() { + return "flairme"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + return false; + } + +} diff --git a/src/alisolarflare/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/components/flairdoor/FlairDoorModule.java deleted file mode 100644 index 1c5cddb..0000000 --- a/src/alisolarflare/components/flairdoor/FlairDoorModule.java +++ /dev/null @@ -1,15 +0,0 @@ -package alisolarflare.components.flairdoor; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.components.flairdoor.commands.FlairMe; -import alisolarflare.components.flairdoor.listeners.PortalListener; - -public class FlairDoorModule extends Module { - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new FlairMe()); - registerListener(plugin, new PortalListener(plugin)); - } -} diff --git a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/Listener_Portal.java similarity index 92% rename from src/alisolarflare/components/flairdoor/listeners/PortalListener.java rename to src/alisolarflare/components/flairdoor/Listener_Portal.java index 4ce684a..59791d4 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/Listener_Portal.java @@ -1,138 +1,138 @@ -package alisolarflare.components.flairdoor.listeners; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.Bukkit; -import org.bukkit.DyeColor; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerPortalEvent; -import org.bukkit.material.MaterialData; -import org.bukkit.material.Wool; -import org.bukkit.plugin.java.JavaPlugin; - -import com.earth2me.essentials.Essentials; -import com.earth2me.essentials.User; - -public class PortalListener implements Listener{ - public static List playersToBeFlaired = new ArrayList(); - public JavaPlugin plugin; - - Essentials essentials; - - public PortalListener(JavaPlugin plugin) { - this.plugin = plugin; - this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials")); - } - @EventHandler - public void onPortalEnter(PlayerPortalEvent event){ - //SANITATION - Player - if(!(event.getPlayer() instanceof Player)){ - return; - } - - //INIT - Player - Player player = event.getPlayer(); - - //SANITATION - PlayersToBeFlaired - if(!(playersToBeFlaired.contains(player.getName()))){ - return; - } - player.sendMessage("-MAY THE FLAIRING COMMENCE-"); - event.setTo(player.getLocation()); - - //INIT - x,y,z - int x = player.getLocation().getBlockX(); - int y = player.getLocation().getBlockY(); - int z = player.getLocation().getBlockZ(); - - //INIT - Blocks Under Portal - Block HigherBlock = player.getWorld().getBlockAt(x,y-2,z); - Block MiddleBlock = player.getWorld().getBlockAt(x,y-3,z); - Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); - - //RECOLOUR PLAYER - if(HigherBlock.getType() == Material.STONE){ - recolourPlayer(player, DyeColor.GRAY); - - //TOP BLOCK IS WOOL? - }else if(HigherBlock.getType() == Material.WOOL){ - Wool wool = (Wool) HigherBlock.getState().getData(); - recolourPlayer(player, wool.getColor()); - - //MIDDLE BLOCK IS WOOL? - }else if(MiddleBlock.getType() == Material.WOOL){ - MaterialData mData = MiddleBlock.getState().getData(); - Wool wool = (Wool) mData; - - recolourPlayer(player, wool.getColor()); - - //BOTTOM BLOCK IS WOOL? - }else if (BottomBlock.getType() == Material.WOOL){ - Wool wool = (Wool) BottomBlock.getState().getData(); - recolourPlayer(player, wool.getColor()); - } - - } - public void recolourPlayer(Player player, DyeColor dyecolour){ - User user = essentials.getUser(player); - - String name = user._getNickname(); - String tempName = ""; - for(int i = 0; i < name.length(); i++){ - if (name.charAt(i) != '§'){ - tempName += name.charAt(i); - }else{ - i++; - } - } - name = tempName; - - switch(dyecolour){ - case GRAY: - player.sendMessage("Adding §7GRAY!§f"); - name = "§7" + name; - break; - case RED: - player.sendMessage("Adding §4RED!§f"); - name = "§4" + name; - break; - case ORANGE: - player.sendMessage("Adding §6ORANGE!§f"); - name = "§6" + name; - break; - case YELLOW: - player.sendMessage("Adding §eYELLOW!§f"); - name = "§e" + name; - break; - case LIME: - case GREEN: - player.sendMessage("Adding §aGREEN!§f"); - name = "§a" + name; - break; - case CYAN: - case LIGHT_BLUE: - case BLUE: - player.sendMessage("Adding §9BLUE!§f"); - name = "§9" + name; - break; - case PURPLE: - player.sendMessage("Adding §5PURPLE!§f"); - name = "§5" + name; - break; - case WHITE: - player.sendMessage("Adding §fWHITE!§f"); - name = "§f" + name; - default: - player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); - break; - } - user.setNickname(name); - player.sendMessage("Your name is now: " + user.getNickname() +"!"); - playersToBeFlaired.remove(player.getName()); - } -} +package alisolarflare.components.flairdoor; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Bukkit; +import org.bukkit.DyeColor; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerPortalEvent; +import org.bukkit.material.MaterialData; +import org.bukkit.material.Wool; +import org.bukkit.plugin.java.JavaPlugin; + +import com.earth2me.essentials.Essentials; +import com.earth2me.essentials.User; + +public class Listener_Portal implements Listener{ + public static List playersToBeFlaired = new ArrayList(); + public JavaPlugin plugin; + + Essentials essentials; + + public Listener_Portal(JavaPlugin plugin) { + this.plugin = plugin; + this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials")); + } + @EventHandler + public void onPortalEnter(PlayerPortalEvent event){ + //SANITATION - Player + if(!(event.getPlayer() instanceof Player)){ + return; + } + + //INIT - Player + Player player = event.getPlayer(); + + //SANITATION - PlayersToBeFlaired + if(!(playersToBeFlaired.contains(player.getName()))){ + return; + } + player.sendMessage("-MAY THE FLAIRING COMMENCE-"); + event.setTo(player.getLocation()); + + //INIT - x,y,z + int x = player.getLocation().getBlockX(); + int y = player.getLocation().getBlockY(); + int z = player.getLocation().getBlockZ(); + + //INIT - Blocks Under Portal + Block HigherBlock = player.getWorld().getBlockAt(x,y-2,z); + Block MiddleBlock = player.getWorld().getBlockAt(x,y-3,z); + Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); + + //RECOLOUR PLAYER + if(HigherBlock.getType() == Material.STONE){ + recolourPlayer(player, DyeColor.GRAY); + + //TOP BLOCK IS WOOL? + }else if(HigherBlock.getType() == Material.WOOL){ + Wool wool = (Wool) HigherBlock.getState().getData(); + recolourPlayer(player, wool.getColor()); + + //MIDDLE BLOCK IS WOOL? + }else if(MiddleBlock.getType() == Material.WOOL){ + MaterialData mData = MiddleBlock.getState().getData(); + Wool wool = (Wool) mData; + + recolourPlayer(player, wool.getColor()); + + //BOTTOM BLOCK IS WOOL? + }else if (BottomBlock.getType() == Material.WOOL){ + Wool wool = (Wool) BottomBlock.getState().getData(); + recolourPlayer(player, wool.getColor()); + } + + } + public void recolourPlayer(Player player, DyeColor dyecolour){ + User user = essentials.getUser(player); + + String name = user._getNickname(); + String tempName = ""; + for(int i = 0; i < name.length(); i++){ + if (name.charAt(i) != '§'){ + tempName += name.charAt(i); + }else{ + i++; + } + } + name = tempName; + + switch(dyecolour){ + case GRAY: + player.sendMessage("Adding §7GRAY!§f"); + name = "§7" + name; + break; + case RED: + player.sendMessage("Adding §4RED!§f"); + name = "§4" + name; + break; + case ORANGE: + player.sendMessage("Adding §6ORANGE!§f"); + name = "§6" + name; + break; + case YELLOW: + player.sendMessage("Adding §eYELLOW!§f"); + name = "§e" + name; + break; + case LIME: + case GREEN: + player.sendMessage("Adding §aGREEN!§f"); + name = "§a" + name; + break; + case CYAN: + case LIGHT_BLUE: + case BLUE: + player.sendMessage("Adding §9BLUE!§f"); + name = "§9" + name; + break; + case PURPLE: + player.sendMessage("Adding §5PURPLE!§f"); + name = "§5" + name; + break; + case WHITE: + player.sendMessage("Adding §fWHITE!§f"); + name = "§f" + name; + default: + player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); + break; + } + user.setNickname(name); + player.sendMessage("Your name is now: " + user.getNickname() +"!"); + playersToBeFlaired.remove(player.getName()); + } +} diff --git a/src/alisolarflare/components/flairdoor/Module_FlairDoor.java b/src/alisolarflare/components/flairdoor/Module_FlairDoor.java new file mode 100644 index 0000000..ca893a7 --- /dev/null +++ b/src/alisolarflare/components/flairdoor/Module_FlairDoor.java @@ -0,0 +1,13 @@ +package alisolarflare.components.flairdoor; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; + +public class Module_FlairDoor extends Module { + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new Command_FlairMe()); + registerListener(plugin, new Listener_Portal(plugin)); + } +} diff --git a/src/alisolarflare/components/gpowers/commands/GPower.java b/src/alisolarflare/components/gpowers/Command_GPower.java similarity index 86% rename from src/alisolarflare/components/gpowers/commands/GPower.java rename to src/alisolarflare/components/gpowers/Command_GPower.java index 4a90d21..a244e8c 100644 --- a/src/alisolarflare/components/gpowers/commands/GPower.java +++ b/src/alisolarflare/components/gpowers/Command_GPower.java @@ -1,76 +1,75 @@ -package alisolarflare.components.gpowers.commands; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.components.gpowers.GPowerMemory; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class GPower extends TBMCCommandBase { - - private GPowerMemory gPowerMemory; - - public GPower(GPowerMemory gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - sender.sendMessage("G power activate!"); - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command! Talk to a dev/ali if you think this is wrong"); - } - Player player = (Player) sender; - if (args.length < 2) { - player.sendMessage("Proper Usage to test G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); - return false; - } - String colour; - if (args[0].startsWith("r") || args[0].startsWith("o") || args[0].startsWith("y") || args[0].startsWith("g") - || args[0].startsWith("b") || args[0].startsWith("p")) { - colour = args[0]; - } else { - player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]"); - return false; - } - boolean isActive; - if (args[1].startsWith("t")) { - isActive = true; - } else if (args[1].startsWith("f")) { - isActive = false; - } else { - player.sendMessage("error: active. Proper Usage to configure G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); - return false; - } - player.sendMessage("Terms Vaild!"); - player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); - gPowerMemory.configurePlayer(player, colour, isActive); - - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return new String[] { "" }; - } - - @Override - public String GetCommandPath() { - return "gpower"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - return false; - } - -} +package alisolarflare.components.gpowers; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_GPower extends TBMCCommandBase { + + private Memory_GPower gPowerMemory; + + public Command_GPower(Memory_GPower gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + sender.sendMessage("G power activate!"); + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command! Talk to a dev/ali if you think this is wrong"); + } + Player player = (Player) sender; + if (args.length < 2) { + player.sendMessage("Proper Usage to test G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + String colour; + if (args[0].startsWith("r") || args[0].startsWith("o") || args[0].startsWith("y") || args[0].startsWith("g") + || args[0].startsWith("b") || args[0].startsWith("p")) { + colour = args[0]; + } else { + player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]"); + return false; + } + boolean isActive; + if (args[1].startsWith("t")) { + isActive = true; + } else if (args[1].startsWith("f")) { + isActive = false; + } else { + player.sendMessage("error: active. Proper Usage to configure G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + player.sendMessage("Terms Vaild!"); + player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); + gPowerMemory.configurePlayer(player, colour, isActive); + + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return new String[] { "" }; + } + + @Override + public String GetCommandPath() { + return "gpower"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + return false; + } + +} diff --git a/src/alisolarflare/components/gpowers/commands/PowerDown.java b/src/alisolarflare/components/gpowers/Command_PowerDown.java similarity index 75% rename from src/alisolarflare/components/gpowers/commands/PowerDown.java rename to src/alisolarflare/components/gpowers/Command_PowerDown.java index 8f3467b..9204c29 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/components/gpowers/Command_PowerDown.java @@ -1,49 +1,48 @@ -package alisolarflare.components.gpowers.commands; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.components.gpowers.GPowerMemory; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class PowerDown extends TBMCCommandBase { - - private GPowerMemory gPowerMemory; - - public PowerDown(GPowerMemory gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (!(sender instanceof Player)) - sender.sendMessage("You must be a player to use this command! Contact dev/ali if you think this is wrong"); - Player player = (Player) sender; - gPowerMemory.PowerDownPlayer(player); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "powerdown"; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.gpowers; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_PowerDown extends TBMCCommandBase { + + private Memory_GPower gPowerMemory; + + public Command_PowerDown(Memory_GPower gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (!(sender instanceof Player)) + sender.sendMessage("You must be a player to use this command! Contact dev/ali if you think this is wrong"); + Player player = (Player) sender; + gPowerMemory.PowerDownPlayer(player); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "powerdown"; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/gpowers/commands/PowerUp.java b/src/alisolarflare/components/gpowers/Command_PowerUp.java similarity index 75% rename from src/alisolarflare/components/gpowers/commands/PowerUp.java rename to src/alisolarflare/components/gpowers/Command_PowerUp.java index 84670f3..171961c 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/components/gpowers/Command_PowerUp.java @@ -1,49 +1,48 @@ -package alisolarflare.components.gpowers.commands; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.components.gpowers.GPowerMemory; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class PowerUp extends TBMCCommandBase { - - private GPowerMemory gPowerMemory; - - public PowerUp(GPowerMemory gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (!(sender instanceof Player)) - sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong"); - - Player player = (Player) sender; - gPowerMemory.PowerUpPlayer(player); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "powerup"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.gpowers; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_PowerUp extends TBMCCommandBase { + + private Memory_GPower gPowerMemory; + + public Command_PowerUp(Memory_GPower gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (!(sender instanceof Player)) + sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong"); + + Player player = (Player) sender; + gPowerMemory.PowerUpPlayer(player); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "powerup"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/gpowers/GPowerModule.java b/src/alisolarflare/components/gpowers/GPowerModule.java deleted file mode 100644 index 3148ee0..0000000 --- a/src/alisolarflare/components/gpowers/GPowerModule.java +++ /dev/null @@ -1,23 +0,0 @@ -package alisolarflare.components.gpowers; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.components.gpowers.commands.GPower; -import alisolarflare.components.gpowers.commands.PowerDown; -import alisolarflare.components.gpowers.commands.PowerUp; -import alisolarflare.components.gpowers.listeners.gPowerListener; - -public class GPowerModule extends Module { - - @Override - public void register(JavaPlugin plugin) { - GPowerMemory gPowerMemory = new GPowerMemory(); - registerCommand(plugin, new GPower(gPowerMemory)); - registerCommand(plugin, new PowerUp(gPowerMemory)); - registerCommand(plugin, new PowerDown(gPowerMemory)); - - registerListener(plugin, new gPowerListener(plugin, gPowerMemory)); - } - -} diff --git a/src/alisolarflare/components/gpowers/Listener_PowerLooper.java b/src/alisolarflare/components/gpowers/Listener_PowerLooper.java new file mode 100644 index 0000000..8b9c299 --- /dev/null +++ b/src/alisolarflare/components/gpowers/Listener_PowerLooper.java @@ -0,0 +1,11 @@ +package alisolarflare.components.gpowers; + +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; + +public class Listener_PowerLooper implements Listener{ + + public Listener_PowerLooper(JavaPlugin plugin, Memory_GPower gPowerMemory){ + new Task_PowerApplier(plugin.getServer(), gPowerMemory.poweredPlayerList).runTaskTimer(plugin, 190, 190); + } +} \ No newline at end of file diff --git a/src/alisolarflare/components/gpowers/GPowerMemory.java b/src/alisolarflare/components/gpowers/Memory_GPower.java similarity index 95% rename from src/alisolarflare/components/gpowers/GPowerMemory.java rename to src/alisolarflare/components/gpowers/Memory_GPower.java index 44e0089..b1ef0fc 100644 --- a/src/alisolarflare/components/gpowers/GPowerMemory.java +++ b/src/alisolarflare/components/gpowers/Memory_GPower.java @@ -1,52 +1,52 @@ -package alisolarflare.components.gpowers; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.bukkit.entity.Player; - -public class GPowerMemory{ - public Map poweredPlayerList = new HashMap(); - - public void configurePlayer(Player player, String colour, boolean powerIsActive){ - poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); - } - public void PowerUpPlayer(Player player){ - player.sendMessage("Powering up!"); - if(poweredPlayerList.containsKey(player.getUniqueId())){ - poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; - player.sendMessage("Powered up!"); - }else{ - player.sendMessage("You must instantiate your power settings using /GPower"); - } - } - - public void PowerDownPlayer(Player player){ - player.sendMessage("Powering down!"); - if (poweredPlayerList.containsKey(player.getUniqueId())){ - player.sendMessage("Powered down!"); - poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; - }else{ - player.sendMessage("P down!"); - return; - } - - } - - public class poweredPlayer{ - public UUID uuid; - public String colour; - public Boolean isPowersActive; - - public poweredPlayer(UUID uuid, String colour, Boolean activated){ - this.uuid = (uuid); - this.colour = (colour); - this.isPowersActive = (activated); - } - public String toString(){ - return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; - } - } -} - +package alisolarflare.components.gpowers; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.bukkit.entity.Player; + +public class Memory_GPower{ + public Map poweredPlayerList = new HashMap(); + + public void configurePlayer(Player player, String colour, boolean powerIsActive){ + poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); + } + public void PowerUpPlayer(Player player){ + player.sendMessage("Powering up!"); + if(poweredPlayerList.containsKey(player.getUniqueId())){ + poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; + player.sendMessage("Powered up!"); + }else{ + player.sendMessage("You must instantiate your power settings using /GPower"); + } + } + + public void PowerDownPlayer(Player player){ + player.sendMessage("Powering down!"); + if (poweredPlayerList.containsKey(player.getUniqueId())){ + player.sendMessage("Powered down!"); + poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; + }else{ + player.sendMessage("P down!"); + return; + } + + } + + public class poweredPlayer{ + public UUID uuid; + public String colour; + public Boolean isPowersActive; + + public poweredPlayer(UUID uuid, String colour, Boolean activated){ + this.uuid = (uuid); + this.colour = (colour); + this.isPowersActive = (activated); + } + public String toString(){ + return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; + } + } +} + diff --git a/src/alisolarflare/components/gpowers/Module_GPower.java b/src/alisolarflare/components/gpowers/Module_GPower.java new file mode 100644 index 0000000..814d9bd --- /dev/null +++ b/src/alisolarflare/components/gpowers/Module_GPower.java @@ -0,0 +1,19 @@ +package alisolarflare.components.gpowers; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; + +public class Module_GPower extends Module { + + @Override + public void register(JavaPlugin plugin) { + Memory_GPower gPowerMemory = new Memory_GPower(); + registerCommand(plugin, new Command_GPower(gPowerMemory)); + registerCommand(plugin, new Command_PowerUp(gPowerMemory)); + registerCommand(plugin, new Command_PowerDown(gPowerMemory)); + + registerListener(plugin, new Listener_PowerLooper(plugin, gPowerMemory)); + } + +} diff --git a/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/components/gpowers/Task_PowerApplier.java similarity index 88% rename from src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java rename to src/alisolarflare/components/gpowers/Task_PowerApplier.java index d966e63..f9d82e3 100644 --- a/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/components/gpowers/Task_PowerApplier.java @@ -1,66 +1,66 @@ -package alisolarflare.components.gpowers.listeners; - -import java.util.Map; -import java.util.UUID; - -import org.bukkit.Color; -import org.bukkit.Server; -import org.bukkit.entity.Player; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; - -public class gPowerApplyingTask extends BukkitRunnable{ - - private Server server; - private Map poweredPlayerList; - - public gPowerApplyingTask(Server server, Map poweredPlayerList) { - this.server = server; - this.poweredPlayerList = poweredPlayerList; - } - - //REPEATS EVERY 5 SECONDS - @Override - public void run() { - for (Player player : server.getOnlinePlayers()){ - if(poweredPlayerList.containsKey(player.getUniqueId())){ - activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); - } - } - } - - private void activatePower(Player player, String colour) { - //GREY - if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.GRAY)); - player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 0, true, false, Color.GRAY)); - //RED - }else if (colour.startsWith("r")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0, true, false, Color.RED)); - //ORANGE - }else if (colour.startsWith("o")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); - player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); - //YELLOW - }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.YELLOW)); - //GREEN - }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 200, 1, true, false, Color.GREEN)); - player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 200, 0, true, false, Color.GREEN)); - //BLUE - }else if (colour.startsWith("b")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1, true, false, Color.BLUE)); - player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 200, 0, true, false, Color.BLUE)); - //PURPLE - }else if (colour.startsWith("p")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 0, true, false, Color.PURPLE)); - //NULL - }else{ - } - } - -} +package alisolarflare.components.gpowers; + +import java.util.Map; +import java.util.UUID; + +import org.bukkit.Color; +import org.bukkit.Server; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +import alisolarflare.components.gpowers.Memory_GPower.poweredPlayer; + +public class Task_PowerApplier extends BukkitRunnable{ + + private Server server; + private Map poweredPlayerList; + + public Task_PowerApplier(Server server, Map poweredPlayerList) { + this.server = server; + this.poweredPlayerList = poweredPlayerList; + } + + //REPEATS EVERY 5 SECONDS + @Override + public void run() { + for (Player player : server.getOnlinePlayers()){ + if(poweredPlayerList.containsKey(player.getUniqueId())){ + activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); + } + } + } + + private void activatePower(Player player, String colour) { + //GREY + if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 0, true, false, Color.GRAY)); + //RED + }else if (colour.startsWith("r")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0, true, false, Color.RED)); + //ORANGE + }else if (colour.startsWith("o")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); + player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); + //YELLOW + }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.YELLOW)); + //GREEN + }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 200, 1, true, false, Color.GREEN)); + player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 200, 0, true, false, Color.GREEN)); + //BLUE + }else if (colour.startsWith("b")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1, true, false, Color.BLUE)); + player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 200, 0, true, false, Color.BLUE)); + //PURPLE + }else if (colour.startsWith("p")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 0, true, false, Color.PURPLE)); + //NULL + }else{ + } + } + +} diff --git a/src/alisolarflare/components/gpowers/listeners/gPowerListener.java b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java deleted file mode 100644 index 1b71481..0000000 --- a/src/alisolarflare/components/gpowers/listeners/gPowerListener.java +++ /dev/null @@ -1,13 +0,0 @@ -package alisolarflare.components.gpowers.listeners; - -import org.bukkit.event.Listener; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.components.gpowers.GPowerMemory; - -public class gPowerListener implements Listener{ - - public gPowerListener(JavaPlugin plugin, GPowerMemory gPowerMemory){ - new gPowerApplyingTask(plugin.getServer(), gPowerMemory.poweredPlayerList).runTaskTimer(plugin, 190, 190); - } -} \ No newline at end of file diff --git a/src/alisolarflare/components/links/AliLinkModule.java b/src/alisolarflare/components/links/AliLinkModule.java deleted file mode 100644 index a6d44a9..0000000 --- a/src/alisolarflare/components/links/AliLinkModule.java +++ /dev/null @@ -1,33 +0,0 @@ -package alisolarflare.components.links; - -import java.util.List; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.components.links.commands.PressAliLink; -import alisolarflare.components.links.commands.SetAliLink; -import alisolarflare.components.links.entities.Link; - -public class AliLinkModule extends Module { - private SetAliLink setAliLink; - - @Override - public void register(JavaPlugin plugin) { - setAliLink = new SetAliLink(plugin); - - registerCommand(plugin, new PressAliLink(plugin, setAliLink)); - registerCommand(plugin, setAliLink); - - } - - public void saveLinkList(JavaPlugin plugin) { - plugin.getConfig().set("aliLinkList", setAliLink.linkList); - } - - @SuppressWarnings("unchecked") - public List loadLinkList(JavaPlugin plugin) { - return (List) plugin.getConfig().getList("aliLinkList"); - } - -} diff --git a/src/alisolarflare/components/links/commands/PressAliLink.java b/src/alisolarflare/components/links/Command_PressAliLink.java similarity index 75% rename from src/alisolarflare/components/links/commands/PressAliLink.java rename to src/alisolarflare/components/links/Command_PressAliLink.java index da21f6d..9619449 100644 --- a/src/alisolarflare/components/links/commands/PressAliLink.java +++ b/src/alisolarflare/components/links/Command_PressAliLink.java @@ -1,60 +1,59 @@ -package alisolarflare.components.links.commands; - -import org.bukkit.command.CommandSender; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.components.links.entities.Link; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class PressAliLink extends TBMCCommandBase { - private JavaPlugin plugin; - private SetAliLink setAliLink; - - public PressAliLink(JavaPlugin plugin, SetAliLink setAliLink) { - this.plugin = plugin; - this.setAliLink = setAliLink; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - - sender.getServer().broadcastMessage(setAliLink.linkList.toString() + "over."); - - if (args.length < 1) { - sender.sendMessage("You must specify a link frequency"); - sender.sendMessage("/pressalilink [frequency]"); - } - for (Link link : setAliLink.linkList) { - for (String inputlink : args) { - if (inputlink.equals(link.frequency)) { - link.press(plugin); - } - } - } - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "pressalilink"; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.links; + +import org.bukkit.command.CommandSender; +import org.bukkit.plugin.java.JavaPlugin; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_PressAliLink extends TBMCCommandBase { + private JavaPlugin plugin; + private Command_SetAliLink setAliLink; + + public Command_PressAliLink(JavaPlugin plugin, Command_SetAliLink setAliLink) { + this.plugin = plugin; + this.setAliLink = setAliLink; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + + sender.getServer().broadcastMessage(setAliLink.linkList.toString() + "over."); + + if (args.length < 1) { + sender.sendMessage("You must specify a link frequency"); + sender.sendMessage("/pressalilink [frequency]"); + } + for (Memory_Link link : setAliLink.linkList) { + for (String inputlink : args) { + if (inputlink.equals(link.frequency)) { + link.press(plugin); + } + } + } + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "pressalilink"; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/links/commands/SetAliLink.java b/src/alisolarflare/components/links/Command_SetAliLink.java similarity index 80% rename from src/alisolarflare/components/links/commands/SetAliLink.java rename to src/alisolarflare/components/links/Command_SetAliLink.java index 03c4e57..2b78235 100644 --- a/src/alisolarflare/components/links/commands/SetAliLink.java +++ b/src/alisolarflare/components/links/Command_SetAliLink.java @@ -1,140 +1,138 @@ -package alisolarflare.components.links.commands; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; -import org.bukkit.Location; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.components.links.AliLinkModule; -import alisolarflare.components.links.entities.Link; -import buttondevteam.lib.chat.TBMCCommandBase; - -/** - * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, a location in a world that when called on by {@link PressAliLink}, creates a temporary redstone - * block, enabling wireless redstone - * - * @see PressAliLink - * @author Alisolarflare - * - */ -public class SetAliLink extends TBMCCommandBase { - public List linkList = new ArrayList(); - AliLinkModule subplugin; - private JavaPlugin plugin; - - /** - * Constructs the SetAliLink class - * - * @param plugin - * The plugin that contains the configuration file of SetAliLink - */ - public SetAliLink(JavaPlugin plugin) { - this.plugin = plugin; - load(); - } - - /** - * This command creates an Ali-Link which, when activated by the command /PressAliLink, creates a temporary redstone block if and only if /PressAliLink [frequency] matches the frequency saved when - * /SetAliLink [frequency] is called. - * - * @see Class#PressAliLink - * @param sender - * Player who sent the command - * @param command - * Command Object created - * @param label - * Name of the command - * @param args - * Arguments: [frequency] [x-coordinate] [y-coordinate] [z-coordinate], where the coordinates point to the intended location of the Ali-Link - */ - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - sender.sendMessage("you pressed shit"); - if (args == null || args.length < 1) { - sender.sendMessage("You must specify a link frequency"); - sender.sendMessage("/pressalilink [name]"); - return false; - } - Player player = (Player) sender; - if (args.length < 4) { - player.sendMessage("short"); - linkList.add(new Link(args[0], player.getLocation())); - save(player); - player.sendMessage("end"); - return false; - } - if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) - && StringUtils.isNumericSpace(args[3])) { - player.sendMessage("CUUUSTOM"); - linkList.add(new Link(args[0], new Location(player.getWorld(), Double.parseDouble(args[1]), - Double.parseDouble(args[2]), Double.parseDouble(args[3])))); - save(player); - player.sendMessage("FINISHED"); - } else { - player.sendMessage("UNCUSTOOM"); - linkList.add(new Link(args[0], player.getLocation())); - save(player); - player.sendMessage("UNFINISHED"); - return false; - } - return false; - } - - /** - * Tries to save the entire SetAliLink class into memory, which includes all of the current Ali-links saved and in use. - * - * @param player - */ - private void save(Player player) { - player.sendMessage("SAAAVING"); - player.sendMessage("SAVE FAILED: TELL ALI TO FIX THE SAVE AND UN-COMMENT THE PARAGRAPH SHE COMMENTED"); - player.sendMessage("Link will only last until next server restart"); - return; - /* - * subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); try { player.sendMessage("SAVIN"); subplugin.plugin.saveConfig(); player.sendMessage("GOOD SAVE"); } catch (Exception e) - * { player.sendMessage("YOU FUCKED STUFF UP"); // TODO Auto-generated catch block e.printStackTrace(); } - */ - } - - /** - * Attempts to load the previous saved state of AliLinks, from the plugin configuration file - */ - @SuppressWarnings("unchecked") - private void load() { - try { - linkList = (List) plugin.getConfig().getList("aliLinkList"); - if (linkList == null || linkList.isEmpty()) { - linkList = new ArrayList(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "setalilink"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.links; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.bukkit.Location; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import buttondevteam.lib.chat.TBMCCommandBase; + +/** + * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, a location in a world that when called on by {@link Command_PressAliLink}, creates a temporary redstone + * block, enabling wireless redstone + * + * @see Command_PressAliLink + * @author Alisolarflare + * + */ +public class Command_SetAliLink extends TBMCCommandBase { + public List linkList = new ArrayList(); + Module_AliLink subplugin; + private JavaPlugin plugin; + + /** + * Constructs the SetAliLink class + * + * @param plugin + * The plugin that contains the configuration file of SetAliLink + */ + public Command_SetAliLink(JavaPlugin plugin) { + this.plugin = plugin; + load(); + } + + /** + * This command creates an Ali-Link which, when activated by the command /PressAliLink, creates a temporary redstone block if and only if /PressAliLink [frequency] matches the frequency saved when + * /SetAliLink [frequency] is called. + * + * @see Class#PressAliLink + * @param sender + * Player who sent the command + * @param command + * Command Object created + * @param label + * Name of the command + * @param args + * Arguments: [frequency] [x-coordinate] [y-coordinate] [z-coordinate], where the coordinates point to the intended location of the Ali-Link + */ + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + sender.sendMessage("you pressed shit"); + if (args == null || args.length < 1) { + sender.sendMessage("You must specify a link frequency"); + sender.sendMessage("/pressalilink [name]"); + return false; + } + Player player = (Player) sender; + if (args.length < 4) { + player.sendMessage("short"); + linkList.add(new Memory_Link(args[0], player.getLocation())); + save(player); + player.sendMessage("end"); + return false; + } + if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) + && StringUtils.isNumericSpace(args[3])) { + player.sendMessage("CUUUSTOM"); + linkList.add(new Memory_Link(args[0], new Location(player.getWorld(), Double.parseDouble(args[1]), + Double.parseDouble(args[2]), Double.parseDouble(args[3])))); + save(player); + player.sendMessage("FINISHED"); + } else { + player.sendMessage("UNCUSTOOM"); + linkList.add(new Memory_Link(args[0], player.getLocation())); + save(player); + player.sendMessage("UNFINISHED"); + return false; + } + return false; + } + + /** + * Tries to save the entire SetAliLink class into memory, which includes all of the current Ali-links saved and in use. + * + * @param player + */ + private void save(Player player) { + player.sendMessage("SAAAVING"); + player.sendMessage("SAVE FAILED: TELL ALI TO FIX THE SAVE AND UN-COMMENT THE PARAGRAPH SHE COMMENTED"); + player.sendMessage("Link will only last until next server restart"); + return; + /* + * subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); try { player.sendMessage("SAVIN"); subplugin.plugin.saveConfig(); player.sendMessage("GOOD SAVE"); } catch (Exception e) + * { player.sendMessage("YOU FUCKED STUFF UP"); // TODO Auto-generated catch block e.printStackTrace(); } + */ + } + + /** + * Attempts to load the previous saved state of AliLinks, from the plugin configuration file + */ + @SuppressWarnings("unchecked") + private void load() { + try { + linkList = (List) plugin.getConfig().getList("aliLinkList"); + if (linkList == null || linkList.isEmpty()) { + linkList = new ArrayList(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "setalilink"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/links/entities/Link.java b/src/alisolarflare/components/links/Memory_Link.java similarity index 74% rename from src/alisolarflare/components/links/entities/Link.java rename to src/alisolarflare/components/links/Memory_Link.java index f55bfc8..2043b7a 100644 --- a/src/alisolarflare/components/links/entities/Link.java +++ b/src/alisolarflare/components/links/Memory_Link.java @@ -1,41 +1,39 @@ -package alisolarflare.components.links.entities; - -import java.io.Serializable; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.components.links.tasks.UnpressTask; - -public class Link implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - public String frequency; - public String world; - public String x; - public String y; - public String z; - - - public Link(String frequency, Location location){ - this.frequency = frequency; - this.world = location.getWorld().getName(); - this.x = "" + location.getBlockX(); - this.y = "" + location.getBlockY(); - this.z = "" + location.getBlockZ(); - //plugin.plugin.getConfig().set("frequency", 10); - } - /** - * Activates the Ali-Link - * @param plugin - */ - public void press(JavaPlugin plugin) { - Location location = new Location(plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); - location.getBlock().setType(Material.REDSTONE_BLOCK); - UnpressTask unPressTask = new UnpressTask(location); - unPressTask.runTaskTimer(plugin, 2, 1); - } -} +package alisolarflare.components.links; + +import java.io.Serializable; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.plugin.java.JavaPlugin; + +public class Memory_Link implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + public String frequency; + public String world; + public String x; + public String y; + public String z; + + + public Memory_Link(String frequency, Location location){ + this.frequency = frequency; + this.world = location.getWorld().getName(); + this.x = "" + location.getBlockX(); + this.y = "" + location.getBlockY(); + this.z = "" + location.getBlockZ(); + //plugin.plugin.getConfig().set("frequency", 10); + } + /** + * Activates the Ali-Link + * @param plugin + */ + public void press(JavaPlugin plugin) { + Location location = new Location(plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); + location.getBlock().setType(Material.REDSTONE_BLOCK); + Task_UnpressTask unPressTask = new Task_UnpressTask(location); + unPressTask.runTaskTimer(plugin, 2, 1); + } +} diff --git a/src/alisolarflare/components/links/Module_AliLink.java b/src/alisolarflare/components/links/Module_AliLink.java new file mode 100644 index 0000000..a16b47b --- /dev/null +++ b/src/alisolarflare/components/links/Module_AliLink.java @@ -0,0 +1,30 @@ +package alisolarflare.components.links; + +import java.util.List; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; + +public class Module_AliLink extends Module { + private Command_SetAliLink setAliLink; + + @Override + public void register(JavaPlugin plugin) { + setAliLink = new Command_SetAliLink(plugin); + + registerCommand(plugin, new Command_PressAliLink(plugin, setAliLink)); + registerCommand(plugin, setAliLink); + + } + + public void saveLinkList(JavaPlugin plugin) { + plugin.getConfig().set("aliLinkList", setAliLink.linkList); + } + + @SuppressWarnings("unchecked") + public List loadLinkList(JavaPlugin plugin) { + return (List) plugin.getConfig().getList("aliLinkList"); + } + +} diff --git a/src/alisolarflare/components/links/tasks/UnpressTask.java b/src/alisolarflare/components/links/Task_UnpressTask.java similarity index 68% rename from src/alisolarflare/components/links/tasks/UnpressTask.java rename to src/alisolarflare/components/links/Task_UnpressTask.java index 769f4f1..17c59c8 100644 --- a/src/alisolarflare/components/links/tasks/UnpressTask.java +++ b/src/alisolarflare/components/links/Task_UnpressTask.java @@ -1,21 +1,21 @@ -package alisolarflare.components.links.tasks; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.scheduler.BukkitRunnable; - -public class UnpressTask extends BukkitRunnable { - private Location location; - public UnpressTask(Location location){ - this.location = location; - } - - @SuppressWarnings("deprecation") - @Override - public void run() { - location.getBlock().setType(Material.STAINED_CLAY); - location.getBlock().setData((byte) 14); - this.cancel(); - } - -} +package alisolarflare.components.links; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.scheduler.BukkitRunnable; + +public class Task_UnpressTask extends BukkitRunnable { + private Location location; + public Task_UnpressTask(Location location){ + this.location = location; + } + + @SuppressWarnings("deprecation") + @Override + public void run() { + location.getBlock().setType(Material.STAINED_CLAY); + location.getBlock().setData((byte) 14); + this.cancel(); + } + +} diff --git a/src/alisolarflare/components/links/serializer/Deserializer.java b/src/alisolarflare/components/links/serializer/Deserializer.java deleted file mode 100644 index cfc1786..0000000 --- a/src/alisolarflare/components/links/serializer/Deserializer.java +++ /dev/null @@ -1,42 +0,0 @@ -package alisolarflare.components.links.serializer; - - -import java.io.FileInputStream; -import java.io.ObjectInputStream; -import java.util.List; - -import alisolarflare.components.links.entities.Link; - -/** - * @deprecated - * @author Alisolarflare - * - */ -public class Deserializer{ - - public static void main (String args[]) { - - //Deserializer deserializer = new Deserializer(); - //List aliLink = deserializer.loadLink(aliLink); - //System.out.println(aliLink); - } - - /**@deprecated*/ - @SuppressWarnings("unchecked") - public List loadLinkList(){ - List aliLinkList; - try{ - - FileInputStream fin = new FileInputStream("AliLinkList.ser"); - ObjectInputStream ois = new ObjectInputStream(fin); - aliLinkList = (List) ois.readObject(); - ois.close(); - - return aliLinkList; - - }catch(Exception ex){ - ex.printStackTrace(); - return null; - } - } -} diff --git a/src/alisolarflare/components/links/serializer/Serializer.java b/src/alisolarflare/components/links/serializer/Serializer.java deleted file mode 100644 index fe4efef..0000000 --- a/src/alisolarflare/components/links/serializer/Serializer.java +++ /dev/null @@ -1,38 +0,0 @@ -package alisolarflare.components.links.serializer; - - -import java.io.FileOutputStream; -import java.io.ObjectOutputStream; -import java.util.List; - -import alisolarflare.components.links.entities.Link; - -/** - * @deprecated - * @author Alisolarflare - * - */ -public class Serializer { - - public static void main (String args[]) { - - //Serializer serializer = new Serializer(); - //serializer.saveLink(plugin, frequency, location) - } - /**@deprecated*/ - public void saveLinkList(List aliLinkList){ - //saves link - - try{ - - FileOutputStream fout = new FileOutputStream("AliLinkList.ser"); - ObjectOutputStream oos = new ObjectOutputStream(fout); - oos.writeObject(aliLinkList); - oos.close(); - System.out.println("Done"); - - }catch(Exception ex){ - ex.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/src/alisolarflare/creativeboundaries/commands/Cbgm0.java b/src/alisolarflare/creativeboundaries/Command_Cbgm0.java similarity index 73% rename from src/alisolarflare/creativeboundaries/commands/Cbgm0.java rename to src/alisolarflare/creativeboundaries/Command_Cbgm0.java index 6e5fd2a..afa0aa9 100644 --- a/src/alisolarflare/creativeboundaries/commands/Cbgm0.java +++ b/src/alisolarflare/creativeboundaries/Command_Cbgm0.java @@ -1,49 +1,48 @@ -package alisolarflare.creativeboundaries.commands; - -import org.bukkit.GameMode; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.creativeboundaries.CreativeBoundariesModule; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Cbgm0 extends TBMCCommandBase{ - - private CreativeBoundariesModule module; - - public Cbgm0(CreativeBoundariesModule module) { - this.module = module; - } - - @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - return false; - } - - Player player = (Player) sender; - player.setGameMode(GameMode.SURVIVAL); - module.cbCreatives.remove(player); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.creativeboundaries; + +import org.bukkit.GameMode; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_Cbgm0 extends TBMCCommandBase{ + + private Module_CreativeBoundaries module; + + public Command_Cbgm0(Module_CreativeBoundaries module) { + this.module = module; + } + + @Override + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + return false; + } + + Player player = (Player) sender; + player.setGameMode(GameMode.SURVIVAL); + module.cbCreatives.remove(player); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/creativeboundaries/commands/Cbgm1.java b/src/alisolarflare/creativeboundaries/Command_Cbgm1.java similarity index 85% rename from src/alisolarflare/creativeboundaries/commands/Cbgm1.java rename to src/alisolarflare/creativeboundaries/Command_Cbgm1.java index 04fba33..c63e430 100644 --- a/src/alisolarflare/creativeboundaries/commands/Cbgm1.java +++ b/src/alisolarflare/creativeboundaries/Command_Cbgm1.java @@ -1,82 +1,81 @@ -package alisolarflare.creativeboundaries.commands; - -import org.bukkit.GameMode; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; -import com.palmergames.bukkit.towny.object.Resident; -import com.palmergames.bukkit.towny.object.Town; -import com.palmergames.bukkit.towny.object.TownBlock; -import com.palmergames.bukkit.towny.object.TownyUniverse; - -import alisolarflare.creativeboundaries.CreativeBoundariesModule; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Cbgm1 extends TBMCCommandBase { - - private CreativeBoundariesModule module; - - public Cbgm1(CreativeBoundariesModule module) { - this.module = module; - } - - @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - - if (!(sender instanceof Player)) { - sender.sendMessage("You must be a player to use this command!"); - return false; - } - - Player player = (Player) sender; - - TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); - if (tb == null) { - player.sendMessage("You aren't standing in a town or some other error occured."); - player.sendMessage("TownBlock is null."); - return false; - } - Town town; - try { - town = tb.getTown(); - } catch (NotRegisteredException e) { - player.sendMessage("You aren't standing in a town or some other error occured."); - player.sendMessage("TownBlock's town is not registered."); - return false; - } - if (town == null) { - player.sendMessage("ERROR: The town you're standing in is Null."); - return false; - } - - for(Resident res : town.getResidents()){ - if (res.getName().toString().equals(player.getName().toString())){ - player.setGameMode(GameMode.CREATIVE); - module.cbCreatives.add(player); - return true; - } - } - player.sendMessage("Sorry, you're not part of this town"); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.creativeboundaries; + +import org.bukkit.GameMode; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.Resident; +import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.towny.object.TownBlock; +import com.palmergames.bukkit.towny.object.TownyUniverse; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_Cbgm1 extends TBMCCommandBase { + + private Module_CreativeBoundaries module; + + public Command_Cbgm1(Module_CreativeBoundaries module) { + this.module = module; + } + + @Override + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { + + if (!(sender instanceof Player)) { + sender.sendMessage("You must be a player to use this command!"); + return false; + } + + Player player = (Player) sender; + + TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); + if (tb == null) { + player.sendMessage("You aren't standing in a town or some other error occured."); + player.sendMessage("TownBlock is null."); + return false; + } + Town town; + try { + town = tb.getTown(); + } catch (NotRegisteredException e) { + player.sendMessage("You aren't standing in a town or some other error occured."); + player.sendMessage("TownBlock's town is not registered."); + return false; + } + if (town == null) { + player.sendMessage("ERROR: The town you're standing in is Null."); + return false; + } + + for(Resident res : town.getResidents()){ + if (res.getName().toString().equals(player.getName().toString())){ + player.setGameMode(GameMode.CREATIVE); + module.cbCreatives.add(player); + return true; + } + } + player.sendMessage("Sorry, you're not part of this town"); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/creativeboundaries/commands/SetDickmode.java b/src/alisolarflare/creativeboundaries/Command_SetDickmode.java similarity index 78% rename from src/alisolarflare/creativeboundaries/commands/SetDickmode.java rename to src/alisolarflare/creativeboundaries/Command_SetDickmode.java index 3b1654b..fb0aa8d 100644 --- a/src/alisolarflare/creativeboundaries/commands/SetDickmode.java +++ b/src/alisolarflare/creativeboundaries/Command_SetDickmode.java @@ -1,54 +1,53 @@ -package alisolarflare.creativeboundaries.commands; - -import org.bukkit.command.CommandSender; - -import alisolarflare.creativeboundaries.CreativeBoundariesModule; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class SetDickmode extends TBMCCommandBase{ - private CreativeBoundariesModule module; - - public SetDickmode(CreativeBoundariesModule module){ - this.module = module; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (sender.getName().equals("Alisolarflare") || sender.getName().equals("iie")){ - if(args[0] == null){ - sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); - return false; - } - if(args[0].equalsIgnoreCase("TRUE") || args[0].equalsIgnoreCase("1")){ - sender.sendMessage("Dickmode has been turned on!"); - module.dickmode=(true); - return true; - } - if(args[0].equalsIgnoreCase("FALSE") || args[0].equalsIgnoreCase("0")){ - sender.sendMessage("Dickmode has been turned off!"); - module.dickmode=(false); - return true; - } - return false; - } - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } -} +package alisolarflare.creativeboundaries; + +import org.bukkit.command.CommandSender; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Command_SetDickmode extends TBMCCommandBase{ + private Module_CreativeBoundaries module; + + public Command_SetDickmode(Module_CreativeBoundaries module){ + this.module = module; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (sender.getName().equals("Alisolarflare") || sender.getName().equals("iie")){ + if(args[0] == null){ + sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); + return false; + } + if(args[0].equalsIgnoreCase("TRUE") || args[0].equalsIgnoreCase("1")){ + sender.sendMessage("Dickmode has been turned on!"); + module.dickmode=(true); + return true; + } + if(args[0].equalsIgnoreCase("FALSE") || args[0].equalsIgnoreCase("0")){ + sender.sendMessage("Dickmode has been turned off!"); + module.dickmode=(false); + return true; + } + return false; + } + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } +} diff --git a/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java b/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java deleted file mode 100644 index 39dac19..0000000 --- a/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java +++ /dev/null @@ -1,30 +0,0 @@ -package alisolarflare.creativeboundaries; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.creativeboundaries.commands.Cbgm0; -import alisolarflare.creativeboundaries.commands.Cbgm1; -import alisolarflare.creativeboundaries.commands.SetDickmode; -import alisolarflare.creativeboundaries.listeners.ItemRestrictionListener; -import alisolarflare.creativeboundaries.listeners.PlotChangeListener; - - -public class CreativeBoundariesModule extends Module{ - public boolean dickmode; - public List cbCreatives = new ArrayList(); - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new Cbgm1(this)); - registerCommand(plugin, new Cbgm0(this)); - registerCommand(plugin, new SetDickmode(this)); - - registerListener(plugin, new PlotChangeListener(this)); - //registerListener(plugin, new ItemRestrictionListener(this)); - } - -} diff --git a/src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java b/src/alisolarflare/creativeboundaries/Listener_ItemRestriction.java similarity index 52% rename from src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java rename to src/alisolarflare/creativeboundaries/Listener_ItemRestriction.java index 9023755..37d5ac7 100644 --- a/src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java +++ b/src/alisolarflare/creativeboundaries/Listener_ItemRestriction.java @@ -1,26 +1,24 @@ -package alisolarflare.creativeboundaries.listeners; - -import java.util.List; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.InventoryCreativeEvent; - -import alisolarflare.creativeboundaries.CreativeBoundariesModule; - -public class ItemRestrictionListener implements Listener { - - private CreativeBoundariesModule module; - - public ItemRestrictionListener(CreativeBoundariesModule module) { - this.module = module; - } - - @EventHandler - public void onItemTake(InventoryCreativeEvent event){ - List cbCreatives = module.cbCreatives; - - } - -} +package alisolarflare.creativeboundaries; + +import java.util.List; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.InventoryCreativeEvent; + +public class Listener_ItemRestriction implements Listener { + + private Module_CreativeBoundaries module; + + public Listener_ItemRestriction(Module_CreativeBoundaries module) { + this.module = module; + } + + @EventHandler + public void onItemTake(InventoryCreativeEvent event){ + List cbCreatives = module.cbCreatives; + + } + +} diff --git a/src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java b/src/alisolarflare/creativeboundaries/Listener_PlotChange.java similarity index 84% rename from src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java rename to src/alisolarflare/creativeboundaries/Listener_PlotChange.java index e911b98..980bdb6 100644 --- a/src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java +++ b/src/alisolarflare/creativeboundaries/Listener_PlotChange.java @@ -1,69 +1,67 @@ -package alisolarflare.creativeboundaries.listeners; - -import org.bukkit.GameMode; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; - -import com.palmergames.bukkit.towny.event.PlayerChangePlotEvent; -import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; -import com.palmergames.bukkit.towny.object.Resident; -import com.palmergames.bukkit.towny.object.Town; -import com.palmergames.bukkit.towny.object.TownBlock; -import com.palmergames.bukkit.towny.object.TownyUniverse; - -import alisolarflare.creativeboundaries.CreativeBoundariesModule; - -public class PlotChangeListener implements Listener{ - public CreativeBoundariesModule module; - public PlotChangeListener(CreativeBoundariesModule module){ - this.module = module; - } - @EventHandler - public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ - Player player = plotEvent.getPlayer(); - if (module.dickmode == false){ - return; - } - if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){ - return; - } - if (!(module.cbCreatives.contains(plotEvent.getPlayer()))){ - return; - } - TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); - if (tb == null) { - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!"); - module.cbCreatives.remove(player); - return; - } - Town town; - try { - town = tb.getTown(); - } catch (NotRegisteredException e) { - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!!"); - module.cbCreatives.remove(player); - return; - } - - if (town == null) { - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!!!"); - module.cbCreatives.remove(player); - return; - } - boolean townHasRes = false; - for(Resident res : town.getResidents()){ - if (res.getName().toString().equals(player.getName().toString())){ - townHasRes = true; - } - } - if (!townHasRes){ - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!!!!"); - module.cbCreatives.remove(player); - } - } -} +package alisolarflare.creativeboundaries; + +import org.bukkit.GameMode; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; + +import com.palmergames.bukkit.towny.event.PlayerChangePlotEvent; +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.Resident; +import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.towny.object.TownBlock; +import com.palmergames.bukkit.towny.object.TownyUniverse; + +public class Listener_PlotChange implements Listener{ + public Module_CreativeBoundaries module; + public Listener_PlotChange(Module_CreativeBoundaries module){ + this.module = module; + } + @EventHandler + public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ + Player player = plotEvent.getPlayer(); + if (module.dickmode == false){ + return; + } + if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){ + return; + } + if (!(module.cbCreatives.contains(plotEvent.getPlayer()))){ + return; + } + TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); + if (tb == null) { + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!"); + module.cbCreatives.remove(player); + return; + } + Town town; + try { + town = tb.getTown(); + } catch (NotRegisteredException e) { + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!!"); + module.cbCreatives.remove(player); + return; + } + + if (town == null) { + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!!!"); + module.cbCreatives.remove(player); + return; + } + boolean townHasRes = false; + for(Resident res : town.getResidents()){ + if (res.getName().toString().equals(player.getName().toString())){ + townHasRes = true; + } + } + if (!townHasRes){ + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!!!!"); + module.cbCreatives.remove(player); + } + } +} diff --git a/src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java b/src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java new file mode 100644 index 0000000..fcd58da --- /dev/null +++ b/src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java @@ -0,0 +1,25 @@ +package alisolarflare.creativeboundaries; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; + + +public class Module_CreativeBoundaries extends Module{ + public boolean dickmode; + public List cbCreatives = new ArrayList(); + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new Command_Cbgm1(this)); + registerCommand(plugin, new Command_Cbgm0(this)); + registerCommand(plugin, new Command_SetDickmode(this)); + + registerListener(plugin, new Listener_PlotChange(this)); + //registerListener(plugin, new ItemRestrictionListener(this)); + } + +} diff --git a/src/alisolarflare/easyuhc/commands/ActivatePowers.java b/src/alisolarflare/easyuhc/Command_ActivatePowers.java similarity index 85% rename from src/alisolarflare/easyuhc/commands/ActivatePowers.java rename to src/alisolarflare/easyuhc/Command_ActivatePowers.java index 737ac72..26789ce 100644 --- a/src/alisolarflare/easyuhc/commands/ActivatePowers.java +++ b/src/alisolarflare/easyuhc/Command_ActivatePowers.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.easyuhc; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class ActivatePowers extends TBMCCommandBase{ +public class Command_ActivatePowers extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/SetupWorldBorders.java b/src/alisolarflare/easyuhc/Command_SetupWorldBorders.java similarity index 85% rename from src/alisolarflare/easyuhc/commands/SetupWorldBorders.java rename to src/alisolarflare/easyuhc/Command_SetupWorldBorders.java index ef90ae8..db45dc0 100644 --- a/src/alisolarflare/easyuhc/commands/SetupWorldBorders.java +++ b/src/alisolarflare/easyuhc/Command_SetupWorldBorders.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.easyuhc; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class SetupWorldBorders extends TBMCCommandBase { +public class Command_SetupWorldBorders extends TBMCCommandBase { @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java b/src/alisolarflare/easyuhc/Command_ShrinkWorldBorders.java similarity index 85% rename from src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java rename to src/alisolarflare/easyuhc/Command_ShrinkWorldBorders.java index bd083a6..b25bf11 100644 --- a/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java +++ b/src/alisolarflare/easyuhc/Command_ShrinkWorldBorders.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.easyuhc; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class ShrinkWorldBorders extends TBMCCommandBase { +public class Command_ShrinkWorldBorders extends TBMCCommandBase { @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/SpreadPlayers.java b/src/alisolarflare/easyuhc/Command_SpreadPlayers.java similarity index 85% rename from src/alisolarflare/easyuhc/commands/SpreadPlayers.java rename to src/alisolarflare/easyuhc/Command_SpreadPlayers.java index a5798ac..f83e70a 100644 --- a/src/alisolarflare/easyuhc/commands/SpreadPlayers.java +++ b/src/alisolarflare/easyuhc/Command_SpreadPlayers.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.easyuhc; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class SpreadPlayers extends TBMCCommandBase{ +public class Command_SpreadPlayers extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/StartTimer.java b/src/alisolarflare/easyuhc/Command_StartTimer.java similarity index 86% rename from src/alisolarflare/easyuhc/commands/StartTimer.java rename to src/alisolarflare/easyuhc/Command_StartTimer.java index 927344e..96dad6f 100644 --- a/src/alisolarflare/easyuhc/commands/StartTimer.java +++ b/src/alisolarflare/easyuhc/Command_StartTimer.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.easyuhc; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class StartTimer extends TBMCCommandBase{ +public class Command_StartTimer extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/StartUHC.java b/src/alisolarflare/easyuhc/Command_StartUHC.java similarity index 86% rename from src/alisolarflare/easyuhc/commands/StartUHC.java rename to src/alisolarflare/easyuhc/Command_StartUHC.java index 2a06889..7cc116d 100644 --- a/src/alisolarflare/easyuhc/commands/StartUHC.java +++ b/src/alisolarflare/easyuhc/Command_StartUHC.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.easyuhc; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class StartUHC extends TBMCCommandBase{ +public class Command_StartUHC extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/TeleportToUHC.java b/src/alisolarflare/easyuhc/Command_TeleportToUHC.java similarity index 85% rename from src/alisolarflare/easyuhc/commands/TeleportToUHC.java rename to src/alisolarflare/easyuhc/Command_TeleportToUHC.java index 5a5c6d0..3f46306 100644 --- a/src/alisolarflare/easyuhc/commands/TeleportToUHC.java +++ b/src/alisolarflare/easyuhc/Command_TeleportToUHC.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.easyuhc; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class TeleportToUHC extends TBMCCommandBase{ +public class Command_TeleportToUHC extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/EasyUHCModule.java b/src/alisolarflare/easyuhc/EasyUHCModule.java deleted file mode 100644 index 408e909..0000000 --- a/src/alisolarflare/easyuhc/EasyUHCModule.java +++ /dev/null @@ -1,24 +0,0 @@ -package alisolarflare.easyuhc; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.easyuhc.commands.ActivatePowers; -import alisolarflare.easyuhc.commands.SetupWorldBorders; -import alisolarflare.easyuhc.commands.SpreadPlayers; -import alisolarflare.easyuhc.commands.StartTimer; -import alisolarflare.easyuhc.commands.StartUHC; -import alisolarflare.easyuhc.commands.TeleportToUHC; - -public class EasyUHCModule extends Module{ - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new ActivatePowers()); - registerCommand(plugin, new SetupWorldBorders()); - registerCommand(plugin, new SetupWorldBorders()); - registerCommand(plugin, new SpreadPlayers()); - registerCommand(plugin, new StartTimer()); - registerCommand(plugin, new StartUHC()); - registerCommand(plugin, new TeleportToUHC()); - } -} diff --git a/src/alisolarflare/easyuhc/Module_EasyUHC.java b/src/alisolarflare/easyuhc/Module_EasyUHC.java new file mode 100644 index 0000000..4ad1b1a --- /dev/null +++ b/src/alisolarflare/easyuhc/Module_EasyUHC.java @@ -0,0 +1,18 @@ +package alisolarflare.easyuhc; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; + +public class Module_EasyUHC extends Module{ + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new Command_ActivatePowers()); + registerCommand(plugin, new Command_SetupWorldBorders()); + registerCommand(plugin, new Command_SetupWorldBorders()); + registerCommand(plugin, new Command_SpreadPlayers()); + registerCommand(plugin, new Command_StartTimer()); + registerCommand(plugin, new Command_StartUHC()); + registerCommand(plugin, new Command_TeleportToUHC()); + } +} diff --git a/src/alisolarflare/magic/tricks/AliArrowListener.java b/src/alisolarflare/magic/AliArrowListener.java similarity index 92% rename from src/alisolarflare/magic/tricks/AliArrowListener.java rename to src/alisolarflare/magic/AliArrowListener.java index 36b8e12..ecd79e6 100644 --- a/src/alisolarflare/magic/tricks/AliArrowListener.java +++ b/src/alisolarflare/magic/AliArrowListener.java @@ -1,39 +1,39 @@ -package alisolarflare.magic.tricks; - -import org.bukkit.entity.Arrow; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.ProjectileLaunchEvent; -import org.bukkit.plugin.java.JavaPlugin; - -public class AliArrowListener implements Listener { - private final JavaPlugin plugin; - - public AliArrowListener(JavaPlugin plugin){ - this.plugin = plugin; - } - - @EventHandler - public void onProjectileLaunch(ProjectileLaunchEvent event){ - if(event.getEntity().getType() != EntityType.ARROW){ - return; - } - Arrow arrow = (Arrow) event.getEntity(); - if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player)){ - return; - } - - String user = ((Player) arrow.getShooter()).getName(); - - for (String permittedUser : AliArrowTask.permittedUsers){ - if(permittedUser.equalsIgnoreCase(user)){ - new AliArrowTask(arrow,user).runTaskTimer(plugin, 2, 1); - break; - } - } - return; - - } +package alisolarflare.magic; + +import org.bukkit.entity.Arrow; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.ProjectileLaunchEvent; +import org.bukkit.plugin.java.JavaPlugin; + +public class AliArrowListener implements Listener { + private final JavaPlugin plugin; + + public AliArrowListener(JavaPlugin plugin){ + this.plugin = plugin; + } + + @EventHandler + public void onProjectileLaunch(ProjectileLaunchEvent event){ + if(event.getEntity().getType() != EntityType.ARROW){ + return; + } + Arrow arrow = (Arrow) event.getEntity(); + if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player)){ + return; + } + + String user = ((Player) arrow.getShooter()).getName(); + + for (String permittedUser : AliArrowTask.permittedUsers){ + if(permittedUser.equalsIgnoreCase(user)){ + new AliArrowTask(arrow,user).runTaskTimer(plugin, 2, 1); + break; + } + } + return; + + } } \ No newline at end of file diff --git a/src/alisolarflare/magic/tricks/AliArrowTask.java b/src/alisolarflare/magic/AliArrowTask.java similarity index 92% rename from src/alisolarflare/magic/tricks/AliArrowTask.java rename to src/alisolarflare/magic/AliArrowTask.java index 10252b8..055a4fd 100644 --- a/src/alisolarflare/magic/tricks/AliArrowTask.java +++ b/src/alisolarflare/magic/AliArrowTask.java @@ -1,40 +1,40 @@ -package alisolarflare.magic.tricks; - -import org.bukkit.Particle; -import org.bukkit.entity.Arrow; -import org.bukkit.scheduler.BukkitRunnable; - -public class AliArrowTask extends BukkitRunnable { - static String[] permittedUsers = {"alisolarflare", "Zanthr", "NorbiPeti"}; - String name; - Arrow arrow; - - public AliArrowTask(Arrow arrow, String name) { - this.name = name; - this.arrow = arrow; - } - - @Override - public void run() { - if (arrow.isOnGround() || arrow.isDead()) { - this.cancel(); - } - - switch(name.toLowerCase()){ - case "alisolarflare": - arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1); - break; - - case "zanthr": - arrow.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, arrow.getLocation(), 1); - arrow.getWorld().spawnParticle(Particle.FLAME, arrow.getLocation(), 1); - break; - - case "norbipeti": - arrow.getWorld().spawnParticle(Particle.LAVA, arrow.getLocation(), 1); - break; - } - - } - -} +package alisolarflare.magic; + +import org.bukkit.Particle; +import org.bukkit.entity.Arrow; +import org.bukkit.scheduler.BukkitRunnable; + +public class AliArrowTask extends BukkitRunnable { + static String[] permittedUsers = {"alisolarflare", "Zanthr", "NorbiPeti"}; + String name; + Arrow arrow; + + public AliArrowTask(Arrow arrow, String name) { + this.name = name; + this.arrow = arrow; + } + + @Override + public void run() { + if (arrow.isOnGround() || arrow.isDead()) { + this.cancel(); + } + + switch(name.toLowerCase()){ + case "alisolarflare": + arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1); + break; + + case "zanthr": + arrow.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, arrow.getLocation(), 1); + arrow.getWorld().spawnParticle(Particle.FLAME, arrow.getLocation(), 1); + break; + + case "norbipeti": + arrow.getWorld().spawnParticle(Particle.LAVA, arrow.getLocation(), 1); + break; + } + + } + +} diff --git a/src/alisolarflare/magic/tricks/BoomBowDeathListener.java b/src/alisolarflare/magic/BoomBowDeathListener.java similarity index 90% rename from src/alisolarflare/magic/tricks/BoomBowDeathListener.java rename to src/alisolarflare/magic/BoomBowDeathListener.java index 427537e..f16d3c1 100644 --- a/src/alisolarflare/magic/tricks/BoomBowDeathListener.java +++ b/src/alisolarflare/magic/BoomBowDeathListener.java @@ -1,18 +1,18 @@ -package alisolarflare.magic.tricks; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.PlayerDeathEvent; - -public class BoomBowDeathListener implements Listener{ - @EventHandler - public void onBoomBowDeath(PlayerDeathEvent event){ - Player player = event.getEntity(); - - if (player.getLastDamage() > 7.42420 && player.getLastDamage() < 7.42429){ - player.sendMessage("42!"); - event.setDeathMessage(player.getName() + " got trigger happy with the [Boom Bow]"); - } - } -} +package alisolarflare.magic; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.PlayerDeathEvent; + +public class BoomBowDeathListener implements Listener{ + @EventHandler + public void onBoomBowDeath(PlayerDeathEvent event){ + Player player = event.getEntity(); + + if (player.getLastDamage() > 7.42420 && player.getLastDamage() < 7.42429){ + player.sendMessage("42!"); + event.setDeathMessage(player.getName() + " got trigger happy with the [Boom Bow]"); + } + } +} diff --git a/src/alisolarflare/magic/tricks/BoomBowListener.java b/src/alisolarflare/magic/BoomBowListener.java similarity index 95% rename from src/alisolarflare/magic/tricks/BoomBowListener.java rename to src/alisolarflare/magic/BoomBowListener.java index 5e74bd8..8381927 100644 --- a/src/alisolarflare/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/magic/BoomBowListener.java @@ -1,107 +1,107 @@ -package alisolarflare.magic.tricks; - -import org.bukkit.GameMode; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Particle; -import org.bukkit.Sound; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; - -public class BoomBowListener implements Listener { - JavaPlugin plugin; - public BoomBowListener(JavaPlugin plugin){ - this.plugin = plugin; - } - @EventHandler - public void ClickEvent(PlayerInteractEvent event){ - FlyBowBoost(event); - - } - public void FlyBowBoost(PlayerInteractEvent event){ - - //ACTION SANITATION - if(!(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK)) return; - if(!(event.getPlayer().isGliding())) return; - if(!(event.getMaterial() == Material.BOW)) return; - - //BOW SANITATION - ItemStack bow = event.getItem(); - if(!(bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK))) return; - if(!(bow.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) == 3)) return; - if(!(bow.getItemMeta().getDisplayName().contains("BOOM BOW"))) return; - - //PLAYER SANITATION - Player player = event.getPlayer(); - if(player.getGameMode().equals(GameMode.CREATIVE))return; - - if(bow.containsEnchantment(Enchantment.ARROW_INFINITE)){ - //HAS INIFINITY - Activate(event); - - }else if((player.getInventory().contains(Material.TNT))){ - //HAS TNT - Activate(event); - - //Reduce tnt by 1 - int tntSlot = player.getInventory().first(Material.TNT); - ItemStack tntStack = player.getInventory().getItem(tntSlot); - if(tntStack.getAmount() > 3){ - tntStack.setAmount(tntStack.getAmount()-3); - }else{ - player.getInventory().remove(tntStack); - } - - }else{ - return; - } - } - - - - public void Activate(PlayerInteractEvent event){ - //INIT - Player variables - Player player = event.getPlayer(); - Location playerLocation = player.getLocation(); - ItemStack boomBow = player.getInventory().getItemInMainHand(); - - //TODO: NERF - boomDecay - //TODO: NERF - endCrystal - //TODO: NERF - healthReduction - //TODO: NERF - localized - - if(BoomBowRule.boomDecay) - new BoomDecayTask(player).runTaskTimer(plugin, 1, 1); - if(BoomBowRule.endCrystal){ - //BoomBowCyrstalSpawn - } - if(BoomBowRule.healthReduction){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1)); - } - if(BoomBowRule.localized); - - - //SET - Player Velocity - player.setVelocity(playerLocation.getDirection().normalize().multiply(3.0)); - - //CREATE - Explosion + damage - player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); - player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); - player.damage(7.42425, player); - player.sendMessage(player.getLastDamage() + ""); - boomBow.setDurability((short) (boomBow.getDurability() + 3)); - if(boomBow.getDurability() < 0){ - player.getInventory().setItemInMainHand(null); - player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0); - } - - } -} +package alisolarflare.magic; + +import org.bukkit.GameMode; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Particle; +import org.bukkit.Sound; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +public class BoomBowListener implements Listener { + JavaPlugin plugin; + public BoomBowListener(JavaPlugin plugin){ + this.plugin = plugin; + } + @EventHandler + public void ClickEvent(PlayerInteractEvent event){ + FlyBowBoost(event); + + } + public void FlyBowBoost(PlayerInteractEvent event){ + + //ACTION SANITATION + if(!(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK)) return; + if(!(event.getPlayer().isGliding())) return; + if(!(event.getMaterial() == Material.BOW)) return; + + //BOW SANITATION + ItemStack bow = event.getItem(); + if(!(bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK))) return; + if(!(bow.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) == 3)) return; + if(!(bow.getItemMeta().getDisplayName().contains("BOOM BOW"))) return; + + //PLAYER SANITATION + Player player = event.getPlayer(); + if(player.getGameMode().equals(GameMode.CREATIVE))return; + + if(bow.containsEnchantment(Enchantment.ARROW_INFINITE)){ + //HAS INIFINITY + Activate(event); + + }else if((player.getInventory().contains(Material.TNT))){ + //HAS TNT + Activate(event); + + //Reduce tnt by 1 + int tntSlot = player.getInventory().first(Material.TNT); + ItemStack tntStack = player.getInventory().getItem(tntSlot); + if(tntStack.getAmount() > 3){ + tntStack.setAmount(tntStack.getAmount()-3); + }else{ + player.getInventory().remove(tntStack); + } + + }else{ + return; + } + } + + + + public void Activate(PlayerInteractEvent event){ + //INIT - Player variables + Player player = event.getPlayer(); + Location playerLocation = player.getLocation(); + ItemStack boomBow = player.getInventory().getItemInMainHand(); + + //TODO: NERF - boomDecay + //TODO: NERF - endCrystal + //TODO: NERF - healthReduction + //TODO: NERF - localized + + if(BoomBowRule.boomDecay) + new BoomDecayTask(player).runTaskTimer(plugin, 1, 1); + if(BoomBowRule.endCrystal){ + //BoomBowCyrstalSpawn + } + if(BoomBowRule.healthReduction){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1)); + } + if(BoomBowRule.localized); + + + //SET - Player Velocity + player.setVelocity(playerLocation.getDirection().normalize().multiply(3.0)); + + //CREATE - Explosion + damage + player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); + player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); + player.damage(7.42425, player); + player.sendMessage(player.getLastDamage() + ""); + boomBow.setDurability((short) (boomBow.getDurability() + 3)); + if(boomBow.getDurability() < 0){ + player.getInventory().setItemInMainHand(null); + player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0); + } + + } +} diff --git a/src/alisolarflare/magic/tricks/BoomBowRule.java b/src/alisolarflare/magic/BoomBowRule.java similarity index 95% rename from src/alisolarflare/magic/tricks/BoomBowRule.java rename to src/alisolarflare/magic/BoomBowRule.java index bbfbf8f..caa0256 100644 --- a/src/alisolarflare/magic/tricks/BoomBowRule.java +++ b/src/alisolarflare/magic/BoomBowRule.java @@ -1,84 +1,84 @@ -package alisolarflare.magic.tricks; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import buttondevteam.lib.chat.TBMCCommandBase; -//HEHEHHEHEH EAASSSTER EGGS -public class BoomBowRule extends TBMCCommandBase{ - public static boolean boomDecay; - public static boolean healthReduction; - public static boolean endCrystal; - public static boolean localized;; - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (sender instanceof Player == false){ - sender.sendMessage("You must be a player to use this command"); - return false; - } - Player player = (Player) sender; - if (player.getName().equals("alisolarflare") == false){ - player.sendMessage("You must be alisolarflare to use this command"); - return false; - } - if (args.length < 2){ - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); - player.sendMessage("Rules:"); - player.sendMessage("boomDecay" + boomDecay); - player.sendMessage("healthReduction" + healthReduction); - player.sendMessage("endCrystal" + endCrystal); - player.sendMessage("localized" + localized); - return false; - } - if(!(args[1].startsWith("t")|| args[1].startsWith("f"))){ - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); - return false; - } - boolean gameRule = false; - if(args[1].startsWith("t") || args[1].startsWith("T")){ - gameRule = true; - } - switch(args[0]){ - case "boomDecay": - boomDecay = gameRule; - break; - case "healthReduction": - healthReduction = gameRule; - break; - case "endCrystal": - endCrystal = gameRule; - break; - case "localized": - localized = gameRule; - break; - default: - player.sendMessage("Error: "+args[0]+" not defined as a rule"); - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); - player.sendMessage("Rule settings: boomDecay, healthReduction, endCrystal, localized"); - break; - } - - return false; - } - @Override - public String GetCommandPath() { - // TODO Auto-generated method stub - return null; - } - @Override - public String[] GetHelpText(String arg0) { - // TODO Auto-generated method stub - return null; - } - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.magic; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import buttondevteam.lib.chat.TBMCCommandBase; +//HEHEHHEHEH EAASSSTER EGGS +public class BoomBowRule extends TBMCCommandBase{ + public static boolean boomDecay; + public static boolean healthReduction; + public static boolean endCrystal; + public static boolean localized;; + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (sender instanceof Player == false){ + sender.sendMessage("You must be a player to use this command"); + return false; + } + Player player = (Player) sender; + if (player.getName().equals("alisolarflare") == false){ + player.sendMessage("You must be alisolarflare to use this command"); + return false; + } + if (args.length < 2){ + player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); + player.sendMessage("Rules:"); + player.sendMessage("boomDecay" + boomDecay); + player.sendMessage("healthReduction" + healthReduction); + player.sendMessage("endCrystal" + endCrystal); + player.sendMessage("localized" + localized); + return false; + } + if(!(args[1].startsWith("t")|| args[1].startsWith("f"))){ + player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); + return false; + } + boolean gameRule = false; + if(args[1].startsWith("t") || args[1].startsWith("T")){ + gameRule = true; + } + switch(args[0]){ + case "boomDecay": + boomDecay = gameRule; + break; + case "healthReduction": + healthReduction = gameRule; + break; + case "endCrystal": + endCrystal = gameRule; + break; + case "localized": + localized = gameRule; + break; + default: + player.sendMessage("Error: "+args[0]+" not defined as a rule"); + player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); + player.sendMessage("Rule settings: boomDecay, healthReduction, endCrystal, localized"); + break; + } + + return false; + } + @Override + public String GetCommandPath() { + // TODO Auto-generated method stub + return null; + } + @Override + public String[] GetHelpText(String arg0) { + // TODO Auto-generated method stub + return null; + } + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/magic/tricks/BoomDecayTask.java b/src/alisolarflare/magic/BoomDecayTask.java similarity index 88% rename from src/alisolarflare/magic/tricks/BoomDecayTask.java rename to src/alisolarflare/magic/BoomDecayTask.java index 5f1875c..2d128f9 100644 --- a/src/alisolarflare/magic/tricks/BoomDecayTask.java +++ b/src/alisolarflare/magic/BoomDecayTask.java @@ -1,25 +1,25 @@ -package alisolarflare.magic.tricks; - -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; - -public class BoomDecayTask extends BukkitRunnable{ - Player player; - private int ticksSinceStart = 0; - private final int effectLength = 20; - public BoomDecayTask(Player player){ - this.player = player; - } - //runs every tick - @Override - public void run() { - if (ticksSinceStart > effectLength){ - this.cancel(); - } - player.sendMessage(player.getVelocity().toString()); - - ticksSinceStart++; - - } - -} +package alisolarflare.magic; + +import org.bukkit.entity.Player; +import org.bukkit.scheduler.BukkitRunnable; + +public class BoomDecayTask extends BukkitRunnable{ + Player player; + private int ticksSinceStart = 0; + private final int effectLength = 20; + public BoomDecayTask(Player player){ + this.player = player; + } + //runs every tick + @Override + public void run() { + if (ticksSinceStart > effectLength){ + this.cancel(); + } + player.sendMessage(player.getVelocity().toString()); + + ticksSinceStart++; + + } + +} diff --git a/src/alisolarflare/magic/MagicModule.java b/src/alisolarflare/magic/MagicModule.java index 616b179..9a83bd0 100644 --- a/src/alisolarflare/magic/MagicModule.java +++ b/src/alisolarflare/magic/MagicModule.java @@ -3,9 +3,6 @@ package alisolarflare.magic; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; -import alisolarflare.magic.tricks.AliArrowListener; -import alisolarflare.magic.tricks.BoomBowDeathListener; -import alisolarflare.magic.tricks.BoomBowListener; public class MagicModule extends Module{ From 76118a768703e569890c4f53fb4fa1d405e2b3de Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 6 Nov 2016 18:53:38 -0500 Subject: [PATCH 108/263] Revert "Revert "Revert "Comit to Uncommit""" This reverts commit 30122d23d8f7d8a9ede7854a758a458e3da30c30. --- .../components/flairdoor/FlairDoorModule.java | 15 + .../flairdoor/Module_FlairDoor.java | 13 - .../FlairMe.java} | 77 ++--- .../PortalListener.java} | 276 ++++++++--------- .../{Memory_GPower.java => GPowerMemory.java} | 104 +++---- .../components/gpowers/GPowerModule.java | 23 ++ .../gpowers/Listener_PowerLooper.java | 11 - .../components/gpowers/Module_GPower.java | 19 -- .../GPower.java} | 151 +++++----- .../PowerDown.java} | 97 +++--- .../PowerUp.java} | 97 +++--- .../gPowerApplyingTask.java} | 132 ++++----- .../gpowers/listeners/gPowerListener.java | 13 + .../components/links/AliLinkModule.java | 33 +++ .../components/links/Module_AliLink.java | 30 -- .../PressAliLink.java} | 119 ++++---- .../SetAliLink.java} | 278 +++++++++--------- .../{Memory_Link.java => entities/Link.java} | 80 ++--- .../links/serializer/Deserializer.java | 42 +++ .../links/serializer/Serializer.java | 38 +++ .../UnpressTask.java} | 42 +-- .../CreativeBoundariesModule.java | 30 ++ .../Module_CreativeBoundaries.java | 25 -- .../Cbgm0.java} | 97 +++--- .../Cbgm1.java} | 163 +++++----- .../SetDickmode.java} | 107 +++---- .../ItemRestrictionListener.java} | 50 ++-- .../PlotChangeListener.java} | 136 ++++----- src/alisolarflare/easyuhc/EasyUHCModule.java | 24 ++ src/alisolarflare/easyuhc/Module_EasyUHC.java | 18 -- .../ActivatePowers.java} | 4 +- .../SetupWorldBorders.java} | 4 +- .../ShrinkWorldBorders.java} | 4 +- .../SpreadPlayers.java} | 4 +- .../StartTimer.java} | 4 +- .../StartUHC.java} | 4 +- .../TeleportToUHC.java} | 4 +- src/alisolarflare/magic/MagicModule.java | 3 + .../magic/{ => tricks}/AliArrowListener.java | 76 ++--- .../magic/{ => tricks}/AliArrowTask.java | 80 ++--- .../{ => tricks}/BoomBowDeathListener.java | 36 +-- .../magic/{ => tricks}/BoomBowListener.java | 214 +++++++------- .../magic/{ => tricks}/BoomBowRule.java | 168 +++++------ .../magic/{ => tricks}/BoomDecayTask.java | 50 ++-- 44 files changed, 1558 insertions(+), 1437 deletions(-) create mode 100644 src/alisolarflare/components/flairdoor/FlairDoorModule.java delete mode 100644 src/alisolarflare/components/flairdoor/Module_FlairDoor.java rename src/alisolarflare/components/flairdoor/{Command_FlairMe.java => commands/FlairMe.java} (69%) rename src/alisolarflare/components/flairdoor/{Listener_Portal.java => listeners/PortalListener.java} (92%) rename src/alisolarflare/components/gpowers/{Memory_GPower.java => GPowerMemory.java} (95%) create mode 100644 src/alisolarflare/components/gpowers/GPowerModule.java delete mode 100644 src/alisolarflare/components/gpowers/Listener_PowerLooper.java delete mode 100644 src/alisolarflare/components/gpowers/Module_GPower.java rename src/alisolarflare/components/gpowers/{Command_GPower.java => commands/GPower.java} (86%) rename src/alisolarflare/components/gpowers/{Command_PowerDown.java => commands/PowerDown.java} (75%) rename src/alisolarflare/components/gpowers/{Command_PowerUp.java => commands/PowerUp.java} (75%) rename src/alisolarflare/components/gpowers/{Task_PowerApplier.java => listeners/gPowerApplyingTask.java} (88%) create mode 100644 src/alisolarflare/components/gpowers/listeners/gPowerListener.java create mode 100644 src/alisolarflare/components/links/AliLinkModule.java delete mode 100644 src/alisolarflare/components/links/Module_AliLink.java rename src/alisolarflare/components/links/{Command_PressAliLink.java => commands/PressAliLink.java} (75%) rename src/alisolarflare/components/links/{Command_SetAliLink.java => commands/SetAliLink.java} (80%) rename src/alisolarflare/components/links/{Memory_Link.java => entities/Link.java} (74%) create mode 100644 src/alisolarflare/components/links/serializer/Deserializer.java create mode 100644 src/alisolarflare/components/links/serializer/Serializer.java rename src/alisolarflare/components/links/{Task_UnpressTask.java => tasks/UnpressTask.java} (68%) create mode 100644 src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java delete mode 100644 src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java rename src/alisolarflare/creativeboundaries/{Command_Cbgm0.java => commands/Cbgm0.java} (73%) rename src/alisolarflare/creativeboundaries/{Command_Cbgm1.java => commands/Cbgm1.java} (85%) rename src/alisolarflare/creativeboundaries/{Command_SetDickmode.java => commands/SetDickmode.java} (78%) rename src/alisolarflare/creativeboundaries/{Listener_ItemRestriction.java => listeners/ItemRestrictionListener.java} (52%) rename src/alisolarflare/creativeboundaries/{Listener_PlotChange.java => listeners/PlotChangeListener.java} (84%) create mode 100644 src/alisolarflare/easyuhc/EasyUHCModule.java delete mode 100644 src/alisolarflare/easyuhc/Module_EasyUHC.java rename src/alisolarflare/easyuhc/{Command_ActivatePowers.java => commands/ActivatePowers.java} (85%) rename src/alisolarflare/easyuhc/{Command_SetupWorldBorders.java => commands/SetupWorldBorders.java} (85%) rename src/alisolarflare/easyuhc/{Command_ShrinkWorldBorders.java => commands/ShrinkWorldBorders.java} (85%) rename src/alisolarflare/easyuhc/{Command_SpreadPlayers.java => commands/SpreadPlayers.java} (85%) rename src/alisolarflare/easyuhc/{Command_StartTimer.java => commands/StartTimer.java} (86%) rename src/alisolarflare/easyuhc/{Command_StartUHC.java => commands/StartUHC.java} (86%) rename src/alisolarflare/easyuhc/{Command_TeleportToUHC.java => commands/TeleportToUHC.java} (85%) rename src/alisolarflare/magic/{ => tricks}/AliArrowListener.java (92%) rename src/alisolarflare/magic/{ => tricks}/AliArrowTask.java (92%) rename src/alisolarflare/magic/{ => tricks}/BoomBowDeathListener.java (90%) rename src/alisolarflare/magic/{ => tricks}/BoomBowListener.java (95%) rename src/alisolarflare/magic/{ => tricks}/BoomBowRule.java (95%) rename src/alisolarflare/magic/{ => tricks}/BoomDecayTask.java (88%) diff --git a/src/alisolarflare/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/components/flairdoor/FlairDoorModule.java new file mode 100644 index 0000000..1c5cddb --- /dev/null +++ b/src/alisolarflare/components/flairdoor/FlairDoorModule.java @@ -0,0 +1,15 @@ +package alisolarflare.components.flairdoor; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.components.flairdoor.commands.FlairMe; +import alisolarflare.components.flairdoor.listeners.PortalListener; + +public class FlairDoorModule extends Module { + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new FlairMe()); + registerListener(plugin, new PortalListener(plugin)); + } +} diff --git a/src/alisolarflare/components/flairdoor/Module_FlairDoor.java b/src/alisolarflare/components/flairdoor/Module_FlairDoor.java deleted file mode 100644 index ca893a7..0000000 --- a/src/alisolarflare/components/flairdoor/Module_FlairDoor.java +++ /dev/null @@ -1,13 +0,0 @@ -package alisolarflare.components.flairdoor; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; - -public class Module_FlairDoor extends Module { - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new Command_FlairMe()); - registerListener(plugin, new Listener_Portal(plugin)); - } -} diff --git a/src/alisolarflare/components/flairdoor/Command_FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java similarity index 69% rename from src/alisolarflare/components/flairdoor/Command_FlairMe.java rename to src/alisolarflare/components/flairdoor/commands/FlairMe.java index 819ed54..963da82 100644 --- a/src/alisolarflare/components/flairdoor/Command_FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -1,38 +1,39 @@ -package alisolarflare.components.flairdoor; - -import org.bukkit.command.CommandSender; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_FlairMe extends TBMCCommandBase { - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - Listener_Portal.playersToBeFlaired.add(sender.getName()); - sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); - - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return new String[] { "" }; - } - - @Override - public String GetCommandPath() { - return "flairme"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - return false; - } - -} +package alisolarflare.components.flairdoor.commands; + +import org.bukkit.command.CommandSender; + +import alisolarflare.components.flairdoor.listeners.PortalListener; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class FlairMe extends TBMCCommandBase { + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + PortalListener.playersToBeFlaired.add(sender.getName()); + sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); + + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return new String[] { "" }; + } + + @Override + public String GetCommandPath() { + return "flairme"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + return false; + } + +} diff --git a/src/alisolarflare/components/flairdoor/Listener_Portal.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java similarity index 92% rename from src/alisolarflare/components/flairdoor/Listener_Portal.java rename to src/alisolarflare/components/flairdoor/listeners/PortalListener.java index 59791d4..4ce684a 100644 --- a/src/alisolarflare/components/flairdoor/Listener_Portal.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -1,138 +1,138 @@ -package alisolarflare.components.flairdoor; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.Bukkit; -import org.bukkit.DyeColor; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerPortalEvent; -import org.bukkit.material.MaterialData; -import org.bukkit.material.Wool; -import org.bukkit.plugin.java.JavaPlugin; - -import com.earth2me.essentials.Essentials; -import com.earth2me.essentials.User; - -public class Listener_Portal implements Listener{ - public static List playersToBeFlaired = new ArrayList(); - public JavaPlugin plugin; - - Essentials essentials; - - public Listener_Portal(JavaPlugin plugin) { - this.plugin = plugin; - this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials")); - } - @EventHandler - public void onPortalEnter(PlayerPortalEvent event){ - //SANITATION - Player - if(!(event.getPlayer() instanceof Player)){ - return; - } - - //INIT - Player - Player player = event.getPlayer(); - - //SANITATION - PlayersToBeFlaired - if(!(playersToBeFlaired.contains(player.getName()))){ - return; - } - player.sendMessage("-MAY THE FLAIRING COMMENCE-"); - event.setTo(player.getLocation()); - - //INIT - x,y,z - int x = player.getLocation().getBlockX(); - int y = player.getLocation().getBlockY(); - int z = player.getLocation().getBlockZ(); - - //INIT - Blocks Under Portal - Block HigherBlock = player.getWorld().getBlockAt(x,y-2,z); - Block MiddleBlock = player.getWorld().getBlockAt(x,y-3,z); - Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); - - //RECOLOUR PLAYER - if(HigherBlock.getType() == Material.STONE){ - recolourPlayer(player, DyeColor.GRAY); - - //TOP BLOCK IS WOOL? - }else if(HigherBlock.getType() == Material.WOOL){ - Wool wool = (Wool) HigherBlock.getState().getData(); - recolourPlayer(player, wool.getColor()); - - //MIDDLE BLOCK IS WOOL? - }else if(MiddleBlock.getType() == Material.WOOL){ - MaterialData mData = MiddleBlock.getState().getData(); - Wool wool = (Wool) mData; - - recolourPlayer(player, wool.getColor()); - - //BOTTOM BLOCK IS WOOL? - }else if (BottomBlock.getType() == Material.WOOL){ - Wool wool = (Wool) BottomBlock.getState().getData(); - recolourPlayer(player, wool.getColor()); - } - - } - public void recolourPlayer(Player player, DyeColor dyecolour){ - User user = essentials.getUser(player); - - String name = user._getNickname(); - String tempName = ""; - for(int i = 0; i < name.length(); i++){ - if (name.charAt(i) != '§'){ - tempName += name.charAt(i); - }else{ - i++; - } - } - name = tempName; - - switch(dyecolour){ - case GRAY: - player.sendMessage("Adding §7GRAY!§f"); - name = "§7" + name; - break; - case RED: - player.sendMessage("Adding §4RED!§f"); - name = "§4" + name; - break; - case ORANGE: - player.sendMessage("Adding §6ORANGE!§f"); - name = "§6" + name; - break; - case YELLOW: - player.sendMessage("Adding §eYELLOW!§f"); - name = "§e" + name; - break; - case LIME: - case GREEN: - player.sendMessage("Adding §aGREEN!§f"); - name = "§a" + name; - break; - case CYAN: - case LIGHT_BLUE: - case BLUE: - player.sendMessage("Adding §9BLUE!§f"); - name = "§9" + name; - break; - case PURPLE: - player.sendMessage("Adding §5PURPLE!§f"); - name = "§5" + name; - break; - case WHITE: - player.sendMessage("Adding §fWHITE!§f"); - name = "§f" + name; - default: - player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); - break; - } - user.setNickname(name); - player.sendMessage("Your name is now: " + user.getNickname() +"!"); - playersToBeFlaired.remove(player.getName()); - } -} +package alisolarflare.components.flairdoor.listeners; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Bukkit; +import org.bukkit.DyeColor; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerPortalEvent; +import org.bukkit.material.MaterialData; +import org.bukkit.material.Wool; +import org.bukkit.plugin.java.JavaPlugin; + +import com.earth2me.essentials.Essentials; +import com.earth2me.essentials.User; + +public class PortalListener implements Listener{ + public static List playersToBeFlaired = new ArrayList(); + public JavaPlugin plugin; + + Essentials essentials; + + public PortalListener(JavaPlugin plugin) { + this.plugin = plugin; + this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials")); + } + @EventHandler + public void onPortalEnter(PlayerPortalEvent event){ + //SANITATION - Player + if(!(event.getPlayer() instanceof Player)){ + return; + } + + //INIT - Player + Player player = event.getPlayer(); + + //SANITATION - PlayersToBeFlaired + if(!(playersToBeFlaired.contains(player.getName()))){ + return; + } + player.sendMessage("-MAY THE FLAIRING COMMENCE-"); + event.setTo(player.getLocation()); + + //INIT - x,y,z + int x = player.getLocation().getBlockX(); + int y = player.getLocation().getBlockY(); + int z = player.getLocation().getBlockZ(); + + //INIT - Blocks Under Portal + Block HigherBlock = player.getWorld().getBlockAt(x,y-2,z); + Block MiddleBlock = player.getWorld().getBlockAt(x,y-3,z); + Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); + + //RECOLOUR PLAYER + if(HigherBlock.getType() == Material.STONE){ + recolourPlayer(player, DyeColor.GRAY); + + //TOP BLOCK IS WOOL? + }else if(HigherBlock.getType() == Material.WOOL){ + Wool wool = (Wool) HigherBlock.getState().getData(); + recolourPlayer(player, wool.getColor()); + + //MIDDLE BLOCK IS WOOL? + }else if(MiddleBlock.getType() == Material.WOOL){ + MaterialData mData = MiddleBlock.getState().getData(); + Wool wool = (Wool) mData; + + recolourPlayer(player, wool.getColor()); + + //BOTTOM BLOCK IS WOOL? + }else if (BottomBlock.getType() == Material.WOOL){ + Wool wool = (Wool) BottomBlock.getState().getData(); + recolourPlayer(player, wool.getColor()); + } + + } + public void recolourPlayer(Player player, DyeColor dyecolour){ + User user = essentials.getUser(player); + + String name = user._getNickname(); + String tempName = ""; + for(int i = 0; i < name.length(); i++){ + if (name.charAt(i) != '§'){ + tempName += name.charAt(i); + }else{ + i++; + } + } + name = tempName; + + switch(dyecolour){ + case GRAY: + player.sendMessage("Adding §7GRAY!§f"); + name = "§7" + name; + break; + case RED: + player.sendMessage("Adding §4RED!§f"); + name = "§4" + name; + break; + case ORANGE: + player.sendMessage("Adding §6ORANGE!§f"); + name = "§6" + name; + break; + case YELLOW: + player.sendMessage("Adding §eYELLOW!§f"); + name = "§e" + name; + break; + case LIME: + case GREEN: + player.sendMessage("Adding §aGREEN!§f"); + name = "§a" + name; + break; + case CYAN: + case LIGHT_BLUE: + case BLUE: + player.sendMessage("Adding §9BLUE!§f"); + name = "§9" + name; + break; + case PURPLE: + player.sendMessage("Adding §5PURPLE!§f"); + name = "§5" + name; + break; + case WHITE: + player.sendMessage("Adding §fWHITE!§f"); + name = "§f" + name; + default: + player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); + break; + } + user.setNickname(name); + player.sendMessage("Your name is now: " + user.getNickname() +"!"); + playersToBeFlaired.remove(player.getName()); + } +} diff --git a/src/alisolarflare/components/gpowers/Memory_GPower.java b/src/alisolarflare/components/gpowers/GPowerMemory.java similarity index 95% rename from src/alisolarflare/components/gpowers/Memory_GPower.java rename to src/alisolarflare/components/gpowers/GPowerMemory.java index b1ef0fc..44e0089 100644 --- a/src/alisolarflare/components/gpowers/Memory_GPower.java +++ b/src/alisolarflare/components/gpowers/GPowerMemory.java @@ -1,52 +1,52 @@ -package alisolarflare.components.gpowers; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.bukkit.entity.Player; - -public class Memory_GPower{ - public Map poweredPlayerList = new HashMap(); - - public void configurePlayer(Player player, String colour, boolean powerIsActive){ - poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); - } - public void PowerUpPlayer(Player player){ - player.sendMessage("Powering up!"); - if(poweredPlayerList.containsKey(player.getUniqueId())){ - poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; - player.sendMessage("Powered up!"); - }else{ - player.sendMessage("You must instantiate your power settings using /GPower"); - } - } - - public void PowerDownPlayer(Player player){ - player.sendMessage("Powering down!"); - if (poweredPlayerList.containsKey(player.getUniqueId())){ - player.sendMessage("Powered down!"); - poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; - }else{ - player.sendMessage("P down!"); - return; - } - - } - - public class poweredPlayer{ - public UUID uuid; - public String colour; - public Boolean isPowersActive; - - public poweredPlayer(UUID uuid, String colour, Boolean activated){ - this.uuid = (uuid); - this.colour = (colour); - this.isPowersActive = (activated); - } - public String toString(){ - return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; - } - } -} - +package alisolarflare.components.gpowers; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.bukkit.entity.Player; + +public class GPowerMemory{ + public Map poweredPlayerList = new HashMap(); + + public void configurePlayer(Player player, String colour, boolean powerIsActive){ + poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); + } + public void PowerUpPlayer(Player player){ + player.sendMessage("Powering up!"); + if(poweredPlayerList.containsKey(player.getUniqueId())){ + poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; + player.sendMessage("Powered up!"); + }else{ + player.sendMessage("You must instantiate your power settings using /GPower"); + } + } + + public void PowerDownPlayer(Player player){ + player.sendMessage("Powering down!"); + if (poweredPlayerList.containsKey(player.getUniqueId())){ + player.sendMessage("Powered down!"); + poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; + }else{ + player.sendMessage("P down!"); + return; + } + + } + + public class poweredPlayer{ + public UUID uuid; + public String colour; + public Boolean isPowersActive; + + public poweredPlayer(UUID uuid, String colour, Boolean activated){ + this.uuid = (uuid); + this.colour = (colour); + this.isPowersActive = (activated); + } + public String toString(){ + return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; + } + } +} + diff --git a/src/alisolarflare/components/gpowers/GPowerModule.java b/src/alisolarflare/components/gpowers/GPowerModule.java new file mode 100644 index 0000000..3148ee0 --- /dev/null +++ b/src/alisolarflare/components/gpowers/GPowerModule.java @@ -0,0 +1,23 @@ +package alisolarflare.components.gpowers; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.components.gpowers.commands.GPower; +import alisolarflare.components.gpowers.commands.PowerDown; +import alisolarflare.components.gpowers.commands.PowerUp; +import alisolarflare.components.gpowers.listeners.gPowerListener; + +public class GPowerModule extends Module { + + @Override + public void register(JavaPlugin plugin) { + GPowerMemory gPowerMemory = new GPowerMemory(); + registerCommand(plugin, new GPower(gPowerMemory)); + registerCommand(plugin, new PowerUp(gPowerMemory)); + registerCommand(plugin, new PowerDown(gPowerMemory)); + + registerListener(plugin, new gPowerListener(plugin, gPowerMemory)); + } + +} diff --git a/src/alisolarflare/components/gpowers/Listener_PowerLooper.java b/src/alisolarflare/components/gpowers/Listener_PowerLooper.java deleted file mode 100644 index 8b9c299..0000000 --- a/src/alisolarflare/components/gpowers/Listener_PowerLooper.java +++ /dev/null @@ -1,11 +0,0 @@ -package alisolarflare.components.gpowers; - -import org.bukkit.event.Listener; -import org.bukkit.plugin.java.JavaPlugin; - -public class Listener_PowerLooper implements Listener{ - - public Listener_PowerLooper(JavaPlugin plugin, Memory_GPower gPowerMemory){ - new Task_PowerApplier(plugin.getServer(), gPowerMemory.poweredPlayerList).runTaskTimer(plugin, 190, 190); - } -} \ No newline at end of file diff --git a/src/alisolarflare/components/gpowers/Module_GPower.java b/src/alisolarflare/components/gpowers/Module_GPower.java deleted file mode 100644 index 814d9bd..0000000 --- a/src/alisolarflare/components/gpowers/Module_GPower.java +++ /dev/null @@ -1,19 +0,0 @@ -package alisolarflare.components.gpowers; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; - -public class Module_GPower extends Module { - - @Override - public void register(JavaPlugin plugin) { - Memory_GPower gPowerMemory = new Memory_GPower(); - registerCommand(plugin, new Command_GPower(gPowerMemory)); - registerCommand(plugin, new Command_PowerUp(gPowerMemory)); - registerCommand(plugin, new Command_PowerDown(gPowerMemory)); - - registerListener(plugin, new Listener_PowerLooper(plugin, gPowerMemory)); - } - -} diff --git a/src/alisolarflare/components/gpowers/Command_GPower.java b/src/alisolarflare/components/gpowers/commands/GPower.java similarity index 86% rename from src/alisolarflare/components/gpowers/Command_GPower.java rename to src/alisolarflare/components/gpowers/commands/GPower.java index a244e8c..4a90d21 100644 --- a/src/alisolarflare/components/gpowers/Command_GPower.java +++ b/src/alisolarflare/components/gpowers/commands/GPower.java @@ -1,75 +1,76 @@ -package alisolarflare.components.gpowers; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_GPower extends TBMCCommandBase { - - private Memory_GPower gPowerMemory; - - public Command_GPower(Memory_GPower gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - sender.sendMessage("G power activate!"); - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command! Talk to a dev/ali if you think this is wrong"); - } - Player player = (Player) sender; - if (args.length < 2) { - player.sendMessage("Proper Usage to test G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); - return false; - } - String colour; - if (args[0].startsWith("r") || args[0].startsWith("o") || args[0].startsWith("y") || args[0].startsWith("g") - || args[0].startsWith("b") || args[0].startsWith("p")) { - colour = args[0]; - } else { - player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]"); - return false; - } - boolean isActive; - if (args[1].startsWith("t")) { - isActive = true; - } else if (args[1].startsWith("f")) { - isActive = false; - } else { - player.sendMessage("error: active. Proper Usage to configure G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); - return false; - } - player.sendMessage("Terms Vaild!"); - player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); - gPowerMemory.configurePlayer(player, colour, isActive); - - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return new String[] { "" }; - } - - @Override - public String GetCommandPath() { - return "gpower"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - return false; - } - -} +package alisolarflare.components.gpowers.commands; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.components.gpowers.GPowerMemory; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class GPower extends TBMCCommandBase { + + private GPowerMemory gPowerMemory; + + public GPower(GPowerMemory gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + sender.sendMessage("G power activate!"); + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command! Talk to a dev/ali if you think this is wrong"); + } + Player player = (Player) sender; + if (args.length < 2) { + player.sendMessage("Proper Usage to test G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + String colour; + if (args[0].startsWith("r") || args[0].startsWith("o") || args[0].startsWith("y") || args[0].startsWith("g") + || args[0].startsWith("b") || args[0].startsWith("p")) { + colour = args[0]; + } else { + player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]"); + return false; + } + boolean isActive; + if (args[1].startsWith("t")) { + isActive = true; + } else if (args[1].startsWith("f")) { + isActive = false; + } else { + player.sendMessage("error: active. Proper Usage to configure G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + player.sendMessage("Terms Vaild!"); + player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); + gPowerMemory.configurePlayer(player, colour, isActive); + + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return new String[] { "" }; + } + + @Override + public String GetCommandPath() { + return "gpower"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + return false; + } + +} diff --git a/src/alisolarflare/components/gpowers/Command_PowerDown.java b/src/alisolarflare/components/gpowers/commands/PowerDown.java similarity index 75% rename from src/alisolarflare/components/gpowers/Command_PowerDown.java rename to src/alisolarflare/components/gpowers/commands/PowerDown.java index 9204c29..8f3467b 100644 --- a/src/alisolarflare/components/gpowers/Command_PowerDown.java +++ b/src/alisolarflare/components/gpowers/commands/PowerDown.java @@ -1,48 +1,49 @@ -package alisolarflare.components.gpowers; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_PowerDown extends TBMCCommandBase { - - private Memory_GPower gPowerMemory; - - public Command_PowerDown(Memory_GPower gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (!(sender instanceof Player)) - sender.sendMessage("You must be a player to use this command! Contact dev/ali if you think this is wrong"); - Player player = (Player) sender; - gPowerMemory.PowerDownPlayer(player); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "powerdown"; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.gpowers.commands; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.components.gpowers.GPowerMemory; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class PowerDown extends TBMCCommandBase { + + private GPowerMemory gPowerMemory; + + public PowerDown(GPowerMemory gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (!(sender instanceof Player)) + sender.sendMessage("You must be a player to use this command! Contact dev/ali if you think this is wrong"); + Player player = (Player) sender; + gPowerMemory.PowerDownPlayer(player); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "powerdown"; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/gpowers/Command_PowerUp.java b/src/alisolarflare/components/gpowers/commands/PowerUp.java similarity index 75% rename from src/alisolarflare/components/gpowers/Command_PowerUp.java rename to src/alisolarflare/components/gpowers/commands/PowerUp.java index 171961c..84670f3 100644 --- a/src/alisolarflare/components/gpowers/Command_PowerUp.java +++ b/src/alisolarflare/components/gpowers/commands/PowerUp.java @@ -1,48 +1,49 @@ -package alisolarflare.components.gpowers; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_PowerUp extends TBMCCommandBase { - - private Memory_GPower gPowerMemory; - - public Command_PowerUp(Memory_GPower gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (!(sender instanceof Player)) - sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong"); - - Player player = (Player) sender; - gPowerMemory.PowerUpPlayer(player); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "powerup"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.gpowers.commands; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.components.gpowers.GPowerMemory; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class PowerUp extends TBMCCommandBase { + + private GPowerMemory gPowerMemory; + + public PowerUp(GPowerMemory gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (!(sender instanceof Player)) + sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong"); + + Player player = (Player) sender; + gPowerMemory.PowerUpPlayer(player); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "powerup"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/gpowers/Task_PowerApplier.java b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java similarity index 88% rename from src/alisolarflare/components/gpowers/Task_PowerApplier.java rename to src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java index f9d82e3..d966e63 100644 --- a/src/alisolarflare/components/gpowers/Task_PowerApplier.java +++ b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java @@ -1,66 +1,66 @@ -package alisolarflare.components.gpowers; - -import java.util.Map; -import java.util.UUID; - -import org.bukkit.Color; -import org.bukkit.Server; -import org.bukkit.entity.Player; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import alisolarflare.components.gpowers.Memory_GPower.poweredPlayer; - -public class Task_PowerApplier extends BukkitRunnable{ - - private Server server; - private Map poweredPlayerList; - - public Task_PowerApplier(Server server, Map poweredPlayerList) { - this.server = server; - this.poweredPlayerList = poweredPlayerList; - } - - //REPEATS EVERY 5 SECONDS - @Override - public void run() { - for (Player player : server.getOnlinePlayers()){ - if(poweredPlayerList.containsKey(player.getUniqueId())){ - activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); - } - } - } - - private void activatePower(Player player, String colour) { - //GREY - if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.GRAY)); - player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 0, true, false, Color.GRAY)); - //RED - }else if (colour.startsWith("r")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0, true, false, Color.RED)); - //ORANGE - }else if (colour.startsWith("o")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); - player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); - //YELLOW - }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.YELLOW)); - //GREEN - }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 200, 1, true, false, Color.GREEN)); - player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 200, 0, true, false, Color.GREEN)); - //BLUE - }else if (colour.startsWith("b")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1, true, false, Color.BLUE)); - player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 200, 0, true, false, Color.BLUE)); - //PURPLE - }else if (colour.startsWith("p")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 0, true, false, Color.PURPLE)); - //NULL - }else{ - } - } - -} +package alisolarflare.components.gpowers.listeners; + +import java.util.Map; +import java.util.UUID; + +import org.bukkit.Color; +import org.bukkit.Server; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; + +public class gPowerApplyingTask extends BukkitRunnable{ + + private Server server; + private Map poweredPlayerList; + + public gPowerApplyingTask(Server server, Map poweredPlayerList) { + this.server = server; + this.poweredPlayerList = poweredPlayerList; + } + + //REPEATS EVERY 5 SECONDS + @Override + public void run() { + for (Player player : server.getOnlinePlayers()){ + if(poweredPlayerList.containsKey(player.getUniqueId())){ + activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); + } + } + } + + private void activatePower(Player player, String colour) { + //GREY + if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 0, true, false, Color.GRAY)); + //RED + }else if (colour.startsWith("r")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0, true, false, Color.RED)); + //ORANGE + }else if (colour.startsWith("o")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); + player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); + //YELLOW + }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.YELLOW)); + //GREEN + }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 200, 1, true, false, Color.GREEN)); + player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 200, 0, true, false, Color.GREEN)); + //BLUE + }else if (colour.startsWith("b")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1, true, false, Color.BLUE)); + player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 200, 0, true, false, Color.BLUE)); + //PURPLE + }else if (colour.startsWith("p")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 0, true, false, Color.PURPLE)); + //NULL + }else{ + } + } + +} diff --git a/src/alisolarflare/components/gpowers/listeners/gPowerListener.java b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java new file mode 100644 index 0000000..1b71481 --- /dev/null +++ b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java @@ -0,0 +1,13 @@ +package alisolarflare.components.gpowers.listeners; + +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.gpowers.GPowerMemory; + +public class gPowerListener implements Listener{ + + public gPowerListener(JavaPlugin plugin, GPowerMemory gPowerMemory){ + new gPowerApplyingTask(plugin.getServer(), gPowerMemory.poweredPlayerList).runTaskTimer(plugin, 190, 190); + } +} \ No newline at end of file diff --git a/src/alisolarflare/components/links/AliLinkModule.java b/src/alisolarflare/components/links/AliLinkModule.java new file mode 100644 index 0000000..a6d44a9 --- /dev/null +++ b/src/alisolarflare/components/links/AliLinkModule.java @@ -0,0 +1,33 @@ +package alisolarflare.components.links; + +import java.util.List; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.components.links.commands.PressAliLink; +import alisolarflare.components.links.commands.SetAliLink; +import alisolarflare.components.links.entities.Link; + +public class AliLinkModule extends Module { + private SetAliLink setAliLink; + + @Override + public void register(JavaPlugin plugin) { + setAliLink = new SetAliLink(plugin); + + registerCommand(plugin, new PressAliLink(plugin, setAliLink)); + registerCommand(plugin, setAliLink); + + } + + public void saveLinkList(JavaPlugin plugin) { + plugin.getConfig().set("aliLinkList", setAliLink.linkList); + } + + @SuppressWarnings("unchecked") + public List loadLinkList(JavaPlugin plugin) { + return (List) plugin.getConfig().getList("aliLinkList"); + } + +} diff --git a/src/alisolarflare/components/links/Module_AliLink.java b/src/alisolarflare/components/links/Module_AliLink.java deleted file mode 100644 index a16b47b..0000000 --- a/src/alisolarflare/components/links/Module_AliLink.java +++ /dev/null @@ -1,30 +0,0 @@ -package alisolarflare.components.links; - -import java.util.List; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; - -public class Module_AliLink extends Module { - private Command_SetAliLink setAliLink; - - @Override - public void register(JavaPlugin plugin) { - setAliLink = new Command_SetAliLink(plugin); - - registerCommand(plugin, new Command_PressAliLink(plugin, setAliLink)); - registerCommand(plugin, setAliLink); - - } - - public void saveLinkList(JavaPlugin plugin) { - plugin.getConfig().set("aliLinkList", setAliLink.linkList); - } - - @SuppressWarnings("unchecked") - public List loadLinkList(JavaPlugin plugin) { - return (List) plugin.getConfig().getList("aliLinkList"); - } - -} diff --git a/src/alisolarflare/components/links/Command_PressAliLink.java b/src/alisolarflare/components/links/commands/PressAliLink.java similarity index 75% rename from src/alisolarflare/components/links/Command_PressAliLink.java rename to src/alisolarflare/components/links/commands/PressAliLink.java index 9619449..da21f6d 100644 --- a/src/alisolarflare/components/links/Command_PressAliLink.java +++ b/src/alisolarflare/components/links/commands/PressAliLink.java @@ -1,59 +1,60 @@ -package alisolarflare.components.links; - -import org.bukkit.command.CommandSender; -import org.bukkit.plugin.java.JavaPlugin; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_PressAliLink extends TBMCCommandBase { - private JavaPlugin plugin; - private Command_SetAliLink setAliLink; - - public Command_PressAliLink(JavaPlugin plugin, Command_SetAliLink setAliLink) { - this.plugin = plugin; - this.setAliLink = setAliLink; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - - sender.getServer().broadcastMessage(setAliLink.linkList.toString() + "over."); - - if (args.length < 1) { - sender.sendMessage("You must specify a link frequency"); - sender.sendMessage("/pressalilink [frequency]"); - } - for (Memory_Link link : setAliLink.linkList) { - for (String inputlink : args) { - if (inputlink.equals(link.frequency)) { - link.press(plugin); - } - } - } - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "pressalilink"; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.links.commands; + +import org.bukkit.command.CommandSender; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.links.entities.Link; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class PressAliLink extends TBMCCommandBase { + private JavaPlugin plugin; + private SetAliLink setAliLink; + + public PressAliLink(JavaPlugin plugin, SetAliLink setAliLink) { + this.plugin = plugin; + this.setAliLink = setAliLink; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + + sender.getServer().broadcastMessage(setAliLink.linkList.toString() + "over."); + + if (args.length < 1) { + sender.sendMessage("You must specify a link frequency"); + sender.sendMessage("/pressalilink [frequency]"); + } + for (Link link : setAliLink.linkList) { + for (String inputlink : args) { + if (inputlink.equals(link.frequency)) { + link.press(plugin); + } + } + } + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "pressalilink"; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/links/Command_SetAliLink.java b/src/alisolarflare/components/links/commands/SetAliLink.java similarity index 80% rename from src/alisolarflare/components/links/Command_SetAliLink.java rename to src/alisolarflare/components/links/commands/SetAliLink.java index 2b78235..03c4e57 100644 --- a/src/alisolarflare/components/links/Command_SetAliLink.java +++ b/src/alisolarflare/components/links/commands/SetAliLink.java @@ -1,138 +1,140 @@ -package alisolarflare.components.links; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; -import org.bukkit.Location; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import buttondevteam.lib.chat.TBMCCommandBase; - -/** - * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, a location in a world that when called on by {@link Command_PressAliLink}, creates a temporary redstone - * block, enabling wireless redstone - * - * @see Command_PressAliLink - * @author Alisolarflare - * - */ -public class Command_SetAliLink extends TBMCCommandBase { - public List linkList = new ArrayList(); - Module_AliLink subplugin; - private JavaPlugin plugin; - - /** - * Constructs the SetAliLink class - * - * @param plugin - * The plugin that contains the configuration file of SetAliLink - */ - public Command_SetAliLink(JavaPlugin plugin) { - this.plugin = plugin; - load(); - } - - /** - * This command creates an Ali-Link which, when activated by the command /PressAliLink, creates a temporary redstone block if and only if /PressAliLink [frequency] matches the frequency saved when - * /SetAliLink [frequency] is called. - * - * @see Class#PressAliLink - * @param sender - * Player who sent the command - * @param command - * Command Object created - * @param label - * Name of the command - * @param args - * Arguments: [frequency] [x-coordinate] [y-coordinate] [z-coordinate], where the coordinates point to the intended location of the Ali-Link - */ - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - sender.sendMessage("you pressed shit"); - if (args == null || args.length < 1) { - sender.sendMessage("You must specify a link frequency"); - sender.sendMessage("/pressalilink [name]"); - return false; - } - Player player = (Player) sender; - if (args.length < 4) { - player.sendMessage("short"); - linkList.add(new Memory_Link(args[0], player.getLocation())); - save(player); - player.sendMessage("end"); - return false; - } - if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) - && StringUtils.isNumericSpace(args[3])) { - player.sendMessage("CUUUSTOM"); - linkList.add(new Memory_Link(args[0], new Location(player.getWorld(), Double.parseDouble(args[1]), - Double.parseDouble(args[2]), Double.parseDouble(args[3])))); - save(player); - player.sendMessage("FINISHED"); - } else { - player.sendMessage("UNCUSTOOM"); - linkList.add(new Memory_Link(args[0], player.getLocation())); - save(player); - player.sendMessage("UNFINISHED"); - return false; - } - return false; - } - - /** - * Tries to save the entire SetAliLink class into memory, which includes all of the current Ali-links saved and in use. - * - * @param player - */ - private void save(Player player) { - player.sendMessage("SAAAVING"); - player.sendMessage("SAVE FAILED: TELL ALI TO FIX THE SAVE AND UN-COMMENT THE PARAGRAPH SHE COMMENTED"); - player.sendMessage("Link will only last until next server restart"); - return; - /* - * subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); try { player.sendMessage("SAVIN"); subplugin.plugin.saveConfig(); player.sendMessage("GOOD SAVE"); } catch (Exception e) - * { player.sendMessage("YOU FUCKED STUFF UP"); // TODO Auto-generated catch block e.printStackTrace(); } - */ - } - - /** - * Attempts to load the previous saved state of AliLinks, from the plugin configuration file - */ - @SuppressWarnings("unchecked") - private void load() { - try { - linkList = (List) plugin.getConfig().getList("aliLinkList"); - if (linkList == null || linkList.isEmpty()) { - linkList = new ArrayList(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String GetCommandPath() { - return "setalilink"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.components.links.commands; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.bukkit.Location; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.links.AliLinkModule; +import alisolarflare.components.links.entities.Link; +import buttondevteam.lib.chat.TBMCCommandBase; + +/** + * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, a location in a world that when called on by {@link PressAliLink}, creates a temporary redstone + * block, enabling wireless redstone + * + * @see PressAliLink + * @author Alisolarflare + * + */ +public class SetAliLink extends TBMCCommandBase { + public List linkList = new ArrayList(); + AliLinkModule subplugin; + private JavaPlugin plugin; + + /** + * Constructs the SetAliLink class + * + * @param plugin + * The plugin that contains the configuration file of SetAliLink + */ + public SetAliLink(JavaPlugin plugin) { + this.plugin = plugin; + load(); + } + + /** + * This command creates an Ali-Link which, when activated by the command /PressAliLink, creates a temporary redstone block if and only if /PressAliLink [frequency] matches the frequency saved when + * /SetAliLink [frequency] is called. + * + * @see Class#PressAliLink + * @param sender + * Player who sent the command + * @param command + * Command Object created + * @param label + * Name of the command + * @param args + * Arguments: [frequency] [x-coordinate] [y-coordinate] [z-coordinate], where the coordinates point to the intended location of the Ali-Link + */ + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + sender.sendMessage("you pressed shit"); + if (args == null || args.length < 1) { + sender.sendMessage("You must specify a link frequency"); + sender.sendMessage("/pressalilink [name]"); + return false; + } + Player player = (Player) sender; + if (args.length < 4) { + player.sendMessage("short"); + linkList.add(new Link(args[0], player.getLocation())); + save(player); + player.sendMessage("end"); + return false; + } + if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) + && StringUtils.isNumericSpace(args[3])) { + player.sendMessage("CUUUSTOM"); + linkList.add(new Link(args[0], new Location(player.getWorld(), Double.parseDouble(args[1]), + Double.parseDouble(args[2]), Double.parseDouble(args[3])))); + save(player); + player.sendMessage("FINISHED"); + } else { + player.sendMessage("UNCUSTOOM"); + linkList.add(new Link(args[0], player.getLocation())); + save(player); + player.sendMessage("UNFINISHED"); + return false; + } + return false; + } + + /** + * Tries to save the entire SetAliLink class into memory, which includes all of the current Ali-links saved and in use. + * + * @param player + */ + private void save(Player player) { + player.sendMessage("SAAAVING"); + player.sendMessage("SAVE FAILED: TELL ALI TO FIX THE SAVE AND UN-COMMENT THE PARAGRAPH SHE COMMENTED"); + player.sendMessage("Link will only last until next server restart"); + return; + /* + * subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); try { player.sendMessage("SAVIN"); subplugin.plugin.saveConfig(); player.sendMessage("GOOD SAVE"); } catch (Exception e) + * { player.sendMessage("YOU FUCKED STUFF UP"); // TODO Auto-generated catch block e.printStackTrace(); } + */ + } + + /** + * Attempts to load the previous saved state of AliLinks, from the plugin configuration file + */ + @SuppressWarnings("unchecked") + private void load() { + try { + linkList = (List) plugin.getConfig().getList("aliLinkList"); + if (linkList == null || linkList.isEmpty()) { + linkList = new ArrayList(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String GetCommandPath() { + return "setalilink"; + } + + @Override + public boolean GetPlayerOnly() { + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/links/Memory_Link.java b/src/alisolarflare/components/links/entities/Link.java similarity index 74% rename from src/alisolarflare/components/links/Memory_Link.java rename to src/alisolarflare/components/links/entities/Link.java index 2043b7a..f55bfc8 100644 --- a/src/alisolarflare/components/links/Memory_Link.java +++ b/src/alisolarflare/components/links/entities/Link.java @@ -1,39 +1,41 @@ -package alisolarflare.components.links; - -import java.io.Serializable; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.plugin.java.JavaPlugin; - -public class Memory_Link implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - public String frequency; - public String world; - public String x; - public String y; - public String z; - - - public Memory_Link(String frequency, Location location){ - this.frequency = frequency; - this.world = location.getWorld().getName(); - this.x = "" + location.getBlockX(); - this.y = "" + location.getBlockY(); - this.z = "" + location.getBlockZ(); - //plugin.plugin.getConfig().set("frequency", 10); - } - /** - * Activates the Ali-Link - * @param plugin - */ - public void press(JavaPlugin plugin) { - Location location = new Location(plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); - location.getBlock().setType(Material.REDSTONE_BLOCK); - Task_UnpressTask unPressTask = new Task_UnpressTask(location); - unPressTask.runTaskTimer(plugin, 2, 1); - } -} +package alisolarflare.components.links.entities; + +import java.io.Serializable; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.links.tasks.UnpressTask; + +public class Link implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + public String frequency; + public String world; + public String x; + public String y; + public String z; + + + public Link(String frequency, Location location){ + this.frequency = frequency; + this.world = location.getWorld().getName(); + this.x = "" + location.getBlockX(); + this.y = "" + location.getBlockY(); + this.z = "" + location.getBlockZ(); + //plugin.plugin.getConfig().set("frequency", 10); + } + /** + * Activates the Ali-Link + * @param plugin + */ + public void press(JavaPlugin plugin) { + Location location = new Location(plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); + location.getBlock().setType(Material.REDSTONE_BLOCK); + UnpressTask unPressTask = new UnpressTask(location); + unPressTask.runTaskTimer(plugin, 2, 1); + } +} diff --git a/src/alisolarflare/components/links/serializer/Deserializer.java b/src/alisolarflare/components/links/serializer/Deserializer.java new file mode 100644 index 0000000..cfc1786 --- /dev/null +++ b/src/alisolarflare/components/links/serializer/Deserializer.java @@ -0,0 +1,42 @@ +package alisolarflare.components.links.serializer; + + +import java.io.FileInputStream; +import java.io.ObjectInputStream; +import java.util.List; + +import alisolarflare.components.links.entities.Link; + +/** + * @deprecated + * @author Alisolarflare + * + */ +public class Deserializer{ + + public static void main (String args[]) { + + //Deserializer deserializer = new Deserializer(); + //List aliLink = deserializer.loadLink(aliLink); + //System.out.println(aliLink); + } + + /**@deprecated*/ + @SuppressWarnings("unchecked") + public List loadLinkList(){ + List aliLinkList; + try{ + + FileInputStream fin = new FileInputStream("AliLinkList.ser"); + ObjectInputStream ois = new ObjectInputStream(fin); + aliLinkList = (List) ois.readObject(); + ois.close(); + + return aliLinkList; + + }catch(Exception ex){ + ex.printStackTrace(); + return null; + } + } +} diff --git a/src/alisolarflare/components/links/serializer/Serializer.java b/src/alisolarflare/components/links/serializer/Serializer.java new file mode 100644 index 0000000..fe4efef --- /dev/null +++ b/src/alisolarflare/components/links/serializer/Serializer.java @@ -0,0 +1,38 @@ +package alisolarflare.components.links.serializer; + + +import java.io.FileOutputStream; +import java.io.ObjectOutputStream; +import java.util.List; + +import alisolarflare.components.links.entities.Link; + +/** + * @deprecated + * @author Alisolarflare + * + */ +public class Serializer { + + public static void main (String args[]) { + + //Serializer serializer = new Serializer(); + //serializer.saveLink(plugin, frequency, location) + } + /**@deprecated*/ + public void saveLinkList(List aliLinkList){ + //saves link + + try{ + + FileOutputStream fout = new FileOutputStream("AliLinkList.ser"); + ObjectOutputStream oos = new ObjectOutputStream(fout); + oos.writeObject(aliLinkList); + oos.close(); + System.out.println("Done"); + + }catch(Exception ex){ + ex.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/src/alisolarflare/components/links/Task_UnpressTask.java b/src/alisolarflare/components/links/tasks/UnpressTask.java similarity index 68% rename from src/alisolarflare/components/links/Task_UnpressTask.java rename to src/alisolarflare/components/links/tasks/UnpressTask.java index 17c59c8..769f4f1 100644 --- a/src/alisolarflare/components/links/Task_UnpressTask.java +++ b/src/alisolarflare/components/links/tasks/UnpressTask.java @@ -1,21 +1,21 @@ -package alisolarflare.components.links; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.scheduler.BukkitRunnable; - -public class Task_UnpressTask extends BukkitRunnable { - private Location location; - public Task_UnpressTask(Location location){ - this.location = location; - } - - @SuppressWarnings("deprecation") - @Override - public void run() { - location.getBlock().setType(Material.STAINED_CLAY); - location.getBlock().setData((byte) 14); - this.cancel(); - } - -} +package alisolarflare.components.links.tasks; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.scheduler.BukkitRunnable; + +public class UnpressTask extends BukkitRunnable { + private Location location; + public UnpressTask(Location location){ + this.location = location; + } + + @SuppressWarnings("deprecation") + @Override + public void run() { + location.getBlock().setType(Material.STAINED_CLAY); + location.getBlock().setData((byte) 14); + this.cancel(); + } + +} diff --git a/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java b/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java new file mode 100644 index 0000000..39dac19 --- /dev/null +++ b/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java @@ -0,0 +1,30 @@ +package alisolarflare.creativeboundaries; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.creativeboundaries.commands.Cbgm0; +import alisolarflare.creativeboundaries.commands.Cbgm1; +import alisolarflare.creativeboundaries.commands.SetDickmode; +import alisolarflare.creativeboundaries.listeners.ItemRestrictionListener; +import alisolarflare.creativeboundaries.listeners.PlotChangeListener; + + +public class CreativeBoundariesModule extends Module{ + public boolean dickmode; + public List cbCreatives = new ArrayList(); + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new Cbgm1(this)); + registerCommand(plugin, new Cbgm0(this)); + registerCommand(plugin, new SetDickmode(this)); + + registerListener(plugin, new PlotChangeListener(this)); + //registerListener(plugin, new ItemRestrictionListener(this)); + } + +} diff --git a/src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java b/src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java deleted file mode 100644 index fcd58da..0000000 --- a/src/alisolarflare/creativeboundaries/Module_CreativeBoundaries.java +++ /dev/null @@ -1,25 +0,0 @@ -package alisolarflare.creativeboundaries; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; - - -public class Module_CreativeBoundaries extends Module{ - public boolean dickmode; - public List cbCreatives = new ArrayList(); - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new Command_Cbgm1(this)); - registerCommand(plugin, new Command_Cbgm0(this)); - registerCommand(plugin, new Command_SetDickmode(this)); - - registerListener(plugin, new Listener_PlotChange(this)); - //registerListener(plugin, new ItemRestrictionListener(this)); - } - -} diff --git a/src/alisolarflare/creativeboundaries/Command_Cbgm0.java b/src/alisolarflare/creativeboundaries/commands/Cbgm0.java similarity index 73% rename from src/alisolarflare/creativeboundaries/Command_Cbgm0.java rename to src/alisolarflare/creativeboundaries/commands/Cbgm0.java index afa0aa9..6e5fd2a 100644 --- a/src/alisolarflare/creativeboundaries/Command_Cbgm0.java +++ b/src/alisolarflare/creativeboundaries/commands/Cbgm0.java @@ -1,48 +1,49 @@ -package alisolarflare.creativeboundaries; - -import org.bukkit.GameMode; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_Cbgm0 extends TBMCCommandBase{ - - private Module_CreativeBoundaries module; - - public Command_Cbgm0(Module_CreativeBoundaries module) { - this.module = module; - } - - @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - return false; - } - - Player player = (Player) sender; - player.setGameMode(GameMode.SURVIVAL); - module.cbCreatives.remove(player); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.creativeboundaries.commands; + +import org.bukkit.GameMode; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.creativeboundaries.CreativeBoundariesModule; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Cbgm0 extends TBMCCommandBase{ + + private CreativeBoundariesModule module; + + public Cbgm0(CreativeBoundariesModule module) { + this.module = module; + } + + @Override + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { + if (!(sender instanceof Player)){ + sender.sendMessage("You must be a player to use this command!"); + return false; + } + + Player player = (Player) sender; + player.setGameMode(GameMode.SURVIVAL); + module.cbCreatives.remove(player); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/creativeboundaries/Command_Cbgm1.java b/src/alisolarflare/creativeboundaries/commands/Cbgm1.java similarity index 85% rename from src/alisolarflare/creativeboundaries/Command_Cbgm1.java rename to src/alisolarflare/creativeboundaries/commands/Cbgm1.java index c63e430..04fba33 100644 --- a/src/alisolarflare/creativeboundaries/Command_Cbgm1.java +++ b/src/alisolarflare/creativeboundaries/commands/Cbgm1.java @@ -1,81 +1,82 @@ -package alisolarflare.creativeboundaries; - -import org.bukkit.GameMode; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; -import com.palmergames.bukkit.towny.object.Resident; -import com.palmergames.bukkit.towny.object.Town; -import com.palmergames.bukkit.towny.object.TownBlock; -import com.palmergames.bukkit.towny.object.TownyUniverse; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_Cbgm1 extends TBMCCommandBase { - - private Module_CreativeBoundaries module; - - public Command_Cbgm1(Module_CreativeBoundaries module) { - this.module = module; - } - - @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - - if (!(sender instanceof Player)) { - sender.sendMessage("You must be a player to use this command!"); - return false; - } - - Player player = (Player) sender; - - TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); - if (tb == null) { - player.sendMessage("You aren't standing in a town or some other error occured."); - player.sendMessage("TownBlock is null."); - return false; - } - Town town; - try { - town = tb.getTown(); - } catch (NotRegisteredException e) { - player.sendMessage("You aren't standing in a town or some other error occured."); - player.sendMessage("TownBlock's town is not registered."); - return false; - } - if (town == null) { - player.sendMessage("ERROR: The town you're standing in is Null."); - return false; - } - - for(Resident res : town.getResidents()){ - if (res.getName().toString().equals(player.getName().toString())){ - player.setGameMode(GameMode.CREATIVE); - module.cbCreatives.add(player); - return true; - } - } - player.sendMessage("Sorry, you're not part of this town"); - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.creativeboundaries.commands; + +import org.bukkit.GameMode; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.Resident; +import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.towny.object.TownBlock; +import com.palmergames.bukkit.towny.object.TownyUniverse; + +import alisolarflare.creativeboundaries.CreativeBoundariesModule; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class Cbgm1 extends TBMCCommandBase { + + private CreativeBoundariesModule module; + + public Cbgm1(CreativeBoundariesModule module) { + this.module = module; + } + + @Override + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { + + if (!(sender instanceof Player)) { + sender.sendMessage("You must be a player to use this command!"); + return false; + } + + Player player = (Player) sender; + + TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); + if (tb == null) { + player.sendMessage("You aren't standing in a town or some other error occured."); + player.sendMessage("TownBlock is null."); + return false; + } + Town town; + try { + town = tb.getTown(); + } catch (NotRegisteredException e) { + player.sendMessage("You aren't standing in a town or some other error occured."); + player.sendMessage("TownBlock's town is not registered."); + return false; + } + if (town == null) { + player.sendMessage("ERROR: The town you're standing in is Null."); + return false; + } + + for(Resident res : town.getResidents()){ + if (res.getName().toString().equals(player.getName().toString())){ + player.setGameMode(GameMode.CREATIVE); + module.cbCreatives.add(player); + return true; + } + } + player.sendMessage("Sorry, you're not part of this town"); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/creativeboundaries/Command_SetDickmode.java b/src/alisolarflare/creativeboundaries/commands/SetDickmode.java similarity index 78% rename from src/alisolarflare/creativeboundaries/Command_SetDickmode.java rename to src/alisolarflare/creativeboundaries/commands/SetDickmode.java index fb0aa8d..3b1654b 100644 --- a/src/alisolarflare/creativeboundaries/Command_SetDickmode.java +++ b/src/alisolarflare/creativeboundaries/commands/SetDickmode.java @@ -1,53 +1,54 @@ -package alisolarflare.creativeboundaries; - -import org.bukkit.command.CommandSender; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class Command_SetDickmode extends TBMCCommandBase{ - private Module_CreativeBoundaries module; - - public Command_SetDickmode(Module_CreativeBoundaries module){ - this.module = module; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (sender.getName().equals("Alisolarflare") || sender.getName().equals("iie")){ - if(args[0] == null){ - sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); - return false; - } - if(args[0].equalsIgnoreCase("TRUE") || args[0].equalsIgnoreCase("1")){ - sender.sendMessage("Dickmode has been turned on!"); - module.dickmode=(true); - return true; - } - if(args[0].equalsIgnoreCase("FALSE") || args[0].equalsIgnoreCase("0")){ - sender.sendMessage("Dickmode has been turned off!"); - module.dickmode=(false); - return true; - } - return false; - } - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } -} +package alisolarflare.creativeboundaries.commands; + +import org.bukkit.command.CommandSender; + +import alisolarflare.creativeboundaries.CreativeBoundariesModule; +import buttondevteam.lib.chat.TBMCCommandBase; + +public class SetDickmode extends TBMCCommandBase{ + private CreativeBoundariesModule module; + + public SetDickmode(CreativeBoundariesModule module){ + this.module = module; + } + + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (sender.getName().equals("Alisolarflare") || sender.getName().equals("iie")){ + if(args[0] == null){ + sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); + return false; + } + if(args[0].equalsIgnoreCase("TRUE") || args[0].equalsIgnoreCase("1")){ + sender.sendMessage("Dickmode has been turned on!"); + module.dickmode=(true); + return true; + } + if(args[0].equalsIgnoreCase("FALSE") || args[0].equalsIgnoreCase("0")){ + sender.sendMessage("Dickmode has been turned off!"); + module.dickmode=(false); + return true; + } + return false; + } + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } +} diff --git a/src/alisolarflare/creativeboundaries/Listener_ItemRestriction.java b/src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java similarity index 52% rename from src/alisolarflare/creativeboundaries/Listener_ItemRestriction.java rename to src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java index 37d5ac7..9023755 100644 --- a/src/alisolarflare/creativeboundaries/Listener_ItemRestriction.java +++ b/src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java @@ -1,24 +1,26 @@ -package alisolarflare.creativeboundaries; - -import java.util.List; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.InventoryCreativeEvent; - -public class Listener_ItemRestriction implements Listener { - - private Module_CreativeBoundaries module; - - public Listener_ItemRestriction(Module_CreativeBoundaries module) { - this.module = module; - } - - @EventHandler - public void onItemTake(InventoryCreativeEvent event){ - List cbCreatives = module.cbCreatives; - - } - -} +package alisolarflare.creativeboundaries.listeners; + +import java.util.List; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.InventoryCreativeEvent; + +import alisolarflare.creativeboundaries.CreativeBoundariesModule; + +public class ItemRestrictionListener implements Listener { + + private CreativeBoundariesModule module; + + public ItemRestrictionListener(CreativeBoundariesModule module) { + this.module = module; + } + + @EventHandler + public void onItemTake(InventoryCreativeEvent event){ + List cbCreatives = module.cbCreatives; + + } + +} diff --git a/src/alisolarflare/creativeboundaries/Listener_PlotChange.java b/src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java similarity index 84% rename from src/alisolarflare/creativeboundaries/Listener_PlotChange.java rename to src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java index 980bdb6..e911b98 100644 --- a/src/alisolarflare/creativeboundaries/Listener_PlotChange.java +++ b/src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java @@ -1,67 +1,69 @@ -package alisolarflare.creativeboundaries; - -import org.bukkit.GameMode; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; - -import com.palmergames.bukkit.towny.event.PlayerChangePlotEvent; -import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; -import com.palmergames.bukkit.towny.object.Resident; -import com.palmergames.bukkit.towny.object.Town; -import com.palmergames.bukkit.towny.object.TownBlock; -import com.palmergames.bukkit.towny.object.TownyUniverse; - -public class Listener_PlotChange implements Listener{ - public Module_CreativeBoundaries module; - public Listener_PlotChange(Module_CreativeBoundaries module){ - this.module = module; - } - @EventHandler - public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ - Player player = plotEvent.getPlayer(); - if (module.dickmode == false){ - return; - } - if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){ - return; - } - if (!(module.cbCreatives.contains(plotEvent.getPlayer()))){ - return; - } - TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); - if (tb == null) { - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!"); - module.cbCreatives.remove(player); - return; - } - Town town; - try { - town = tb.getTown(); - } catch (NotRegisteredException e) { - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!!"); - module.cbCreatives.remove(player); - return; - } - - if (town == null) { - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!!!"); - module.cbCreatives.remove(player); - return; - } - boolean townHasRes = false; - for(Resident res : town.getResidents()){ - if (res.getName().toString().equals(player.getName().toString())){ - townHasRes = true; - } - } - if (!townHasRes){ - player.setGameMode(GameMode.SURVIVAL); - player.sendMessage("You have left your town boundaries!!!!"); - module.cbCreatives.remove(player); - } - } -} +package alisolarflare.creativeboundaries.listeners; + +import org.bukkit.GameMode; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; + +import com.palmergames.bukkit.towny.event.PlayerChangePlotEvent; +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.Resident; +import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.towny.object.TownBlock; +import com.palmergames.bukkit.towny.object.TownyUniverse; + +import alisolarflare.creativeboundaries.CreativeBoundariesModule; + +public class PlotChangeListener implements Listener{ + public CreativeBoundariesModule module; + public PlotChangeListener(CreativeBoundariesModule module){ + this.module = module; + } + @EventHandler + public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ + Player player = plotEvent.getPlayer(); + if (module.dickmode == false){ + return; + } + if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){ + return; + } + if (!(module.cbCreatives.contains(plotEvent.getPlayer()))){ + return; + } + TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); + if (tb == null) { + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!"); + module.cbCreatives.remove(player); + return; + } + Town town; + try { + town = tb.getTown(); + } catch (NotRegisteredException e) { + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!!"); + module.cbCreatives.remove(player); + return; + } + + if (town == null) { + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!!!"); + module.cbCreatives.remove(player); + return; + } + boolean townHasRes = false; + for(Resident res : town.getResidents()){ + if (res.getName().toString().equals(player.getName().toString())){ + townHasRes = true; + } + } + if (!townHasRes){ + player.setGameMode(GameMode.SURVIVAL); + player.sendMessage("You have left your town boundaries!!!!"); + module.cbCreatives.remove(player); + } + } +} diff --git a/src/alisolarflare/easyuhc/EasyUHCModule.java b/src/alisolarflare/easyuhc/EasyUHCModule.java new file mode 100644 index 0000000..408e909 --- /dev/null +++ b/src/alisolarflare/easyuhc/EasyUHCModule.java @@ -0,0 +1,24 @@ +package alisolarflare.easyuhc; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.easyuhc.commands.ActivatePowers; +import alisolarflare.easyuhc.commands.SetupWorldBorders; +import alisolarflare.easyuhc.commands.SpreadPlayers; +import alisolarflare.easyuhc.commands.StartTimer; +import alisolarflare.easyuhc.commands.StartUHC; +import alisolarflare.easyuhc.commands.TeleportToUHC; + +public class EasyUHCModule extends Module{ + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new ActivatePowers()); + registerCommand(plugin, new SetupWorldBorders()); + registerCommand(plugin, new SetupWorldBorders()); + registerCommand(plugin, new SpreadPlayers()); + registerCommand(plugin, new StartTimer()); + registerCommand(plugin, new StartUHC()); + registerCommand(plugin, new TeleportToUHC()); + } +} diff --git a/src/alisolarflare/easyuhc/Module_EasyUHC.java b/src/alisolarflare/easyuhc/Module_EasyUHC.java deleted file mode 100644 index 4ad1b1a..0000000 --- a/src/alisolarflare/easyuhc/Module_EasyUHC.java +++ /dev/null @@ -1,18 +0,0 @@ -package alisolarflare.easyuhc; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; - -public class Module_EasyUHC extends Module{ - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new Command_ActivatePowers()); - registerCommand(plugin, new Command_SetupWorldBorders()); - registerCommand(plugin, new Command_SetupWorldBorders()); - registerCommand(plugin, new Command_SpreadPlayers()); - registerCommand(plugin, new Command_StartTimer()); - registerCommand(plugin, new Command_StartUHC()); - registerCommand(plugin, new Command_TeleportToUHC()); - } -} diff --git a/src/alisolarflare/easyuhc/Command_ActivatePowers.java b/src/alisolarflare/easyuhc/commands/ActivatePowers.java similarity index 85% rename from src/alisolarflare/easyuhc/Command_ActivatePowers.java rename to src/alisolarflare/easyuhc/commands/ActivatePowers.java index 26789ce..737ac72 100644 --- a/src/alisolarflare/easyuhc/Command_ActivatePowers.java +++ b/src/alisolarflare/easyuhc/commands/ActivatePowers.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc; +package alisolarflare.easyuhc.commands; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class Command_ActivatePowers extends TBMCCommandBase{ +public class ActivatePowers extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/Command_SetupWorldBorders.java b/src/alisolarflare/easyuhc/commands/SetupWorldBorders.java similarity index 85% rename from src/alisolarflare/easyuhc/Command_SetupWorldBorders.java rename to src/alisolarflare/easyuhc/commands/SetupWorldBorders.java index db45dc0..ef90ae8 100644 --- a/src/alisolarflare/easyuhc/Command_SetupWorldBorders.java +++ b/src/alisolarflare/easyuhc/commands/SetupWorldBorders.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc; +package alisolarflare.easyuhc.commands; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class Command_SetupWorldBorders extends TBMCCommandBase { +public class SetupWorldBorders extends TBMCCommandBase { @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/Command_ShrinkWorldBorders.java b/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java similarity index 85% rename from src/alisolarflare/easyuhc/Command_ShrinkWorldBorders.java rename to src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java index b25bf11..bd083a6 100644 --- a/src/alisolarflare/easyuhc/Command_ShrinkWorldBorders.java +++ b/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc; +package alisolarflare.easyuhc.commands; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class Command_ShrinkWorldBorders extends TBMCCommandBase { +public class ShrinkWorldBorders extends TBMCCommandBase { @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/Command_SpreadPlayers.java b/src/alisolarflare/easyuhc/commands/SpreadPlayers.java similarity index 85% rename from src/alisolarflare/easyuhc/Command_SpreadPlayers.java rename to src/alisolarflare/easyuhc/commands/SpreadPlayers.java index f83e70a..a5798ac 100644 --- a/src/alisolarflare/easyuhc/Command_SpreadPlayers.java +++ b/src/alisolarflare/easyuhc/commands/SpreadPlayers.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc; +package alisolarflare.easyuhc.commands; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class Command_SpreadPlayers extends TBMCCommandBase{ +public class SpreadPlayers extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/Command_StartTimer.java b/src/alisolarflare/easyuhc/commands/StartTimer.java similarity index 86% rename from src/alisolarflare/easyuhc/Command_StartTimer.java rename to src/alisolarflare/easyuhc/commands/StartTimer.java index 96dad6f..927344e 100644 --- a/src/alisolarflare/easyuhc/Command_StartTimer.java +++ b/src/alisolarflare/easyuhc/commands/StartTimer.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc; +package alisolarflare.easyuhc.commands; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class Command_StartTimer extends TBMCCommandBase{ +public class StartTimer extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/Command_StartUHC.java b/src/alisolarflare/easyuhc/commands/StartUHC.java similarity index 86% rename from src/alisolarflare/easyuhc/Command_StartUHC.java rename to src/alisolarflare/easyuhc/commands/StartUHC.java index 7cc116d..2a06889 100644 --- a/src/alisolarflare/easyuhc/Command_StartUHC.java +++ b/src/alisolarflare/easyuhc/commands/StartUHC.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc; +package alisolarflare.easyuhc.commands; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class Command_StartUHC extends TBMCCommandBase{ +public class StartUHC extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/Command_TeleportToUHC.java b/src/alisolarflare/easyuhc/commands/TeleportToUHC.java similarity index 85% rename from src/alisolarflare/easyuhc/Command_TeleportToUHC.java rename to src/alisolarflare/easyuhc/commands/TeleportToUHC.java index 3f46306..5a5c6d0 100644 --- a/src/alisolarflare/easyuhc/Command_TeleportToUHC.java +++ b/src/alisolarflare/easyuhc/commands/TeleportToUHC.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc; +package alisolarflare.easyuhc.commands; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public class Command_TeleportToUHC extends TBMCCommandBase{ +public class TeleportToUHC extends TBMCCommandBase{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/magic/MagicModule.java b/src/alisolarflare/magic/MagicModule.java index 9a83bd0..616b179 100644 --- a/src/alisolarflare/magic/MagicModule.java +++ b/src/alisolarflare/magic/MagicModule.java @@ -3,6 +3,9 @@ package alisolarflare.magic; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; +import alisolarflare.magic.tricks.AliArrowListener; +import alisolarflare.magic.tricks.BoomBowDeathListener; +import alisolarflare.magic.tricks.BoomBowListener; public class MagicModule extends Module{ diff --git a/src/alisolarflare/magic/AliArrowListener.java b/src/alisolarflare/magic/tricks/AliArrowListener.java similarity index 92% rename from src/alisolarflare/magic/AliArrowListener.java rename to src/alisolarflare/magic/tricks/AliArrowListener.java index ecd79e6..36b8e12 100644 --- a/src/alisolarflare/magic/AliArrowListener.java +++ b/src/alisolarflare/magic/tricks/AliArrowListener.java @@ -1,39 +1,39 @@ -package alisolarflare.magic; - -import org.bukkit.entity.Arrow; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.ProjectileLaunchEvent; -import org.bukkit.plugin.java.JavaPlugin; - -public class AliArrowListener implements Listener { - private final JavaPlugin plugin; - - public AliArrowListener(JavaPlugin plugin){ - this.plugin = plugin; - } - - @EventHandler - public void onProjectileLaunch(ProjectileLaunchEvent event){ - if(event.getEntity().getType() != EntityType.ARROW){ - return; - } - Arrow arrow = (Arrow) event.getEntity(); - if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player)){ - return; - } - - String user = ((Player) arrow.getShooter()).getName(); - - for (String permittedUser : AliArrowTask.permittedUsers){ - if(permittedUser.equalsIgnoreCase(user)){ - new AliArrowTask(arrow,user).runTaskTimer(plugin, 2, 1); - break; - } - } - return; - - } +package alisolarflare.magic.tricks; + +import org.bukkit.entity.Arrow; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.ProjectileLaunchEvent; +import org.bukkit.plugin.java.JavaPlugin; + +public class AliArrowListener implements Listener { + private final JavaPlugin plugin; + + public AliArrowListener(JavaPlugin plugin){ + this.plugin = plugin; + } + + @EventHandler + public void onProjectileLaunch(ProjectileLaunchEvent event){ + if(event.getEntity().getType() != EntityType.ARROW){ + return; + } + Arrow arrow = (Arrow) event.getEntity(); + if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player)){ + return; + } + + String user = ((Player) arrow.getShooter()).getName(); + + for (String permittedUser : AliArrowTask.permittedUsers){ + if(permittedUser.equalsIgnoreCase(user)){ + new AliArrowTask(arrow,user).runTaskTimer(plugin, 2, 1); + break; + } + } + return; + + } } \ No newline at end of file diff --git a/src/alisolarflare/magic/AliArrowTask.java b/src/alisolarflare/magic/tricks/AliArrowTask.java similarity index 92% rename from src/alisolarflare/magic/AliArrowTask.java rename to src/alisolarflare/magic/tricks/AliArrowTask.java index 055a4fd..10252b8 100644 --- a/src/alisolarflare/magic/AliArrowTask.java +++ b/src/alisolarflare/magic/tricks/AliArrowTask.java @@ -1,40 +1,40 @@ -package alisolarflare.magic; - -import org.bukkit.Particle; -import org.bukkit.entity.Arrow; -import org.bukkit.scheduler.BukkitRunnable; - -public class AliArrowTask extends BukkitRunnable { - static String[] permittedUsers = {"alisolarflare", "Zanthr", "NorbiPeti"}; - String name; - Arrow arrow; - - public AliArrowTask(Arrow arrow, String name) { - this.name = name; - this.arrow = arrow; - } - - @Override - public void run() { - if (arrow.isOnGround() || arrow.isDead()) { - this.cancel(); - } - - switch(name.toLowerCase()){ - case "alisolarflare": - arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1); - break; - - case "zanthr": - arrow.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, arrow.getLocation(), 1); - arrow.getWorld().spawnParticle(Particle.FLAME, arrow.getLocation(), 1); - break; - - case "norbipeti": - arrow.getWorld().spawnParticle(Particle.LAVA, arrow.getLocation(), 1); - break; - } - - } - -} +package alisolarflare.magic.tricks; + +import org.bukkit.Particle; +import org.bukkit.entity.Arrow; +import org.bukkit.scheduler.BukkitRunnable; + +public class AliArrowTask extends BukkitRunnable { + static String[] permittedUsers = {"alisolarflare", "Zanthr", "NorbiPeti"}; + String name; + Arrow arrow; + + public AliArrowTask(Arrow arrow, String name) { + this.name = name; + this.arrow = arrow; + } + + @Override + public void run() { + if (arrow.isOnGround() || arrow.isDead()) { + this.cancel(); + } + + switch(name.toLowerCase()){ + case "alisolarflare": + arrow.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, arrow.getLocation(), 1); + break; + + case "zanthr": + arrow.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, arrow.getLocation(), 1); + arrow.getWorld().spawnParticle(Particle.FLAME, arrow.getLocation(), 1); + break; + + case "norbipeti": + arrow.getWorld().spawnParticle(Particle.LAVA, arrow.getLocation(), 1); + break; + } + + } + +} diff --git a/src/alisolarflare/magic/BoomBowDeathListener.java b/src/alisolarflare/magic/tricks/BoomBowDeathListener.java similarity index 90% rename from src/alisolarflare/magic/BoomBowDeathListener.java rename to src/alisolarflare/magic/tricks/BoomBowDeathListener.java index f16d3c1..427537e 100644 --- a/src/alisolarflare/magic/BoomBowDeathListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowDeathListener.java @@ -1,18 +1,18 @@ -package alisolarflare.magic; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.PlayerDeathEvent; - -public class BoomBowDeathListener implements Listener{ - @EventHandler - public void onBoomBowDeath(PlayerDeathEvent event){ - Player player = event.getEntity(); - - if (player.getLastDamage() > 7.42420 && player.getLastDamage() < 7.42429){ - player.sendMessage("42!"); - event.setDeathMessage(player.getName() + " got trigger happy with the [Boom Bow]"); - } - } -} +package alisolarflare.magic.tricks; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.PlayerDeathEvent; + +public class BoomBowDeathListener implements Listener{ + @EventHandler + public void onBoomBowDeath(PlayerDeathEvent event){ + Player player = event.getEntity(); + + if (player.getLastDamage() > 7.42420 && player.getLastDamage() < 7.42429){ + player.sendMessage("42!"); + event.setDeathMessage(player.getName() + " got trigger happy with the [Boom Bow]"); + } + } +} diff --git a/src/alisolarflare/magic/BoomBowListener.java b/src/alisolarflare/magic/tricks/BoomBowListener.java similarity index 95% rename from src/alisolarflare/magic/BoomBowListener.java rename to src/alisolarflare/magic/tricks/BoomBowListener.java index 8381927..5e74bd8 100644 --- a/src/alisolarflare/magic/BoomBowListener.java +++ b/src/alisolarflare/magic/tricks/BoomBowListener.java @@ -1,107 +1,107 @@ -package alisolarflare.magic; - -import org.bukkit.GameMode; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Particle; -import org.bukkit.Sound; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; - -public class BoomBowListener implements Listener { - JavaPlugin plugin; - public BoomBowListener(JavaPlugin plugin){ - this.plugin = plugin; - } - @EventHandler - public void ClickEvent(PlayerInteractEvent event){ - FlyBowBoost(event); - - } - public void FlyBowBoost(PlayerInteractEvent event){ - - //ACTION SANITATION - if(!(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK)) return; - if(!(event.getPlayer().isGliding())) return; - if(!(event.getMaterial() == Material.BOW)) return; - - //BOW SANITATION - ItemStack bow = event.getItem(); - if(!(bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK))) return; - if(!(bow.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) == 3)) return; - if(!(bow.getItemMeta().getDisplayName().contains("BOOM BOW"))) return; - - //PLAYER SANITATION - Player player = event.getPlayer(); - if(player.getGameMode().equals(GameMode.CREATIVE))return; - - if(bow.containsEnchantment(Enchantment.ARROW_INFINITE)){ - //HAS INIFINITY - Activate(event); - - }else if((player.getInventory().contains(Material.TNT))){ - //HAS TNT - Activate(event); - - //Reduce tnt by 1 - int tntSlot = player.getInventory().first(Material.TNT); - ItemStack tntStack = player.getInventory().getItem(tntSlot); - if(tntStack.getAmount() > 3){ - tntStack.setAmount(tntStack.getAmount()-3); - }else{ - player.getInventory().remove(tntStack); - } - - }else{ - return; - } - } - - - - public void Activate(PlayerInteractEvent event){ - //INIT - Player variables - Player player = event.getPlayer(); - Location playerLocation = player.getLocation(); - ItemStack boomBow = player.getInventory().getItemInMainHand(); - - //TODO: NERF - boomDecay - //TODO: NERF - endCrystal - //TODO: NERF - healthReduction - //TODO: NERF - localized - - if(BoomBowRule.boomDecay) - new BoomDecayTask(player).runTaskTimer(plugin, 1, 1); - if(BoomBowRule.endCrystal){ - //BoomBowCyrstalSpawn - } - if(BoomBowRule.healthReduction){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1)); - } - if(BoomBowRule.localized); - - - //SET - Player Velocity - player.setVelocity(playerLocation.getDirection().normalize().multiply(3.0)); - - //CREATE - Explosion + damage - player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); - player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); - player.damage(7.42425, player); - player.sendMessage(player.getLastDamage() + ""); - boomBow.setDurability((short) (boomBow.getDurability() + 3)); - if(boomBow.getDurability() < 0){ - player.getInventory().setItemInMainHand(null); - player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0); - } - - } -} +package alisolarflare.magic.tricks; + +import org.bukkit.GameMode; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Particle; +import org.bukkit.Sound; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +public class BoomBowListener implements Listener { + JavaPlugin plugin; + public BoomBowListener(JavaPlugin plugin){ + this.plugin = plugin; + } + @EventHandler + public void ClickEvent(PlayerInteractEvent event){ + FlyBowBoost(event); + + } + public void FlyBowBoost(PlayerInteractEvent event){ + + //ACTION SANITATION + if(!(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK)) return; + if(!(event.getPlayer().isGliding())) return; + if(!(event.getMaterial() == Material.BOW)) return; + + //BOW SANITATION + ItemStack bow = event.getItem(); + if(!(bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK))) return; + if(!(bow.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) == 3)) return; + if(!(bow.getItemMeta().getDisplayName().contains("BOOM BOW"))) return; + + //PLAYER SANITATION + Player player = event.getPlayer(); + if(player.getGameMode().equals(GameMode.CREATIVE))return; + + if(bow.containsEnchantment(Enchantment.ARROW_INFINITE)){ + //HAS INIFINITY + Activate(event); + + }else if((player.getInventory().contains(Material.TNT))){ + //HAS TNT + Activate(event); + + //Reduce tnt by 1 + int tntSlot = player.getInventory().first(Material.TNT); + ItemStack tntStack = player.getInventory().getItem(tntSlot); + if(tntStack.getAmount() > 3){ + tntStack.setAmount(tntStack.getAmount()-3); + }else{ + player.getInventory().remove(tntStack); + } + + }else{ + return; + } + } + + + + public void Activate(PlayerInteractEvent event){ + //INIT - Player variables + Player player = event.getPlayer(); + Location playerLocation = player.getLocation(); + ItemStack boomBow = player.getInventory().getItemInMainHand(); + + //TODO: NERF - boomDecay + //TODO: NERF - endCrystal + //TODO: NERF - healthReduction + //TODO: NERF - localized + + if(BoomBowRule.boomDecay) + new BoomDecayTask(player).runTaskTimer(plugin, 1, 1); + if(BoomBowRule.endCrystal){ + //BoomBowCyrstalSpawn + } + if(BoomBowRule.healthReduction){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1)); + } + if(BoomBowRule.localized); + + + //SET - Player Velocity + player.setVelocity(playerLocation.getDirection().normalize().multiply(3.0)); + + //CREATE - Explosion + damage + player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); + player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); + player.damage(7.42425, player); + player.sendMessage(player.getLastDamage() + ""); + boomBow.setDurability((short) (boomBow.getDurability() + 3)); + if(boomBow.getDurability() < 0){ + player.getInventory().setItemInMainHand(null); + player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0); + } + + } +} diff --git a/src/alisolarflare/magic/BoomBowRule.java b/src/alisolarflare/magic/tricks/BoomBowRule.java similarity index 95% rename from src/alisolarflare/magic/BoomBowRule.java rename to src/alisolarflare/magic/tricks/BoomBowRule.java index caa0256..bbfbf8f 100644 --- a/src/alisolarflare/magic/BoomBowRule.java +++ b/src/alisolarflare/magic/tricks/BoomBowRule.java @@ -1,84 +1,84 @@ -package alisolarflare.magic; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import buttondevteam.lib.chat.TBMCCommandBase; -//HEHEHHEHEH EAASSSTER EGGS -public class BoomBowRule extends TBMCCommandBase{ - public static boolean boomDecay; - public static boolean healthReduction; - public static boolean endCrystal; - public static boolean localized;; - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (sender instanceof Player == false){ - sender.sendMessage("You must be a player to use this command"); - return false; - } - Player player = (Player) sender; - if (player.getName().equals("alisolarflare") == false){ - player.sendMessage("You must be alisolarflare to use this command"); - return false; - } - if (args.length < 2){ - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); - player.sendMessage("Rules:"); - player.sendMessage("boomDecay" + boomDecay); - player.sendMessage("healthReduction" + healthReduction); - player.sendMessage("endCrystal" + endCrystal); - player.sendMessage("localized" + localized); - return false; - } - if(!(args[1].startsWith("t")|| args[1].startsWith("f"))){ - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); - return false; - } - boolean gameRule = false; - if(args[1].startsWith("t") || args[1].startsWith("T")){ - gameRule = true; - } - switch(args[0]){ - case "boomDecay": - boomDecay = gameRule; - break; - case "healthReduction": - healthReduction = gameRule; - break; - case "endCrystal": - endCrystal = gameRule; - break; - case "localized": - localized = gameRule; - break; - default: - player.sendMessage("Error: "+args[0]+" not defined as a rule"); - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); - player.sendMessage("Rule settings: boomDecay, healthReduction, endCrystal, localized"); - break; - } - - return false; - } - @Override - public String GetCommandPath() { - // TODO Auto-generated method stub - return null; - } - @Override - public String[] GetHelpText(String arg0) { - // TODO Auto-generated method stub - return null; - } - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.magic.tricks; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import buttondevteam.lib.chat.TBMCCommandBase; +//HEHEHHEHEH EAASSSTER EGGS +public class BoomBowRule extends TBMCCommandBase{ + public static boolean boomDecay; + public static boolean healthReduction; + public static boolean endCrystal; + public static boolean localized;; + @Override + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if (sender instanceof Player == false){ + sender.sendMessage("You must be a player to use this command"); + return false; + } + Player player = (Player) sender; + if (player.getName().equals("alisolarflare") == false){ + player.sendMessage("You must be alisolarflare to use this command"); + return false; + } + if (args.length < 2){ + player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); + player.sendMessage("Rules:"); + player.sendMessage("boomDecay" + boomDecay); + player.sendMessage("healthReduction" + healthReduction); + player.sendMessage("endCrystal" + endCrystal); + player.sendMessage("localized" + localized); + return false; + } + if(!(args[1].startsWith("t")|| args[1].startsWith("f"))){ + player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); + return false; + } + boolean gameRule = false; + if(args[1].startsWith("t") || args[1].startsWith("T")){ + gameRule = true; + } + switch(args[0]){ + case "boomDecay": + boomDecay = gameRule; + break; + case "healthReduction": + healthReduction = gameRule; + break; + case "endCrystal": + endCrystal = gameRule; + break; + case "localized": + localized = gameRule; + break; + default: + player.sendMessage("Error: "+args[0]+" not defined as a rule"); + player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); + player.sendMessage("Rule settings: boomDecay, healthReduction, endCrystal, localized"); + break; + } + + return false; + } + @Override + public String GetCommandPath() { + // TODO Auto-generated method stub + return null; + } + @Override + public String[] GetHelpText(String arg0) { + // TODO Auto-generated method stub + return null; + } + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/magic/BoomDecayTask.java b/src/alisolarflare/magic/tricks/BoomDecayTask.java similarity index 88% rename from src/alisolarflare/magic/BoomDecayTask.java rename to src/alisolarflare/magic/tricks/BoomDecayTask.java index 2d128f9..5f1875c 100644 --- a/src/alisolarflare/magic/BoomDecayTask.java +++ b/src/alisolarflare/magic/tricks/BoomDecayTask.java @@ -1,25 +1,25 @@ -package alisolarflare.magic; - -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; - -public class BoomDecayTask extends BukkitRunnable{ - Player player; - private int ticksSinceStart = 0; - private final int effectLength = 20; - public BoomDecayTask(Player player){ - this.player = player; - } - //runs every tick - @Override - public void run() { - if (ticksSinceStart > effectLength){ - this.cancel(); - } - player.sendMessage(player.getVelocity().toString()); - - ticksSinceStart++; - - } - -} +package alisolarflare.magic.tricks; + +import org.bukkit.entity.Player; +import org.bukkit.scheduler.BukkitRunnable; + +public class BoomDecayTask extends BukkitRunnable{ + Player player; + private int ticksSinceStart = 0; + private final int effectLength = 20; + public BoomDecayTask(Player player){ + this.player = player; + } + //runs every tick + @Override + public void run() { + if (ticksSinceStart > effectLength){ + this.cancel(); + } + player.sendMessage(player.getVelocity().toString()); + + ticksSinceStart++; + + } + +} From 17c6c1026514a1938218552dc98d96f2cb0d2bad Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 11 Nov 2016 13:43:28 -0500 Subject: [PATCH 109/263] Spaces, not Tabs --- plugin.yml | 2 +- .../commands/{SetupWorldBorders.java => SetWorldBorders.java} | 0 .../{components => easyuhc}/gpowers/GPowerMemory.java | 0 .../{components => easyuhc}/gpowers/GPowerModule.java | 0 .../{components => easyuhc}/gpowers/commands/GPower.java | 0 .../{components => easyuhc}/gpowers/commands/PowerDown.java | 0 .../{components => easyuhc}/gpowers/commands/PowerUp.java | 0 .../gpowers/listeners/gPowerApplyingTask.java | 0 .../gpowers/listeners/gPowerListener.java | 0 9 files changed, 1 insertion(+), 1 deletion(-) rename src/alisolarflare/easyuhc/commands/{SetupWorldBorders.java => SetWorldBorders.java} (100%) rename src/alisolarflare/{components => easyuhc}/gpowers/GPowerMemory.java (100%) rename src/alisolarflare/{components => easyuhc}/gpowers/GPowerModule.java (100%) rename src/alisolarflare/{components => easyuhc}/gpowers/commands/GPower.java (100%) rename src/alisolarflare/{components => easyuhc}/gpowers/commands/PowerDown.java (100%) rename src/alisolarflare/{components => easyuhc}/gpowers/commands/PowerUp.java (100%) rename src/alisolarflare/{components => easyuhc}/gpowers/listeners/gPowerApplyingTask.java (100%) rename src/alisolarflare/{components => easyuhc}/gpowers/listeners/gPowerListener.java (100%) diff --git a/plugin.yml b/plugin.yml index 2bf7be2..8765a40 100644 --- a/plugin.yml +++ b/plugin.yml @@ -30,7 +30,7 @@ commands: setcolourspawn: description: sets the spawn points for each colour in a button minigame setmatchstate: - description: sets the current state of the ultrahardcore game. + description: sets the current state of the ultrahardcore game. addtouhc: description: Adds a player to the UltraHardcore match joinuhc: diff --git a/src/alisolarflare/easyuhc/commands/SetupWorldBorders.java b/src/alisolarflare/easyuhc/commands/SetWorldBorders.java similarity index 100% rename from src/alisolarflare/easyuhc/commands/SetupWorldBorders.java rename to src/alisolarflare/easyuhc/commands/SetWorldBorders.java diff --git a/src/alisolarflare/components/gpowers/GPowerMemory.java b/src/alisolarflare/easyuhc/gpowers/GPowerMemory.java similarity index 100% rename from src/alisolarflare/components/gpowers/GPowerMemory.java rename to src/alisolarflare/easyuhc/gpowers/GPowerMemory.java diff --git a/src/alisolarflare/components/gpowers/GPowerModule.java b/src/alisolarflare/easyuhc/gpowers/GPowerModule.java similarity index 100% rename from src/alisolarflare/components/gpowers/GPowerModule.java rename to src/alisolarflare/easyuhc/gpowers/GPowerModule.java diff --git a/src/alisolarflare/components/gpowers/commands/GPower.java b/src/alisolarflare/easyuhc/gpowers/commands/GPower.java similarity index 100% rename from src/alisolarflare/components/gpowers/commands/GPower.java rename to src/alisolarflare/easyuhc/gpowers/commands/GPower.java diff --git a/src/alisolarflare/components/gpowers/commands/PowerDown.java b/src/alisolarflare/easyuhc/gpowers/commands/PowerDown.java similarity index 100% rename from src/alisolarflare/components/gpowers/commands/PowerDown.java rename to src/alisolarflare/easyuhc/gpowers/commands/PowerDown.java diff --git a/src/alisolarflare/components/gpowers/commands/PowerUp.java b/src/alisolarflare/easyuhc/gpowers/commands/PowerUp.java similarity index 100% rename from src/alisolarflare/components/gpowers/commands/PowerUp.java rename to src/alisolarflare/easyuhc/gpowers/commands/PowerUp.java diff --git a/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java similarity index 100% rename from src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java rename to src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java diff --git a/src/alisolarflare/components/gpowers/listeners/gPowerListener.java b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java similarity index 100% rename from src/alisolarflare/components/gpowers/listeners/gPowerListener.java rename to src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java From 02f19712ae6de5f3cd5b54817131f56a65867fb0 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 11 Nov 2016 13:43:39 -0500 Subject: [PATCH 110/263] Shoved Gpowers into EasyUHC --- src/alisolarflare/AliPresents.java | 2 +- src/alisolarflare/DevCommand.java | 26 +++++++++ src/alisolarflare/easyuhc/EasyUHCModule.java | 52 +++++++++--------- .../easyuhc/commands/ActivatePowers.java | 52 +++++++----------- .../easyuhc/commands/SetUHCLobby.java | 27 ++++++++++ .../easyuhc/commands/SetWorldBorders.java | 53 +++++++----------- .../easyuhc/commands/ShrinkWorldBorders.java | 53 +++++++----------- .../easyuhc/commands/SpreadPlayers.java | 54 ++++++++----------- .../easyuhc/commands/StartTimer.java | 53 +++++++----------- .../easyuhc/commands/StartUHC.java | 53 +++++++----------- .../easyuhc/commands/TeleportToUHC.java | 53 +++++++----------- .../easyuhc/gpowers/GPowerMemory.java | 2 +- .../easyuhc/gpowers/GPowerModule.java | 10 ++-- .../easyuhc/gpowers/commands/GPower.java | 4 +- .../easyuhc/gpowers/commands/PowerDown.java | 4 +- .../easyuhc/gpowers/commands/PowerUp.java | 4 +- .../gpowers/listeners/gPowerApplyingTask.java | 4 +- .../gpowers/listeners/gPowerListener.java | 4 +- 18 files changed, 238 insertions(+), 272 deletions(-) create mode 100644 src/alisolarflare/DevCommand.java create mode 100644 src/alisolarflare/easyuhc/commands/SetUHCLobby.java diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 2af4284..04b65fc 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -7,10 +7,10 @@ import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.flairdoor.FlairDoorModule; -import alisolarflare.components.gpowers.GPowerModule; import alisolarflare.components.links.AliLinkModule; import alisolarflare.creativeboundaries.CreativeBoundariesModule; import alisolarflare.easyuhc.EasyUHCModule; +import alisolarflare.easyuhc.gpowers.GPowerModule; import alisolarflare.magic.MagicModule; import alisolarflare.minigames.MinigameModule; diff --git a/src/alisolarflare/DevCommand.java b/src/alisolarflare/DevCommand.java new file mode 100644 index 0000000..a4c5091 --- /dev/null +++ b/src/alisolarflare/DevCommand.java @@ -0,0 +1,26 @@ +package alisolarflare; + +import org.bukkit.command.CommandSender; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public abstract class DevCommand extends TBMCCommandBase{ + + @Override + public abstract boolean OnCommand(CommandSender sender, String alias, String[] args); + + @Override + public abstract String[] GetHelpText(String alias); + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return true; + } +} diff --git a/src/alisolarflare/easyuhc/EasyUHCModule.java b/src/alisolarflare/easyuhc/EasyUHCModule.java index 408e909..b96d80b 100644 --- a/src/alisolarflare/easyuhc/EasyUHCModule.java +++ b/src/alisolarflare/easyuhc/EasyUHCModule.java @@ -1,24 +1,28 @@ -package alisolarflare.easyuhc; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.easyuhc.commands.ActivatePowers; -import alisolarflare.easyuhc.commands.SetupWorldBorders; -import alisolarflare.easyuhc.commands.SpreadPlayers; -import alisolarflare.easyuhc.commands.StartTimer; -import alisolarflare.easyuhc.commands.StartUHC; -import alisolarflare.easyuhc.commands.TeleportToUHC; - -public class EasyUHCModule extends Module{ - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new ActivatePowers()); - registerCommand(plugin, new SetupWorldBorders()); - registerCommand(plugin, new SetupWorldBorders()); - registerCommand(plugin, new SpreadPlayers()); - registerCommand(plugin, new StartTimer()); - registerCommand(plugin, new StartUHC()); - registerCommand(plugin, new TeleportToUHC()); - } -} +package alisolarflare.easyuhc; + +import org.bukkit.Location; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.Module; +import alisolarflare.easyuhc.commands.ActivatePowers; +import alisolarflare.easyuhc.commands.SetUHCLobby; +import alisolarflare.easyuhc.commands.SetWorldBorders; +import alisolarflare.easyuhc.commands.SpreadPlayers; +import alisolarflare.easyuhc.commands.StartTimer; +import alisolarflare.easyuhc.commands.StartUHC; +import alisolarflare.easyuhc.commands.TeleportToUHC; + +public class EasyUHCModule extends Module{ + public Location lobbyLocation; + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new ActivatePowers()); + registerCommand(plugin, new SetUHCLobby(this)); + registerCommand(plugin, new SetWorldBorders()); + registerCommand(plugin, new SetWorldBorders()); + registerCommand(plugin, new SpreadPlayers()); + registerCommand(plugin, new StartTimer()); + registerCommand(plugin, new StartUHC()); + registerCommand(plugin, new TeleportToUHC()); + } +} diff --git a/src/alisolarflare/easyuhc/commands/ActivatePowers.java b/src/alisolarflare/easyuhc/commands/ActivatePowers.java index 737ac72..8f78fa1 100644 --- a/src/alisolarflare/easyuhc/commands/ActivatePowers.java +++ b/src/alisolarflare/easyuhc/commands/ActivatePowers.java @@ -1,33 +1,19 @@ -package alisolarflare.easyuhc.commands; - -import org.bukkit.command.CommandSender; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class ActivatePowers extends TBMCCommandBase{ - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.easyuhc.commands; + +import org.bukkit.command.CommandSender; + +import alisolarflare.DevCommand; + +public class ActivatePowers extends DevCommand{ + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } +} diff --git a/src/alisolarflare/easyuhc/commands/SetUHCLobby.java b/src/alisolarflare/easyuhc/commands/SetUHCLobby.java new file mode 100644 index 0000000..72609eb --- /dev/null +++ b/src/alisolarflare/easyuhc/commands/SetUHCLobby.java @@ -0,0 +1,27 @@ +package alisolarflare.easyuhc.commands; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.DevCommand; +import alisolarflare.easyuhc.EasyUHCModule; + +public class SetUHCLobby extends DevCommand{ + EasyUHCModule module; + public SetUHCLobby(EasyUHCModule easyUHCModule) { + this.module = easyUHCModule; + } + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + module.lobbyLocation = ((Player) sender).getLocation(); + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/alisolarflare/easyuhc/commands/SetWorldBorders.java b/src/alisolarflare/easyuhc/commands/SetWorldBorders.java index ef90ae8..0f66241 100644 --- a/src/alisolarflare/easyuhc/commands/SetWorldBorders.java +++ b/src/alisolarflare/easyuhc/commands/SetWorldBorders.java @@ -1,33 +1,20 @@ -package alisolarflare.easyuhc.commands; - -import org.bukkit.command.CommandSender; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class SetupWorldBorders extends TBMCCommandBase { - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.easyuhc.commands; + +import org.bukkit.command.CommandSender; + +import alisolarflare.DevCommand; + +public class SetWorldBorders extends DevCommand { + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } +} diff --git a/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java b/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java index bd083a6..76f993b 100644 --- a/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java +++ b/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java @@ -1,33 +1,20 @@ -package alisolarflare.easyuhc.commands; - -import org.bukkit.command.CommandSender; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class ShrinkWorldBorders extends TBMCCommandBase { - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.easyuhc.commands; + +import org.bukkit.command.CommandSender; + +import alisolarflare.DevCommand; + +public class ShrinkWorldBorders extends DevCommand { + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } +} diff --git a/src/alisolarflare/easyuhc/commands/SpreadPlayers.java b/src/alisolarflare/easyuhc/commands/SpreadPlayers.java index a5798ac..2b3cb12 100644 --- a/src/alisolarflare/easyuhc/commands/SpreadPlayers.java +++ b/src/alisolarflare/easyuhc/commands/SpreadPlayers.java @@ -1,33 +1,21 @@ -package alisolarflare.easyuhc.commands; - -import org.bukkit.command.CommandSender; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class SpreadPlayers extends TBMCCommandBase{ - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.easyuhc.commands; + +import org.bukkit.command.CommandSender; + +import alisolarflare.DevCommand; + +public class SpreadPlayers extends DevCommand{ + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/alisolarflare/easyuhc/commands/StartTimer.java b/src/alisolarflare/easyuhc/commands/StartTimer.java index 927344e..c7c613c 100644 --- a/src/alisolarflare/easyuhc/commands/StartTimer.java +++ b/src/alisolarflare/easyuhc/commands/StartTimer.java @@ -1,33 +1,20 @@ -package alisolarflare.easyuhc.commands; - -import org.bukkit.command.CommandSender; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class StartTimer extends TBMCCommandBase{ - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.easyuhc.commands; + +import org.bukkit.command.CommandSender; + +import alisolarflare.DevCommand; + +public class StartTimer extends DevCommand{ + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } +} diff --git a/src/alisolarflare/easyuhc/commands/StartUHC.java b/src/alisolarflare/easyuhc/commands/StartUHC.java index 2a06889..63d9df7 100644 --- a/src/alisolarflare/easyuhc/commands/StartUHC.java +++ b/src/alisolarflare/easyuhc/commands/StartUHC.java @@ -1,33 +1,20 @@ -package alisolarflare.easyuhc.commands; - -import org.bukkit.command.CommandSender; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class StartUHC extends TBMCCommandBase{ - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.easyuhc.commands; + +import org.bukkit.command.CommandSender; + +import alisolarflare.DevCommand; + +public class StartUHC extends DevCommand{ + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } +} diff --git a/src/alisolarflare/easyuhc/commands/TeleportToUHC.java b/src/alisolarflare/easyuhc/commands/TeleportToUHC.java index 5a5c6d0..463f30a 100644 --- a/src/alisolarflare/easyuhc/commands/TeleportToUHC.java +++ b/src/alisolarflare/easyuhc/commands/TeleportToUHC.java @@ -1,33 +1,20 @@ -package alisolarflare.easyuhc.commands; - -import org.bukkit.command.CommandSender; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public class TeleportToUHC extends TBMCCommandBase{ - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +package alisolarflare.easyuhc.commands; + +import org.bukkit.command.CommandSender; + +import alisolarflare.DevCommand; + +public class TeleportToUHC extends DevCommand{ + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } +} diff --git a/src/alisolarflare/easyuhc/gpowers/GPowerMemory.java b/src/alisolarflare/easyuhc/gpowers/GPowerMemory.java index 44e0089..ccbab17 100644 --- a/src/alisolarflare/easyuhc/gpowers/GPowerMemory.java +++ b/src/alisolarflare/easyuhc/gpowers/GPowerMemory.java @@ -1,4 +1,4 @@ -package alisolarflare.components.gpowers; +package alisolarflare.easyuhc.gpowers; import java.util.HashMap; import java.util.Map; diff --git a/src/alisolarflare/easyuhc/gpowers/GPowerModule.java b/src/alisolarflare/easyuhc/gpowers/GPowerModule.java index 3148ee0..2b0dfd4 100644 --- a/src/alisolarflare/easyuhc/gpowers/GPowerModule.java +++ b/src/alisolarflare/easyuhc/gpowers/GPowerModule.java @@ -1,12 +1,12 @@ -package alisolarflare.components.gpowers; +package alisolarflare.easyuhc.gpowers; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.Module; -import alisolarflare.components.gpowers.commands.GPower; -import alisolarflare.components.gpowers.commands.PowerDown; -import alisolarflare.components.gpowers.commands.PowerUp; -import alisolarflare.components.gpowers.listeners.gPowerListener; +import alisolarflare.easyuhc.gpowers.commands.GPower; +import alisolarflare.easyuhc.gpowers.commands.PowerDown; +import alisolarflare.easyuhc.gpowers.commands.PowerUp; +import alisolarflare.easyuhc.gpowers.listeners.gPowerListener; public class GPowerModule extends Module { diff --git a/src/alisolarflare/easyuhc/gpowers/commands/GPower.java b/src/alisolarflare/easyuhc/gpowers/commands/GPower.java index 4a90d21..b261519 100644 --- a/src/alisolarflare/easyuhc/gpowers/commands/GPower.java +++ b/src/alisolarflare/easyuhc/gpowers/commands/GPower.java @@ -1,9 +1,9 @@ -package alisolarflare.components.gpowers.commands; +package alisolarflare.easyuhc.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.components.gpowers.GPowerMemory; +import alisolarflare.easyuhc.gpowers.GPowerMemory; import buttondevteam.lib.chat.TBMCCommandBase; public class GPower extends TBMCCommandBase { diff --git a/src/alisolarflare/easyuhc/gpowers/commands/PowerDown.java b/src/alisolarflare/easyuhc/gpowers/commands/PowerDown.java index 8f3467b..46f1717 100644 --- a/src/alisolarflare/easyuhc/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/easyuhc/gpowers/commands/PowerDown.java @@ -1,9 +1,9 @@ -package alisolarflare.components.gpowers.commands; +package alisolarflare.easyuhc.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.components.gpowers.GPowerMemory; +import alisolarflare.easyuhc.gpowers.GPowerMemory; import buttondevteam.lib.chat.TBMCCommandBase; public class PowerDown extends TBMCCommandBase { diff --git a/src/alisolarflare/easyuhc/gpowers/commands/PowerUp.java b/src/alisolarflare/easyuhc/gpowers/commands/PowerUp.java index 84670f3..0f5748c 100644 --- a/src/alisolarflare/easyuhc/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/easyuhc/gpowers/commands/PowerUp.java @@ -1,9 +1,9 @@ -package alisolarflare.components.gpowers.commands; +package alisolarflare.easyuhc.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.components.gpowers.GPowerMemory; +import alisolarflare.easyuhc.gpowers.GPowerMemory; import buttondevteam.lib.chat.TBMCCommandBase; public class PowerUp extends TBMCCommandBase { diff --git a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java index d966e63..a537565 100644 --- a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java @@ -1,4 +1,4 @@ -package alisolarflare.components.gpowers.listeners; +package alisolarflare.easyuhc.gpowers.listeners; import java.util.Map; import java.util.UUID; @@ -10,7 +10,7 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitRunnable; -import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; +import alisolarflare.easyuhc.gpowers.GPowerMemory.poweredPlayer; public class gPowerApplyingTask extends BukkitRunnable{ diff --git a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java index 1b71481..802bb63 100644 --- a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java @@ -1,9 +1,9 @@ -package alisolarflare.components.gpowers.listeners; +package alisolarflare.easyuhc.gpowers.listeners; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.gpowers.GPowerMemory; +import alisolarflare.easyuhc.gpowers.GPowerMemory; public class gPowerListener implements Listener{ From e75428f7183d65ef3f509de29d20550db29f2efa Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 11 Nov 2016 14:05:57 -0500 Subject: [PATCH 111/263] Ugly change --- src/alisolarflare/DevCommand.java | 4 +++- src/alisolarflare/Module.java | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/alisolarflare/DevCommand.java b/src/alisolarflare/DevCommand.java index a4c5091..9a01eed 100644 --- a/src/alisolarflare/DevCommand.java +++ b/src/alisolarflare/DevCommand.java @@ -1,10 +1,11 @@ package alisolarflare; +import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public abstract class DevCommand extends TBMCCommandBase{ +public abstract class DevCommand extends TBMCCommandBase implements CommandExecutor{ @Override public abstract boolean OnCommand(CommandSender sender, String alias, String[] args); @@ -12,6 +13,7 @@ public abstract class DevCommand extends TBMCCommandBase{ @Override public abstract String[] GetHelpText(String alias); + public abstract String GetLabel(); @Override public boolean GetPlayerOnly() { // TODO Auto-generated method stub diff --git a/src/alisolarflare/Module.java b/src/alisolarflare/Module.java index 3fe900b..c2a20f4 100644 --- a/src/alisolarflare/Module.java +++ b/src/alisolarflare/Module.java @@ -33,8 +33,8 @@ public abstract class Module{ * @param label Name of the command in plugin.yml * @param commandExecutor Custom coded CommandExecutor class */ - protected void registerCommand(JavaPlugin plugin, TBMCCommandBase commandBase){ - TBMCChatAPI.AddCommand(plugin, commandBase); + protected void registerCommand(JavaPlugin plugin, DevCommand devCommand){ + plugin.getCommand(devCommand.GetLabel()).setExecutor(devCommand); } /** * Registers a Listener to this plugin From 6817a076cb37ba478db4e36d4a66d7fc42349ca7 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 11 Nov 2016 14:06:15 -0500 Subject: [PATCH 112/263] Revert "Ugly change" This reverts commit e75428f7183d65ef3f509de29d20550db29f2efa. --- src/alisolarflare/DevCommand.java | 4 +--- src/alisolarflare/Module.java | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/alisolarflare/DevCommand.java b/src/alisolarflare/DevCommand.java index 9a01eed..a4c5091 100644 --- a/src/alisolarflare/DevCommand.java +++ b/src/alisolarflare/DevCommand.java @@ -1,11 +1,10 @@ package alisolarflare; -import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public abstract class DevCommand extends TBMCCommandBase implements CommandExecutor{ +public abstract class DevCommand extends TBMCCommandBase{ @Override public abstract boolean OnCommand(CommandSender sender, String alias, String[] args); @@ -13,7 +12,6 @@ public abstract class DevCommand extends TBMCCommandBase implements CommandExecu @Override public abstract String[] GetHelpText(String alias); - public abstract String GetLabel(); @Override public boolean GetPlayerOnly() { // TODO Auto-generated method stub diff --git a/src/alisolarflare/Module.java b/src/alisolarflare/Module.java index c2a20f4..3fe900b 100644 --- a/src/alisolarflare/Module.java +++ b/src/alisolarflare/Module.java @@ -33,8 +33,8 @@ public abstract class Module{ * @param label Name of the command in plugin.yml * @param commandExecutor Custom coded CommandExecutor class */ - protected void registerCommand(JavaPlugin plugin, DevCommand devCommand){ - plugin.getCommand(devCommand.GetLabel()).setExecutor(devCommand); + protected void registerCommand(JavaPlugin plugin, TBMCCommandBase commandBase){ + TBMCChatAPI.AddCommand(plugin, commandBase); } /** * Registers a Listener to this plugin From 91aa02494b8dcf5e967864162a48cb3270864c78 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 11 Nov 2016 14:27:07 -0500 Subject: [PATCH 113/263] updated plugin.yml --- plugin.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugin.yml b/plugin.yml index 8765a40..d6c5a19 100644 --- a/plugin.yml +++ b/plugin.yml @@ -40,4 +40,14 @@ commands: schedulematch: description: Schedules an UltraHardcore match startmatch: - description: Starts an UltraHardcore match \ No newline at end of file + description: Starts an UltraHardcore match + spreadplayers: + description: Admin command that spreads players around an ultrahardcore match + teleporttouhc: + description: Teleports you to the ultrahardcore match + setuhclobby: + description: Sets the area where a uhc will take place + activatepowers: + description: Admin command that activates gpowers on a uhc + setworldborders: + description: sets the worldborders to a uhc match From f37d1ad2c4a12cdc7aa105ee4e07704433c59faa Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 11 Nov 2016 14:44:55 -0500 Subject: [PATCH 114/263] Updated powerapplyingtask --- plugin.yml | 4 +++ .../gpowers/listeners/gPowerApplyingTask.java | 27 ++++++++++--------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/plugin.yml b/plugin.yml index d6c5a19..4b18371 100644 --- a/plugin.yml +++ b/plugin.yml @@ -51,3 +51,7 @@ commands: description: Admin command that activates gpowers on a uhc setworldborders: description: sets the worldborders to a uhc match + startuhc: + description: starts an ultrahardcore match + starttimer: + description: starts an ultrahardcore timer \ No newline at end of file diff --git a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java index a537565..04d7369 100644 --- a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java @@ -13,7 +13,7 @@ import org.bukkit.scheduler.BukkitRunnable; import alisolarflare.easyuhc.gpowers.GPowerMemory.poweredPlayer; public class gPowerApplyingTask extends BukkitRunnable{ - + private int powerLength = 200; private Server server; private Map poweredPlayerList; @@ -25,8 +25,9 @@ public class gPowerApplyingTask extends BukkitRunnable{ //REPEATS EVERY 5 SECONDS @Override public void run() { + server.broadcastMessage("ping!"); for (Player player : server.getOnlinePlayers()){ - if(poweredPlayerList.containsKey(player.getUniqueId())){ + if(poweredPlayerList.containsKey(player.getUniqueId()) && poweredPlayerList.get(player.getUniqueId()).isPowersActive){ activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); } } @@ -35,29 +36,29 @@ public class gPowerApplyingTask extends BukkitRunnable{ private void activatePower(Player player, String colour) { //GREY if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.GRAY)); - player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 0, true, false, Color.GRAY)); + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.GRAY), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, powerLength+100, 0, true, false, Color.GRAY), true); //RED }else if (colour.startsWith("r")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0, true, false, Color.RED)); + player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, powerLength, 0, true, false, Color.RED), true); //ORANGE }else if (colour.startsWith("o")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); - player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 0, true, false, Color.ORANGE)); + player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); //YELLOW }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.YELLOW)); + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.YELLOW), true); //GREEN }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 200, 1, true, false, Color.GREEN)); - player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 200, 0, true, false, Color.GREEN)); + player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, powerLength, 1, true, false, Color.GREEN), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, powerLength, 0, true, false, Color.GREEN), true); //BLUE }else if (colour.startsWith("b")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1, true, false, Color.BLUE)); - player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 200, 0, true, false, Color.BLUE)); + player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, powerLength, 1, true, false, Color.BLUE), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, powerLength, 0, true, false, Color.BLUE), true); //PURPLE }else if (colour.startsWith("p")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 0, true, false, Color.PURPLE)); + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, powerLength, 0, true, false, Color.PURPLE), true); //NULL }else{ } From 15bd5160960a7903ba2965b11f834edbfc9ea6ae Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 11 Nov 2016 18:48:07 -0500 Subject: [PATCH 115/263] Fixed plugin.yml --- plugin.yml | 10 ++++--- src/alisolarflare/AliPresents.java | 2 -- src/alisolarflare/easyuhc/EasyUHCModule.java | 15 ++++++++++ .../easyuhc/gpowers/GPowerModule.java | 23 --------------- .../easyuhc/gpowers/commands/PowerAll.java | 28 +++++++++++++++++++ .../gpowers/listeners/gPowerApplyingTask.java | 5 +++- .../gpowers/listeners/gPowerListener.java | 2 +- 7 files changed, 54 insertions(+), 31 deletions(-) delete mode 100644 src/alisolarflare/easyuhc/gpowers/GPowerModule.java create mode 100644 src/alisolarflare/easyuhc/gpowers/commands/PowerAll.java diff --git a/plugin.yml b/plugin.yml index 4b18371..1bbfbb3 100644 --- a/plugin.yml +++ b/plugin.yml @@ -4,7 +4,7 @@ version: 2.0.1 commands: flairme: - description: Activates the Flair Me Command. Ask Ali, she was tired when writing this description + description: Activates the Flair Me Command. Ask Ali - she was tired when writing this description gpower: description: Testing command for ghostie powers powerup: @@ -16,9 +16,9 @@ commands: setalilink: description: Creates an Ali Link setalilink frequency cbgm0: - description: Creative Boundaries Gamemode 0, allows players to return to survival + description: Creative Boundaries Gamemode 0 - allows players to return to survival cbgm1: - description: Creative Boundaries Gamemode 1, allows players to access creative within their towns. Creative is removed outside of towns, so be careful + description: Creative Boundaries Gamemode 1 - allows players to access creative within their towns. Creative is removed outside of towns, so be careful setdickmode: description: Should players automatically return to creative when outside town borders? Dickmode says yes. joinminigame: @@ -54,4 +54,6 @@ commands: startuhc: description: starts an ultrahardcore match starttimer: - description: starts an ultrahardcore timer \ No newline at end of file + description: starts an ultrahardcore timer + powerall: + description: activate every player's power \ No newline at end of file diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 04b65fc..7646d71 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -10,7 +10,6 @@ import alisolarflare.components.flairdoor.FlairDoorModule; import alisolarflare.components.links.AliLinkModule; import alisolarflare.creativeboundaries.CreativeBoundariesModule; import alisolarflare.easyuhc.EasyUHCModule; -import alisolarflare.easyuhc.gpowers.GPowerModule; import alisolarflare.magic.MagicModule; import alisolarflare.minigames.MinigameModule; @@ -23,7 +22,6 @@ public class AliPresents extends JavaPlugin{ new FlairDoorModule().register(this); - new GPowerModule().register(this); new AliLinkModule().register(this); new EasyUHCModule().register(this); new MagicModule().register(this); diff --git a/src/alisolarflare/easyuhc/EasyUHCModule.java b/src/alisolarflare/easyuhc/EasyUHCModule.java index b96d80b..2ca862c 100644 --- a/src/alisolarflare/easyuhc/EasyUHCModule.java +++ b/src/alisolarflare/easyuhc/EasyUHCModule.java @@ -11,11 +11,25 @@ import alisolarflare.easyuhc.commands.SpreadPlayers; import alisolarflare.easyuhc.commands.StartTimer; import alisolarflare.easyuhc.commands.StartUHC; import alisolarflare.easyuhc.commands.TeleportToUHC; +import alisolarflare.easyuhc.gpowers.GPowerMemory; +import alisolarflare.easyuhc.gpowers.commands.GPower; +import alisolarflare.easyuhc.gpowers.commands.PowerDown; +import alisolarflare.easyuhc.gpowers.commands.PowerUp; +import alisolarflare.easyuhc.gpowers.listeners.gPowerListener; public class EasyUHCModule extends Module{ public Location lobbyLocation; @Override public void register(JavaPlugin plugin) { + + + GPowerMemory gPowerMemory = new GPowerMemory(); + registerCommand(plugin, new GPower(gPowerMemory)); + registerCommand(plugin, new PowerUp(gPowerMemory)); + registerCommand(plugin, new PowerDown(gPowerMemory)); + + registerListener(plugin, new gPowerListener(plugin, gPowerMemory)); + registerCommand(plugin, new ActivatePowers()); registerCommand(plugin, new SetUHCLobby(this)); registerCommand(plugin, new SetWorldBorders()); @@ -24,5 +38,6 @@ public class EasyUHCModule extends Module{ registerCommand(plugin, new StartTimer()); registerCommand(plugin, new StartUHC()); registerCommand(plugin, new TeleportToUHC()); + } } diff --git a/src/alisolarflare/easyuhc/gpowers/GPowerModule.java b/src/alisolarflare/easyuhc/gpowers/GPowerModule.java deleted file mode 100644 index 2b0dfd4..0000000 --- a/src/alisolarflare/easyuhc/gpowers/GPowerModule.java +++ /dev/null @@ -1,23 +0,0 @@ -package alisolarflare.easyuhc.gpowers; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.easyuhc.gpowers.commands.GPower; -import alisolarflare.easyuhc.gpowers.commands.PowerDown; -import alisolarflare.easyuhc.gpowers.commands.PowerUp; -import alisolarflare.easyuhc.gpowers.listeners.gPowerListener; - -public class GPowerModule extends Module { - - @Override - public void register(JavaPlugin plugin) { - GPowerMemory gPowerMemory = new GPowerMemory(); - registerCommand(plugin, new GPower(gPowerMemory)); - registerCommand(plugin, new PowerUp(gPowerMemory)); - registerCommand(plugin, new PowerDown(gPowerMemory)); - - registerListener(plugin, new gPowerListener(plugin, gPowerMemory)); - } - -} diff --git a/src/alisolarflare/easyuhc/gpowers/commands/PowerAll.java b/src/alisolarflare/easyuhc/gpowers/commands/PowerAll.java new file mode 100644 index 0000000..706d764 --- /dev/null +++ b/src/alisolarflare/easyuhc/gpowers/commands/PowerAll.java @@ -0,0 +1,28 @@ +package alisolarflare.easyuhc.gpowers.commands; + +import org.bukkit.command.CommandSender; + +import alisolarflare.DevCommand; +import alisolarflare.easyuhc.gpowers.GPowerMemory; +import alisolarflare.easyuhc.gpowers.GPowerMemory.poweredPlayer; + +public class PowerAll extends DevCommand{ + private GPowerMemory gPowerMemory; + + public PowerAll(GPowerMemory gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + for (poweredPlayer poweredPlayer : gPowerMemory.poweredPlayerList.values()){ + poweredPlayer.isPowersActive = true; + } + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } +} diff --git a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java index 04d7369..35dcec2 100644 --- a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java @@ -13,7 +13,7 @@ import org.bukkit.scheduler.BukkitRunnable; import alisolarflare.easyuhc.gpowers.GPowerMemory.poweredPlayer; public class gPowerApplyingTask extends BukkitRunnable{ - private int powerLength = 200; + private int powerLength = 300; private Server server; private Map poweredPlayerList; @@ -35,6 +35,9 @@ public class gPowerApplyingTask extends BukkitRunnable{ private void activatePower(Player player, String colour) { //GREY + for (PotionEffect potionEffect : player.getActivePotionEffects()){ + player.removePotionEffect(potionEffect.getType()); + } if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.GRAY), true); player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, powerLength+100, 0, true, false, Color.GRAY), true); diff --git a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java index 802bb63..76bae71 100644 --- a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java @@ -8,6 +8,6 @@ import alisolarflare.easyuhc.gpowers.GPowerMemory; public class gPowerListener implements Listener{ public gPowerListener(JavaPlugin plugin, GPowerMemory gPowerMemory){ - new gPowerApplyingTask(plugin.getServer(), gPowerMemory.poweredPlayerList).runTaskTimer(plugin, 190, 190); + new gPowerApplyingTask(plugin.getServer(), gPowerMemory.poweredPlayerList).runTaskTimer(plugin, 0, 190); } } \ No newline at end of file From 3946a0d4c9894e38f8647cd391413dd562fea22a Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 11 Nov 2016 20:00:07 -0500 Subject: [PATCH 116/263] Created ModCommand and PlayerCommand abstract classes Take note of PlayerCommand.GetHelpText --- src/alisolarflare/AliPresents.java | 8 +-- .../autouhc/intro/ConfigureMatch.java | 38 ------------- .../autouhc/intro/ScheduleMatch.java | 38 ------------- .../components/flairdoor/FlairDoorModule.java | 2 +- .../flairdoor/commands/FlairMe.java | 15 +---- .../components/links/AliLinkModule.java | 2 +- .../links/commands/PressAliLink.java | 23 +------- .../components/links/commands/SetAliLink.java | 21 +------ .../ModCommand.java} | 55 ++++++++++--------- src/alisolarflare/{ => modules}/Module.java | 2 +- src/alisolarflare/modules/PlayerCommand.java | 24 ++++++++ .../{ => modules}/autouhc/UHCModule.java | 20 +++---- .../autouhc/controller/SetMatchState.java | 20 +++---- .../{ => modules}/autouhc/idle/AddToUHC.java | 25 ++------- .../{ => modules}/autouhc/idle/JoinUHC.java | 23 ++------ .../modules/autouhc/intro/ConfigureMatch.java | 25 +++++++++ .../autouhc/intro/IntroductionCutscene.java | 2 +- .../modules/autouhc/intro/ScheduleMatch.java | 25 +++++++++ .../autouhc/intro/StartMatch.java | 23 ++------ .../listeners/MatchCyclingListener.java | 2 +- .../autouhc/listeners/MatchMainLoop.java | 2 +- .../autouhc/memory/MatchState.java | 2 +- .../autouhc/memory/UHCMatch.java | 2 +- .../CreativeBoundariesModule.java | 14 ++--- .../creativeboundaries/commands/Cbgm0.java | 21 ++----- .../creativeboundaries/commands/Cbgm1.java | 21 ++----- .../commands/SetDickmode.java | 20 ++----- .../listeners/ItemRestrictionListener.java | 4 +- .../listeners/PlotChangeListener.java | 4 +- .../{ => modules}/easyuhc/EasyUHCModule.java | 28 +++++----- .../easyuhc/commands/ActivatePowers.java | 6 +- .../easyuhc/commands/SetUHCLobby.java | 8 +-- .../easyuhc/commands/SetWorldBorders.java | 6 +- .../easyuhc/commands/ShrinkWorldBorders.java | 6 +- .../easyuhc/commands/SpreadPlayers.java | 6 +- .../easyuhc/commands/StartTimer.java | 6 +- .../easyuhc/commands/StartUHC.java | 6 +- .../easyuhc/commands/TeleportToUHC.java | 6 +- .../easyuhc/gpowers/GPowerMemory.java | 2 +- .../easyuhc/gpowers/commands/GPower.java | 19 ++----- .../easyuhc/gpowers/commands/PowerAll.java | 10 ++-- .../easyuhc/gpowers/commands/PowerDown.java | 21 ++----- .../easyuhc/gpowers/commands/PowerUp.java | 20 ++----- .../gpowers/listeners/gPowerApplyingTask.java | 4 +- .../gpowers/listeners/gPowerListener.java | 4 +- .../{ => modules}/magic/MagicModule.java | 10 ++-- .../magic/tricks/AliArrowListener.java | 2 +- .../magic/tricks/AliArrowTask.java | 2 +- .../magic/tricks/BoomBowDeathListener.java | 2 +- .../magic/tricks/BoomBowListener.java | 2 +- .../magic/tricks/BoomBowRule.java | 17 +----- .../magic/tricks/BoomDecayTask.java | 2 +- .../{ => modules}/minigames/GameState.java | 2 +- .../minigames/MinigameModule.java | 14 ++--- .../minigames/commands/JoinMinigame.java | 19 ++----- .../minigames/commands/LeaveMinigame.java | 19 ++----- .../minigames/commands/ListFighters.java | 19 ++----- .../minigames/commands/SetColourSpawn.java | 19 ++----- .../minigames/data/SpawnSet.java | 2 +- .../minigames/entities/Fighter.java | 2 +- src/graveyard/shulker/AliShulkerModule.java | 2 +- 61 files changed, 279 insertions(+), 497 deletions(-) delete mode 100644 src/alisolarflare/autouhc/intro/ConfigureMatch.java delete mode 100644 src/alisolarflare/autouhc/intro/ScheduleMatch.java rename src/alisolarflare/{DevCommand.java => modules/ModCommand.java} (53%) rename src/alisolarflare/{ => modules}/Module.java (95%) create mode 100644 src/alisolarflare/modules/PlayerCommand.java rename src/alisolarflare/{ => modules}/autouhc/UHCModule.java (56%) rename src/alisolarflare/{ => modules}/autouhc/controller/SetMatchState.java (86%) rename src/alisolarflare/{ => modules}/autouhc/idle/AddToUHC.java (74%) rename src/alisolarflare/{ => modules}/autouhc/idle/JoinUHC.java (71%) create mode 100644 src/alisolarflare/modules/autouhc/intro/ConfigureMatch.java rename src/alisolarflare/{ => modules}/autouhc/intro/IntroductionCutscene.java (64%) create mode 100644 src/alisolarflare/modules/autouhc/intro/ScheduleMatch.java rename src/alisolarflare/{ => modules}/autouhc/intro/StartMatch.java (71%) rename src/alisolarflare/{ => modules}/autouhc/listeners/MatchCyclingListener.java (88%) rename src/alisolarflare/{ => modules}/autouhc/listeners/MatchMainLoop.java (69%) rename src/alisolarflare/{ => modules}/autouhc/memory/MatchState.java (85%) rename src/alisolarflare/{ => modules}/autouhc/memory/UHCMatch.java (92%) rename src/alisolarflare/{ => modules}/creativeboundaries/CreativeBoundariesModule.java (55%) rename src/alisolarflare/{ => modules}/creativeboundaries/commands/Cbgm0.java (60%) rename src/alisolarflare/{ => modules}/creativeboundaries/commands/Cbgm1.java (78%) rename src/alisolarflare/{ => modules}/creativeboundaries/commands/SetDickmode.java (67%) rename src/alisolarflare/{ => modules}/creativeboundaries/listeners/ItemRestrictionListener.java (76%) rename src/alisolarflare/{ => modules}/creativeboundaries/listeners/PlotChangeListener.java (90%) rename src/alisolarflare/{ => modules}/easyuhc/EasyUHCModule.java (50%) rename src/alisolarflare/{ => modules}/easyuhc/commands/ActivatePowers.java (63%) rename src/alisolarflare/{ => modules}/easyuhc/commands/SetUHCLobby.java (71%) rename src/alisolarflare/{ => modules}/easyuhc/commands/SetWorldBorders.java (63%) rename src/alisolarflare/{ => modules}/easyuhc/commands/ShrinkWorldBorders.java (65%) rename src/alisolarflare/{ => modules}/easyuhc/commands/SpreadPlayers.java (66%) rename src/alisolarflare/{ => modules}/easyuhc/commands/StartTimer.java (66%) rename src/alisolarflare/{ => modules}/easyuhc/commands/StartUHC.java (66%) rename src/alisolarflare/{ => modules}/easyuhc/commands/TeleportToUHC.java (65%) rename src/alisolarflare/{ => modules}/easyuhc/gpowers/GPowerMemory.java (93%) rename src/alisolarflare/{ => modules}/easyuhc/gpowers/commands/GPower.java (82%) rename src/alisolarflare/{ => modules}/easyuhc/gpowers/commands/PowerAll.java (65%) rename src/alisolarflare/{ => modules}/easyuhc/gpowers/commands/PowerDown.java (61%) rename src/alisolarflare/{ => modules}/easyuhc/gpowers/commands/PowerUp.java (63%) rename src/alisolarflare/{ => modules}/easyuhc/gpowers/listeners/gPowerApplyingTask.java (94%) rename src/alisolarflare/{ => modules}/easyuhc/gpowers/listeners/gPowerListener.java (70%) rename src/alisolarflare/{ => modules}/magic/MagicModule.java (53%) rename src/alisolarflare/{ => modules}/magic/tricks/AliArrowListener.java (92%) rename src/alisolarflare/{ => modules}/magic/tricks/AliArrowTask.java (91%) rename src/alisolarflare/{ => modules}/magic/tricks/BoomBowDeathListener.java (89%) rename src/alisolarflare/{ => modules}/magic/tricks/BoomBowListener.java (95%) rename src/alisolarflare/{ => modules}/magic/tricks/BoomBowRule.java (82%) rename src/alisolarflare/{ => modules}/magic/tricks/BoomDecayTask.java (87%) rename src/alisolarflare/{ => modules}/minigames/GameState.java (54%) rename src/alisolarflare/{ => modules}/minigames/MinigameModule.java (60%) rename src/alisolarflare/{ => modules}/minigames/commands/JoinMinigame.java (68%) rename src/alisolarflare/{ => modules}/minigames/commands/LeaveMinigame.java (68%) rename src/alisolarflare/{ => modules}/minigames/commands/ListFighters.java (54%) rename src/alisolarflare/{ => modules}/minigames/commands/SetColourSpawn.java (79%) rename src/alisolarflare/{ => modules}/minigames/data/SpawnSet.java (92%) rename src/alisolarflare/{ => modules}/minigames/entities/Fighter.java (74%) diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 7646d71..c9330d1 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -8,10 +8,10 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.flairdoor.FlairDoorModule; import alisolarflare.components.links.AliLinkModule; -import alisolarflare.creativeboundaries.CreativeBoundariesModule; -import alisolarflare.easyuhc.EasyUHCModule; -import alisolarflare.magic.MagicModule; -import alisolarflare.minigames.MinigameModule; +import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; +import alisolarflare.modules.easyuhc.EasyUHCModule; +import alisolarflare.modules.magic.MagicModule; +import alisolarflare.modules.minigames.MinigameModule; public class AliPresents extends JavaPlugin{ public void onEnable(){ diff --git a/src/alisolarflare/autouhc/intro/ConfigureMatch.java b/src/alisolarflare/autouhc/intro/ConfigureMatch.java deleted file mode 100644 index 958e571..0000000 --- a/src/alisolarflare/autouhc/intro/ConfigureMatch.java +++ /dev/null @@ -1,38 +0,0 @@ -package alisolarflare.autouhc.intro; - -import org.bukkit.command.CommandSender; - -import alisolarflare.autouhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class ConfigureMatch extends TBMCCommandBase{ - - public ConfigureMatch(UHCMatch match) { - // TODO Auto-generated constructor stub - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} diff --git a/src/alisolarflare/autouhc/intro/ScheduleMatch.java b/src/alisolarflare/autouhc/intro/ScheduleMatch.java deleted file mode 100644 index d1d904f..0000000 --- a/src/alisolarflare/autouhc/intro/ScheduleMatch.java +++ /dev/null @@ -1,38 +0,0 @@ -package alisolarflare.autouhc.intro; - -import org.bukkit.command.CommandSender; - -import alisolarflare.autouhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCCommandBase; - -public class ScheduleMatch extends TBMCCommandBase{ - - public ScheduleMatch(UHCMatch match) { - // TODO Auto-generated constructor stub - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} diff --git a/src/alisolarflare/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/components/flairdoor/FlairDoorModule.java index 1c5cddb..290522c 100644 --- a/src/alisolarflare/components/flairdoor/FlairDoorModule.java +++ b/src/alisolarflare/components/flairdoor/FlairDoorModule.java @@ -2,9 +2,9 @@ package alisolarflare.components.flairdoor; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.Module; import alisolarflare.components.flairdoor.commands.FlairMe; import alisolarflare.components.flairdoor.listeners.PortalListener; +import alisolarflare.modules.Module; public class FlairDoorModule extends Module { @Override diff --git a/src/alisolarflare/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java index 963da82..fab0112 100644 --- a/src/alisolarflare/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -3,9 +3,9 @@ package alisolarflare.components.flairdoor.commands; import org.bukkit.command.CommandSender; import alisolarflare.components.flairdoor.listeners.PortalListener; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.PlayerCommand; -public class FlairMe extends TBMCCommandBase { +public class FlairMe extends PlayerCommand { @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { @@ -25,15 +25,4 @@ public class FlairMe extends TBMCCommandBase { public String GetCommandPath() { return "flairme"; } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - return false; - } - } diff --git a/src/alisolarflare/components/links/AliLinkModule.java b/src/alisolarflare/components/links/AliLinkModule.java index a6d44a9..5a40320 100644 --- a/src/alisolarflare/components/links/AliLinkModule.java +++ b/src/alisolarflare/components/links/AliLinkModule.java @@ -4,10 +4,10 @@ import java.util.List; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.Module; import alisolarflare.components.links.commands.PressAliLink; import alisolarflare.components.links.commands.SetAliLink; import alisolarflare.components.links.entities.Link; +import alisolarflare.modules.Module; public class AliLinkModule extends Module { private SetAliLink setAliLink; diff --git a/src/alisolarflare/components/links/commands/PressAliLink.java b/src/alisolarflare/components/links/commands/PressAliLink.java index da21f6d..657c611 100644 --- a/src/alisolarflare/components/links/commands/PressAliLink.java +++ b/src/alisolarflare/components/links/commands/PressAliLink.java @@ -4,9 +4,9 @@ import org.bukkit.command.CommandSender; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.links.entities.Link; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.PlayerCommand; -public class PressAliLink extends TBMCCommandBase { +public class PressAliLink extends PlayerCommand { private JavaPlugin plugin; private SetAliLink setAliLink; @@ -36,25 +36,6 @@ public class PressAliLink extends TBMCCommandBase { @Override public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub return null; } - - @Override - public String GetCommandPath() { - return "pressalilink"; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - } diff --git a/src/alisolarflare/components/links/commands/SetAliLink.java b/src/alisolarflare/components/links/commands/SetAliLink.java index 03c4e57..f25d8f7 100644 --- a/src/alisolarflare/components/links/commands/SetAliLink.java +++ b/src/alisolarflare/components/links/commands/SetAliLink.java @@ -11,7 +11,7 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.links.AliLinkModule; import alisolarflare.components.links.entities.Link; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.PlayerCommand; /** * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, a location in a world that when called on by {@link PressAliLink}, creates a temporary redstone @@ -21,7 +21,7 @@ import buttondevteam.lib.chat.TBMCCommandBase; * @author Alisolarflare * */ -public class SetAliLink extends TBMCCommandBase { +public class SetAliLink extends PlayerCommand { public List linkList = new ArrayList(); AliLinkModule subplugin; private JavaPlugin plugin; @@ -120,21 +120,4 @@ public class SetAliLink extends TBMCCommandBase { // TODO Auto-generated method stub return null; } - - @Override - public String GetCommandPath() { - return "setalilink"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - } diff --git a/src/alisolarflare/DevCommand.java b/src/alisolarflare/modules/ModCommand.java similarity index 53% rename from src/alisolarflare/DevCommand.java rename to src/alisolarflare/modules/ModCommand.java index a4c5091..2a650f0 100644 --- a/src/alisolarflare/DevCommand.java +++ b/src/alisolarflare/modules/ModCommand.java @@ -1,26 +1,29 @@ -package alisolarflare; - -import org.bukkit.command.CommandSender; - -import buttondevteam.lib.chat.TBMCCommandBase; - -public abstract class DevCommand extends TBMCCommandBase{ - - @Override - public abstract boolean OnCommand(CommandSender sender, String alias, String[] args); - - @Override - public abstract String[] GetHelpText(String alias); - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return true; - } -} +package alisolarflare.modules; + +import org.bukkit.command.CommandSender; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public abstract class ModCommand extends TBMCCommandBase{ + + @Override + public abstract boolean OnCommand(CommandSender sender, String alias, String[] args); + + @Override + public String[] GetHelpText(String alias){ + return new String[] {"This command doesn't have help text, ask a dev to add one, using public String[] GetHelpText. " + + "If you're a dev, write the help text you lazy bastard. -Ali"}; + } + + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return true; + } +} diff --git a/src/alisolarflare/Module.java b/src/alisolarflare/modules/Module.java similarity index 95% rename from src/alisolarflare/Module.java rename to src/alisolarflare/modules/Module.java index 3fe900b..6446ff0 100644 --- a/src/alisolarflare/Module.java +++ b/src/alisolarflare/modules/Module.java @@ -1,4 +1,4 @@ -package alisolarflare; +package alisolarflare.modules; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; diff --git a/src/alisolarflare/modules/PlayerCommand.java b/src/alisolarflare/modules/PlayerCommand.java new file mode 100644 index 0000000..51dcad9 --- /dev/null +++ b/src/alisolarflare/modules/PlayerCommand.java @@ -0,0 +1,24 @@ +package alisolarflare.modules; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public abstract class PlayerCommand extends TBMCCommandBase{ + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return true; + } + + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + @Override + public String[] GetHelpText(String alias){ + return new String[] {"This command doesn't have help text, ask a mod to ask a dev to add one, using public String[] GetHelpText. " + + "If you're a mod, ask a dev to write the help text." + + "If you're a dev, write the help text you lazy bastard. -Ali"}; + } + +} diff --git a/src/alisolarflare/autouhc/UHCModule.java b/src/alisolarflare/modules/autouhc/UHCModule.java similarity index 56% rename from src/alisolarflare/autouhc/UHCModule.java rename to src/alisolarflare/modules/autouhc/UHCModule.java index 3c0c2d8..cd65d63 100644 --- a/src/alisolarflare/autouhc/UHCModule.java +++ b/src/alisolarflare/modules/autouhc/UHCModule.java @@ -1,16 +1,16 @@ -package alisolarflare.autouhc; +package alisolarflare.modules.autouhc; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.Module; -import alisolarflare.autouhc.controller.SetMatchState; -import alisolarflare.autouhc.idle.AddToUHC; -import alisolarflare.autouhc.idle.JoinUHC; -import alisolarflare.autouhc.intro.ConfigureMatch; -import alisolarflare.autouhc.intro.ScheduleMatch; -import alisolarflare.autouhc.intro.StartMatch; -import alisolarflare.autouhc.memory.MatchState; -import alisolarflare.autouhc.memory.UHCMatch; +import alisolarflare.modules.Module; +import alisolarflare.modules.autouhc.controller.SetMatchState; +import alisolarflare.modules.autouhc.idle.AddToUHC; +import alisolarflare.modules.autouhc.idle.JoinUHC; +import alisolarflare.modules.autouhc.intro.ConfigureMatch; +import alisolarflare.modules.autouhc.intro.ScheduleMatch; +import alisolarflare.modules.autouhc.intro.StartMatch; +import alisolarflare.modules.autouhc.memory.MatchState; +import alisolarflare.modules.autouhc.memory.UHCMatch; public class UHCModule extends Module { public UHCMatch match; diff --git a/src/alisolarflare/autouhc/controller/SetMatchState.java b/src/alisolarflare/modules/autouhc/controller/SetMatchState.java similarity index 86% rename from src/alisolarflare/autouhc/controller/SetMatchState.java rename to src/alisolarflare/modules/autouhc/controller/SetMatchState.java index 0945cc7..f6a4aa3 100644 --- a/src/alisolarflare/autouhc/controller/SetMatchState.java +++ b/src/alisolarflare/modules/autouhc/controller/SetMatchState.java @@ -1,24 +1,19 @@ -package alisolarflare.autouhc.controller; +package alisolarflare.modules.autouhc.controller; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.autouhc.memory.MatchState; -import alisolarflare.autouhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.ModCommand; +import alisolarflare.modules.autouhc.memory.MatchState; +import alisolarflare.modules.autouhc.memory.UHCMatch; -public class SetMatchState extends TBMCCommandBase{ +public class SetMatchState extends ModCommand{ UHCMatch match; public SetMatchState(UHCMatch match) { this.match = match; } - @Override - public String[] GetHelpText(String alias) { - return null; - } - @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { if (!(sender instanceof Player)){ @@ -72,5 +67,10 @@ public class SetMatchState extends TBMCCommandBase{ // TODO Auto-generated method stub return false; } + + @Override + public String[] GetHelpText(String alias) { + return new String[] { "" }; + } } diff --git a/src/alisolarflare/autouhc/idle/AddToUHC.java b/src/alisolarflare/modules/autouhc/idle/AddToUHC.java similarity index 74% rename from src/alisolarflare/autouhc/idle/AddToUHC.java rename to src/alisolarflare/modules/autouhc/idle/AddToUHC.java index b27ace6..8d3abee 100644 --- a/src/alisolarflare/autouhc/idle/AddToUHC.java +++ b/src/alisolarflare/modules/autouhc/idle/AddToUHC.java @@ -1,17 +1,17 @@ -package alisolarflare.autouhc.idle; +package alisolarflare.modules.autouhc.idle; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.autouhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.ModCommand; +import alisolarflare.modules.autouhc.memory.UHCMatch; /** * This class handles the specific command /addToUHC which, in-game, adds a player to a specific UltraHardcore match, that is defined by the constructor: {@linkplain #AddToUHC(UHCMatch)} * * @author Alisolarflare */ -public class AddToUHC extends TBMCCommandBase { +public class AddToUHC extends ModCommand { private UHCMatch match; public AddToUHC(UHCMatch match) { @@ -57,21 +57,4 @@ public class AddToUHC extends TBMCCommandBase { // TODO Auto-generated method stub return null; } - - @Override - public String GetCommandPath() { - return "addtouhc"; - } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - } diff --git a/src/alisolarflare/autouhc/idle/JoinUHC.java b/src/alisolarflare/modules/autouhc/idle/JoinUHC.java similarity index 71% rename from src/alisolarflare/autouhc/idle/JoinUHC.java rename to src/alisolarflare/modules/autouhc/idle/JoinUHC.java index 764a2da..ba6621d 100644 --- a/src/alisolarflare/autouhc/idle/JoinUHC.java +++ b/src/alisolarflare/modules/autouhc/idle/JoinUHC.java @@ -1,12 +1,12 @@ -package alisolarflare.autouhc.idle; +package alisolarflare.modules.autouhc.idle; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.autouhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.ModCommand; +import alisolarflare.modules.autouhc.memory.UHCMatch; -public class JoinUHC extends TBMCCommandBase{ +public class JoinUHC extends ModCommand{ private UHCMatch match; @@ -50,18 +50,5 @@ public class JoinUHC extends TBMCCommandBase{ } return false; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - + } } diff --git a/src/alisolarflare/modules/autouhc/intro/ConfigureMatch.java b/src/alisolarflare/modules/autouhc/intro/ConfigureMatch.java new file mode 100644 index 0000000..9ebab8c --- /dev/null +++ b/src/alisolarflare/modules/autouhc/intro/ConfigureMatch.java @@ -0,0 +1,25 @@ +package alisolarflare.modules.autouhc.intro; + +import org.bukkit.command.CommandSender; + +import alisolarflare.modules.ModCommand; +import alisolarflare.modules.autouhc.memory.UHCMatch; + +public class ConfigureMatch extends ModCommand{ + + public ConfigureMatch(UHCMatch match) { + // TODO Auto-generated constructor stub + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } +} diff --git a/src/alisolarflare/autouhc/intro/IntroductionCutscene.java b/src/alisolarflare/modules/autouhc/intro/IntroductionCutscene.java similarity index 64% rename from src/alisolarflare/autouhc/intro/IntroductionCutscene.java rename to src/alisolarflare/modules/autouhc/intro/IntroductionCutscene.java index 7921231..6244a5f 100644 --- a/src/alisolarflare/autouhc/intro/IntroductionCutscene.java +++ b/src/alisolarflare/modules/autouhc/intro/IntroductionCutscene.java @@ -1,4 +1,4 @@ -package alisolarflare.autouhc.intro; +package alisolarflare.modules.autouhc.intro; public class IntroductionCutscene { //TODO: Teleport all players to the area. diff --git a/src/alisolarflare/modules/autouhc/intro/ScheduleMatch.java b/src/alisolarflare/modules/autouhc/intro/ScheduleMatch.java new file mode 100644 index 0000000..ae6361b --- /dev/null +++ b/src/alisolarflare/modules/autouhc/intro/ScheduleMatch.java @@ -0,0 +1,25 @@ +package alisolarflare.modules.autouhc.intro; + +import org.bukkit.command.CommandSender; + +import alisolarflare.modules.ModCommand; +import alisolarflare.modules.autouhc.memory.UHCMatch; + +public class ScheduleMatch extends ModCommand{ + + public ScheduleMatch(UHCMatch match) { + // TODO Auto-generated constructor stub + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } +} diff --git a/src/alisolarflare/autouhc/intro/StartMatch.java b/src/alisolarflare/modules/autouhc/intro/StartMatch.java similarity index 71% rename from src/alisolarflare/autouhc/intro/StartMatch.java rename to src/alisolarflare/modules/autouhc/intro/StartMatch.java index 08932e8..c39d968 100644 --- a/src/alisolarflare/autouhc/intro/StartMatch.java +++ b/src/alisolarflare/modules/autouhc/intro/StartMatch.java @@ -1,12 +1,12 @@ -package alisolarflare.autouhc.intro; +package alisolarflare.modules.autouhc.intro; import org.bukkit.command.CommandSender; -import alisolarflare.autouhc.memory.MatchState; -import alisolarflare.autouhc.memory.UHCMatch; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.ModCommand; +import alisolarflare.modules.autouhc.memory.MatchState; +import alisolarflare.modules.autouhc.memory.UHCMatch; -public class StartMatch extends TBMCCommandBase { +public class StartMatch extends ModCommand { private UHCMatch match; public StartMatch(UHCMatch match) { @@ -37,8 +37,6 @@ public class StartMatch extends TBMCCommandBase { default: sender.sendMessage("You cannot start a match now, one is already in progress!"); - - } return false; @@ -56,15 +54,4 @@ public class StartMatch extends TBMCCommandBase { public String GetCommandPath() { return "startmatch"; } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } } diff --git a/src/alisolarflare/autouhc/listeners/MatchCyclingListener.java b/src/alisolarflare/modules/autouhc/listeners/MatchCyclingListener.java similarity index 88% rename from src/alisolarflare/autouhc/listeners/MatchCyclingListener.java rename to src/alisolarflare/modules/autouhc/listeners/MatchCyclingListener.java index e11fc9b..d8ef831 100644 --- a/src/alisolarflare/autouhc/listeners/MatchCyclingListener.java +++ b/src/alisolarflare/modules/autouhc/listeners/MatchCyclingListener.java @@ -1,4 +1,4 @@ -package alisolarflare.autouhc.listeners; +package alisolarflare.modules.autouhc.listeners; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; diff --git a/src/alisolarflare/autouhc/listeners/MatchMainLoop.java b/src/alisolarflare/modules/autouhc/listeners/MatchMainLoop.java similarity index 69% rename from src/alisolarflare/autouhc/listeners/MatchMainLoop.java rename to src/alisolarflare/modules/autouhc/listeners/MatchMainLoop.java index 41c3b06..4005028 100644 --- a/src/alisolarflare/autouhc/listeners/MatchMainLoop.java +++ b/src/alisolarflare/modules/autouhc/listeners/MatchMainLoop.java @@ -1,4 +1,4 @@ -package alisolarflare.autouhc.listeners; +package alisolarflare.modules.autouhc.listeners; import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/alisolarflare/autouhc/memory/MatchState.java b/src/alisolarflare/modules/autouhc/memory/MatchState.java similarity index 85% rename from src/alisolarflare/autouhc/memory/MatchState.java rename to src/alisolarflare/modules/autouhc/memory/MatchState.java index f25c350..b4587b5 100644 --- a/src/alisolarflare/autouhc/memory/MatchState.java +++ b/src/alisolarflare/modules/autouhc/memory/MatchState.java @@ -1,4 +1,4 @@ -package alisolarflare.autouhc.memory; +package alisolarflare.modules.autouhc.memory; public enum MatchState { IDLE, //Idle: Configure Match, Wait: Schedule Match, Intro: Start Match diff --git a/src/alisolarflare/autouhc/memory/UHCMatch.java b/src/alisolarflare/modules/autouhc/memory/UHCMatch.java similarity index 92% rename from src/alisolarflare/autouhc/memory/UHCMatch.java rename to src/alisolarflare/modules/autouhc/memory/UHCMatch.java index ee8911d..c0c64b9 100644 --- a/src/alisolarflare/autouhc/memory/UHCMatch.java +++ b/src/alisolarflare/modules/autouhc/memory/UHCMatch.java @@ -1,4 +1,4 @@ -package alisolarflare.autouhc.memory; +package alisolarflare.modules.autouhc.memory; import java.util.ArrayList; import java.util.List; diff --git a/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java b/src/alisolarflare/modules/creativeboundaries/CreativeBoundariesModule.java similarity index 55% rename from src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java rename to src/alisolarflare/modules/creativeboundaries/CreativeBoundariesModule.java index 39dac19..d9ecdf8 100644 --- a/src/alisolarflare/creativeboundaries/CreativeBoundariesModule.java +++ b/src/alisolarflare/modules/creativeboundaries/CreativeBoundariesModule.java @@ -1,4 +1,4 @@ -package alisolarflare.creativeboundaries; +package alisolarflare.modules.creativeboundaries; import java.util.ArrayList; import java.util.List; @@ -6,12 +6,12 @@ import java.util.List; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.Module; -import alisolarflare.creativeboundaries.commands.Cbgm0; -import alisolarflare.creativeboundaries.commands.Cbgm1; -import alisolarflare.creativeboundaries.commands.SetDickmode; -import alisolarflare.creativeboundaries.listeners.ItemRestrictionListener; -import alisolarflare.creativeboundaries.listeners.PlotChangeListener; +import alisolarflare.modules.Module; +import alisolarflare.modules.creativeboundaries.commands.Cbgm0; +import alisolarflare.modules.creativeboundaries.commands.Cbgm1; +import alisolarflare.modules.creativeboundaries.commands.SetDickmode; +import alisolarflare.modules.creativeboundaries.listeners.ItemRestrictionListener; +import alisolarflare.modules.creativeboundaries.listeners.PlotChangeListener; public class CreativeBoundariesModule extends Module{ diff --git a/src/alisolarflare/creativeboundaries/commands/Cbgm0.java b/src/alisolarflare/modules/creativeboundaries/commands/Cbgm0.java similarity index 60% rename from src/alisolarflare/creativeboundaries/commands/Cbgm0.java rename to src/alisolarflare/modules/creativeboundaries/commands/Cbgm0.java index 6e5fd2a..832cace 100644 --- a/src/alisolarflare/creativeboundaries/commands/Cbgm0.java +++ b/src/alisolarflare/modules/creativeboundaries/commands/Cbgm0.java @@ -1,13 +1,13 @@ -package alisolarflare.creativeboundaries.commands; +package alisolarflare.modules.creativeboundaries.commands; import org.bukkit.GameMode; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.creativeboundaries.CreativeBoundariesModule; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.PlayerCommand; +import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; -public class Cbgm0 extends TBMCCommandBase{ +public class Cbgm0 extends PlayerCommand{ private CreativeBoundariesModule module; @@ -33,17 +33,4 @@ public class Cbgm0 extends TBMCCommandBase{ // TODO Auto-generated method stub return null; } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - } diff --git a/src/alisolarflare/creativeboundaries/commands/Cbgm1.java b/src/alisolarflare/modules/creativeboundaries/commands/Cbgm1.java similarity index 78% rename from src/alisolarflare/creativeboundaries/commands/Cbgm1.java rename to src/alisolarflare/modules/creativeboundaries/commands/Cbgm1.java index 04fba33..e3c7753 100644 --- a/src/alisolarflare/creativeboundaries/commands/Cbgm1.java +++ b/src/alisolarflare/modules/creativeboundaries/commands/Cbgm1.java @@ -1,4 +1,4 @@ -package alisolarflare.creativeboundaries.commands; +package alisolarflare.modules.creativeboundaries.commands; import org.bukkit.GameMode; import org.bukkit.command.CommandSender; @@ -10,10 +10,10 @@ import com.palmergames.bukkit.towny.object.Town; import com.palmergames.bukkit.towny.object.TownBlock; import com.palmergames.bukkit.towny.object.TownyUniverse; -import alisolarflare.creativeboundaries.CreativeBoundariesModule; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.PlayerCommand; +import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; -public class Cbgm1 extends TBMCCommandBase { +public class Cbgm1 extends PlayerCommand { private CreativeBoundariesModule module; @@ -66,17 +66,4 @@ public class Cbgm1 extends TBMCCommandBase { // TODO Auto-generated method stub return null; } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - } diff --git a/src/alisolarflare/creativeboundaries/commands/SetDickmode.java b/src/alisolarflare/modules/creativeboundaries/commands/SetDickmode.java similarity index 67% rename from src/alisolarflare/creativeboundaries/commands/SetDickmode.java rename to src/alisolarflare/modules/creativeboundaries/commands/SetDickmode.java index 3b1654b..576844c 100644 --- a/src/alisolarflare/creativeboundaries/commands/SetDickmode.java +++ b/src/alisolarflare/modules/creativeboundaries/commands/SetDickmode.java @@ -1,11 +1,11 @@ -package alisolarflare.creativeboundaries.commands; +package alisolarflare.modules.creativeboundaries.commands; import org.bukkit.command.CommandSender; -import alisolarflare.creativeboundaries.CreativeBoundariesModule; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.PlayerCommand; +import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; -public class SetDickmode extends TBMCCommandBase{ +public class SetDickmode extends PlayerCommand{ private CreativeBoundariesModule module; public SetDickmode(CreativeBoundariesModule module){ @@ -39,16 +39,4 @@ public class SetDickmode extends TBMCCommandBase{ // TODO Auto-generated method stub return null; } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } } diff --git a/src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java b/src/alisolarflare/modules/creativeboundaries/listeners/ItemRestrictionListener.java similarity index 76% rename from src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java rename to src/alisolarflare/modules/creativeboundaries/listeners/ItemRestrictionListener.java index 9023755..3cb6581 100644 --- a/src/alisolarflare/creativeboundaries/listeners/ItemRestrictionListener.java +++ b/src/alisolarflare/modules/creativeboundaries/listeners/ItemRestrictionListener.java @@ -1,4 +1,4 @@ -package alisolarflare.creativeboundaries.listeners; +package alisolarflare.modules.creativeboundaries.listeners; import java.util.List; @@ -7,7 +7,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryCreativeEvent; -import alisolarflare.creativeboundaries.CreativeBoundariesModule; +import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; public class ItemRestrictionListener implements Listener { diff --git a/src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java b/src/alisolarflare/modules/creativeboundaries/listeners/PlotChangeListener.java similarity index 90% rename from src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java rename to src/alisolarflare/modules/creativeboundaries/listeners/PlotChangeListener.java index e911b98..a257f89 100644 --- a/src/alisolarflare/creativeboundaries/listeners/PlotChangeListener.java +++ b/src/alisolarflare/modules/creativeboundaries/listeners/PlotChangeListener.java @@ -1,4 +1,4 @@ -package alisolarflare.creativeboundaries.listeners; +package alisolarflare.modules.creativeboundaries.listeners; import org.bukkit.GameMode; import org.bukkit.entity.Player; @@ -12,7 +12,7 @@ import com.palmergames.bukkit.towny.object.Town; import com.palmergames.bukkit.towny.object.TownBlock; import com.palmergames.bukkit.towny.object.TownyUniverse; -import alisolarflare.creativeboundaries.CreativeBoundariesModule; +import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; public class PlotChangeListener implements Listener{ public CreativeBoundariesModule module; diff --git a/src/alisolarflare/easyuhc/EasyUHCModule.java b/src/alisolarflare/modules/easyuhc/EasyUHCModule.java similarity index 50% rename from src/alisolarflare/easyuhc/EasyUHCModule.java rename to src/alisolarflare/modules/easyuhc/EasyUHCModule.java index 2ca862c..01c4ea0 100644 --- a/src/alisolarflare/easyuhc/EasyUHCModule.java +++ b/src/alisolarflare/modules/easyuhc/EasyUHCModule.java @@ -1,21 +1,21 @@ -package alisolarflare.easyuhc; +package alisolarflare.modules.easyuhc; import org.bukkit.Location; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.Module; -import alisolarflare.easyuhc.commands.ActivatePowers; -import alisolarflare.easyuhc.commands.SetUHCLobby; -import alisolarflare.easyuhc.commands.SetWorldBorders; -import alisolarflare.easyuhc.commands.SpreadPlayers; -import alisolarflare.easyuhc.commands.StartTimer; -import alisolarflare.easyuhc.commands.StartUHC; -import alisolarflare.easyuhc.commands.TeleportToUHC; -import alisolarflare.easyuhc.gpowers.GPowerMemory; -import alisolarflare.easyuhc.gpowers.commands.GPower; -import alisolarflare.easyuhc.gpowers.commands.PowerDown; -import alisolarflare.easyuhc.gpowers.commands.PowerUp; -import alisolarflare.easyuhc.gpowers.listeners.gPowerListener; +import alisolarflare.modules.Module; +import alisolarflare.modules.easyuhc.commands.ActivatePowers; +import alisolarflare.modules.easyuhc.commands.SetUHCLobby; +import alisolarflare.modules.easyuhc.commands.SetWorldBorders; +import alisolarflare.modules.easyuhc.commands.SpreadPlayers; +import alisolarflare.modules.easyuhc.commands.StartTimer; +import alisolarflare.modules.easyuhc.commands.StartUHC; +import alisolarflare.modules.easyuhc.commands.TeleportToUHC; +import alisolarflare.modules.easyuhc.gpowers.GPowerMemory; +import alisolarflare.modules.easyuhc.gpowers.commands.GPower; +import alisolarflare.modules.easyuhc.gpowers.commands.PowerDown; +import alisolarflare.modules.easyuhc.gpowers.commands.PowerUp; +import alisolarflare.modules.easyuhc.gpowers.listeners.gPowerListener; public class EasyUHCModule extends Module{ public Location lobbyLocation; diff --git a/src/alisolarflare/easyuhc/commands/ActivatePowers.java b/src/alisolarflare/modules/easyuhc/commands/ActivatePowers.java similarity index 63% rename from src/alisolarflare/easyuhc/commands/ActivatePowers.java rename to src/alisolarflare/modules/easyuhc/commands/ActivatePowers.java index 8f78fa1..3c20dbc 100644 --- a/src/alisolarflare/easyuhc/commands/ActivatePowers.java +++ b/src/alisolarflare/modules/easyuhc/commands/ActivatePowers.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.modules.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.DevCommand; +import alisolarflare.modules.ModCommand; -public class ActivatePowers extends DevCommand{ +public class ActivatePowers extends ModCommand{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/SetUHCLobby.java b/src/alisolarflare/modules/easyuhc/commands/SetUHCLobby.java similarity index 71% rename from src/alisolarflare/easyuhc/commands/SetUHCLobby.java rename to src/alisolarflare/modules/easyuhc/commands/SetUHCLobby.java index 72609eb..380acb3 100644 --- a/src/alisolarflare/easyuhc/commands/SetUHCLobby.java +++ b/src/alisolarflare/modules/easyuhc/commands/SetUHCLobby.java @@ -1,12 +1,12 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.modules.easyuhc.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.DevCommand; -import alisolarflare.easyuhc.EasyUHCModule; +import alisolarflare.modules.ModCommand; +import alisolarflare.modules.easyuhc.EasyUHCModule; -public class SetUHCLobby extends DevCommand{ +public class SetUHCLobby extends ModCommand{ EasyUHCModule module; public SetUHCLobby(EasyUHCModule easyUHCModule) { this.module = easyUHCModule; diff --git a/src/alisolarflare/easyuhc/commands/SetWorldBorders.java b/src/alisolarflare/modules/easyuhc/commands/SetWorldBorders.java similarity index 63% rename from src/alisolarflare/easyuhc/commands/SetWorldBorders.java rename to src/alisolarflare/modules/easyuhc/commands/SetWorldBorders.java index 0f66241..7dfd016 100644 --- a/src/alisolarflare/easyuhc/commands/SetWorldBorders.java +++ b/src/alisolarflare/modules/easyuhc/commands/SetWorldBorders.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.modules.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.DevCommand; +import alisolarflare.modules.ModCommand; -public class SetWorldBorders extends DevCommand { +public class SetWorldBorders extends ModCommand { @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java b/src/alisolarflare/modules/easyuhc/commands/ShrinkWorldBorders.java similarity index 65% rename from src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java rename to src/alisolarflare/modules/easyuhc/commands/ShrinkWorldBorders.java index 76f993b..cacd3d6 100644 --- a/src/alisolarflare/easyuhc/commands/ShrinkWorldBorders.java +++ b/src/alisolarflare/modules/easyuhc/commands/ShrinkWorldBorders.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.modules.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.DevCommand; +import alisolarflare.modules.ModCommand; -public class ShrinkWorldBorders extends DevCommand { +public class ShrinkWorldBorders extends ModCommand { @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/SpreadPlayers.java b/src/alisolarflare/modules/easyuhc/commands/SpreadPlayers.java similarity index 66% rename from src/alisolarflare/easyuhc/commands/SpreadPlayers.java rename to src/alisolarflare/modules/easyuhc/commands/SpreadPlayers.java index 2b3cb12..53faba9 100644 --- a/src/alisolarflare/easyuhc/commands/SpreadPlayers.java +++ b/src/alisolarflare/modules/easyuhc/commands/SpreadPlayers.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.modules.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.DevCommand; +import alisolarflare.modules.ModCommand; -public class SpreadPlayers extends DevCommand{ +public class SpreadPlayers extends ModCommand{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/StartTimer.java b/src/alisolarflare/modules/easyuhc/commands/StartTimer.java similarity index 66% rename from src/alisolarflare/easyuhc/commands/StartTimer.java rename to src/alisolarflare/modules/easyuhc/commands/StartTimer.java index c7c613c..b044130 100644 --- a/src/alisolarflare/easyuhc/commands/StartTimer.java +++ b/src/alisolarflare/modules/easyuhc/commands/StartTimer.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.modules.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.DevCommand; +import alisolarflare.modules.ModCommand; -public class StartTimer extends DevCommand{ +public class StartTimer extends ModCommand{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/StartUHC.java b/src/alisolarflare/modules/easyuhc/commands/StartUHC.java similarity index 66% rename from src/alisolarflare/easyuhc/commands/StartUHC.java rename to src/alisolarflare/modules/easyuhc/commands/StartUHC.java index 63d9df7..0c8f2d0 100644 --- a/src/alisolarflare/easyuhc/commands/StartUHC.java +++ b/src/alisolarflare/modules/easyuhc/commands/StartUHC.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.modules.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.DevCommand; +import alisolarflare.modules.ModCommand; -public class StartUHC extends DevCommand{ +public class StartUHC extends ModCommand{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/commands/TeleportToUHC.java b/src/alisolarflare/modules/easyuhc/commands/TeleportToUHC.java similarity index 65% rename from src/alisolarflare/easyuhc/commands/TeleportToUHC.java rename to src/alisolarflare/modules/easyuhc/commands/TeleportToUHC.java index 463f30a..ee9050e 100644 --- a/src/alisolarflare/easyuhc/commands/TeleportToUHC.java +++ b/src/alisolarflare/modules/easyuhc/commands/TeleportToUHC.java @@ -1,10 +1,10 @@ -package alisolarflare.easyuhc.commands; +package alisolarflare.modules.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.DevCommand; +import alisolarflare.modules.PlayerCommand; -public class TeleportToUHC extends DevCommand{ +public class TeleportToUHC extends PlayerCommand{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { diff --git a/src/alisolarflare/easyuhc/gpowers/GPowerMemory.java b/src/alisolarflare/modules/easyuhc/gpowers/GPowerMemory.java similarity index 93% rename from src/alisolarflare/easyuhc/gpowers/GPowerMemory.java rename to src/alisolarflare/modules/easyuhc/gpowers/GPowerMemory.java index ccbab17..83a35be 100644 --- a/src/alisolarflare/easyuhc/gpowers/GPowerMemory.java +++ b/src/alisolarflare/modules/easyuhc/gpowers/GPowerMemory.java @@ -1,4 +1,4 @@ -package alisolarflare.easyuhc.gpowers; +package alisolarflare.modules.easyuhc.gpowers; import java.util.HashMap; import java.util.Map; diff --git a/src/alisolarflare/easyuhc/gpowers/commands/GPower.java b/src/alisolarflare/modules/easyuhc/gpowers/commands/GPower.java similarity index 82% rename from src/alisolarflare/easyuhc/gpowers/commands/GPower.java rename to src/alisolarflare/modules/easyuhc/gpowers/commands/GPower.java index b261519..6469d21 100644 --- a/src/alisolarflare/easyuhc/gpowers/commands/GPower.java +++ b/src/alisolarflare/modules/easyuhc/gpowers/commands/GPower.java @@ -1,12 +1,12 @@ -package alisolarflare.easyuhc.gpowers.commands; +package alisolarflare.modules.easyuhc.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.easyuhc.gpowers.GPowerMemory; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.PlayerCommand; +import alisolarflare.modules.easyuhc.gpowers.GPowerMemory; -public class GPower extends TBMCCommandBase { +public class GPower extends PlayerCommand { private GPowerMemory gPowerMemory; @@ -62,15 +62,4 @@ public class GPower extends TBMCCommandBase { public String GetCommandPath() { return "gpower"; } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - return false; - } - } diff --git a/src/alisolarflare/easyuhc/gpowers/commands/PowerAll.java b/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerAll.java similarity index 65% rename from src/alisolarflare/easyuhc/gpowers/commands/PowerAll.java rename to src/alisolarflare/modules/easyuhc/gpowers/commands/PowerAll.java index 706d764..fa71fc2 100644 --- a/src/alisolarflare/easyuhc/gpowers/commands/PowerAll.java +++ b/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerAll.java @@ -1,12 +1,12 @@ -package alisolarflare.easyuhc.gpowers.commands; +package alisolarflare.modules.easyuhc.gpowers.commands; import org.bukkit.command.CommandSender; -import alisolarflare.DevCommand; -import alisolarflare.easyuhc.gpowers.GPowerMemory; -import alisolarflare.easyuhc.gpowers.GPowerMemory.poweredPlayer; +import alisolarflare.modules.ModCommand; +import alisolarflare.modules.easyuhc.gpowers.GPowerMemory; +import alisolarflare.modules.easyuhc.gpowers.GPowerMemory.poweredPlayer; -public class PowerAll extends DevCommand{ +public class PowerAll extends ModCommand{ private GPowerMemory gPowerMemory; public PowerAll(GPowerMemory gPowerMemory) { diff --git a/src/alisolarflare/easyuhc/gpowers/commands/PowerDown.java b/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerDown.java similarity index 61% rename from src/alisolarflare/easyuhc/gpowers/commands/PowerDown.java rename to src/alisolarflare/modules/easyuhc/gpowers/commands/PowerDown.java index 46f1717..f5bb5e2 100644 --- a/src/alisolarflare/easyuhc/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerDown.java @@ -1,12 +1,12 @@ -package alisolarflare.easyuhc.gpowers.commands; +package alisolarflare.modules.easyuhc.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.easyuhc.gpowers.GPowerMemory; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.PlayerCommand; +import alisolarflare.modules.easyuhc.gpowers.GPowerMemory; -public class PowerDown extends TBMCCommandBase { +public class PowerDown extends PlayerCommand { private GPowerMemory gPowerMemory; @@ -33,17 +33,4 @@ public class PowerDown extends TBMCCommandBase { public String GetCommandPath() { return "powerdown"; } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - } diff --git a/src/alisolarflare/easyuhc/gpowers/commands/PowerUp.java b/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerUp.java similarity index 63% rename from src/alisolarflare/easyuhc/gpowers/commands/PowerUp.java rename to src/alisolarflare/modules/easyuhc/gpowers/commands/PowerUp.java index 0f5748c..78c5b2b 100644 --- a/src/alisolarflare/easyuhc/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerUp.java @@ -1,12 +1,12 @@ -package alisolarflare.easyuhc.gpowers.commands; +package alisolarflare.modules.easyuhc.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.easyuhc.gpowers.GPowerMemory; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.PlayerCommand; +import alisolarflare.modules.easyuhc.gpowers.GPowerMemory; -public class PowerUp extends TBMCCommandBase { +public class PowerUp extends PlayerCommand { private GPowerMemory gPowerMemory; @@ -34,16 +34,4 @@ public class PowerUp extends TBMCCommandBase { public String GetCommandPath() { return "powerup"; } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - } diff --git a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/modules/easyuhc/gpowers/listeners/gPowerApplyingTask.java similarity index 94% rename from src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java rename to src/alisolarflare/modules/easyuhc/gpowers/listeners/gPowerApplyingTask.java index 35dcec2..e8c05c8 100644 --- a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/modules/easyuhc/gpowers/listeners/gPowerApplyingTask.java @@ -1,4 +1,4 @@ -package alisolarflare.easyuhc.gpowers.listeners; +package alisolarflare.modules.easyuhc.gpowers.listeners; import java.util.Map; import java.util.UUID; @@ -10,7 +10,7 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitRunnable; -import alisolarflare.easyuhc.gpowers.GPowerMemory.poweredPlayer; +import alisolarflare.modules.easyuhc.gpowers.GPowerMemory.poweredPlayer; public class gPowerApplyingTask extends BukkitRunnable{ private int powerLength = 300; diff --git a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java b/src/alisolarflare/modules/easyuhc/gpowers/listeners/gPowerListener.java similarity index 70% rename from src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java rename to src/alisolarflare/modules/easyuhc/gpowers/listeners/gPowerListener.java index 76bae71..461387e 100644 --- a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/modules/easyuhc/gpowers/listeners/gPowerListener.java @@ -1,9 +1,9 @@ -package alisolarflare.easyuhc.gpowers.listeners; +package alisolarflare.modules.easyuhc.gpowers.listeners; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.easyuhc.gpowers.GPowerMemory; +import alisolarflare.modules.easyuhc.gpowers.GPowerMemory; public class gPowerListener implements Listener{ diff --git a/src/alisolarflare/magic/MagicModule.java b/src/alisolarflare/modules/magic/MagicModule.java similarity index 53% rename from src/alisolarflare/magic/MagicModule.java rename to src/alisolarflare/modules/magic/MagicModule.java index 616b179..76477c2 100644 --- a/src/alisolarflare/magic/MagicModule.java +++ b/src/alisolarflare/modules/magic/MagicModule.java @@ -1,11 +1,11 @@ -package alisolarflare.magic; +package alisolarflare.modules.magic; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.Module; -import alisolarflare.magic.tricks.AliArrowListener; -import alisolarflare.magic.tricks.BoomBowDeathListener; -import alisolarflare.magic.tricks.BoomBowListener; +import alisolarflare.modules.Module; +import alisolarflare.modules.magic.tricks.AliArrowListener; +import alisolarflare.modules.magic.tricks.BoomBowDeathListener; +import alisolarflare.modules.magic.tricks.BoomBowListener; public class MagicModule extends Module{ diff --git a/src/alisolarflare/magic/tricks/AliArrowListener.java b/src/alisolarflare/modules/magic/tricks/AliArrowListener.java similarity index 92% rename from src/alisolarflare/magic/tricks/AliArrowListener.java rename to src/alisolarflare/modules/magic/tricks/AliArrowListener.java index 36b8e12..437fa02 100644 --- a/src/alisolarflare/magic/tricks/AliArrowListener.java +++ b/src/alisolarflare/modules/magic/tricks/AliArrowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.magic.tricks; +package alisolarflare.modules.magic.tricks; import org.bukkit.entity.Arrow; import org.bukkit.entity.EntityType; diff --git a/src/alisolarflare/magic/tricks/AliArrowTask.java b/src/alisolarflare/modules/magic/tricks/AliArrowTask.java similarity index 91% rename from src/alisolarflare/magic/tricks/AliArrowTask.java rename to src/alisolarflare/modules/magic/tricks/AliArrowTask.java index 10252b8..b21f161 100644 --- a/src/alisolarflare/magic/tricks/AliArrowTask.java +++ b/src/alisolarflare/modules/magic/tricks/AliArrowTask.java @@ -1,4 +1,4 @@ -package alisolarflare.magic.tricks; +package alisolarflare.modules.magic.tricks; import org.bukkit.Particle; import org.bukkit.entity.Arrow; diff --git a/src/alisolarflare/magic/tricks/BoomBowDeathListener.java b/src/alisolarflare/modules/magic/tricks/BoomBowDeathListener.java similarity index 89% rename from src/alisolarflare/magic/tricks/BoomBowDeathListener.java rename to src/alisolarflare/modules/magic/tricks/BoomBowDeathListener.java index 427537e..5a7b749 100644 --- a/src/alisolarflare/magic/tricks/BoomBowDeathListener.java +++ b/src/alisolarflare/modules/magic/tricks/BoomBowDeathListener.java @@ -1,4 +1,4 @@ -package alisolarflare.magic.tricks; +package alisolarflare.modules.magic.tricks; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; diff --git a/src/alisolarflare/magic/tricks/BoomBowListener.java b/src/alisolarflare/modules/magic/tricks/BoomBowListener.java similarity index 95% rename from src/alisolarflare/magic/tricks/BoomBowListener.java rename to src/alisolarflare/modules/magic/tricks/BoomBowListener.java index 5e74bd8..d650646 100644 --- a/src/alisolarflare/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/modules/magic/tricks/BoomBowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.magic.tricks; +package alisolarflare.modules.magic.tricks; import org.bukkit.GameMode; import org.bukkit.Location; diff --git a/src/alisolarflare/magic/tricks/BoomBowRule.java b/src/alisolarflare/modules/magic/tricks/BoomBowRule.java similarity index 82% rename from src/alisolarflare/magic/tricks/BoomBowRule.java rename to src/alisolarflare/modules/magic/tricks/BoomBowRule.java index bbfbf8f..e701070 100644 --- a/src/alisolarflare/magic/tricks/BoomBowRule.java +++ b/src/alisolarflare/modules/magic/tricks/BoomBowRule.java @@ -1,11 +1,11 @@ -package alisolarflare.magic.tricks; +package alisolarflare.modules.magic.tricks; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.ModCommand; //HEHEHHEHEH EAASSSTER EGGS -public class BoomBowRule extends TBMCCommandBase{ +public class BoomBowRule extends ModCommand{ public static boolean boomDecay; public static boolean healthReduction; public static boolean endCrystal; @@ -70,15 +70,4 @@ public class BoomBowRule extends TBMCCommandBase{ // TODO Auto-generated method stub return null; } - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - } diff --git a/src/alisolarflare/magic/tricks/BoomDecayTask.java b/src/alisolarflare/modules/magic/tricks/BoomDecayTask.java similarity index 87% rename from src/alisolarflare/magic/tricks/BoomDecayTask.java rename to src/alisolarflare/modules/magic/tricks/BoomDecayTask.java index 5f1875c..5cc0401 100644 --- a/src/alisolarflare/magic/tricks/BoomDecayTask.java +++ b/src/alisolarflare/modules/magic/tricks/BoomDecayTask.java @@ -1,4 +1,4 @@ -package alisolarflare.magic.tricks; +package alisolarflare.modules.magic.tricks; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/alisolarflare/minigames/GameState.java b/src/alisolarflare/modules/minigames/GameState.java similarity index 54% rename from src/alisolarflare/minigames/GameState.java rename to src/alisolarflare/modules/minigames/GameState.java index 5c63bf3..c985192 100644 --- a/src/alisolarflare/minigames/GameState.java +++ b/src/alisolarflare/modules/minigames/GameState.java @@ -1,4 +1,4 @@ -package alisolarflare.minigames; +package alisolarflare.modules.minigames; public enum GameState { Idle, FreeForAll, Heroes; diff --git a/src/alisolarflare/minigames/MinigameModule.java b/src/alisolarflare/modules/minigames/MinigameModule.java similarity index 60% rename from src/alisolarflare/minigames/MinigameModule.java rename to src/alisolarflare/modules/minigames/MinigameModule.java index fe8712c..30f832e 100644 --- a/src/alisolarflare/minigames/MinigameModule.java +++ b/src/alisolarflare/modules/minigames/MinigameModule.java @@ -1,15 +1,15 @@ -package alisolarflare.minigames; +package alisolarflare.modules.minigames; import java.util.List; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.Module; -import alisolarflare.minigames.commands.JoinMinigame; -import alisolarflare.minigames.commands.LeaveMinigame; -import alisolarflare.minigames.commands.ListFighters; -import alisolarflare.minigames.commands.SetColourSpawn; -import alisolarflare.minigames.data.SpawnSet; +import alisolarflare.modules.Module; +import alisolarflare.modules.minigames.commands.JoinMinigame; +import alisolarflare.modules.minigames.commands.LeaveMinigame; +import alisolarflare.modules.minigames.commands.ListFighters; +import alisolarflare.modules.minigames.commands.SetColourSpawn; +import alisolarflare.modules.minigames.data.SpawnSet; public class MinigameModule extends Module{ public SpawnSet spawnSet; diff --git a/src/alisolarflare/minigames/commands/JoinMinigame.java b/src/alisolarflare/modules/minigames/commands/JoinMinigame.java similarity index 68% rename from src/alisolarflare/minigames/commands/JoinMinigame.java rename to src/alisolarflare/modules/minigames/commands/JoinMinigame.java index fc194cd..5e00593 100644 --- a/src/alisolarflare/minigames/commands/JoinMinigame.java +++ b/src/alisolarflare/modules/minigames/commands/JoinMinigame.java @@ -1,12 +1,12 @@ -package alisolarflare.minigames.commands; +package alisolarflare.modules.minigames.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.minigames.MinigameModule; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.PlayerCommand; +import alisolarflare.modules.minigames.MinigameModule; -public class JoinMinigame extends TBMCCommandBase { +public class JoinMinigame extends PlayerCommand { private MinigameModule module; public JoinMinigame(MinigameModule module) { @@ -39,15 +39,4 @@ public class JoinMinigame extends TBMCCommandBase { // TODO Auto-generated method stub return null; } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - return false; - } - } diff --git a/src/alisolarflare/minigames/commands/LeaveMinigame.java b/src/alisolarflare/modules/minigames/commands/LeaveMinigame.java similarity index 68% rename from src/alisolarflare/minigames/commands/LeaveMinigame.java rename to src/alisolarflare/modules/minigames/commands/LeaveMinigame.java index f234a32..555f0f7 100644 --- a/src/alisolarflare/minigames/commands/LeaveMinigame.java +++ b/src/alisolarflare/modules/minigames/commands/LeaveMinigame.java @@ -1,12 +1,12 @@ -package alisolarflare.minigames.commands; +package alisolarflare.modules.minigames.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.minigames.MinigameModule; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.PlayerCommand; +import alisolarflare.modules.minigames.MinigameModule; -public class LeaveMinigame extends TBMCCommandBase { +public class LeaveMinigame extends PlayerCommand { private MinigameModule module; @@ -39,15 +39,4 @@ public class LeaveMinigame extends TBMCCommandBase { // TODO Auto-generated method stub return null; } - - @Override - public boolean GetPlayerOnly() { - return true; - } - - @Override - public boolean GetModOnly() { - return false; - } - } diff --git a/src/alisolarflare/minigames/commands/ListFighters.java b/src/alisolarflare/modules/minigames/commands/ListFighters.java similarity index 54% rename from src/alisolarflare/minigames/commands/ListFighters.java rename to src/alisolarflare/modules/minigames/commands/ListFighters.java index 6dda457..9174358 100644 --- a/src/alisolarflare/minigames/commands/ListFighters.java +++ b/src/alisolarflare/modules/minigames/commands/ListFighters.java @@ -1,11 +1,11 @@ -package alisolarflare.minigames.commands; +package alisolarflare.modules.minigames.commands; import org.bukkit.command.CommandSender; -import alisolarflare.minigames.MinigameModule; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.PlayerCommand; +import alisolarflare.modules.minigames.MinigameModule; -public class ListFighters extends TBMCCommandBase { +public class ListFighters extends PlayerCommand { private MinigameModule lobby; public ListFighters(MinigameModule lobby) { @@ -23,15 +23,4 @@ public class ListFighters extends TBMCCommandBase { // TODO Auto-generated method stub return null; } - - @Override - public boolean GetPlayerOnly() { - return false; - } - - @Override - public boolean GetModOnly() { - return false; - } - } diff --git a/src/alisolarflare/minigames/commands/SetColourSpawn.java b/src/alisolarflare/modules/minigames/commands/SetColourSpawn.java similarity index 79% rename from src/alisolarflare/minigames/commands/SetColourSpawn.java rename to src/alisolarflare/modules/minigames/commands/SetColourSpawn.java index ca9501f..d6c14e3 100644 --- a/src/alisolarflare/minigames/commands/SetColourSpawn.java +++ b/src/alisolarflare/modules/minigames/commands/SetColourSpawn.java @@ -1,12 +1,12 @@ -package alisolarflare.minigames.commands; +package alisolarflare.modules.minigames.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.minigames.data.SpawnSet; -import buttondevteam.lib.chat.TBMCCommandBase; +import alisolarflare.modules.PlayerCommand; +import alisolarflare.modules.minigames.data.SpawnSet; -public class SetColourSpawn extends TBMCCommandBase{ +public class SetColourSpawn extends PlayerCommand{ private SpawnSet spawnSet; public SetColourSpawn(SpawnSet spawnSet){ @@ -70,15 +70,4 @@ public class SetColourSpawn extends TBMCCommandBase{ // TODO Auto-generated method stub return null; } - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - } diff --git a/src/alisolarflare/minigames/data/SpawnSet.java b/src/alisolarflare/modules/minigames/data/SpawnSet.java similarity index 92% rename from src/alisolarflare/minigames/data/SpawnSet.java rename to src/alisolarflare/modules/minigames/data/SpawnSet.java index 40fd0ae..10f519e 100644 --- a/src/alisolarflare/minigames/data/SpawnSet.java +++ b/src/alisolarflare/modules/minigames/data/SpawnSet.java @@ -1,4 +1,4 @@ -package alisolarflare.minigames.data; +package alisolarflare.modules.minigames.data; import org.bukkit.Location; diff --git a/src/alisolarflare/minigames/entities/Fighter.java b/src/alisolarflare/modules/minigames/entities/Fighter.java similarity index 74% rename from src/alisolarflare/minigames/entities/Fighter.java rename to src/alisolarflare/modules/minigames/entities/Fighter.java index 557c1ae..ace6db1 100644 --- a/src/alisolarflare/minigames/entities/Fighter.java +++ b/src/alisolarflare/modules/minigames/entities/Fighter.java @@ -1,4 +1,4 @@ -package alisolarflare.minigames.entities; +package alisolarflare.modules.minigames.entities; import org.bukkit.entity.Player; diff --git a/src/graveyard/shulker/AliShulkerModule.java b/src/graveyard/shulker/AliShulkerModule.java index 3425a02..6b47bdd 100644 --- a/src/graveyard/shulker/AliShulkerModule.java +++ b/src/graveyard/shulker/AliShulkerModule.java @@ -2,7 +2,7 @@ package graveyard.shulker; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.Module; +import alisolarflare.modules.Module; import graveyard.shulker.commands.AliShulker; /**@deprecated*/ From 70d8f93597a55c1072103441a1dd8f80e195a716 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 11 Nov 2016 20:03:19 -0500 Subject: [PATCH 117/263] Removed GetHelpText --- .../components/flairdoor/commands/FlairMe.java | 6 ------ .../modules/autouhc/controller/SetMatchState.java | 5 ----- src/alisolarflare/modules/autouhc/idle/AddToUHC.java | 6 ------ src/alisolarflare/modules/autouhc/idle/JoinUHC.java | 6 ------ src/alisolarflare/modules/autouhc/intro/ConfigureMatch.java | 6 ------ src/alisolarflare/modules/autouhc/intro/ScheduleMatch.java | 6 ------ src/alisolarflare/modules/autouhc/intro/StartMatch.java | 6 ------ .../modules/creativeboundaries/commands/Cbgm0.java | 6 ------ .../modules/creativeboundaries/commands/Cbgm1.java | 6 ------ .../modules/creativeboundaries/commands/SetDickmode.java | 6 ------ .../modules/easyuhc/commands/ActivatePowers.java | 6 ------ src/alisolarflare/modules/easyuhc/commands/SetUHCLobby.java | 6 ------ .../modules/easyuhc/commands/SetWorldBorders.java | 6 ------ .../modules/easyuhc/commands/ShrinkWorldBorders.java | 6 ------ .../modules/easyuhc/commands/SpreadPlayers.java | 6 ------ src/alisolarflare/modules/easyuhc/commands/StartTimer.java | 6 ------ src/alisolarflare/modules/easyuhc/commands/StartUHC.java | 6 ------ .../modules/easyuhc/commands/TeleportToUHC.java | 6 ------ .../modules/easyuhc/gpowers/commands/GPower.java | 6 ------ .../modules/easyuhc/gpowers/commands/PowerAll.java | 6 ------ .../modules/easyuhc/gpowers/commands/PowerDown.java | 6 ------ .../modules/easyuhc/gpowers/commands/PowerUp.java | 6 ------ .../modules/minigames/commands/JoinMinigame.java | 6 ------ .../modules/minigames/commands/LeaveMinigame.java | 6 ------ .../modules/minigames/commands/ListFighters.java | 6 ------ .../modules/minigames/commands/SetColourSpawn.java | 5 ----- 26 files changed, 154 deletions(-) diff --git a/src/alisolarflare/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java index fab0112..52d36f0 100644 --- a/src/alisolarflare/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -15,12 +15,6 @@ public class FlairMe extends PlayerCommand { return false; } - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return new String[] { "" }; - } - @Override public String GetCommandPath() { return "flairme"; diff --git a/src/alisolarflare/modules/autouhc/controller/SetMatchState.java b/src/alisolarflare/modules/autouhc/controller/SetMatchState.java index f6a4aa3..8078fea 100644 --- a/src/alisolarflare/modules/autouhc/controller/SetMatchState.java +++ b/src/alisolarflare/modules/autouhc/controller/SetMatchState.java @@ -67,10 +67,5 @@ public class SetMatchState extends ModCommand{ // TODO Auto-generated method stub return false; } - - @Override - public String[] GetHelpText(String alias) { - return new String[] { "" }; - } } diff --git a/src/alisolarflare/modules/autouhc/idle/AddToUHC.java b/src/alisolarflare/modules/autouhc/idle/AddToUHC.java index 8d3abee..5cfd45a 100644 --- a/src/alisolarflare/modules/autouhc/idle/AddToUHC.java +++ b/src/alisolarflare/modules/autouhc/idle/AddToUHC.java @@ -51,10 +51,4 @@ public class AddToUHC extends ModCommand { return false; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/alisolarflare/modules/autouhc/idle/JoinUHC.java b/src/alisolarflare/modules/autouhc/idle/JoinUHC.java index ba6621d..b948c8f 100644 --- a/src/alisolarflare/modules/autouhc/idle/JoinUHC.java +++ b/src/alisolarflare/modules/autouhc/idle/JoinUHC.java @@ -14,12 +14,6 @@ public class JoinUHC extends ModCommand{ this.match = match; } - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { if (!(sender instanceof Player)) diff --git a/src/alisolarflare/modules/autouhc/intro/ConfigureMatch.java b/src/alisolarflare/modules/autouhc/intro/ConfigureMatch.java index 9ebab8c..dc5a58f 100644 --- a/src/alisolarflare/modules/autouhc/intro/ConfigureMatch.java +++ b/src/alisolarflare/modules/autouhc/intro/ConfigureMatch.java @@ -11,12 +11,6 @@ public class ConfigureMatch extends ModCommand{ // TODO Auto-generated constructor stub } - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { // TODO Auto-generated method stub diff --git a/src/alisolarflare/modules/autouhc/intro/ScheduleMatch.java b/src/alisolarflare/modules/autouhc/intro/ScheduleMatch.java index ae6361b..a451386 100644 --- a/src/alisolarflare/modules/autouhc/intro/ScheduleMatch.java +++ b/src/alisolarflare/modules/autouhc/intro/ScheduleMatch.java @@ -11,12 +11,6 @@ public class ScheduleMatch extends ModCommand{ // TODO Auto-generated constructor stub } - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { // TODO Auto-generated method stub diff --git a/src/alisolarflare/modules/autouhc/intro/StartMatch.java b/src/alisolarflare/modules/autouhc/intro/StartMatch.java index c39d968..5484653 100644 --- a/src/alisolarflare/modules/autouhc/intro/StartMatch.java +++ b/src/alisolarflare/modules/autouhc/intro/StartMatch.java @@ -44,12 +44,6 @@ public class StartMatch extends ModCommand { } - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - @Override public String GetCommandPath() { return "startmatch"; diff --git a/src/alisolarflare/modules/creativeboundaries/commands/Cbgm0.java b/src/alisolarflare/modules/creativeboundaries/commands/Cbgm0.java index 832cace..70da940 100644 --- a/src/alisolarflare/modules/creativeboundaries/commands/Cbgm0.java +++ b/src/alisolarflare/modules/creativeboundaries/commands/Cbgm0.java @@ -27,10 +27,4 @@ public class Cbgm0 extends PlayerCommand{ module.cbCreatives.remove(player); return false; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/alisolarflare/modules/creativeboundaries/commands/Cbgm1.java b/src/alisolarflare/modules/creativeboundaries/commands/Cbgm1.java index e3c7753..b6e888e 100644 --- a/src/alisolarflare/modules/creativeboundaries/commands/Cbgm1.java +++ b/src/alisolarflare/modules/creativeboundaries/commands/Cbgm1.java @@ -60,10 +60,4 @@ public class Cbgm1 extends PlayerCommand { player.sendMessage("Sorry, you're not part of this town"); return false; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/alisolarflare/modules/creativeboundaries/commands/SetDickmode.java b/src/alisolarflare/modules/creativeboundaries/commands/SetDickmode.java index 576844c..bbf3026 100644 --- a/src/alisolarflare/modules/creativeboundaries/commands/SetDickmode.java +++ b/src/alisolarflare/modules/creativeboundaries/commands/SetDickmode.java @@ -33,10 +33,4 @@ public class SetDickmode extends PlayerCommand{ } return false; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/alisolarflare/modules/easyuhc/commands/ActivatePowers.java b/src/alisolarflare/modules/easyuhc/commands/ActivatePowers.java index 3c20dbc..00395d1 100644 --- a/src/alisolarflare/modules/easyuhc/commands/ActivatePowers.java +++ b/src/alisolarflare/modules/easyuhc/commands/ActivatePowers.java @@ -10,10 +10,4 @@ public class ActivatePowers extends ModCommand{ public boolean OnCommand(CommandSender sender, String alias, String[] args) { return false; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/alisolarflare/modules/easyuhc/commands/SetUHCLobby.java b/src/alisolarflare/modules/easyuhc/commands/SetUHCLobby.java index 380acb3..57c9e31 100644 --- a/src/alisolarflare/modules/easyuhc/commands/SetUHCLobby.java +++ b/src/alisolarflare/modules/easyuhc/commands/SetUHCLobby.java @@ -17,11 +17,5 @@ public class SetUHCLobby extends ModCommand{ module.lobbyLocation = ((Player) sender).getLocation(); return false; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/alisolarflare/modules/easyuhc/commands/SetWorldBorders.java b/src/alisolarflare/modules/easyuhc/commands/SetWorldBorders.java index 7dfd016..deb6a12 100644 --- a/src/alisolarflare/modules/easyuhc/commands/SetWorldBorders.java +++ b/src/alisolarflare/modules/easyuhc/commands/SetWorldBorders.java @@ -11,10 +11,4 @@ public class SetWorldBorders extends ModCommand { return false; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/alisolarflare/modules/easyuhc/commands/ShrinkWorldBorders.java b/src/alisolarflare/modules/easyuhc/commands/ShrinkWorldBorders.java index cacd3d6..d15b370 100644 --- a/src/alisolarflare/modules/easyuhc/commands/ShrinkWorldBorders.java +++ b/src/alisolarflare/modules/easyuhc/commands/ShrinkWorldBorders.java @@ -10,11 +10,5 @@ public class ShrinkWorldBorders extends ModCommand { public boolean OnCommand(CommandSender sender, String alias, String[] args) { // TODO Auto-generated method stub return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; } } diff --git a/src/alisolarflare/modules/easyuhc/commands/SpreadPlayers.java b/src/alisolarflare/modules/easyuhc/commands/SpreadPlayers.java index 53faba9..b6cbd9e 100644 --- a/src/alisolarflare/modules/easyuhc/commands/SpreadPlayers.java +++ b/src/alisolarflare/modules/easyuhc/commands/SpreadPlayers.java @@ -11,11 +11,5 @@ public class SpreadPlayers extends ModCommand{ // TODO Auto-generated method stub return false; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/alisolarflare/modules/easyuhc/commands/StartTimer.java b/src/alisolarflare/modules/easyuhc/commands/StartTimer.java index b044130..9d2fb47 100644 --- a/src/alisolarflare/modules/easyuhc/commands/StartTimer.java +++ b/src/alisolarflare/modules/easyuhc/commands/StartTimer.java @@ -11,10 +11,4 @@ public class StartTimer extends ModCommand{ // TODO Auto-generated method stub return false; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/alisolarflare/modules/easyuhc/commands/StartUHC.java b/src/alisolarflare/modules/easyuhc/commands/StartUHC.java index 0c8f2d0..68b7557 100644 --- a/src/alisolarflare/modules/easyuhc/commands/StartUHC.java +++ b/src/alisolarflare/modules/easyuhc/commands/StartUHC.java @@ -11,10 +11,4 @@ public class StartUHC extends ModCommand{ // TODO Auto-generated method stub return false; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/alisolarflare/modules/easyuhc/commands/TeleportToUHC.java b/src/alisolarflare/modules/easyuhc/commands/TeleportToUHC.java index ee9050e..b5c3665 100644 --- a/src/alisolarflare/modules/easyuhc/commands/TeleportToUHC.java +++ b/src/alisolarflare/modules/easyuhc/commands/TeleportToUHC.java @@ -11,10 +11,4 @@ public class TeleportToUHC extends PlayerCommand{ // TODO Auto-generated method stub return false; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/alisolarflare/modules/easyuhc/gpowers/commands/GPower.java b/src/alisolarflare/modules/easyuhc/gpowers/commands/GPower.java index 6469d21..816241a 100644 --- a/src/alisolarflare/modules/easyuhc/gpowers/commands/GPower.java +++ b/src/alisolarflare/modules/easyuhc/gpowers/commands/GPower.java @@ -52,12 +52,6 @@ public class GPower extends PlayerCommand { return false; } - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return new String[] { "" }; - } - @Override public String GetCommandPath() { return "gpower"; diff --git a/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerAll.java b/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerAll.java index fa71fc2..be1c7c8 100644 --- a/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerAll.java +++ b/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerAll.java @@ -19,10 +19,4 @@ public class PowerAll extends ModCommand{ } return false; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerDown.java b/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerDown.java index f5bb5e2..abcffdb 100644 --- a/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerDown.java @@ -23,12 +23,6 @@ public class PowerDown extends PlayerCommand { return false; } - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - @Override public String GetCommandPath() { return "powerdown"; diff --git a/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerUp.java b/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerUp.java index 78c5b2b..db14e9f 100644 --- a/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerUp.java @@ -24,12 +24,6 @@ public class PowerUp extends PlayerCommand { return false; } - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - @Override public String GetCommandPath() { return "powerup"; diff --git a/src/alisolarflare/modules/minigames/commands/JoinMinigame.java b/src/alisolarflare/modules/minigames/commands/JoinMinigame.java index 5e00593..4c958a7 100644 --- a/src/alisolarflare/modules/minigames/commands/JoinMinigame.java +++ b/src/alisolarflare/modules/minigames/commands/JoinMinigame.java @@ -33,10 +33,4 @@ public class JoinMinigame extends PlayerCommand { } return false; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/alisolarflare/modules/minigames/commands/LeaveMinigame.java b/src/alisolarflare/modules/minigames/commands/LeaveMinigame.java index 555f0f7..e712bd0 100644 --- a/src/alisolarflare/modules/minigames/commands/LeaveMinigame.java +++ b/src/alisolarflare/modules/minigames/commands/LeaveMinigame.java @@ -33,10 +33,4 @@ public class LeaveMinigame extends PlayerCommand { return false; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/alisolarflare/modules/minigames/commands/ListFighters.java b/src/alisolarflare/modules/minigames/commands/ListFighters.java index 9174358..0d3b769 100644 --- a/src/alisolarflare/modules/minigames/commands/ListFighters.java +++ b/src/alisolarflare/modules/minigames/commands/ListFighters.java @@ -17,10 +17,4 @@ public class ListFighters extends PlayerCommand { sender.sendMessage(lobby.fighters.toString()); return false; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } diff --git a/src/alisolarflare/modules/minigames/commands/SetColourSpawn.java b/src/alisolarflare/modules/minigames/commands/SetColourSpawn.java index d6c14e3..db07787 100644 --- a/src/alisolarflare/modules/minigames/commands/SetColourSpawn.java +++ b/src/alisolarflare/modules/minigames/commands/SetColourSpawn.java @@ -65,9 +65,4 @@ public class SetColourSpawn extends PlayerCommand{ } return false; } - @Override - public String[] GetHelpText(String arg0) { - // TODO Auto-generated method stub - return null; - } } From cf4bf48fb2e4807e39773b2d455e16ec798a78fe Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 11 Nov 2016 20:29:15 -0500 Subject: [PATCH 118/263] Cleaned up PortalListener code --- .../flairdoor/commands/FlairMe.java | 1 - .../flairdoor/listeners/PortalListener.java | 97 +++++++++---------- 2 files changed, 46 insertions(+), 52 deletions(-) diff --git a/src/alisolarflare/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java index 52d36f0..faca295 100644 --- a/src/alisolarflare/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -11,7 +11,6 @@ public class FlairMe extends PlayerCommand { public boolean OnCommand(CommandSender sender, String label, String[] args) { PortalListener.playersToBeFlaired.add(sender.getName()); sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); - return false; } diff --git a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java index 4ce684a..5788167 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -11,7 +11,6 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerPortalEvent; -import org.bukkit.material.MaterialData; import org.bukkit.material.Wool; import org.bukkit.plugin.java.JavaPlugin; @@ -30,109 +29,105 @@ public class PortalListener implements Listener{ } @EventHandler public void onPortalEnter(PlayerPortalEvent event){ - //SANITATION - Player if(!(event.getPlayer() instanceof Player)){ return; } - //INIT - Player Player player = event.getPlayer(); - //SANITATION - PlayersToBeFlaired if(!(playersToBeFlaired.contains(player.getName()))){ return; } - player.sendMessage("-MAY THE FLAIRING COMMENCE-"); + event.setTo(player.getLocation()); - //INIT - x,y,z int x = player.getLocation().getBlockX(); int y = player.getLocation().getBlockY(); int z = player.getLocation().getBlockZ(); - //INIT - Blocks Under Portal - Block HigherBlock = player.getWorld().getBlockAt(x,y-2,z); - Block MiddleBlock = player.getWorld().getBlockAt(x,y-3,z); - Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); + Block HigherBlock = player.getWorld().getBlockAt(x,y-2,z); //Block under obsidian + Block MiddleBlock = player.getWorld().getBlockAt(x,y-3,z); //Block under higher block + Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); //Block under middle block - //RECOLOUR PLAYER if(HigherBlock.getType() == Material.STONE){ recolourPlayer(player, DyeColor.GRAY); - - //TOP BLOCK IS WOOL? - }else if(HigherBlock.getType() == Material.WOOL){ - Wool wool = (Wool) HigherBlock.getState().getData(); - recolourPlayer(player, wool.getColor()); - - //MIDDLE BLOCK IS WOOL? - }else if(MiddleBlock.getType() == Material.WOOL){ - MaterialData mData = MiddleBlock.getState().getData(); - Wool wool = (Wool) mData; - - recolourPlayer(player, wool.getColor()); - - //BOTTOM BLOCK IS WOOL? - }else if (BottomBlock.getType() == Material.WOOL){ - Wool wool = (Wool) BottomBlock.getState().getData(); - recolourPlayer(player, wool.getColor()); + return; } + DyeColor woolColour = DyeColor.PINK; //Illegal value + if(HigherBlock.getType() == Material.WOOL){ + woolColour = ((Wool) HigherBlock.getState().getData()).getColor(); + }else if(MiddleBlock.getType() == Material.WOOL){ + woolColour = ((Wool) MiddleBlock.getState().getData()).getColor(); + }else if (BottomBlock.getType() == Material.WOOL){ + woolColour = ((Wool) BottomBlock.getState().getData()).getColor(); + }else{ + return; + } + + recolourPlayer(player, woolColour); + } public void recolourPlayer(Player player, DyeColor dyecolour){ User user = essentials.getUser(player); String name = user._getNickname(); - String tempName = ""; + String sanitizedName = ""; for(int i = 0; i < name.length(); i++){ if (name.charAt(i) != '§'){ - tempName += name.charAt(i); + sanitizedName += name.charAt(i); }else{ i++; } } - name = tempName; + + String colourChanger = ""; switch(dyecolour){ - case GRAY: - player.sendMessage("Adding §7GRAY!§f"); - name = "§7" + name; + case GRAY: + colourChanger = "§7"; break; case RED: - player.sendMessage("Adding §4RED!§f"); - name = "§4" + name; + colourChanger = "§4"; break; - case ORANGE: - player.sendMessage("Adding §6ORANGE!§f"); - name = "§6" + name; + case ORANGE: + colourChanger = "§6"; break; case YELLOW: - player.sendMessage("Adding §eYELLOW!§f"); - name = "§e" + name; + colourChanger = "§e"; break; case LIME: + colourChanger = "§a"; + break; case GREEN: - player.sendMessage("Adding §aGREEN!§f"); - name = "§a" + name; + colourChanger = "§a"; break; case CYAN: + colourChanger = "§9"; + break; case LIGHT_BLUE: - case BLUE: - player.sendMessage("Adding §9BLUE!§f"); - name = "§9" + name; + colourChanger = "§9"; + break; + case BLUE: + colourChanger = "§9"; break; case PURPLE: - player.sendMessage("Adding §5PURPLE!§f"); - name = "§5" + name; + colourChanger = "§5"; break; case WHITE: - player.sendMessage("Adding §fWHITE!§f"); - name = "§f" + name; + colourChanger = "§f"; + break; default: player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); break; } - user.setNickname(name); + + String newName = colourChanger + sanitizedName; + user.setNickname(newName); + + player.sendMessage("Adding the colour " + colourChanger + dyecolour.name() + "§f!"); player.sendMessage("Your name is now: " + user.getNickname() +"!"); + playersToBeFlaired.remove(player.getName()); } } From 8f9a3b7457829d86ef272dd6462d94bf8df7f02f Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 11 Nov 2016 20:53:43 -0500 Subject: [PATCH 119/263] Deprecated Autouhc --- .../flairdoor/commands/FlairMe.java | 3 ++- .../flairdoor/listeners/PortalListener.java | 4 ++-- .../modules/easyuhc/EasyUHCModule.java | 11 --------- .../{easyuhc => }/gpowers/GPowerMemory.java | 2 +- .../modules/gpowers/GPowerModule.java | 24 +++++++++++++++++++ .../gpowers/commands/GPower.java | 4 ++-- .../gpowers/commands/PowerAll.java | 6 ++--- .../gpowers/commands/PowerDown.java | 4 ++-- .../gpowers/commands/PowerUp.java | 4 ++-- .../gpowers/listeners/gPowerApplyingTask.java | 4 ++-- .../gpowers/listeners/gPowerListener.java | 4 ++-- .../autouhc/UHCModule.java | 14 ++++------- .../autouhc/controller/SetMatchState.java | 6 ++--- .../autouhc/idle/AddToUHC.java | 4 ++-- .../autouhc/idle/JoinUHC.java | 4 ++-- .../autouhc/intro/ConfigureMatch.java | 4 ++-- .../autouhc/intro/IntroductionCutscene.java | 2 +- .../autouhc/intro/ScheduleMatch.java | 4 ++-- .../autouhc/intro/StartMatch.java | 6 ++--- .../listeners/MatchCyclingListener.java | 2 +- .../autouhc/listeners/MatchMainLoop.java | 2 +- .../autouhc/memory/MatchState.java | 2 +- .../autouhc/memory/UHCMatch.java | 2 +- .../thebuttonrebirth/ButtonRebirthPlugin.java | 10 ++++---- .../thebuttonrebirth/admin/CreateShrine.java | 4 ++-- .../thebuttonrebirth/commands/ShowBars.java | 4 ++-- .../listeners/CyclicalDisplayListener.java | 6 ++--- .../listeners/MidnightListener.java | 6 ++--- .../listeners/StealChestListener.java | 6 ++--- .../tasks/CheckChestTask.java | 6 ++--- .../tasks/CyclicalDisplayTask.java | 4 ++-- .../tasks/StealChestTask.java | 4 ++-- 32 files changed, 90 insertions(+), 82 deletions(-) rename src/alisolarflare/modules/{easyuhc => }/gpowers/GPowerMemory.java (93%) create mode 100644 src/alisolarflare/modules/gpowers/GPowerModule.java rename src/alisolarflare/modules/{easyuhc => }/gpowers/commands/GPower.java (91%) rename src/alisolarflare/modules/{easyuhc => }/gpowers/commands/PowerAll.java (71%) rename src/alisolarflare/modules/{easyuhc => }/gpowers/commands/PowerDown.java (82%) rename src/alisolarflare/modules/{easyuhc => }/gpowers/commands/PowerUp.java (82%) rename src/alisolarflare/modules/{easyuhc => }/gpowers/listeners/gPowerApplyingTask.java (94%) rename src/alisolarflare/modules/{easyuhc => }/gpowers/listeners/gPowerListener.java (70%) rename src/{alisolarflare/modules => graveyard}/autouhc/UHCModule.java (59%) rename src/{alisolarflare/modules => graveyard}/autouhc/controller/SetMatchState.java (91%) rename src/{alisolarflare/modules => graveyard}/autouhc/idle/AddToUHC.java (90%) rename src/{alisolarflare/modules => graveyard}/autouhc/idle/JoinUHC.java (88%) rename src/{alisolarflare/modules => graveyard}/autouhc/intro/ConfigureMatch.java (75%) rename src/{alisolarflare/modules => graveyard}/autouhc/intro/IntroductionCutscene.java (64%) rename src/{alisolarflare/modules => graveyard}/autouhc/intro/ScheduleMatch.java (75%) rename src/{alisolarflare/modules => graveyard}/autouhc/intro/StartMatch.java (84%) rename src/{alisolarflare/modules => graveyard}/autouhc/listeners/MatchCyclingListener.java (88%) rename src/{alisolarflare/modules => graveyard}/autouhc/listeners/MatchMainLoop.java (69%) rename src/{alisolarflare/modules => graveyard}/autouhc/memory/MatchState.java (85%) rename src/{alisolarflare/modules => graveyard}/autouhc/memory/UHCMatch.java (92%) rename src/graveyard/{shulker => }/thebuttonrebirth/ButtonRebirthPlugin.java (83%) rename src/graveyard/{shulker => }/thebuttonrebirth/admin/CreateShrine.java (94%) rename src/graveyard/{shulker => }/thebuttonrebirth/commands/ShowBars.java (81%) rename src/graveyard/{shulker => }/thebuttonrebirth/listeners/CyclicalDisplayListener.java (70%) rename src/graveyard/{shulker => }/thebuttonrebirth/listeners/MidnightListener.java (65%) rename src/graveyard/{shulker => }/thebuttonrebirth/listeners/StealChestListener.java (65%) rename src/graveyard/{shulker => }/thebuttonrebirth/tasks/CheckChestTask.java (94%) rename src/graveyard/{shulker => }/thebuttonrebirth/tasks/CyclicalDisplayTask.java (95%) rename src/graveyard/{shulker => }/thebuttonrebirth/tasks/StealChestTask.java (95%) diff --git a/src/alisolarflare/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java index faca295..8745da8 100644 --- a/src/alisolarflare/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -1,6 +1,7 @@ package alisolarflare.components.flairdoor.commands; import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import alisolarflare.components.flairdoor.listeners.PortalListener; import alisolarflare.modules.PlayerCommand; @@ -9,7 +10,7 @@ public class FlairMe extends PlayerCommand { @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { - PortalListener.playersToBeFlaired.add(sender.getName()); + PortalListener.playersToBeFlaired.add((Player) sender); sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); return false; } diff --git a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java index 5788167..2f42642 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -18,7 +18,7 @@ import com.earth2me.essentials.Essentials; import com.earth2me.essentials.User; public class PortalListener implements Listener{ - public static List playersToBeFlaired = new ArrayList(); + public static List playersToBeFlaired = new ArrayList(); public JavaPlugin plugin; Essentials essentials; @@ -35,7 +35,7 @@ public class PortalListener implements Listener{ Player player = event.getPlayer(); - if(!(playersToBeFlaired.contains(player.getName()))){ + if(!(playersToBeFlaired.contains(player))){ return; } diff --git a/src/alisolarflare/modules/easyuhc/EasyUHCModule.java b/src/alisolarflare/modules/easyuhc/EasyUHCModule.java index 01c4ea0..3d49527 100644 --- a/src/alisolarflare/modules/easyuhc/EasyUHCModule.java +++ b/src/alisolarflare/modules/easyuhc/EasyUHCModule.java @@ -11,11 +11,6 @@ import alisolarflare.modules.easyuhc.commands.SpreadPlayers; import alisolarflare.modules.easyuhc.commands.StartTimer; import alisolarflare.modules.easyuhc.commands.StartUHC; import alisolarflare.modules.easyuhc.commands.TeleportToUHC; -import alisolarflare.modules.easyuhc.gpowers.GPowerMemory; -import alisolarflare.modules.easyuhc.gpowers.commands.GPower; -import alisolarflare.modules.easyuhc.gpowers.commands.PowerDown; -import alisolarflare.modules.easyuhc.gpowers.commands.PowerUp; -import alisolarflare.modules.easyuhc.gpowers.listeners.gPowerListener; public class EasyUHCModule extends Module{ public Location lobbyLocation; @@ -23,12 +18,6 @@ public class EasyUHCModule extends Module{ public void register(JavaPlugin plugin) { - GPowerMemory gPowerMemory = new GPowerMemory(); - registerCommand(plugin, new GPower(gPowerMemory)); - registerCommand(plugin, new PowerUp(gPowerMemory)); - registerCommand(plugin, new PowerDown(gPowerMemory)); - - registerListener(plugin, new gPowerListener(plugin, gPowerMemory)); registerCommand(plugin, new ActivatePowers()); registerCommand(plugin, new SetUHCLobby(this)); diff --git a/src/alisolarflare/modules/easyuhc/gpowers/GPowerMemory.java b/src/alisolarflare/modules/gpowers/GPowerMemory.java similarity index 93% rename from src/alisolarflare/modules/easyuhc/gpowers/GPowerMemory.java rename to src/alisolarflare/modules/gpowers/GPowerMemory.java index 83a35be..e0891d2 100644 --- a/src/alisolarflare/modules/easyuhc/gpowers/GPowerMemory.java +++ b/src/alisolarflare/modules/gpowers/GPowerMemory.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.easyuhc.gpowers; +package alisolarflare.modules.gpowers; import java.util.HashMap; import java.util.Map; diff --git a/src/alisolarflare/modules/gpowers/GPowerModule.java b/src/alisolarflare/modules/gpowers/GPowerModule.java new file mode 100644 index 0000000..3c74111 --- /dev/null +++ b/src/alisolarflare/modules/gpowers/GPowerModule.java @@ -0,0 +1,24 @@ +package alisolarflare.modules.gpowers; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.modules.Module; +import alisolarflare.modules.gpowers.commands.GPower; +import alisolarflare.modules.gpowers.commands.PowerDown; +import alisolarflare.modules.gpowers.commands.PowerUp; +import alisolarflare.modules.gpowers.listeners.gPowerListener; + +public class GPowerModule extends Module { + + @Override + public void register(JavaPlugin plugin) { + GPowerMemory gPowerMemory = new GPowerMemory(); + registerCommand(plugin, new GPower(gPowerMemory)); + registerCommand(plugin, new PowerUp(gPowerMemory)); + registerCommand(plugin, new PowerDown(gPowerMemory)); + + registerListener(plugin, new gPowerListener(plugin, gPowerMemory)); + + } + +} diff --git a/src/alisolarflare/modules/easyuhc/gpowers/commands/GPower.java b/src/alisolarflare/modules/gpowers/commands/GPower.java similarity index 91% rename from src/alisolarflare/modules/easyuhc/gpowers/commands/GPower.java rename to src/alisolarflare/modules/gpowers/commands/GPower.java index 816241a..7777d09 100644 --- a/src/alisolarflare/modules/easyuhc/gpowers/commands/GPower.java +++ b/src/alisolarflare/modules/gpowers/commands/GPower.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.easyuhc.gpowers.commands; +package alisolarflare.modules.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.easyuhc.gpowers.GPowerMemory; +import alisolarflare.modules.gpowers.GPowerMemory; public class GPower extends PlayerCommand { diff --git a/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerAll.java b/src/alisolarflare/modules/gpowers/commands/PowerAll.java similarity index 71% rename from src/alisolarflare/modules/easyuhc/gpowers/commands/PowerAll.java rename to src/alisolarflare/modules/gpowers/commands/PowerAll.java index be1c7c8..b92aba1 100644 --- a/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerAll.java +++ b/src/alisolarflare/modules/gpowers/commands/PowerAll.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.easyuhc.gpowers.commands; +package alisolarflare.modules.gpowers.commands; import org.bukkit.command.CommandSender; import alisolarflare.modules.ModCommand; -import alisolarflare.modules.easyuhc.gpowers.GPowerMemory; -import alisolarflare.modules.easyuhc.gpowers.GPowerMemory.poweredPlayer; +import alisolarflare.modules.gpowers.GPowerMemory; +import alisolarflare.modules.gpowers.GPowerMemory.poweredPlayer; public class PowerAll extends ModCommand{ private GPowerMemory gPowerMemory; diff --git a/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerDown.java b/src/alisolarflare/modules/gpowers/commands/PowerDown.java similarity index 82% rename from src/alisolarflare/modules/easyuhc/gpowers/commands/PowerDown.java rename to src/alisolarflare/modules/gpowers/commands/PowerDown.java index abcffdb..a7849f6 100644 --- a/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/modules/gpowers/commands/PowerDown.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.easyuhc.gpowers.commands; +package alisolarflare.modules.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.easyuhc.gpowers.GPowerMemory; +import alisolarflare.modules.gpowers.GPowerMemory; public class PowerDown extends PlayerCommand { diff --git a/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerUp.java b/src/alisolarflare/modules/gpowers/commands/PowerUp.java similarity index 82% rename from src/alisolarflare/modules/easyuhc/gpowers/commands/PowerUp.java rename to src/alisolarflare/modules/gpowers/commands/PowerUp.java index db14e9f..c82e669 100644 --- a/src/alisolarflare/modules/easyuhc/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/modules/gpowers/commands/PowerUp.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.easyuhc.gpowers.commands; +package alisolarflare.modules.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.easyuhc.gpowers.GPowerMemory; +import alisolarflare.modules.gpowers.GPowerMemory; public class PowerUp extends PlayerCommand { diff --git a/src/alisolarflare/modules/easyuhc/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/modules/gpowers/listeners/gPowerApplyingTask.java similarity index 94% rename from src/alisolarflare/modules/easyuhc/gpowers/listeners/gPowerApplyingTask.java rename to src/alisolarflare/modules/gpowers/listeners/gPowerApplyingTask.java index e8c05c8..d1404c3 100644 --- a/src/alisolarflare/modules/easyuhc/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/modules/gpowers/listeners/gPowerApplyingTask.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.easyuhc.gpowers.listeners; +package alisolarflare.modules.gpowers.listeners; import java.util.Map; import java.util.UUID; @@ -10,7 +10,7 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitRunnable; -import alisolarflare.modules.easyuhc.gpowers.GPowerMemory.poweredPlayer; +import alisolarflare.modules.gpowers.GPowerMemory.poweredPlayer; public class gPowerApplyingTask extends BukkitRunnable{ private int powerLength = 300; diff --git a/src/alisolarflare/modules/easyuhc/gpowers/listeners/gPowerListener.java b/src/alisolarflare/modules/gpowers/listeners/gPowerListener.java similarity index 70% rename from src/alisolarflare/modules/easyuhc/gpowers/listeners/gPowerListener.java rename to src/alisolarflare/modules/gpowers/listeners/gPowerListener.java index 461387e..7021d68 100644 --- a/src/alisolarflare/modules/easyuhc/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/modules/gpowers/listeners/gPowerListener.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.easyuhc.gpowers.listeners; +package alisolarflare.modules.gpowers.listeners; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.easyuhc.gpowers.GPowerMemory; +import alisolarflare.modules.gpowers.GPowerMemory; public class gPowerListener implements Listener{ diff --git a/src/alisolarflare/modules/autouhc/UHCModule.java b/src/graveyard/autouhc/UHCModule.java similarity index 59% rename from src/alisolarflare/modules/autouhc/UHCModule.java rename to src/graveyard/autouhc/UHCModule.java index cd65d63..c3b36ae 100644 --- a/src/alisolarflare/modules/autouhc/UHCModule.java +++ b/src/graveyard/autouhc/UHCModule.java @@ -1,16 +1,10 @@ -package alisolarflare.modules.autouhc; - +package graveyard.autouhc; +/**@deprecated*/ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.modules.Module; -import alisolarflare.modules.autouhc.controller.SetMatchState; -import alisolarflare.modules.autouhc.idle.AddToUHC; -import alisolarflare.modules.autouhc.idle.JoinUHC; -import alisolarflare.modules.autouhc.intro.ConfigureMatch; -import alisolarflare.modules.autouhc.intro.ScheduleMatch; -import alisolarflare.modules.autouhc.intro.StartMatch; -import alisolarflare.modules.autouhc.memory.MatchState; -import alisolarflare.modules.autouhc.memory.UHCMatch; +import graveyard.autouhc.memory.MatchState; +import graveyard.autouhc.memory.UHCMatch; public class UHCModule extends Module { public UHCMatch match; diff --git a/src/alisolarflare/modules/autouhc/controller/SetMatchState.java b/src/graveyard/autouhc/controller/SetMatchState.java similarity index 91% rename from src/alisolarflare/modules/autouhc/controller/SetMatchState.java rename to src/graveyard/autouhc/controller/SetMatchState.java index 8078fea..483c74c 100644 --- a/src/alisolarflare/modules/autouhc/controller/SetMatchState.java +++ b/src/graveyard/autouhc/controller/SetMatchState.java @@ -1,11 +1,11 @@ -package alisolarflare.modules.autouhc.controller; +package graveyard.autouhc.controller; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.modules.ModCommand; -import alisolarflare.modules.autouhc.memory.MatchState; -import alisolarflare.modules.autouhc.memory.UHCMatch; +import graveyard.autouhc.memory.MatchState; +import graveyard.autouhc.memory.UHCMatch; public class SetMatchState extends ModCommand{ diff --git a/src/alisolarflare/modules/autouhc/idle/AddToUHC.java b/src/graveyard/autouhc/idle/AddToUHC.java similarity index 90% rename from src/alisolarflare/modules/autouhc/idle/AddToUHC.java rename to src/graveyard/autouhc/idle/AddToUHC.java index 5cfd45a..821e16b 100644 --- a/src/alisolarflare/modules/autouhc/idle/AddToUHC.java +++ b/src/graveyard/autouhc/idle/AddToUHC.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.autouhc.idle; +package graveyard.autouhc.idle; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.modules.ModCommand; -import alisolarflare.modules.autouhc.memory.UHCMatch; +import graveyard.autouhc.memory.UHCMatch; /** * This class handles the specific command /addToUHC which, in-game, adds a player to a specific UltraHardcore match, that is defined by the constructor: {@linkplain #AddToUHC(UHCMatch)} diff --git a/src/alisolarflare/modules/autouhc/idle/JoinUHC.java b/src/graveyard/autouhc/idle/JoinUHC.java similarity index 88% rename from src/alisolarflare/modules/autouhc/idle/JoinUHC.java rename to src/graveyard/autouhc/idle/JoinUHC.java index b948c8f..9234aff 100644 --- a/src/alisolarflare/modules/autouhc/idle/JoinUHC.java +++ b/src/graveyard/autouhc/idle/JoinUHC.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.autouhc.idle; +package graveyard.autouhc.idle; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.modules.ModCommand; -import alisolarflare.modules.autouhc.memory.UHCMatch; +import graveyard.autouhc.memory.UHCMatch; public class JoinUHC extends ModCommand{ diff --git a/src/alisolarflare/modules/autouhc/intro/ConfigureMatch.java b/src/graveyard/autouhc/intro/ConfigureMatch.java similarity index 75% rename from src/alisolarflare/modules/autouhc/intro/ConfigureMatch.java rename to src/graveyard/autouhc/intro/ConfigureMatch.java index dc5a58f..e3aa894 100644 --- a/src/alisolarflare/modules/autouhc/intro/ConfigureMatch.java +++ b/src/graveyard/autouhc/intro/ConfigureMatch.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.autouhc.intro; +package graveyard.autouhc.intro; import org.bukkit.command.CommandSender; import alisolarflare.modules.ModCommand; -import alisolarflare.modules.autouhc.memory.UHCMatch; +import graveyard.autouhc.memory.UHCMatch; public class ConfigureMatch extends ModCommand{ diff --git a/src/alisolarflare/modules/autouhc/intro/IntroductionCutscene.java b/src/graveyard/autouhc/intro/IntroductionCutscene.java similarity index 64% rename from src/alisolarflare/modules/autouhc/intro/IntroductionCutscene.java rename to src/graveyard/autouhc/intro/IntroductionCutscene.java index 6244a5f..3727cec 100644 --- a/src/alisolarflare/modules/autouhc/intro/IntroductionCutscene.java +++ b/src/graveyard/autouhc/intro/IntroductionCutscene.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.autouhc.intro; +package graveyard.autouhc.intro; public class IntroductionCutscene { //TODO: Teleport all players to the area. diff --git a/src/alisolarflare/modules/autouhc/intro/ScheduleMatch.java b/src/graveyard/autouhc/intro/ScheduleMatch.java similarity index 75% rename from src/alisolarflare/modules/autouhc/intro/ScheduleMatch.java rename to src/graveyard/autouhc/intro/ScheduleMatch.java index a451386..8190d2c 100644 --- a/src/alisolarflare/modules/autouhc/intro/ScheduleMatch.java +++ b/src/graveyard/autouhc/intro/ScheduleMatch.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.autouhc.intro; +package graveyard.autouhc.intro; import org.bukkit.command.CommandSender; import alisolarflare.modules.ModCommand; -import alisolarflare.modules.autouhc.memory.UHCMatch; +import graveyard.autouhc.memory.UHCMatch; public class ScheduleMatch extends ModCommand{ diff --git a/src/alisolarflare/modules/autouhc/intro/StartMatch.java b/src/graveyard/autouhc/intro/StartMatch.java similarity index 84% rename from src/alisolarflare/modules/autouhc/intro/StartMatch.java rename to src/graveyard/autouhc/intro/StartMatch.java index 5484653..2a6134e 100644 --- a/src/alisolarflare/modules/autouhc/intro/StartMatch.java +++ b/src/graveyard/autouhc/intro/StartMatch.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.autouhc.intro; +package graveyard.autouhc.intro; import org.bukkit.command.CommandSender; import alisolarflare.modules.ModCommand; -import alisolarflare.modules.autouhc.memory.MatchState; -import alisolarflare.modules.autouhc.memory.UHCMatch; +import graveyard.autouhc.memory.MatchState; +import graveyard.autouhc.memory.UHCMatch; public class StartMatch extends ModCommand { private UHCMatch match; diff --git a/src/alisolarflare/modules/autouhc/listeners/MatchCyclingListener.java b/src/graveyard/autouhc/listeners/MatchCyclingListener.java similarity index 88% rename from src/alisolarflare/modules/autouhc/listeners/MatchCyclingListener.java rename to src/graveyard/autouhc/listeners/MatchCyclingListener.java index d8ef831..5a21b9c 100644 --- a/src/alisolarflare/modules/autouhc/listeners/MatchCyclingListener.java +++ b/src/graveyard/autouhc/listeners/MatchCyclingListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.autouhc.listeners; +package graveyard.autouhc.listeners; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; diff --git a/src/alisolarflare/modules/autouhc/listeners/MatchMainLoop.java b/src/graveyard/autouhc/listeners/MatchMainLoop.java similarity index 69% rename from src/alisolarflare/modules/autouhc/listeners/MatchMainLoop.java rename to src/graveyard/autouhc/listeners/MatchMainLoop.java index 4005028..0698590 100644 --- a/src/alisolarflare/modules/autouhc/listeners/MatchMainLoop.java +++ b/src/graveyard/autouhc/listeners/MatchMainLoop.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.autouhc.listeners; +package graveyard.autouhc.listeners; import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/alisolarflare/modules/autouhc/memory/MatchState.java b/src/graveyard/autouhc/memory/MatchState.java similarity index 85% rename from src/alisolarflare/modules/autouhc/memory/MatchState.java rename to src/graveyard/autouhc/memory/MatchState.java index b4587b5..c97ed01 100644 --- a/src/alisolarflare/modules/autouhc/memory/MatchState.java +++ b/src/graveyard/autouhc/memory/MatchState.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.autouhc.memory; +package graveyard.autouhc.memory; public enum MatchState { IDLE, //Idle: Configure Match, Wait: Schedule Match, Intro: Start Match diff --git a/src/alisolarflare/modules/autouhc/memory/UHCMatch.java b/src/graveyard/autouhc/memory/UHCMatch.java similarity index 92% rename from src/alisolarflare/modules/autouhc/memory/UHCMatch.java rename to src/graveyard/autouhc/memory/UHCMatch.java index c0c64b9..f408d2c 100644 --- a/src/alisolarflare/modules/autouhc/memory/UHCMatch.java +++ b/src/graveyard/autouhc/memory/UHCMatch.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.autouhc.memory; +package graveyard.autouhc.memory; import java.util.ArrayList; import java.util.List; diff --git a/src/graveyard/shulker/thebuttonrebirth/ButtonRebirthPlugin.java b/src/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java similarity index 83% rename from src/graveyard/shulker/thebuttonrebirth/ButtonRebirthPlugin.java rename to src/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java index 210bca4..13e0096 100644 --- a/src/graveyard/shulker/thebuttonrebirth/ButtonRebirthPlugin.java +++ b/src/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java @@ -1,4 +1,4 @@ -package graveyard.shulker.thebuttonrebirth; +package graveyard.thebuttonrebirth; import java.util.ArrayList; import java.util.List; @@ -9,10 +9,10 @@ import org.bukkit.entity.Player; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; -import graveyard.shulker.thebuttonrebirth.admin.CreateShrine; -import graveyard.shulker.thebuttonrebirth.listeners.CyclicalDisplayListener; -import graveyard.shulker.thebuttonrebirth.listeners.MidnightListener; -import graveyard.shulker.thebuttonrebirth.listeners.StealChestListener; +import graveyard.thebuttonrebirth.admin.CreateShrine; +import graveyard.thebuttonrebirth.listeners.CyclicalDisplayListener; +import graveyard.thebuttonrebirth.listeners.MidnightListener; +import graveyard.thebuttonrebirth.listeners.StealChestListener; public class ButtonRebirthPlugin extends JavaPlugin{ public PluginDescriptionFile pdfFile; diff --git a/src/graveyard/shulker/thebuttonrebirth/admin/CreateShrine.java b/src/graveyard/thebuttonrebirth/admin/CreateShrine.java similarity index 94% rename from src/graveyard/shulker/thebuttonrebirth/admin/CreateShrine.java rename to src/graveyard/thebuttonrebirth/admin/CreateShrine.java index 6e8ded2..3f973e1 100644 --- a/src/graveyard/shulker/thebuttonrebirth/admin/CreateShrine.java +++ b/src/graveyard/thebuttonrebirth/admin/CreateShrine.java @@ -1,4 +1,4 @@ -package graveyard.shulker.thebuttonrebirth.admin; +package graveyard.thebuttonrebirth.admin; import org.bukkit.Material; import org.bukkit.World; @@ -7,7 +7,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; +import graveyard.thebuttonrebirth.ButtonRebirthPlugin; import net.md_5.bungee.api.ChatColor; public class CreateShrine implements CommandExecutor{ diff --git a/src/graveyard/shulker/thebuttonrebirth/commands/ShowBars.java b/src/graveyard/thebuttonrebirth/commands/ShowBars.java similarity index 81% rename from src/graveyard/shulker/thebuttonrebirth/commands/ShowBars.java rename to src/graveyard/thebuttonrebirth/commands/ShowBars.java index b375603..34f9a38 100644 --- a/src/graveyard/shulker/thebuttonrebirth/commands/ShowBars.java +++ b/src/graveyard/thebuttonrebirth/commands/ShowBars.java @@ -1,11 +1,11 @@ -package graveyard.shulker.thebuttonrebirth.commands; +package graveyard.thebuttonrebirth.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; +import graveyard.thebuttonrebirth.ButtonRebirthPlugin; public class ShowBars implements CommandExecutor{ diff --git a/src/graveyard/shulker/thebuttonrebirth/listeners/CyclicalDisplayListener.java b/src/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java similarity index 70% rename from src/graveyard/shulker/thebuttonrebirth/listeners/CyclicalDisplayListener.java rename to src/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java index 8b2c9ee..68b6c13 100644 --- a/src/graveyard/shulker/thebuttonrebirth/listeners/CyclicalDisplayListener.java +++ b/src/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java @@ -1,10 +1,10 @@ -package graveyard.shulker.thebuttonrebirth.listeners; +package graveyard.thebuttonrebirth.listeners; import org.bukkit.event.Listener; import org.bukkit.scheduler.BukkitTask; -import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; -import graveyard.shulker.thebuttonrebirth.tasks.CyclicalDisplayTask; +import graveyard.thebuttonrebirth.ButtonRebirthPlugin; +import graveyard.thebuttonrebirth.tasks.CyclicalDisplayTask; public class CyclicalDisplayListener implements Listener{ private final ButtonRebirthPlugin plugin; diff --git a/src/graveyard/shulker/thebuttonrebirth/listeners/MidnightListener.java b/src/graveyard/thebuttonrebirth/listeners/MidnightListener.java similarity index 65% rename from src/graveyard/shulker/thebuttonrebirth/listeners/MidnightListener.java rename to src/graveyard/thebuttonrebirth/listeners/MidnightListener.java index 48afb1d..1e3b155 100644 --- a/src/graveyard/shulker/thebuttonrebirth/listeners/MidnightListener.java +++ b/src/graveyard/thebuttonrebirth/listeners/MidnightListener.java @@ -1,10 +1,10 @@ -package graveyard.shulker.thebuttonrebirth.listeners; +package graveyard.thebuttonrebirth.listeners; import org.bukkit.event.Listener; import org.bukkit.scheduler.BukkitTask; -import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; -import graveyard.shulker.thebuttonrebirth.tasks.CheckChestTask; +import graveyard.thebuttonrebirth.ButtonRebirthPlugin; +import graveyard.thebuttonrebirth.tasks.CheckChestTask; public class MidnightListener implements Listener{ diff --git a/src/graveyard/shulker/thebuttonrebirth/listeners/StealChestListener.java b/src/graveyard/thebuttonrebirth/listeners/StealChestListener.java similarity index 65% rename from src/graveyard/shulker/thebuttonrebirth/listeners/StealChestListener.java rename to src/graveyard/thebuttonrebirth/listeners/StealChestListener.java index 062a592..1574add 100644 --- a/src/graveyard/shulker/thebuttonrebirth/listeners/StealChestListener.java +++ b/src/graveyard/thebuttonrebirth/listeners/StealChestListener.java @@ -1,10 +1,10 @@ -package graveyard.shulker.thebuttonrebirth.listeners; +package graveyard.thebuttonrebirth.listeners; import org.bukkit.event.Listener; import org.bukkit.scheduler.BukkitTask; -import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; -import graveyard.shulker.thebuttonrebirth.tasks.StealChestTask; +import graveyard.thebuttonrebirth.ButtonRebirthPlugin; +import graveyard.thebuttonrebirth.tasks.StealChestTask; public class StealChestListener implements Listener{ diff --git a/src/graveyard/shulker/thebuttonrebirth/tasks/CheckChestTask.java b/src/graveyard/thebuttonrebirth/tasks/CheckChestTask.java similarity index 94% rename from src/graveyard/shulker/thebuttonrebirth/tasks/CheckChestTask.java rename to src/graveyard/thebuttonrebirth/tasks/CheckChestTask.java index 0fd2e7a..dae0446 100644 --- a/src/graveyard/shulker/thebuttonrebirth/tasks/CheckChestTask.java +++ b/src/graveyard/thebuttonrebirth/tasks/CheckChestTask.java @@ -1,4 +1,4 @@ -package graveyard.shulker.thebuttonrebirth.tasks; +package graveyard.thebuttonrebirth.tasks; import java.time.Clock; import java.time.LocalDateTime; @@ -13,8 +13,8 @@ import org.bukkit.block.Chest; import org.bukkit.inventory.Inventory; import org.bukkit.scheduler.BukkitRunnable; -import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; -import graveyard.shulker.thebuttonrebirth.admin.CreateShrine; +import graveyard.thebuttonrebirth.ButtonRebirthPlugin; +import graveyard.thebuttonrebirth.admin.CreateShrine; public class CheckChestTask extends BukkitRunnable{ //Plugin diff --git a/src/graveyard/shulker/thebuttonrebirth/tasks/CyclicalDisplayTask.java b/src/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java similarity index 95% rename from src/graveyard/shulker/thebuttonrebirth/tasks/CyclicalDisplayTask.java rename to src/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java index fec8ece..5361af7 100644 --- a/src/graveyard/shulker/thebuttonrebirth/tasks/CyclicalDisplayTask.java +++ b/src/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java @@ -1,4 +1,4 @@ -package graveyard.shulker.thebuttonrebirth.tasks; +package graveyard.thebuttonrebirth.tasks; import java.time.Clock; import java.time.Duration; @@ -19,7 +19,7 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.scheduler.BukkitRunnable; -import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; +import graveyard.thebuttonrebirth.ButtonRebirthPlugin; public class CyclicalDisplayTask extends BukkitRunnable{ //Pointers diff --git a/src/graveyard/shulker/thebuttonrebirth/tasks/StealChestTask.java b/src/graveyard/thebuttonrebirth/tasks/StealChestTask.java similarity index 95% rename from src/graveyard/shulker/thebuttonrebirth/tasks/StealChestTask.java rename to src/graveyard/thebuttonrebirth/tasks/StealChestTask.java index 92778bc..1bc1239 100644 --- a/src/graveyard/shulker/thebuttonrebirth/tasks/StealChestTask.java +++ b/src/graveyard/thebuttonrebirth/tasks/StealChestTask.java @@ -1,4 +1,4 @@ -package graveyard.shulker.thebuttonrebirth.tasks; +package graveyard.thebuttonrebirth.tasks; import java.time.Clock; import java.time.LocalDateTime; @@ -15,7 +15,7 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.scheduler.BukkitRunnable; -import graveyard.shulker.thebuttonrebirth.ButtonRebirthPlugin; +import graveyard.thebuttonrebirth.ButtonRebirthPlugin; public class StealChestTask extends BukkitRunnable{ From 0f1e8967223464ad4a3b4f688ea80e421c54709d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 11 Nov 2016 22:32:25 -0500 Subject: [PATCH 120/263] Started work on a metrics system Tracking player login events, etc --- src/alisolarflare/modules/Module.java | 21 +++++++++++++++++++ .../modules/metrics/MetricsModule.java | 16 ++++++++++++++ .../listeners/PlayerLoginListener.java | 20 ++++++++++++++++++ src/graveyard/autouhc/UHCModule.java | 2 +- .../autouhc/controller/SetMatchState.java | 2 +- src/graveyard/autouhc/idle/AddToUHC.java | 1 + src/graveyard/autouhc/idle/JoinUHC.java | 2 +- .../autouhc/intro/ConfigureMatch.java | 2 +- .../autouhc/intro/IntroductionCutscene.java | 2 +- .../autouhc/intro/ScheduleMatch.java | 2 +- src/graveyard/autouhc/intro/StartMatch.java | 2 +- .../listeners/MatchCyclingListener.java | 1 + .../autouhc/listeners/MatchMainLoop.java | 2 +- src/graveyard/autouhc/memory/MatchState.java | 2 +- src/graveyard/autouhc/memory/UHCMatch.java | 2 +- 15 files changed, 69 insertions(+), 10 deletions(-) create mode 100644 src/alisolarflare/modules/metrics/MetricsModule.java create mode 100644 src/alisolarflare/modules/metrics/listeners/PlayerLoginListener.java diff --git a/src/alisolarflare/modules/Module.java b/src/alisolarflare/modules/Module.java index 6446ff0..9818c99 100644 --- a/src/alisolarflare/modules/Module.java +++ b/src/alisolarflare/modules/Module.java @@ -1,5 +1,6 @@ package alisolarflare.modules; +import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; @@ -20,6 +21,7 @@ import buttondevteam.lib.chat.TBMCCommandBase; * */ public abstract class Module{ + /** * Registers the module, when called by the JavaPlugin class. Call * registerCommand() and registerListener() within this method. @@ -46,5 +48,24 @@ public abstract class Module{ TBMCCoreAPI.RegisterEventsForExceptions(listener, plugin); return listener; } + + public void saveData(FileConfiguration config, String pathToData, Object data){ + + config.set("moduledata." + this.getClassName() + "." + pathToData, data); + } + public Object getData(FileConfiguration config, String pathToData, Object data){ + return config.get("moduledata." + this.getClassName() + "." + pathToData, data); + } + + public String getClassName(){ + Class enclosingClass = getClass().getEnclosingClass(); + String className = "nullModule"; + if (enclosingClass != null) { + className = (enclosingClass.getName()); + } else { + className = (getClass().getName()); + } + return className; + } } diff --git a/src/alisolarflare/modules/metrics/MetricsModule.java b/src/alisolarflare/modules/metrics/MetricsModule.java new file mode 100644 index 0000000..a4ca43e --- /dev/null +++ b/src/alisolarflare/modules/metrics/MetricsModule.java @@ -0,0 +1,16 @@ +package alisolarflare.modules.metrics; + +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.modules.Module; + +public class MetricsModule extends Module{ + + public FileConfiguration config; + + @Override + public void register(JavaPlugin plugin) { + this.config = plugin.getConfig(); + } +} diff --git a/src/alisolarflare/modules/metrics/listeners/PlayerLoginListener.java b/src/alisolarflare/modules/metrics/listeners/PlayerLoginListener.java new file mode 100644 index 0000000..b512120 --- /dev/null +++ b/src/alisolarflare/modules/metrics/listeners/PlayerLoginListener.java @@ -0,0 +1,20 @@ +package alisolarflare.modules.metrics.listeners; + +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerLoginEvent; + +import alisolarflare.modules.metrics.MetricsModule; + +public class PlayerLoginListener implements Listener{ + + private MetricsModule module; + public PlayerLoginListener(MetricsModule module){ + this.module = module; + } + @EventHandler + public void onPlayerLogin(PlayerLoginEvent event){ + module.saveData(module.config, "loginlog."+System.currentTimeMillis(), event.getPlayer().getName()); + event.getPlayer(); + } +} diff --git a/src/graveyard/autouhc/UHCModule.java b/src/graveyard/autouhc/UHCModule.java index c3b36ae..1891c31 100644 --- a/src/graveyard/autouhc/UHCModule.java +++ b/src/graveyard/autouhc/UHCModule.java @@ -1,11 +1,11 @@ package graveyard.autouhc; -/**@deprecated*/ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.modules.Module; import graveyard.autouhc.memory.MatchState; import graveyard.autouhc.memory.UHCMatch; +/**@deprecated*/ public class UHCModule extends Module { public UHCMatch match; diff --git a/src/graveyard/autouhc/controller/SetMatchState.java b/src/graveyard/autouhc/controller/SetMatchState.java index 483c74c..00f8d94 100644 --- a/src/graveyard/autouhc/controller/SetMatchState.java +++ b/src/graveyard/autouhc/controller/SetMatchState.java @@ -6,7 +6,7 @@ import org.bukkit.entity.Player; import alisolarflare.modules.ModCommand; import graveyard.autouhc.memory.MatchState; import graveyard.autouhc.memory.UHCMatch; - +/**@deprecated*/ public class SetMatchState extends ModCommand{ UHCMatch match; diff --git a/src/graveyard/autouhc/idle/AddToUHC.java b/src/graveyard/autouhc/idle/AddToUHC.java index 821e16b..f1ffa57 100644 --- a/src/graveyard/autouhc/idle/AddToUHC.java +++ b/src/graveyard/autouhc/idle/AddToUHC.java @@ -11,6 +11,7 @@ import graveyard.autouhc.memory.UHCMatch; * * @author Alisolarflare */ +/**@deprecated*/ public class AddToUHC extends ModCommand { private UHCMatch match; diff --git a/src/graveyard/autouhc/idle/JoinUHC.java b/src/graveyard/autouhc/idle/JoinUHC.java index 9234aff..c37d301 100644 --- a/src/graveyard/autouhc/idle/JoinUHC.java +++ b/src/graveyard/autouhc/idle/JoinUHC.java @@ -5,7 +5,7 @@ import org.bukkit.entity.Player; import alisolarflare.modules.ModCommand; import graveyard.autouhc.memory.UHCMatch; - +/**@deprecated*/ public class JoinUHC extends ModCommand{ private UHCMatch match; diff --git a/src/graveyard/autouhc/intro/ConfigureMatch.java b/src/graveyard/autouhc/intro/ConfigureMatch.java index e3aa894..49f1bfb 100644 --- a/src/graveyard/autouhc/intro/ConfigureMatch.java +++ b/src/graveyard/autouhc/intro/ConfigureMatch.java @@ -4,7 +4,7 @@ import org.bukkit.command.CommandSender; import alisolarflare.modules.ModCommand; import graveyard.autouhc.memory.UHCMatch; - +/**@deprecated*/ public class ConfigureMatch extends ModCommand{ public ConfigureMatch(UHCMatch match) { diff --git a/src/graveyard/autouhc/intro/IntroductionCutscene.java b/src/graveyard/autouhc/intro/IntroductionCutscene.java index 3727cec..e548dc8 100644 --- a/src/graveyard/autouhc/intro/IntroductionCutscene.java +++ b/src/graveyard/autouhc/intro/IntroductionCutscene.java @@ -1,5 +1,5 @@ package graveyard.autouhc.intro; - +/**@deprecated*/ public class IntroductionCutscene { //TODO: Teleport all players to the area. } diff --git a/src/graveyard/autouhc/intro/ScheduleMatch.java b/src/graveyard/autouhc/intro/ScheduleMatch.java index 8190d2c..91b130a 100644 --- a/src/graveyard/autouhc/intro/ScheduleMatch.java +++ b/src/graveyard/autouhc/intro/ScheduleMatch.java @@ -4,7 +4,7 @@ import org.bukkit.command.CommandSender; import alisolarflare.modules.ModCommand; import graveyard.autouhc.memory.UHCMatch; - +/**@deprecated*/ public class ScheduleMatch extends ModCommand{ public ScheduleMatch(UHCMatch match) { diff --git a/src/graveyard/autouhc/intro/StartMatch.java b/src/graveyard/autouhc/intro/StartMatch.java index 2a6134e..22f2b5a 100644 --- a/src/graveyard/autouhc/intro/StartMatch.java +++ b/src/graveyard/autouhc/intro/StartMatch.java @@ -8,7 +8,7 @@ import graveyard.autouhc.memory.UHCMatch; public class StartMatch extends ModCommand { private UHCMatch match; - + /**@deprecated*/ public StartMatch(UHCMatch match) { this.match = match; } diff --git a/src/graveyard/autouhc/listeners/MatchCyclingListener.java b/src/graveyard/autouhc/listeners/MatchCyclingListener.java index 5a21b9c..c15fbcd 100644 --- a/src/graveyard/autouhc/listeners/MatchCyclingListener.java +++ b/src/graveyard/autouhc/listeners/MatchCyclingListener.java @@ -9,6 +9,7 @@ import org.bukkit.scheduler.BukkitTask; * ghostie powers if an Ultrahardcore Match is going on, * and it's time for powers to activate */ +/**@deprecated*/ public class MatchCyclingListener implements Listener { public BukkitTask PowerCyclingTask; diff --git a/src/graveyard/autouhc/listeners/MatchMainLoop.java b/src/graveyard/autouhc/listeners/MatchMainLoop.java index 0698590..e300596 100644 --- a/src/graveyard/autouhc/listeners/MatchMainLoop.java +++ b/src/graveyard/autouhc/listeners/MatchMainLoop.java @@ -1,7 +1,7 @@ package graveyard.autouhc.listeners; import org.bukkit.scheduler.BukkitRunnable; - +/**@deprecated*/ public class MatchMainLoop extends BukkitRunnable{ @Override public void run() { diff --git a/src/graveyard/autouhc/memory/MatchState.java b/src/graveyard/autouhc/memory/MatchState.java index c97ed01..68a6c48 100644 --- a/src/graveyard/autouhc/memory/MatchState.java +++ b/src/graveyard/autouhc/memory/MatchState.java @@ -1,5 +1,5 @@ package graveyard.autouhc.memory; - +/**@deprecated*/ public enum MatchState { IDLE, //Idle: Configure Match, Wait: Schedule Match, Intro: Start Match WAITING, //SETUP: Scheduled Time, INTRO: No Setup diff --git a/src/graveyard/autouhc/memory/UHCMatch.java b/src/graveyard/autouhc/memory/UHCMatch.java index f408d2c..a5f4538 100644 --- a/src/graveyard/autouhc/memory/UHCMatch.java +++ b/src/graveyard/autouhc/memory/UHCMatch.java @@ -7,7 +7,7 @@ import org.bukkit.Location; import org.bukkit.World; import org.bukkit.configuration.file.FileConfiguration; - +/**@deprecated*/ public class UHCMatch { private FileConfiguration config; private MatchState matchState = MatchState.IDLE; From 0df59ba8d4ecb0dd2dbdeb4de4da60b0fe52362b Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 12 Nov 2016 09:52:08 -0500 Subject: [PATCH 121/263] Changed Software Architecture based on this GoTo talk: https://www.youtube.com/watch?v=GAFZcYlO5S0 --- src/alisolarflare/AliPresents.java | 22 ++++----- .../Module.java => components/Component.java} | 4 +- .../{modules => components}/ModCommand.java | 2 +- .../PlayerCommand.java | 2 +- .../AliLinkComponent.java} | 12 ++--- .../commands/PressAliLink.java | 6 +-- .../commands/SetAliLink.java | 10 ++-- .../{links => alilinks}/entities/Link.java | 4 +- .../tasks/UnpressTask.java | 2 +- .../CreativeBoundariesComponent.java | 30 ++++++++++++ .../creativeboundaries/commands/Cbgm0.java | 10 ++-- .../creativeboundaries/commands/Cbgm1.java | 10 ++-- .../commands/SetDickmode.java | 10 ++-- .../listeners/ItemRestrictionListener.java | 8 ++-- .../listeners/PlotChangeListener.java | 8 ++-- .../components/easyuhc/EasyUHCComponent.java | 32 +++++++++++++ .../easyuhc/commands/ActivatePowers.java | 4 +- .../easyuhc/commands/SetUHCLobby.java | 10 ++-- .../easyuhc/commands/SetWorldBorders.java | 4 +- .../easyuhc/commands/ShrinkWorldBorders.java | 4 +- .../easyuhc/commands/SpreadPlayers.java | 4 +- .../easyuhc/commands/StartTimer.java | 4 +- .../easyuhc/commands/StartUHC.java | 4 +- .../easyuhc/commands/TeleportToUHC.java | 4 +- ...oorModule.java => FlairDoorComponent.java} | 4 +- .../flairdoor/commands/FlairMe.java | 2 +- .../gpowers/GPowerComponent.java} | 14 +++--- .../gpowers/GPowerMemory.java | 2 +- .../gpowers/commands/GPower.java | 6 +-- .../gpowers/commands/PowerAll.java | 8 ++-- .../gpowers/commands/PowerDown.java | 6 +-- .../gpowers/commands/PowerUp.java | 6 +-- .../gpowers/listeners/gPowerApplyingTask.java | 4 +- .../gpowers/listeners/gPowerListener.java | 4 +- .../links/serializer/Deserializer.java | 42 ---------------- .../links/serializer/Serializer.java | 38 --------------- .../components/magic/MagicComponent.java | 18 +++++++ .../magic/tricks/AliArrowListener.java | 2 +- .../magic/tricks/AliArrowTask.java | 2 +- .../magic/tricks/BoomBowDeathListener.java | 2 +- .../magic/tricks/BoomBowListener.java | 2 +- .../magic/tricks/BoomBowRule.java | 4 +- .../magic/tricks/BoomDecayTask.java | 2 +- .../components/metrics/MetricsModule.java | 48 +++++++++++++++++++ .../listeners/PlayerLoginListener.java | 6 +-- .../minigames/GameState.java | 2 +- .../minigames/MinigameModule.java | 16 +++---- .../minigames/commands/JoinMinigame.java | 6 +-- .../minigames/commands/LeaveMinigame.java | 6 +-- .../minigames/commands/ListFighters.java | 6 +-- .../minigames/commands/SetColourSpawn.java | 6 +-- .../minigames/data/SpawnSet.java | 2 +- .../minigames/entities/Fighter.java | 2 +- .../CreativeBoundariesModule.java | 30 ------------ .../modules/easyuhc/EasyUHCModule.java | 32 ------------- .../modules/magic/MagicModule.java | 18 ------- .../modules/metrics/MetricsModule.java | 16 ------- src/graveyard/autouhc/UHCModule.java | 4 +- .../autouhc/controller/SetMatchState.java | 2 +- src/graveyard/autouhc/idle/AddToUHC.java | 2 +- src/graveyard/autouhc/idle/JoinUHC.java | 2 +- .../autouhc/intro/ConfigureMatch.java | 2 +- .../autouhc/intro/ScheduleMatch.java | 2 +- src/graveyard/autouhc/intro/StartMatch.java | 2 +- src/graveyard/shulker/AliShulkerModule.java | 4 +- 65 files changed, 273 insertions(+), 321 deletions(-) rename src/alisolarflare/{modules/Module.java => components/Component.java} (94%) rename src/alisolarflare/{modules => components}/ModCommand.java (91%) rename src/alisolarflare/{modules => components}/PlayerCommand.java (94%) rename src/alisolarflare/components/{links/AliLinkModule.java => alilinks/AliLinkComponent.java} (62%) rename src/alisolarflare/components/{links => alilinks}/commands/PressAliLink.java (82%) rename src/alisolarflare/components/{links => alilinks}/commands/SetAliLink.java (91%) rename src/alisolarflare/components/{links => alilinks}/entities/Link.java (87%) rename src/alisolarflare/components/{links => alilinks}/tasks/UnpressTask.java (86%) create mode 100644 src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java rename src/alisolarflare/{modules => components}/creativeboundaries/commands/Cbgm0.java (62%) rename src/alisolarflare/{modules => components}/creativeboundaries/commands/Cbgm1.java (82%) rename src/alisolarflare/{modules => components}/creativeboundaries/commands/SetDickmode.java (71%) rename src/alisolarflare/{modules => components}/creativeboundaries/listeners/ItemRestrictionListener.java (58%) rename src/alisolarflare/{modules => components}/creativeboundaries/listeners/PlotChangeListener.java (85%) create mode 100644 src/alisolarflare/components/easyuhc/EasyUHCComponent.java rename src/alisolarflare/{modules => components}/easyuhc/commands/ActivatePowers.java (65%) rename src/alisolarflare/{modules => components}/easyuhc/commands/SetUHCLobby.java (58%) rename src/alisolarflare/{modules => components}/easyuhc/commands/SetWorldBorders.java (65%) rename src/alisolarflare/{modules => components}/easyuhc/commands/ShrinkWorldBorders.java (69%) rename src/alisolarflare/{modules => components}/easyuhc/commands/SpreadPlayers.java (68%) rename src/alisolarflare/{modules => components}/easyuhc/commands/StartTimer.java (68%) rename src/alisolarflare/{modules => components}/easyuhc/commands/StartUHC.java (68%) rename src/alisolarflare/{modules => components}/easyuhc/commands/TeleportToUHC.java (68%) rename src/alisolarflare/components/flairdoor/{FlairDoorModule.java => FlairDoorComponent.java} (77%) rename src/alisolarflare/{modules/gpowers/GPowerModule.java => components/gpowers/GPowerComponent.java} (51%) rename src/alisolarflare/{modules => components}/gpowers/GPowerMemory.java (94%) rename src/alisolarflare/{modules => components}/gpowers/commands/GPower.java (89%) rename src/alisolarflare/{modules => components}/gpowers/commands/PowerAll.java (67%) rename src/alisolarflare/{modules => components}/gpowers/commands/PowerDown.java (78%) rename src/alisolarflare/{modules => components}/gpowers/commands/PowerUp.java (78%) rename src/alisolarflare/{modules => components}/gpowers/listeners/gPowerApplyingTask.java (94%) rename src/alisolarflare/{modules => components}/gpowers/listeners/gPowerListener.java (72%) delete mode 100644 src/alisolarflare/components/links/serializer/Deserializer.java delete mode 100644 src/alisolarflare/components/links/serializer/Serializer.java create mode 100644 src/alisolarflare/components/magic/MagicComponent.java rename src/alisolarflare/{modules => components}/magic/tricks/AliArrowListener.java (91%) rename src/alisolarflare/{modules => components}/magic/tricks/AliArrowTask.java (91%) rename src/alisolarflare/{modules => components}/magic/tricks/BoomBowDeathListener.java (88%) rename src/alisolarflare/{modules => components}/magic/tricks/BoomBowListener.java (95%) rename src/alisolarflare/{modules => components}/magic/tricks/BoomBowRule.java (92%) rename src/alisolarflare/{modules => components}/magic/tricks/BoomDecayTask.java (87%) create mode 100644 src/alisolarflare/components/metrics/MetricsModule.java rename src/alisolarflare/{modules => components}/metrics/listeners/PlayerLoginListener.java (64%) rename src/alisolarflare/{modules => components}/minigames/GameState.java (52%) rename src/alisolarflare/{modules => components}/minigames/MinigameModule.java (55%) rename src/alisolarflare/{modules => components}/minigames/commands/JoinMinigame.java (79%) rename src/alisolarflare/{modules => components}/minigames/commands/LeaveMinigame.java (79%) rename src/alisolarflare/{modules => components}/minigames/commands/ListFighters.java (66%) rename src/alisolarflare/{modules => components}/minigames/commands/SetColourSpawn.java (88%) rename src/alisolarflare/{modules => components}/minigames/data/SpawnSet.java (92%) rename src/alisolarflare/{modules => components}/minigames/entities/Fighter.java (73%) delete mode 100644 src/alisolarflare/modules/creativeboundaries/CreativeBoundariesModule.java delete mode 100644 src/alisolarflare/modules/easyuhc/EasyUHCModule.java delete mode 100644 src/alisolarflare/modules/magic/MagicModule.java delete mode 100644 src/alisolarflare/modules/metrics/MetricsModule.java diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index c9330d1..a68d201 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -6,12 +6,12 @@ import org.bukkit.plugin.PluginDescriptionFile; //import alisolarflare.links.AliLinkSubPlug; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.flairdoor.FlairDoorModule; -import alisolarflare.components.links.AliLinkModule; -import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; -import alisolarflare.modules.easyuhc.EasyUHCModule; -import alisolarflare.modules.magic.MagicModule; -import alisolarflare.modules.minigames.MinigameModule; +import alisolarflare.components.alilinks.AliLinkComponent; +import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; +import alisolarflare.components.easyuhc.EasyUHCComponent; +import alisolarflare.components.flairdoor.FlairDoorComponent; +import alisolarflare.components.magic.MagicComponent; +import alisolarflare.components.minigames.MinigameModule; public class AliPresents extends JavaPlugin{ public void onEnable(){ @@ -21,12 +21,12 @@ public class AliPresents extends JavaPlugin{ logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); - new FlairDoorModule().register(this); - new AliLinkModule().register(this); - new EasyUHCModule().register(this); - new MagicModule().register(this); + new FlairDoorComponent().register(this); + new AliLinkComponent().register(this); + new EasyUHCComponent().register(this); + new MagicComponent().register(this); new MinigameModule().register(this); - new CreativeBoundariesModule().register(this); + new CreativeBoundariesComponent().register(this); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); diff --git a/src/alisolarflare/modules/Module.java b/src/alisolarflare/components/Component.java similarity index 94% rename from src/alisolarflare/modules/Module.java rename to src/alisolarflare/components/Component.java index 9818c99..13bfeab 100644 --- a/src/alisolarflare/modules/Module.java +++ b/src/alisolarflare/components/Component.java @@ -1,4 +1,4 @@ -package alisolarflare.modules; +package alisolarflare.components; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.event.Listener; @@ -20,7 +20,7 @@ import buttondevteam.lib.chat.TBMCCommandBase; * @author Alisolarflare * */ -public abstract class Module{ +public abstract class Component{ /** * Registers the module, when called by the JavaPlugin class. Call diff --git a/src/alisolarflare/modules/ModCommand.java b/src/alisolarflare/components/ModCommand.java similarity index 91% rename from src/alisolarflare/modules/ModCommand.java rename to src/alisolarflare/components/ModCommand.java index 2a650f0..c359349 100644 --- a/src/alisolarflare/modules/ModCommand.java +++ b/src/alisolarflare/components/ModCommand.java @@ -1,4 +1,4 @@ -package alisolarflare.modules; +package alisolarflare.components; import org.bukkit.command.CommandSender; diff --git a/src/alisolarflare/modules/PlayerCommand.java b/src/alisolarflare/components/PlayerCommand.java similarity index 94% rename from src/alisolarflare/modules/PlayerCommand.java rename to src/alisolarflare/components/PlayerCommand.java index 51dcad9..e3bfae5 100644 --- a/src/alisolarflare/modules/PlayerCommand.java +++ b/src/alisolarflare/components/PlayerCommand.java @@ -1,4 +1,4 @@ -package alisolarflare.modules; +package alisolarflare.components; import buttondevteam.lib.chat.TBMCCommandBase; diff --git a/src/alisolarflare/components/links/AliLinkModule.java b/src/alisolarflare/components/alilinks/AliLinkComponent.java similarity index 62% rename from src/alisolarflare/components/links/AliLinkModule.java rename to src/alisolarflare/components/alilinks/AliLinkComponent.java index 5a40320..9e6741e 100644 --- a/src/alisolarflare/components/links/AliLinkModule.java +++ b/src/alisolarflare/components/alilinks/AliLinkComponent.java @@ -1,15 +1,15 @@ -package alisolarflare.components.links; +package alisolarflare.components.alilinks; import java.util.List; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.links.commands.PressAliLink; -import alisolarflare.components.links.commands.SetAliLink; -import alisolarflare.components.links.entities.Link; -import alisolarflare.modules.Module; +import alisolarflare.components.Component; +import alisolarflare.components.alilinks.commands.PressAliLink; +import alisolarflare.components.alilinks.commands.SetAliLink; +import alisolarflare.components.alilinks.entities.Link; -public class AliLinkModule extends Module { +public class AliLinkComponent extends Component { private SetAliLink setAliLink; @Override diff --git a/src/alisolarflare/components/links/commands/PressAliLink.java b/src/alisolarflare/components/alilinks/commands/PressAliLink.java similarity index 82% rename from src/alisolarflare/components/links/commands/PressAliLink.java rename to src/alisolarflare/components/alilinks/commands/PressAliLink.java index 657c611..9ba8e68 100644 --- a/src/alisolarflare/components/links/commands/PressAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/PressAliLink.java @@ -1,10 +1,10 @@ -package alisolarflare.components.links.commands; +package alisolarflare.components.alilinks.commands; import org.bukkit.command.CommandSender; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.links.entities.Link; -import alisolarflare.modules.PlayerCommand; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.alilinks.entities.Link; public class PressAliLink extends PlayerCommand { private JavaPlugin plugin; diff --git a/src/alisolarflare/components/links/commands/SetAliLink.java b/src/alisolarflare/components/alilinks/commands/SetAliLink.java similarity index 91% rename from src/alisolarflare/components/links/commands/SetAliLink.java rename to src/alisolarflare/components/alilinks/commands/SetAliLink.java index f25d8f7..b98ff5b 100644 --- a/src/alisolarflare/components/links/commands/SetAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/SetAliLink.java @@ -1,4 +1,4 @@ -package alisolarflare.components.links.commands; +package alisolarflare.components.alilinks.commands; import java.util.ArrayList; import java.util.List; @@ -9,9 +9,9 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.links.AliLinkModule; -import alisolarflare.components.links.entities.Link; -import alisolarflare.modules.PlayerCommand; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.alilinks.AliLinkComponent; +import alisolarflare.components.alilinks.entities.Link; /** * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, a location in a world that when called on by {@link PressAliLink}, creates a temporary redstone @@ -23,7 +23,7 @@ import alisolarflare.modules.PlayerCommand; */ public class SetAliLink extends PlayerCommand { public List linkList = new ArrayList(); - AliLinkModule subplugin; + AliLinkComponent subplugin; private JavaPlugin plugin; /** diff --git a/src/alisolarflare/components/links/entities/Link.java b/src/alisolarflare/components/alilinks/entities/Link.java similarity index 87% rename from src/alisolarflare/components/links/entities/Link.java rename to src/alisolarflare/components/alilinks/entities/Link.java index f55bfc8..55199d9 100644 --- a/src/alisolarflare/components/links/entities/Link.java +++ b/src/alisolarflare/components/alilinks/entities/Link.java @@ -1,4 +1,4 @@ -package alisolarflare.components.links.entities; +package alisolarflare.components.alilinks.entities; import java.io.Serializable; @@ -6,7 +6,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.links.tasks.UnpressTask; +import alisolarflare.components.alilinks.tasks.UnpressTask; public class Link implements Serializable{ /** diff --git a/src/alisolarflare/components/links/tasks/UnpressTask.java b/src/alisolarflare/components/alilinks/tasks/UnpressTask.java similarity index 86% rename from src/alisolarflare/components/links/tasks/UnpressTask.java rename to src/alisolarflare/components/alilinks/tasks/UnpressTask.java index 769f4f1..8820778 100644 --- a/src/alisolarflare/components/links/tasks/UnpressTask.java +++ b/src/alisolarflare/components/alilinks/tasks/UnpressTask.java @@ -1,4 +1,4 @@ -package alisolarflare.components.links.tasks; +package alisolarflare.components.alilinks.tasks; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java b/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java new file mode 100644 index 0000000..466859e --- /dev/null +++ b/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java @@ -0,0 +1,30 @@ +package alisolarflare.components.creativeboundaries; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.Component; +import alisolarflare.components.creativeboundaries.commands.Cbgm0; +import alisolarflare.components.creativeboundaries.commands.Cbgm1; +import alisolarflare.components.creativeboundaries.commands.SetDickmode; +import alisolarflare.components.creativeboundaries.listeners.ItemRestrictionListener; +import alisolarflare.components.creativeboundaries.listeners.PlotChangeListener; + + +public class CreativeBoundariesComponent extends Component{ + public boolean dickmode; + public List cbCreatives = new ArrayList(); + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new Cbgm1(this)); + registerCommand(plugin, new Cbgm0(this)); + registerCommand(plugin, new SetDickmode(this)); + + registerListener(plugin, new PlotChangeListener(this)); + //registerListener(plugin, new ItemRestrictionListener(this)); + } + +} diff --git a/src/alisolarflare/modules/creativeboundaries/commands/Cbgm0.java b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java similarity index 62% rename from src/alisolarflare/modules/creativeboundaries/commands/Cbgm0.java rename to src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java index 70da940..2551d68 100644 --- a/src/alisolarflare/modules/creativeboundaries/commands/Cbgm0.java +++ b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java @@ -1,17 +1,17 @@ -package alisolarflare.modules.creativeboundaries.commands; +package alisolarflare.components.creativeboundaries.commands; import org.bukkit.GameMode; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class Cbgm0 extends PlayerCommand{ - private CreativeBoundariesModule module; + private CreativeBoundariesComponent module; - public Cbgm0(CreativeBoundariesModule module) { + public Cbgm0(CreativeBoundariesComponent module) { this.module = module; } diff --git a/src/alisolarflare/modules/creativeboundaries/commands/Cbgm1.java b/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java similarity index 82% rename from src/alisolarflare/modules/creativeboundaries/commands/Cbgm1.java rename to src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java index b6e888e..9767dd3 100644 --- a/src/alisolarflare/modules/creativeboundaries/commands/Cbgm1.java +++ b/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.creativeboundaries.commands; +package alisolarflare.components.creativeboundaries.commands; import org.bukkit.GameMode; import org.bukkit.command.CommandSender; @@ -10,14 +10,14 @@ import com.palmergames.bukkit.towny.object.Town; import com.palmergames.bukkit.towny.object.TownBlock; import com.palmergames.bukkit.towny.object.TownyUniverse; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class Cbgm1 extends PlayerCommand { - private CreativeBoundariesModule module; + private CreativeBoundariesComponent module; - public Cbgm1(CreativeBoundariesModule module) { + public Cbgm1(CreativeBoundariesComponent module) { this.module = module; } diff --git a/src/alisolarflare/modules/creativeboundaries/commands/SetDickmode.java b/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java similarity index 71% rename from src/alisolarflare/modules/creativeboundaries/commands/SetDickmode.java rename to src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java index bbf3026..8650dd1 100644 --- a/src/alisolarflare/modules/creativeboundaries/commands/SetDickmode.java +++ b/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java @@ -1,14 +1,14 @@ -package alisolarflare.modules.creativeboundaries.commands; +package alisolarflare.components.creativeboundaries.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class SetDickmode extends PlayerCommand{ - private CreativeBoundariesModule module; + private CreativeBoundariesComponent module; - public SetDickmode(CreativeBoundariesModule module){ + public SetDickmode(CreativeBoundariesComponent module){ this.module = module; } diff --git a/src/alisolarflare/modules/creativeboundaries/listeners/ItemRestrictionListener.java b/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java similarity index 58% rename from src/alisolarflare/modules/creativeboundaries/listeners/ItemRestrictionListener.java rename to src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java index 3cb6581..acb431b 100644 --- a/src/alisolarflare/modules/creativeboundaries/listeners/ItemRestrictionListener.java +++ b/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.creativeboundaries.listeners; +package alisolarflare.components.creativeboundaries.listeners; import java.util.List; @@ -7,13 +7,13 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryCreativeEvent; -import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; +import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class ItemRestrictionListener implements Listener { - private CreativeBoundariesModule module; + private CreativeBoundariesComponent module; - public ItemRestrictionListener(CreativeBoundariesModule module) { + public ItemRestrictionListener(CreativeBoundariesComponent module) { this.module = module; } diff --git a/src/alisolarflare/modules/creativeboundaries/listeners/PlotChangeListener.java b/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java similarity index 85% rename from src/alisolarflare/modules/creativeboundaries/listeners/PlotChangeListener.java rename to src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java index a257f89..2516b4e 100644 --- a/src/alisolarflare/modules/creativeboundaries/listeners/PlotChangeListener.java +++ b/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.creativeboundaries.listeners; +package alisolarflare.components.creativeboundaries.listeners; import org.bukkit.GameMode; import org.bukkit.entity.Player; @@ -12,11 +12,11 @@ import com.palmergames.bukkit.towny.object.Town; import com.palmergames.bukkit.towny.object.TownBlock; import com.palmergames.bukkit.towny.object.TownyUniverse; -import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; +import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class PlotChangeListener implements Listener{ - public CreativeBoundariesModule module; - public PlotChangeListener(CreativeBoundariesModule module){ + public CreativeBoundariesComponent module; + public PlotChangeListener(CreativeBoundariesComponent module){ this.module = module; } @EventHandler diff --git a/src/alisolarflare/components/easyuhc/EasyUHCComponent.java b/src/alisolarflare/components/easyuhc/EasyUHCComponent.java new file mode 100644 index 0000000..3487368 --- /dev/null +++ b/src/alisolarflare/components/easyuhc/EasyUHCComponent.java @@ -0,0 +1,32 @@ +package alisolarflare.components.easyuhc; + +import org.bukkit.Location; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.Component; +import alisolarflare.components.easyuhc.commands.ActivatePowers; +import alisolarflare.components.easyuhc.commands.SetUHCLobby; +import alisolarflare.components.easyuhc.commands.SetWorldBorders; +import alisolarflare.components.easyuhc.commands.SpreadPlayers; +import alisolarflare.components.easyuhc.commands.StartTimer; +import alisolarflare.components.easyuhc.commands.StartUHC; +import alisolarflare.components.easyuhc.commands.TeleportToUHC; + +public class EasyUHCComponent extends Component{ + public Location lobbyLocation; + @Override + public void register(JavaPlugin plugin) { + + + + registerCommand(plugin, new ActivatePowers()); + registerCommand(plugin, new SetUHCLobby(this)); + registerCommand(plugin, new SetWorldBorders()); + registerCommand(plugin, new SetWorldBorders()); + registerCommand(plugin, new SpreadPlayers()); + registerCommand(plugin, new StartTimer()); + registerCommand(plugin, new StartUHC()); + registerCommand(plugin, new TeleportToUHC()); + + } +} diff --git a/src/alisolarflare/modules/easyuhc/commands/ActivatePowers.java b/src/alisolarflare/components/easyuhc/commands/ActivatePowers.java similarity index 65% rename from src/alisolarflare/modules/easyuhc/commands/ActivatePowers.java rename to src/alisolarflare/components/easyuhc/commands/ActivatePowers.java index 00395d1..7c19b02 100644 --- a/src/alisolarflare/modules/easyuhc/commands/ActivatePowers.java +++ b/src/alisolarflare/components/easyuhc/commands/ActivatePowers.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; public class ActivatePowers extends ModCommand{ diff --git a/src/alisolarflare/modules/easyuhc/commands/SetUHCLobby.java b/src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java similarity index 58% rename from src/alisolarflare/modules/easyuhc/commands/SetUHCLobby.java rename to src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java index 57c9e31..907a1b8 100644 --- a/src/alisolarflare/modules/easyuhc/commands/SetUHCLobby.java +++ b/src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java @@ -1,14 +1,14 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.ModCommand; -import alisolarflare.modules.easyuhc.EasyUHCModule; +import alisolarflare.components.ModCommand; +import alisolarflare.components.easyuhc.EasyUHCComponent; public class SetUHCLobby extends ModCommand{ - EasyUHCModule module; - public SetUHCLobby(EasyUHCModule easyUHCModule) { + EasyUHCComponent module; + public SetUHCLobby(EasyUHCComponent easyUHCModule) { this.module = easyUHCModule; } diff --git a/src/alisolarflare/modules/easyuhc/commands/SetWorldBorders.java b/src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java similarity index 65% rename from src/alisolarflare/modules/easyuhc/commands/SetWorldBorders.java rename to src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java index deb6a12..69ff39a 100644 --- a/src/alisolarflare/modules/easyuhc/commands/SetWorldBorders.java +++ b/src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; public class SetWorldBorders extends ModCommand { diff --git a/src/alisolarflare/modules/easyuhc/commands/ShrinkWorldBorders.java b/src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java similarity index 69% rename from src/alisolarflare/modules/easyuhc/commands/ShrinkWorldBorders.java rename to src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java index d15b370..4cf60d2 100644 --- a/src/alisolarflare/modules/easyuhc/commands/ShrinkWorldBorders.java +++ b/src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; public class ShrinkWorldBorders extends ModCommand { diff --git a/src/alisolarflare/modules/easyuhc/commands/SpreadPlayers.java b/src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java similarity index 68% rename from src/alisolarflare/modules/easyuhc/commands/SpreadPlayers.java rename to src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java index b6cbd9e..cb9e621 100644 --- a/src/alisolarflare/modules/easyuhc/commands/SpreadPlayers.java +++ b/src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; public class SpreadPlayers extends ModCommand{ diff --git a/src/alisolarflare/modules/easyuhc/commands/StartTimer.java b/src/alisolarflare/components/easyuhc/commands/StartTimer.java similarity index 68% rename from src/alisolarflare/modules/easyuhc/commands/StartTimer.java rename to src/alisolarflare/components/easyuhc/commands/StartTimer.java index 9d2fb47..9af948a 100644 --- a/src/alisolarflare/modules/easyuhc/commands/StartTimer.java +++ b/src/alisolarflare/components/easyuhc/commands/StartTimer.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; public class StartTimer extends ModCommand{ diff --git a/src/alisolarflare/modules/easyuhc/commands/StartUHC.java b/src/alisolarflare/components/easyuhc/commands/StartUHC.java similarity index 68% rename from src/alisolarflare/modules/easyuhc/commands/StartUHC.java rename to src/alisolarflare/components/easyuhc/commands/StartUHC.java index 68b7557..04bb96a 100644 --- a/src/alisolarflare/modules/easyuhc/commands/StartUHC.java +++ b/src/alisolarflare/components/easyuhc/commands/StartUHC.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; public class StartUHC extends ModCommand{ diff --git a/src/alisolarflare/modules/easyuhc/commands/TeleportToUHC.java b/src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java similarity index 68% rename from src/alisolarflare/modules/easyuhc/commands/TeleportToUHC.java rename to src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java index b5c3665..856b4ab 100644 --- a/src/alisolarflare/modules/easyuhc/commands/TeleportToUHC.java +++ b/src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.PlayerCommand; +import alisolarflare.components.PlayerCommand; public class TeleportToUHC extends PlayerCommand{ diff --git a/src/alisolarflare/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/components/flairdoor/FlairDoorComponent.java similarity index 77% rename from src/alisolarflare/components/flairdoor/FlairDoorModule.java rename to src/alisolarflare/components/flairdoor/FlairDoorComponent.java index 290522c..34a9ead 100644 --- a/src/alisolarflare/components/flairdoor/FlairDoorModule.java +++ b/src/alisolarflare/components/flairdoor/FlairDoorComponent.java @@ -2,11 +2,11 @@ package alisolarflare.components.flairdoor; import org.bukkit.plugin.java.JavaPlugin; +import alisolarflare.components.Component; import alisolarflare.components.flairdoor.commands.FlairMe; import alisolarflare.components.flairdoor.listeners.PortalListener; -import alisolarflare.modules.Module; -public class FlairDoorModule extends Module { +public class FlairDoorComponent extends Component { @Override public void register(JavaPlugin plugin) { registerCommand(plugin, new FlairMe()); diff --git a/src/alisolarflare/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java index 8745da8..cceaaf3 100644 --- a/src/alisolarflare/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -3,8 +3,8 @@ package alisolarflare.components.flairdoor.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import alisolarflare.components.PlayerCommand; import alisolarflare.components.flairdoor.listeners.PortalListener; -import alisolarflare.modules.PlayerCommand; public class FlairMe extends PlayerCommand { diff --git a/src/alisolarflare/modules/gpowers/GPowerModule.java b/src/alisolarflare/components/gpowers/GPowerComponent.java similarity index 51% rename from src/alisolarflare/modules/gpowers/GPowerModule.java rename to src/alisolarflare/components/gpowers/GPowerComponent.java index 3c74111..91ea408 100644 --- a/src/alisolarflare/modules/gpowers/GPowerModule.java +++ b/src/alisolarflare/components/gpowers/GPowerComponent.java @@ -1,14 +1,14 @@ -package alisolarflare.modules.gpowers; +package alisolarflare.components.gpowers; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.gpowers.commands.GPower; -import alisolarflare.modules.gpowers.commands.PowerDown; -import alisolarflare.modules.gpowers.commands.PowerUp; -import alisolarflare.modules.gpowers.listeners.gPowerListener; +import alisolarflare.components.Component; +import alisolarflare.components.gpowers.commands.GPower; +import alisolarflare.components.gpowers.commands.PowerDown; +import alisolarflare.components.gpowers.commands.PowerUp; +import alisolarflare.components.gpowers.listeners.gPowerListener; -public class GPowerModule extends Module { +public class GPowerComponent extends Component { @Override public void register(JavaPlugin plugin) { diff --git a/src/alisolarflare/modules/gpowers/GPowerMemory.java b/src/alisolarflare/components/gpowers/GPowerMemory.java similarity index 94% rename from src/alisolarflare/modules/gpowers/GPowerMemory.java rename to src/alisolarflare/components/gpowers/GPowerMemory.java index e0891d2..44e0089 100644 --- a/src/alisolarflare/modules/gpowers/GPowerMemory.java +++ b/src/alisolarflare/components/gpowers/GPowerMemory.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.gpowers; +package alisolarflare.components.gpowers; import java.util.HashMap; import java.util.Map; diff --git a/src/alisolarflare/modules/gpowers/commands/GPower.java b/src/alisolarflare/components/gpowers/commands/GPower.java similarity index 89% rename from src/alisolarflare/modules/gpowers/commands/GPower.java rename to src/alisolarflare/components/gpowers/commands/GPower.java index 7777d09..bfd8ce5 100644 --- a/src/alisolarflare/modules/gpowers/commands/GPower.java +++ b/src/alisolarflare/components/gpowers/commands/GPower.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.gpowers.commands; +package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.gpowers.GPowerMemory; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.gpowers.GPowerMemory; public class GPower extends PlayerCommand { diff --git a/src/alisolarflare/modules/gpowers/commands/PowerAll.java b/src/alisolarflare/components/gpowers/commands/PowerAll.java similarity index 67% rename from src/alisolarflare/modules/gpowers/commands/PowerAll.java rename to src/alisolarflare/components/gpowers/commands/PowerAll.java index b92aba1..a6fafe2 100644 --- a/src/alisolarflare/modules/gpowers/commands/PowerAll.java +++ b/src/alisolarflare/components/gpowers/commands/PowerAll.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.gpowers.commands; +package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; -import alisolarflare.modules.gpowers.GPowerMemory; -import alisolarflare.modules.gpowers.GPowerMemory.poweredPlayer; +import alisolarflare.components.ModCommand; +import alisolarflare.components.gpowers.GPowerMemory; +import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; public class PowerAll extends ModCommand{ private GPowerMemory gPowerMemory; diff --git a/src/alisolarflare/modules/gpowers/commands/PowerDown.java b/src/alisolarflare/components/gpowers/commands/PowerDown.java similarity index 78% rename from src/alisolarflare/modules/gpowers/commands/PowerDown.java rename to src/alisolarflare/components/gpowers/commands/PowerDown.java index a7849f6..42ca6c0 100644 --- a/src/alisolarflare/modules/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/components/gpowers/commands/PowerDown.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.gpowers.commands; +package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.gpowers.GPowerMemory; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.gpowers.GPowerMemory; public class PowerDown extends PlayerCommand { diff --git a/src/alisolarflare/modules/gpowers/commands/PowerUp.java b/src/alisolarflare/components/gpowers/commands/PowerUp.java similarity index 78% rename from src/alisolarflare/modules/gpowers/commands/PowerUp.java rename to src/alisolarflare/components/gpowers/commands/PowerUp.java index c82e669..433ac32 100644 --- a/src/alisolarflare/modules/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/components/gpowers/commands/PowerUp.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.gpowers.commands; +package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.gpowers.GPowerMemory; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.gpowers.GPowerMemory; public class PowerUp extends PlayerCommand { diff --git a/src/alisolarflare/modules/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java similarity index 94% rename from src/alisolarflare/modules/gpowers/listeners/gPowerApplyingTask.java rename to src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java index d1404c3..35f1f2b 100644 --- a/src/alisolarflare/modules/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.gpowers.listeners; +package alisolarflare.components.gpowers.listeners; import java.util.Map; import java.util.UUID; @@ -10,7 +10,7 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitRunnable; -import alisolarflare.modules.gpowers.GPowerMemory.poweredPlayer; +import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; public class gPowerApplyingTask extends BukkitRunnable{ private int powerLength = 300; diff --git a/src/alisolarflare/modules/gpowers/listeners/gPowerListener.java b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java similarity index 72% rename from src/alisolarflare/modules/gpowers/listeners/gPowerListener.java rename to src/alisolarflare/components/gpowers/listeners/gPowerListener.java index 7021d68..6ef02dd 100644 --- a/src/alisolarflare/modules/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.gpowers.listeners; +package alisolarflare.components.gpowers.listeners; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.gpowers.GPowerMemory; +import alisolarflare.components.gpowers.GPowerMemory; public class gPowerListener implements Listener{ diff --git a/src/alisolarflare/components/links/serializer/Deserializer.java b/src/alisolarflare/components/links/serializer/Deserializer.java deleted file mode 100644 index cfc1786..0000000 --- a/src/alisolarflare/components/links/serializer/Deserializer.java +++ /dev/null @@ -1,42 +0,0 @@ -package alisolarflare.components.links.serializer; - - -import java.io.FileInputStream; -import java.io.ObjectInputStream; -import java.util.List; - -import alisolarflare.components.links.entities.Link; - -/** - * @deprecated - * @author Alisolarflare - * - */ -public class Deserializer{ - - public static void main (String args[]) { - - //Deserializer deserializer = new Deserializer(); - //List aliLink = deserializer.loadLink(aliLink); - //System.out.println(aliLink); - } - - /**@deprecated*/ - @SuppressWarnings("unchecked") - public List loadLinkList(){ - List aliLinkList; - try{ - - FileInputStream fin = new FileInputStream("AliLinkList.ser"); - ObjectInputStream ois = new ObjectInputStream(fin); - aliLinkList = (List) ois.readObject(); - ois.close(); - - return aliLinkList; - - }catch(Exception ex){ - ex.printStackTrace(); - return null; - } - } -} diff --git a/src/alisolarflare/components/links/serializer/Serializer.java b/src/alisolarflare/components/links/serializer/Serializer.java deleted file mode 100644 index fe4efef..0000000 --- a/src/alisolarflare/components/links/serializer/Serializer.java +++ /dev/null @@ -1,38 +0,0 @@ -package alisolarflare.components.links.serializer; - - -import java.io.FileOutputStream; -import java.io.ObjectOutputStream; -import java.util.List; - -import alisolarflare.components.links.entities.Link; - -/** - * @deprecated - * @author Alisolarflare - * - */ -public class Serializer { - - public static void main (String args[]) { - - //Serializer serializer = new Serializer(); - //serializer.saveLink(plugin, frequency, location) - } - /**@deprecated*/ - public void saveLinkList(List aliLinkList){ - //saves link - - try{ - - FileOutputStream fout = new FileOutputStream("AliLinkList.ser"); - ObjectOutputStream oos = new ObjectOutputStream(fout); - oos.writeObject(aliLinkList); - oos.close(); - System.out.println("Done"); - - }catch(Exception ex){ - ex.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/src/alisolarflare/components/magic/MagicComponent.java b/src/alisolarflare/components/magic/MagicComponent.java new file mode 100644 index 0000000..835c80e --- /dev/null +++ b/src/alisolarflare/components/magic/MagicComponent.java @@ -0,0 +1,18 @@ +package alisolarflare.components.magic; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.Component; +import alisolarflare.components.magic.tricks.AliArrowListener; +import alisolarflare.components.magic.tricks.BoomBowDeathListener; +import alisolarflare.components.magic.tricks.BoomBowListener; + +public class MagicComponent extends Component{ + + @Override + public void register(JavaPlugin plugin) { + registerListener(plugin, new AliArrowListener(plugin)); + registerListener(plugin, new BoomBowDeathListener()); + registerListener(plugin, new BoomBowListener(plugin)); + } +} diff --git a/src/alisolarflare/modules/magic/tricks/AliArrowListener.java b/src/alisolarflare/components/magic/tricks/AliArrowListener.java similarity index 91% rename from src/alisolarflare/modules/magic/tricks/AliArrowListener.java rename to src/alisolarflare/components/magic/tricks/AliArrowListener.java index 437fa02..cbbe46c 100644 --- a/src/alisolarflare/modules/magic/tricks/AliArrowListener.java +++ b/src/alisolarflare/components/magic/tricks/AliArrowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.tricks; +package alisolarflare.components.magic.tricks; import org.bukkit.entity.Arrow; import org.bukkit.entity.EntityType; diff --git a/src/alisolarflare/modules/magic/tricks/AliArrowTask.java b/src/alisolarflare/components/magic/tricks/AliArrowTask.java similarity index 91% rename from src/alisolarflare/modules/magic/tricks/AliArrowTask.java rename to src/alisolarflare/components/magic/tricks/AliArrowTask.java index b21f161..6aa6665 100644 --- a/src/alisolarflare/modules/magic/tricks/AliArrowTask.java +++ b/src/alisolarflare/components/magic/tricks/AliArrowTask.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.tricks; +package alisolarflare.components.magic.tricks; import org.bukkit.Particle; import org.bukkit.entity.Arrow; diff --git a/src/alisolarflare/modules/magic/tricks/BoomBowDeathListener.java b/src/alisolarflare/components/magic/tricks/BoomBowDeathListener.java similarity index 88% rename from src/alisolarflare/modules/magic/tricks/BoomBowDeathListener.java rename to src/alisolarflare/components/magic/tricks/BoomBowDeathListener.java index 5a7b749..1b55fe4 100644 --- a/src/alisolarflare/modules/magic/tricks/BoomBowDeathListener.java +++ b/src/alisolarflare/components/magic/tricks/BoomBowDeathListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.tricks; +package alisolarflare.components.magic.tricks; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; diff --git a/src/alisolarflare/modules/magic/tricks/BoomBowListener.java b/src/alisolarflare/components/magic/tricks/BoomBowListener.java similarity index 95% rename from src/alisolarflare/modules/magic/tricks/BoomBowListener.java rename to src/alisolarflare/components/magic/tricks/BoomBowListener.java index d650646..6aaca6a 100644 --- a/src/alisolarflare/modules/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/components/magic/tricks/BoomBowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.tricks; +package alisolarflare.components.magic.tricks; import org.bukkit.GameMode; import org.bukkit.Location; diff --git a/src/alisolarflare/modules/magic/tricks/BoomBowRule.java b/src/alisolarflare/components/magic/tricks/BoomBowRule.java similarity index 92% rename from src/alisolarflare/modules/magic/tricks/BoomBowRule.java rename to src/alisolarflare/components/magic/tricks/BoomBowRule.java index e701070..9d9d9c0 100644 --- a/src/alisolarflare/modules/magic/tricks/BoomBowRule.java +++ b/src/alisolarflare/components/magic/tricks/BoomBowRule.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.magic.tricks; +package alisolarflare.components.magic.tricks; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; //HEHEHHEHEH EAASSSTER EGGS public class BoomBowRule extends ModCommand{ public static boolean boomDecay; diff --git a/src/alisolarflare/modules/magic/tricks/BoomDecayTask.java b/src/alisolarflare/components/magic/tricks/BoomDecayTask.java similarity index 87% rename from src/alisolarflare/modules/magic/tricks/BoomDecayTask.java rename to src/alisolarflare/components/magic/tricks/BoomDecayTask.java index 5cc0401..15a5474 100644 --- a/src/alisolarflare/modules/magic/tricks/BoomDecayTask.java +++ b/src/alisolarflare/components/magic/tricks/BoomDecayTask.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.tricks; +package alisolarflare.components.magic.tricks; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/alisolarflare/components/metrics/MetricsModule.java b/src/alisolarflare/components/metrics/MetricsModule.java new file mode 100644 index 0000000..4672898 --- /dev/null +++ b/src/alisolarflare/components/metrics/MetricsModule.java @@ -0,0 +1,48 @@ +package alisolarflare.components.metrics; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.List; + +import org.bukkit.configuration.InvalidConfigurationException; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.Component; + +public class MetricsModule extends Component{ + + public FileConfiguration metricsYml; + private List playerList; + + @Override + public void register(JavaPlugin plugin){ + + try { + loadFileConfiguration(plugin, "config.yml"); + } catch (IOException | InvalidConfigurationException e) { + e.printStackTrace(); + return; + } + + + } + + private FileConfiguration loadFileConfiguration(JavaPlugin plugin, String fileName) throws FileNotFoundException, IOException, InvalidConfigurationException { + + File file = new File(plugin.getDataFolder(), fileName); + + if (!file.exists()) { + file.getParentFile().mkdirs(); + plugin.saveResource(fileName, false); + } + + FileConfiguration config = new YamlConfiguration(); + + config.load(file); + + return config; + } +} diff --git a/src/alisolarflare/modules/metrics/listeners/PlayerLoginListener.java b/src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java similarity index 64% rename from src/alisolarflare/modules/metrics/listeners/PlayerLoginListener.java rename to src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java index b512120..289c2fd 100644 --- a/src/alisolarflare/modules/metrics/listeners/PlayerLoginListener.java +++ b/src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.metrics.listeners; +package alisolarflare.components.metrics.listeners; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerLoginEvent; -import alisolarflare.modules.metrics.MetricsModule; +import alisolarflare.components.metrics.MetricsModule; public class PlayerLoginListener implements Listener{ @@ -14,7 +14,7 @@ public class PlayerLoginListener implements Listener{ } @EventHandler public void onPlayerLogin(PlayerLoginEvent event){ - module.saveData(module.config, "loginlog."+System.currentTimeMillis(), event.getPlayer().getName()); + module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis(), event.getPlayer().getName()); event.getPlayer(); } } diff --git a/src/alisolarflare/modules/minigames/GameState.java b/src/alisolarflare/components/minigames/GameState.java similarity index 52% rename from src/alisolarflare/modules/minigames/GameState.java rename to src/alisolarflare/components/minigames/GameState.java index c985192..7a5a953 100644 --- a/src/alisolarflare/modules/minigames/GameState.java +++ b/src/alisolarflare/components/minigames/GameState.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.minigames; +package alisolarflare.components.minigames; public enum GameState { Idle, FreeForAll, Heroes; diff --git a/src/alisolarflare/modules/minigames/MinigameModule.java b/src/alisolarflare/components/minigames/MinigameModule.java similarity index 55% rename from src/alisolarflare/modules/minigames/MinigameModule.java rename to src/alisolarflare/components/minigames/MinigameModule.java index 30f832e..51e332c 100644 --- a/src/alisolarflare/modules/minigames/MinigameModule.java +++ b/src/alisolarflare/components/minigames/MinigameModule.java @@ -1,17 +1,17 @@ -package alisolarflare.modules.minigames; +package alisolarflare.components.minigames; import java.util.List; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.minigames.commands.JoinMinigame; -import alisolarflare.modules.minigames.commands.LeaveMinigame; -import alisolarflare.modules.minigames.commands.ListFighters; -import alisolarflare.modules.minigames.commands.SetColourSpawn; -import alisolarflare.modules.minigames.data.SpawnSet; +import alisolarflare.components.Component; +import alisolarflare.components.minigames.commands.JoinMinigame; +import alisolarflare.components.minigames.commands.LeaveMinigame; +import alisolarflare.components.minigames.commands.ListFighters; +import alisolarflare.components.minigames.commands.SetColourSpawn; +import alisolarflare.components.minigames.data.SpawnSet; -public class MinigameModule extends Module{ +public class MinigameModule extends Component{ public SpawnSet spawnSet; public List fighters; private GameState gameState; diff --git a/src/alisolarflare/modules/minigames/commands/JoinMinigame.java b/src/alisolarflare/components/minigames/commands/JoinMinigame.java similarity index 79% rename from src/alisolarflare/modules/minigames/commands/JoinMinigame.java rename to src/alisolarflare/components/minigames/commands/JoinMinigame.java index 4c958a7..88a5cb0 100644 --- a/src/alisolarflare/modules/minigames/commands/JoinMinigame.java +++ b/src/alisolarflare/components/minigames/commands/JoinMinigame.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.minigames.commands; +package alisolarflare.components.minigames.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.minigames.MinigameModule; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.minigames.MinigameModule; public class JoinMinigame extends PlayerCommand { private MinigameModule module; diff --git a/src/alisolarflare/modules/minigames/commands/LeaveMinigame.java b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java similarity index 79% rename from src/alisolarflare/modules/minigames/commands/LeaveMinigame.java rename to src/alisolarflare/components/minigames/commands/LeaveMinigame.java index e712bd0..3685433 100644 --- a/src/alisolarflare/modules/minigames/commands/LeaveMinigame.java +++ b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.minigames.commands; +package alisolarflare.components.minigames.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.minigames.MinigameModule; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.minigames.MinigameModule; public class LeaveMinigame extends PlayerCommand { diff --git a/src/alisolarflare/modules/minigames/commands/ListFighters.java b/src/alisolarflare/components/minigames/commands/ListFighters.java similarity index 66% rename from src/alisolarflare/modules/minigames/commands/ListFighters.java rename to src/alisolarflare/components/minigames/commands/ListFighters.java index 0d3b769..f0d1738 100644 --- a/src/alisolarflare/modules/minigames/commands/ListFighters.java +++ b/src/alisolarflare/components/minigames/commands/ListFighters.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.minigames.commands; +package alisolarflare.components.minigames.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.minigames.MinigameModule; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.minigames.MinigameModule; public class ListFighters extends PlayerCommand { private MinigameModule lobby; diff --git a/src/alisolarflare/modules/minigames/commands/SetColourSpawn.java b/src/alisolarflare/components/minigames/commands/SetColourSpawn.java similarity index 88% rename from src/alisolarflare/modules/minigames/commands/SetColourSpawn.java rename to src/alisolarflare/components/minigames/commands/SetColourSpawn.java index db07787..eb44a5d 100644 --- a/src/alisolarflare/modules/minigames/commands/SetColourSpawn.java +++ b/src/alisolarflare/components/minigames/commands/SetColourSpawn.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.minigames.commands; +package alisolarflare.components.minigames.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.minigames.data.SpawnSet; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.minigames.data.SpawnSet; public class SetColourSpawn extends PlayerCommand{ private SpawnSet spawnSet; diff --git a/src/alisolarflare/modules/minigames/data/SpawnSet.java b/src/alisolarflare/components/minigames/data/SpawnSet.java similarity index 92% rename from src/alisolarflare/modules/minigames/data/SpawnSet.java rename to src/alisolarflare/components/minigames/data/SpawnSet.java index 10f519e..dfd2ba9 100644 --- a/src/alisolarflare/modules/minigames/data/SpawnSet.java +++ b/src/alisolarflare/components/minigames/data/SpawnSet.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.minigames.data; +package alisolarflare.components.minigames.data; import org.bukkit.Location; diff --git a/src/alisolarflare/modules/minigames/entities/Fighter.java b/src/alisolarflare/components/minigames/entities/Fighter.java similarity index 73% rename from src/alisolarflare/modules/minigames/entities/Fighter.java rename to src/alisolarflare/components/minigames/entities/Fighter.java index ace6db1..79fc62a 100644 --- a/src/alisolarflare/modules/minigames/entities/Fighter.java +++ b/src/alisolarflare/components/minigames/entities/Fighter.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.minigames.entities; +package alisolarflare.components.minigames.entities; import org.bukkit.entity.Player; diff --git a/src/alisolarflare/modules/creativeboundaries/CreativeBoundariesModule.java b/src/alisolarflare/modules/creativeboundaries/CreativeBoundariesModule.java deleted file mode 100644 index d9ecdf8..0000000 --- a/src/alisolarflare/modules/creativeboundaries/CreativeBoundariesModule.java +++ /dev/null @@ -1,30 +0,0 @@ -package alisolarflare.modules.creativeboundaries; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.modules.Module; -import alisolarflare.modules.creativeboundaries.commands.Cbgm0; -import alisolarflare.modules.creativeboundaries.commands.Cbgm1; -import alisolarflare.modules.creativeboundaries.commands.SetDickmode; -import alisolarflare.modules.creativeboundaries.listeners.ItemRestrictionListener; -import alisolarflare.modules.creativeboundaries.listeners.PlotChangeListener; - - -public class CreativeBoundariesModule extends Module{ - public boolean dickmode; - public List cbCreatives = new ArrayList(); - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new Cbgm1(this)); - registerCommand(plugin, new Cbgm0(this)); - registerCommand(plugin, new SetDickmode(this)); - - registerListener(plugin, new PlotChangeListener(this)); - //registerListener(plugin, new ItemRestrictionListener(this)); - } - -} diff --git a/src/alisolarflare/modules/easyuhc/EasyUHCModule.java b/src/alisolarflare/modules/easyuhc/EasyUHCModule.java deleted file mode 100644 index 3d49527..0000000 --- a/src/alisolarflare/modules/easyuhc/EasyUHCModule.java +++ /dev/null @@ -1,32 +0,0 @@ -package alisolarflare.modules.easyuhc; - -import org.bukkit.Location; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.modules.Module; -import alisolarflare.modules.easyuhc.commands.ActivatePowers; -import alisolarflare.modules.easyuhc.commands.SetUHCLobby; -import alisolarflare.modules.easyuhc.commands.SetWorldBorders; -import alisolarflare.modules.easyuhc.commands.SpreadPlayers; -import alisolarflare.modules.easyuhc.commands.StartTimer; -import alisolarflare.modules.easyuhc.commands.StartUHC; -import alisolarflare.modules.easyuhc.commands.TeleportToUHC; - -public class EasyUHCModule extends Module{ - public Location lobbyLocation; - @Override - public void register(JavaPlugin plugin) { - - - - registerCommand(plugin, new ActivatePowers()); - registerCommand(plugin, new SetUHCLobby(this)); - registerCommand(plugin, new SetWorldBorders()); - registerCommand(plugin, new SetWorldBorders()); - registerCommand(plugin, new SpreadPlayers()); - registerCommand(plugin, new StartTimer()); - registerCommand(plugin, new StartUHC()); - registerCommand(plugin, new TeleportToUHC()); - - } -} diff --git a/src/alisolarflare/modules/magic/MagicModule.java b/src/alisolarflare/modules/magic/MagicModule.java deleted file mode 100644 index 76477c2..0000000 --- a/src/alisolarflare/modules/magic/MagicModule.java +++ /dev/null @@ -1,18 +0,0 @@ -package alisolarflare.modules.magic; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.modules.Module; -import alisolarflare.modules.magic.tricks.AliArrowListener; -import alisolarflare.modules.magic.tricks.BoomBowDeathListener; -import alisolarflare.modules.magic.tricks.BoomBowListener; - -public class MagicModule extends Module{ - - @Override - public void register(JavaPlugin plugin) { - registerListener(plugin, new AliArrowListener(plugin)); - registerListener(plugin, new BoomBowDeathListener()); - registerListener(plugin, new BoomBowListener(plugin)); - } -} diff --git a/src/alisolarflare/modules/metrics/MetricsModule.java b/src/alisolarflare/modules/metrics/MetricsModule.java deleted file mode 100644 index a4ca43e..0000000 --- a/src/alisolarflare/modules/metrics/MetricsModule.java +++ /dev/null @@ -1,16 +0,0 @@ -package alisolarflare.modules.metrics; - -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.modules.Module; - -public class MetricsModule extends Module{ - - public FileConfiguration config; - - @Override - public void register(JavaPlugin plugin) { - this.config = plugin.getConfig(); - } -} diff --git a/src/graveyard/autouhc/UHCModule.java b/src/graveyard/autouhc/UHCModule.java index 1891c31..861a834 100644 --- a/src/graveyard/autouhc/UHCModule.java +++ b/src/graveyard/autouhc/UHCModule.java @@ -1,12 +1,12 @@ package graveyard.autouhc; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; +import alisolarflare.components.Component; import graveyard.autouhc.memory.MatchState; import graveyard.autouhc.memory.UHCMatch; /**@deprecated*/ -public class UHCModule extends Module { +public class UHCModule extends Component { public UHCMatch match; public void register(JavaPlugin plugin) { diff --git a/src/graveyard/autouhc/controller/SetMatchState.java b/src/graveyard/autouhc/controller/SetMatchState.java index 00f8d94..bced5be 100644 --- a/src/graveyard/autouhc/controller/SetMatchState.java +++ b/src/graveyard/autouhc/controller/SetMatchState.java @@ -3,7 +3,7 @@ package graveyard.autouhc.controller; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; import graveyard.autouhc.memory.MatchState; import graveyard.autouhc.memory.UHCMatch; /**@deprecated*/ diff --git a/src/graveyard/autouhc/idle/AddToUHC.java b/src/graveyard/autouhc/idle/AddToUHC.java index f1ffa57..030fb85 100644 --- a/src/graveyard/autouhc/idle/AddToUHC.java +++ b/src/graveyard/autouhc/idle/AddToUHC.java @@ -3,7 +3,7 @@ package graveyard.autouhc.idle; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; import graveyard.autouhc.memory.UHCMatch; /** diff --git a/src/graveyard/autouhc/idle/JoinUHC.java b/src/graveyard/autouhc/idle/JoinUHC.java index c37d301..f1a09a1 100644 --- a/src/graveyard/autouhc/idle/JoinUHC.java +++ b/src/graveyard/autouhc/idle/JoinUHC.java @@ -3,7 +3,7 @@ package graveyard.autouhc.idle; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; import graveyard.autouhc.memory.UHCMatch; /**@deprecated*/ public class JoinUHC extends ModCommand{ diff --git a/src/graveyard/autouhc/intro/ConfigureMatch.java b/src/graveyard/autouhc/intro/ConfigureMatch.java index 49f1bfb..50ac73d 100644 --- a/src/graveyard/autouhc/intro/ConfigureMatch.java +++ b/src/graveyard/autouhc/intro/ConfigureMatch.java @@ -2,7 +2,7 @@ package graveyard.autouhc.intro; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; import graveyard.autouhc.memory.UHCMatch; /**@deprecated*/ public class ConfigureMatch extends ModCommand{ diff --git a/src/graveyard/autouhc/intro/ScheduleMatch.java b/src/graveyard/autouhc/intro/ScheduleMatch.java index 91b130a..670826e 100644 --- a/src/graveyard/autouhc/intro/ScheduleMatch.java +++ b/src/graveyard/autouhc/intro/ScheduleMatch.java @@ -2,7 +2,7 @@ package graveyard.autouhc.intro; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; import graveyard.autouhc.memory.UHCMatch; /**@deprecated*/ public class ScheduleMatch extends ModCommand{ diff --git a/src/graveyard/autouhc/intro/StartMatch.java b/src/graveyard/autouhc/intro/StartMatch.java index 22f2b5a..26a6948 100644 --- a/src/graveyard/autouhc/intro/StartMatch.java +++ b/src/graveyard/autouhc/intro/StartMatch.java @@ -2,7 +2,7 @@ package graveyard.autouhc.intro; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; import graveyard.autouhc.memory.MatchState; import graveyard.autouhc.memory.UHCMatch; diff --git a/src/graveyard/shulker/AliShulkerModule.java b/src/graveyard/shulker/AliShulkerModule.java index 6b47bdd..04c6037 100644 --- a/src/graveyard/shulker/AliShulkerModule.java +++ b/src/graveyard/shulker/AliShulkerModule.java @@ -2,11 +2,11 @@ package graveyard.shulker; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; +import alisolarflare.components.Component; import graveyard.shulker.commands.AliShulker; /**@deprecated*/ -public class AliShulkerModule extends Module { +public class AliShulkerModule extends Component { @Override public void register(JavaPlugin plugin) { From e089d8ff12724d6c2608a4fad187747cd166f6e3 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 12 Nov 2016 11:17:38 -0500 Subject: [PATCH 122/263] Completely rewrote AliLink code --- .../components/alilinks/AliLinkComponent.java | 28 ++-- .../alilinks/commands/PressAliLink.java | 17 +-- .../alilinks/commands/SetAliLink.java | 128 +++++------------- .../components/alilinks/entities/Link.java | 34 ++++- 4 files changed, 85 insertions(+), 122 deletions(-) diff --git a/src/alisolarflare/components/alilinks/AliLinkComponent.java b/src/alisolarflare/components/alilinks/AliLinkComponent.java index 9e6741e..3879f63 100644 --- a/src/alisolarflare/components/alilinks/AliLinkComponent.java +++ b/src/alisolarflare/components/alilinks/AliLinkComponent.java @@ -1,6 +1,8 @@ package alisolarflare.components.alilinks; +import java.util.ArrayList; import java.util.List; +import java.util.Map; import org.bukkit.plugin.java.JavaPlugin; @@ -10,24 +12,26 @@ import alisolarflare.components.alilinks.commands.SetAliLink; import alisolarflare.components.alilinks.entities.Link; public class AliLinkComponent extends Component { - private SetAliLink setAliLink; + private List linkList; + private List> linkData; @Override public void register(JavaPlugin plugin) { - setAliLink = new SetAliLink(plugin); + this.linkList = MapToLinkList(plugin.getConfig().getMapList("aliLinkList")); + for (Link link: linkList){ + linkData.add(link.toMap()); + } - registerCommand(plugin, new PressAliLink(plugin, setAliLink)); - registerCommand(plugin, setAliLink); + registerCommand(plugin, new PressAliLink(plugin, linkList)); + registerCommand(plugin, new SetAliLink(plugin.getConfig(), linkList, linkData)); } - - public void saveLinkList(JavaPlugin plugin) { - plugin.getConfig().set("aliLinkList", setAliLink.linkList); - } - @SuppressWarnings("unchecked") - public List loadLinkList(JavaPlugin plugin) { - return (List) plugin.getConfig().getList("aliLinkList"); + private List MapToLinkList(List> mapList) { + List linkList = new ArrayList(); + for (Map MapWithLinkData : mapList){ + linkList.add(new Link((Map) MapWithLinkData)); + } + return linkList; } - } diff --git a/src/alisolarflare/components/alilinks/commands/PressAliLink.java b/src/alisolarflare/components/alilinks/commands/PressAliLink.java index 9ba8e68..eeeee96 100644 --- a/src/alisolarflare/components/alilinks/commands/PressAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/PressAliLink.java @@ -1,5 +1,7 @@ package alisolarflare.components.alilinks.commands; +import java.util.List; + import org.bukkit.command.CommandSender; import org.bukkit.plugin.java.JavaPlugin; @@ -8,23 +10,23 @@ import alisolarflare.components.alilinks.entities.Link; public class PressAliLink extends PlayerCommand { private JavaPlugin plugin; - private SetAliLink setAliLink; + private List linkList; - public PressAliLink(JavaPlugin plugin, SetAliLink setAliLink) { + public PressAliLink(JavaPlugin plugin, List linkList) { this.plugin = plugin; - this.setAliLink = setAliLink; + this.linkList = linkList; } @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { - sender.getServer().broadcastMessage(setAliLink.linkList.toString() + "over."); + sender.getServer().broadcastMessage(linkList.toString() + "over."); if (args.length < 1) { sender.sendMessage("You must specify a link frequency"); sender.sendMessage("/pressalilink [frequency]"); } - for (Link link : setAliLink.linkList) { + for (Link link : linkList) { for (String inputlink : args) { if (inputlink.equals(link.frequency)) { link.press(plugin); @@ -33,9 +35,4 @@ public class PressAliLink extends PlayerCommand { } return false; } - - @Override - public String[] GetHelpText(String alias) { - return null; - } } diff --git a/src/alisolarflare/components/alilinks/commands/SetAliLink.java b/src/alisolarflare/components/alilinks/commands/SetAliLink.java index b98ff5b..c68aa18 100644 --- a/src/alisolarflare/components/alilinks/commands/SetAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/SetAliLink.java @@ -2,122 +2,62 @@ package alisolarflare.components.alilinks.commands; import java.util.ArrayList; import java.util.List; +import java.util.Map; import org.apache.commons.lang3.StringUtils; -import org.bukkit.Location; +import org.bukkit.World; import org.bukkit.command.CommandSender; +import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.PlayerCommand; -import alisolarflare.components.alilinks.AliLinkComponent; import alisolarflare.components.alilinks.entities.Link; -/** - * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, a location in a world that when called on by {@link PressAliLink}, creates a temporary redstone - * block, enabling wireless redstone - * - * @see PressAliLink - * @author Alisolarflare - * - */ public class SetAliLink extends PlayerCommand { - public List linkList = new ArrayList(); - AliLinkComponent subplugin; - private JavaPlugin plugin; - - /** - * Constructs the SetAliLink class - * - * @param plugin - * The plugin that contains the configuration file of SetAliLink - */ - public SetAliLink(JavaPlugin plugin) { - this.plugin = plugin; - load(); + public List linkList; + public List> linkData; + private FileConfiguration config; + + public SetAliLink(FileConfiguration config, List linkList, List> linkData) { + this.linkList = linkList; + this.linkData = linkData; + this.config = config; } - /** - * This command creates an Ali-Link which, when activated by the command /PressAliLink, creates a temporary redstone block if and only if /PressAliLink [frequency] matches the frequency saved when - * /SetAliLink [frequency] is called. - * - * @see Class#PressAliLink - * @param sender - * Player who sent the command - * @param command - * Command Object created - * @param label - * Name of the command - * @param args - * Arguments: [frequency] [x-coordinate] [y-coordinate] [z-coordinate], where the coordinates point to the intended location of the Ali-Link - */ @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { - sender.sendMessage("you pressed shit"); + Player player = (Player) sender; + player.sendMessage("you pressed"); if (args == null || args.length < 1) { sender.sendMessage("You must specify a link frequency"); sender.sendMessage("/pressalilink [name]"); return false; } - Player player = (Player) sender; - if (args.length < 4) { - player.sendMessage("short"); - linkList.add(new Link(args[0], player.getLocation())); - save(player); - player.sendMessage("end"); - return false; - } - if (StringUtils.isNumericSpace(args[1]) && StringUtils.isNumericSpace(args[2]) - && StringUtils.isNumericSpace(args[3])) { - player.sendMessage("CUUUSTOM"); - linkList.add(new Link(args[0], new Location(player.getWorld(), Double.parseDouble(args[1]), - Double.parseDouble(args[2]), Double.parseDouble(args[3])))); - save(player); - player.sendMessage("FINISHED"); - } else { - player.sendMessage("UNCUSTOOM"); - linkList.add(new Link(args[0], player.getLocation())); - save(player); - player.sendMessage("UNFINISHED"); - return false; - } - return false; - } - /** - * Tries to save the entire SetAliLink class into memory, which includes all of the current Ali-links saved and in use. - * - * @param player - */ - private void save(Player player) { - player.sendMessage("SAAAVING"); - player.sendMessage("SAVE FAILED: TELL ALI TO FIX THE SAVE AND UN-COMMENT THE PARAGRAPH SHE COMMENTED"); - player.sendMessage("Link will only last until next server restart"); - return; - /* - * subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); try { player.sendMessage("SAVIN"); subplugin.plugin.saveConfig(); player.sendMessage("GOOD SAVE"); } catch (Exception e) - * { player.sendMessage("YOU FUCKED STUFF UP"); // TODO Auto-generated catch block e.printStackTrace(); } - */ - } - - /** - * Attempts to load the previous saved state of AliLinks, from the plugin configuration file - */ - @SuppressWarnings("unchecked") - private void load() { - try { - linkList = (List) plugin.getConfig().getList("aliLinkList"); - if (linkList == null || linkList.isEmpty()) { - linkList = new ArrayList(); + String frequency = args[0]; + World world = player.getWorld(); + Double x = player.getLocation().getX(); + Double y = player.getLocation().getY(); + Double z = player.getLocation().getZ(); + + if (args.length > 4) { + boolean arg1isNumber = StringUtils.isNumericSpace(args[1]); + boolean arg2isNumber = StringUtils.isNumericSpace(args[2]); + boolean arg3isNumber = StringUtils.isNumericSpace(args[3]); + if (arg1isNumber && arg2isNumber && arg3isNumber) { + x = Double.parseDouble(args[1]); + y = Double.parseDouble(args[2]); + z = Double.parseDouble(args[3]); } - } catch (Exception e) { - e.printStackTrace(); } + Link link = new Link(frequency, world, x, y, z); + linkList.add(link); + linkData.add(link.toMap()); + saveLinkList(); + return true; } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; + private void saveLinkList(){ + config.set("aliLinkList", linkData); } } diff --git a/src/alisolarflare/components/alilinks/entities/Link.java b/src/alisolarflare/components/alilinks/entities/Link.java index 55199d9..b27b61b 100644 --- a/src/alisolarflare/components/alilinks/entities/Link.java +++ b/src/alisolarflare/components/alilinks/entities/Link.java @@ -1,24 +1,29 @@ package alisolarflare.components.alilinks.entities; -import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.World; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.alilinks.tasks.UnpressTask; -public class Link implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; +public class Link{ public String frequency; public String world; public String x; public String y; public String z; + public Link(Map linkFromMap){ + this.frequency = linkFromMap.get("frequency"); + this.world = linkFromMap.get("world"); + this.x = linkFromMap.get("x"); + this.y = linkFromMap.get("y"); + this.z = linkFromMap.get("z"); + } public Link(String frequency, Location location){ this.frequency = frequency; @@ -28,6 +33,13 @@ public class Link implements Serializable{ this.z = "" + location.getBlockZ(); //plugin.plugin.getConfig().set("frequency", 10); } + public Link (String frequency, World world, Double x, Double y, Double z){ + this.frequency = frequency; + this.world = world.getName(); + this.x = "" + x; + this.y = "" + y; + this.z = "" + z; + } /** * Activates the Ali-Link * @param plugin @@ -38,4 +50,14 @@ public class Link implements Serializable{ UnpressTask unPressTask = new UnpressTask(location); unPressTask.runTaskTimer(plugin, 2, 1); } + + public Map toMap(){ + Map linkAsMap = new HashMap(); + linkAsMap.put("frequency", frequency); + linkAsMap.put("world", world); + linkAsMap.put("x", x); + linkAsMap.put("y", y); + linkAsMap.put("z", z); + return linkAsMap; + } } From eefc647347ba9e5461224ae2cb1852928d4bc3a2 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 12 Nov 2016 20:40:08 +0100 Subject: [PATCH 123/263] Removed Ping! (It was spamming the console) --- .../components/gpowers/listeners/gPowerApplyingTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java index 35f1f2b..d32e5fa 100644 --- a/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java @@ -25,7 +25,7 @@ public class gPowerApplyingTask extends BukkitRunnable{ //REPEATS EVERY 5 SECONDS @Override public void run() { - server.broadcastMessage("ping!"); + //server.broadcastMessage("ping!"); for (Player player : server.getOnlinePlayers()){ if(poweredPlayerList.containsKey(player.getUniqueId()) && poweredPlayerList.get(player.getUniqueId()).isPowersActive){ activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); From 728674335a24b0fdcb842e1ed7dbcb69c2e1c262 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 13 Nov 2016 17:00:00 -0500 Subject: [PATCH 124/263] Wrote the help text for all commands --- src/alisolarflare/components/ModCommand.java | 7 ++- .../components/PlayerCommand.java | 9 ++-- .../alilinks/commands/PressAliLink.java | 14 ++++-- .../alilinks/commands/SetAliLink.java | 10 +++- .../creativeboundaries/commands/Cbgm0.java | 17 +++++-- .../creativeboundaries/commands/Cbgm1.java | 47 ++++++++++--------- .../commands/SetDickmode.java | 40 ++++++++-------- .../listeners/ItemRestrictionListener.java | 12 ----- .../listeners/PlotChangeListener.java | 21 +++++---- .../flairdoor/commands/FlairMe.java | 10 ++-- .../components/gpowers/commands/GPower.java | 13 +++-- .../components/gpowers/commands/PowerAll.java | 7 ++- .../gpowers/commands/PowerDown.java | 11 ++--- .../components/gpowers/commands/PowerUp.java | 9 ++-- .../components/magic/tricks/BoomBowRule.java | 21 +++------ .../minigames/commands/JoinMinigame.java | 18 +++---- .../minigames/commands/LeaveMinigame.java | 10 +++- .../minigames/commands/ListFighters.java | 8 +++- .../minigames/commands/SetColourSpawn.java | 19 ++++---- 19 files changed, 166 insertions(+), 137 deletions(-) diff --git a/src/alisolarflare/components/ModCommand.java b/src/alisolarflare/components/ModCommand.java index c359349..ebe15f8 100644 --- a/src/alisolarflare/components/ModCommand.java +++ b/src/alisolarflare/components/ModCommand.java @@ -11,8 +11,11 @@ public abstract class ModCommand extends TBMCCommandBase{ @Override public String[] GetHelpText(String alias){ - return new String[] {"This command doesn't have help text, ask a dev to add one, using public String[] GetHelpText. " - + "If you're a dev, write the help text you lazy bastard. -Ali"}; + return new String[] { + "This command doesn't have help text, ask a dev to add one", + " using public String[] GetHelpText. ", + "If you're a dev, write the help text you lazy bastard. -Ali" + }; } @Override diff --git a/src/alisolarflare/components/PlayerCommand.java b/src/alisolarflare/components/PlayerCommand.java index e3bfae5..5b32d24 100644 --- a/src/alisolarflare/components/PlayerCommand.java +++ b/src/alisolarflare/components/PlayerCommand.java @@ -16,9 +16,12 @@ public abstract class PlayerCommand extends TBMCCommandBase{ } @Override public String[] GetHelpText(String alias){ - return new String[] {"This command doesn't have help text, ask a mod to ask a dev to add one, using public String[] GetHelpText. " - + "If you're a mod, ask a dev to write the help text." + - "If you're a dev, write the help text you lazy bastard. -Ali"}; + return new String[] { + "This command doesn't have help text, ask a mod to ask a ", + "dev to add one using public String[] GetHelpText. ", + "If you're a mod, ask a dev to write the help text.", + "If you're a dev, write the help text you lazy bastard. -Ali" + }; } } diff --git a/src/alisolarflare/components/alilinks/commands/PressAliLink.java b/src/alisolarflare/components/alilinks/commands/PressAliLink.java index eeeee96..0f2b0ba 100644 --- a/src/alisolarflare/components/alilinks/commands/PressAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/PressAliLink.java @@ -19,12 +19,9 @@ public class PressAliLink extends PlayerCommand { @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { - - sender.getServer().broadcastMessage(linkList.toString() + "over."); - if (args.length < 1) { sender.sendMessage("You must specify a link frequency"); - sender.sendMessage("/pressalilink [frequency]"); + return false; } for (Link link : linkList) { for (String inputlink : args) { @@ -33,6 +30,13 @@ public class PressAliLink extends PlayerCommand { } } } - return false; + sender.sendMessage("Link pressed!"); + return true; + } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: /pressalilink " + }; } } diff --git a/src/alisolarflare/components/alilinks/commands/SetAliLink.java b/src/alisolarflare/components/alilinks/commands/SetAliLink.java index c68aa18..11ffb83 100644 --- a/src/alisolarflare/components/alilinks/commands/SetAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/SetAliLink.java @@ -1,6 +1,5 @@ package alisolarflare.components.alilinks.commands; -import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -9,7 +8,6 @@ import org.bukkit.World; import org.bukkit.command.CommandSender; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.PlayerCommand; import alisolarflare.components.alilinks.entities.Link; @@ -51,13 +49,21 @@ public class SetAliLink extends PlayerCommand { z = Double.parseDouble(args[3]); } } + Link link = new Link(frequency, world, x, y, z); linkList.add(link); linkData.add(link.toMap()); saveLinkList(); + return true; } private void saveLinkList(){ config.set("aliLinkList", linkData); } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: /setalilink [x] [y] [z]" + }; + } } diff --git a/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java index 2551d68..b1e597b 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java +++ b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java @@ -1,5 +1,7 @@ package alisolarflare.components.creativeboundaries.commands; +import java.util.List; + import org.bukkit.GameMode; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -9,10 +11,10 @@ import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class Cbgm0 extends PlayerCommand{ - private CreativeBoundariesComponent module; + private List cbCreatives; - public Cbgm0(CreativeBoundariesComponent module) { - this.module = module; + public Cbgm0(CreativeBoundariesComponent component) { + this.cbCreatives = component.cbCreatives; } @Override @@ -24,7 +26,12 @@ public class Cbgm0 extends PlayerCommand{ Player player = (Player) sender; player.setGameMode(GameMode.SURVIVAL); - module.cbCreatives.remove(player); - return false; + cbCreatives.remove(player); + return true; + } + public String[] GetHelpText(String alias){ + return new String[]{ + "Creative Boundaries Usage: /cbgm0" + }; } } diff --git a/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java b/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java index 9767dd3..845de5e 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java +++ b/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java @@ -1,5 +1,7 @@ package alisolarflare.components.creativeboundaries.commands; +import java.util.List; + import org.bukkit.GameMode; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -15,25 +17,21 @@ import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class Cbgm1 extends PlayerCommand { - private CreativeBoundariesComponent module; + List cbCreatives; - public Cbgm1(CreativeBoundariesComponent module) { - this.module = module; + public Cbgm1(CreativeBoundariesComponent component) { + this.cbCreatives = component.cbCreatives; } @Override public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - - if (!(sender instanceof Player)) { - sender.sendMessage("You must be a player to use this command!"); - return false; - } + Player player = (Player) sender; - TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); + if (tb == null) { - player.sendMessage("You aren't standing in a town or some other error occured."); + player.sendMessage("Some error occured."); player.sendMessage("TownBlock is null."); return false; } @@ -41,23 +39,30 @@ public class Cbgm1 extends PlayerCommand { try { town = tb.getTown(); } catch (NotRegisteredException e) { - player.sendMessage("You aren't standing in a town or some other error occured."); - player.sendMessage("TownBlock's town is not registered."); - return false; - } - if (town == null) { - player.sendMessage("ERROR: The town you're standing in is Null."); + player.sendMessage("You aren't standing in a town, head to your home town to use this command."); return false; } + boolean playerIsInTown = false; for(Resident res : town.getResidents()){ if (res.getName().toString().equals(player.getName().toString())){ - player.setGameMode(GameMode.CREATIVE); - module.cbCreatives.add(player); - return true; + playerIsInTown = true; + break; } } - player.sendMessage("Sorry, you're not part of this town"); - return false; + if (!playerIsInTown){ + player.sendMessage("Sorry, you're not part of this town"); + return false; + } + + player.setGameMode(GameMode.CREATIVE); + cbCreatives.add(player); + return true; + } + @Override + public String[] GetHelpText(String alias){ + return new String[] { + "Usage: When in a town that you either own or are a resident of, type /cbgm1 to gain creative" + }; } } diff --git a/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java b/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java index 8650dd1..134ffb0 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java +++ b/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java @@ -2,35 +2,33 @@ package alisolarflare.components.creativeboundaries.commands; import org.bukkit.command.CommandSender; -import alisolarflare.components.PlayerCommand; +import alisolarflare.components.ModCommand; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; -public class SetDickmode extends PlayerCommand{ - private CreativeBoundariesComponent module; +public class SetDickmode extends ModCommand{ + boolean dickMode; - public SetDickmode(CreativeBoundariesComponent module){ - this.module = module; + public SetDickmode(CreativeBoundariesComponent component){ + this.dickMode = component.dickmode; } @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (sender.getName().equals("Alisolarflare") || sender.getName().equals("iie")){ - if(args[0] == null){ - sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); - return false; - } - if(args[0].equalsIgnoreCase("TRUE") || args[0].equalsIgnoreCase("1")){ - sender.sendMessage("Dickmode has been turned on!"); - module.dickmode=(true); - return true; - } - if(args[0].equalsIgnoreCase("FALSE") || args[0].equalsIgnoreCase("0")){ - sender.sendMessage("Dickmode has been turned off!"); - module.dickmode=(false); - return true; - } + public boolean OnCommand(CommandSender sender, String label, String[] args) { + if(args.length < 1){ + sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); return false; } + String firstArgument = args[0]; + if(firstArgument.startsWith("t") || firstArgument.equals("1")){ + sender.sendMessage("Dickmode has been turned on!"); + dickMode = true; + return true; + } + if(firstArgument.startsWith("f") || firstArgument.equals("0")){ + sender.sendMessage("Dickmode has been turned off!"); + dickMode = false; + return true; + } return false; } } diff --git a/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java b/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java index acb431b..8b09d5a 100644 --- a/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java +++ b/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java @@ -1,11 +1,6 @@ package alisolarflare.components.creativeboundaries.listeners; -import java.util.List; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.inventory.InventoryCreativeEvent; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; @@ -16,11 +11,4 @@ public class ItemRestrictionListener implements Listener { public ItemRestrictionListener(CreativeBoundariesComponent module) { this.module = module; } - - @EventHandler - public void onItemTake(InventoryCreativeEvent event){ - List cbCreatives = module.cbCreatives; - - } - } diff --git a/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java b/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java index 2516b4e..856cf90 100644 --- a/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java +++ b/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java @@ -1,5 +1,7 @@ package alisolarflare.components.creativeboundaries.listeners; +import java.util.List; + import org.bukkit.GameMode; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -15,27 +17,30 @@ import com.palmergames.bukkit.towny.object.TownyUniverse; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class PlotChangeListener implements Listener{ - public CreativeBoundariesComponent module; + private boolean dickmode; + private List cbCreatives; + public PlotChangeListener(CreativeBoundariesComponent module){ - this.module = module; + this.dickmode = module.dickmode; + this.cbCreatives = module.cbCreatives; } @EventHandler public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ Player player = plotEvent.getPlayer(); - if (module.dickmode == false){ + if (dickmode == false){ return; } if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){ return; } - if (!(module.cbCreatives.contains(plotEvent.getPlayer()))){ + if (!(cbCreatives.contains(plotEvent.getPlayer()))){ return; } TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); if (tb == null) { player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!"); - module.cbCreatives.remove(player); + cbCreatives.remove(player); return; } Town town; @@ -44,14 +49,14 @@ public class PlotChangeListener implements Listener{ } catch (NotRegisteredException e) { player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!!"); - module.cbCreatives.remove(player); + cbCreatives.remove(player); return; } if (town == null) { player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!!!"); - module.cbCreatives.remove(player); + cbCreatives.remove(player); return; } boolean townHasRes = false; @@ -63,7 +68,7 @@ public class PlotChangeListener implements Listener{ if (!townHasRes){ player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!!!!"); - module.cbCreatives.remove(player); + cbCreatives.remove(player); } } } diff --git a/src/alisolarflare/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java index cceaaf3..8654260 100644 --- a/src/alisolarflare/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -12,11 +12,13 @@ public class FlairMe extends PlayerCommand { public boolean OnCommand(CommandSender sender, String label, String[] args) { PortalListener.playersToBeFlaired.add((Player) sender); sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); - return false; + return true; } - @Override - public String GetCommandPath() { - return "flairme"; + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: Type /flairme and enter a portal with coloured", + "wool underneath to change your flair" + }; } } diff --git a/src/alisolarflare/components/gpowers/commands/GPower.java b/src/alisolarflare/components/gpowers/commands/GPower.java index bfd8ce5..3a2561d 100644 --- a/src/alisolarflare/components/gpowers/commands/GPower.java +++ b/src/alisolarflare/components/gpowers/commands/GPower.java @@ -16,10 +16,6 @@ public class GPower extends PlayerCommand { @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { - sender.sendMessage("G power activate!"); - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command! Talk to a dev/ali if you think this is wrong"); - } Player player = (Player) sender; if (args.length < 2) { player.sendMessage("Proper Usage to test G-Powers:"); @@ -32,7 +28,6 @@ public class GPower extends PlayerCommand { colour = args[0]; } else { player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]"); return false; } boolean isActive; @@ -42,18 +37,22 @@ public class GPower extends PlayerCommand { isActive = false; } else { player.sendMessage("error: active. Proper Usage to configure G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); return false; } player.sendMessage("Terms Vaild!"); player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); gPowerMemory.configurePlayer(player, colour, isActive); - return false; + return true; } @Override public String GetCommandPath() { return "gpower"; } + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: /gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]" + }; + } } diff --git a/src/alisolarflare/components/gpowers/commands/PowerAll.java b/src/alisolarflare/components/gpowers/commands/PowerAll.java index a6fafe2..e69874a 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerAll.java +++ b/src/alisolarflare/components/gpowers/commands/PowerAll.java @@ -17,6 +17,11 @@ public class PowerAll extends ModCommand{ for (poweredPlayer poweredPlayer : gPowerMemory.poweredPlayerList.values()){ poweredPlayer.isPowersActive = true; } - return false; + return true; + } + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: Type /PowerAll to activate all powers for all players with gpowers" + }; } } diff --git a/src/alisolarflare/components/gpowers/commands/PowerDown.java b/src/alisolarflare/components/gpowers/commands/PowerDown.java index 42ca6c0..1dbe47b 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/components/gpowers/commands/PowerDown.java @@ -16,15 +16,14 @@ public class PowerDown extends PlayerCommand { @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (!(sender instanceof Player)) - sender.sendMessage("You must be a player to use this command! Contact dev/ali if you think this is wrong"); Player player = (Player) sender; gPowerMemory.PowerDownPlayer(player); - return false; + return true; } - @Override - public String GetCommandPath() { - return "powerdown"; + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: Type /PowerDown to disable your g-power" + }; } } diff --git a/src/alisolarflare/components/gpowers/commands/PowerUp.java b/src/alisolarflare/components/gpowers/commands/PowerUp.java index 433ac32..00de691 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/components/gpowers/commands/PowerUp.java @@ -21,11 +21,12 @@ public class PowerUp extends PlayerCommand { Player player = (Player) sender; gPowerMemory.PowerUpPlayer(player); - return false; + return true; } - @Override - public String GetCommandPath() { - return "powerup"; + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: Type /PowerUp to activate your registered G-Power" + }; } } diff --git a/src/alisolarflare/components/magic/tricks/BoomBowRule.java b/src/alisolarflare/components/magic/tricks/BoomBowRule.java index 9d9d9c0..44cea27 100644 --- a/src/alisolarflare/components/magic/tricks/BoomBowRule.java +++ b/src/alisolarflare/components/magic/tricks/BoomBowRule.java @@ -22,7 +22,6 @@ public class BoomBowRule extends ModCommand{ return false; } if (args.length < 2){ - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); player.sendMessage("Rules:"); player.sendMessage("boomDecay" + boomDecay); player.sendMessage("healthReduction" + healthReduction); @@ -31,7 +30,6 @@ public class BoomBowRule extends ModCommand{ return false; } if(!(args[1].startsWith("t")|| args[1].startsWith("f"))){ - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); return false; } boolean gameRule = false; @@ -53,21 +51,16 @@ public class BoomBowRule extends ModCommand{ break; default: player.sendMessage("Error: "+args[0]+" not defined as a rule"); - player.sendMessage("Usage: /boomBowRule [rulename] [true/false]"); - player.sendMessage("Rule settings: boomDecay, healthReduction, endCrystal, localized"); - break; + return false; } - return false; + return true; } @Override - public String GetCommandPath() { - // TODO Auto-generated method stub - return null; - } - @Override - public String[] GetHelpText(String arg0) { - // TODO Auto-generated method stub - return null; + public String[] GetHelpText(String alias) { + return new String[]{ + "Usage: /boomBowRule [rulename] [true/false]", + "Rule settings: boomDecay, healthReduction, endCrystal, localized" + }; } } diff --git a/src/alisolarflare/components/minigames/commands/JoinMinigame.java b/src/alisolarflare/components/minigames/commands/JoinMinigame.java index 88a5cb0..304c407 100644 --- a/src/alisolarflare/components/minigames/commands/JoinMinigame.java +++ b/src/alisolarflare/components/minigames/commands/JoinMinigame.java @@ -1,7 +1,6 @@ package alisolarflare.components.minigames.commands; import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; import alisolarflare.components.PlayerCommand; import alisolarflare.components.minigames.MinigameModule; @@ -14,16 +13,11 @@ public class JoinMinigame extends PlayerCommand { } @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - return false; - } - + public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { String name = sender.getName(); if (module.fighters.contains(name)) { sender.sendMessage("You are already in the minigame!"); - return false; + return true; } module.fighters.add(name); @@ -31,6 +25,12 @@ public class JoinMinigame extends PlayerCommand { if (module.fighters.contains(name)) { sender.sendMessage("You have joined the minigame!"); } - return false; + return true; + } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: Type /JoinMinigame to join a current button minigame!" + }; } } diff --git a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java index 3685433..a05199f 100644 --- a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java +++ b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java @@ -23,7 +23,7 @@ public class LeaveMinigame extends PlayerCommand { String name = sender.getName(); if (!(module.fighters.contains(name))) { sender.sendMessage("You are not fighting!"); - return false; + return true; } while(module.fighters.contains(name)){ @@ -31,6 +31,12 @@ public class LeaveMinigame extends PlayerCommand { } sender.sendMessage("You have left the fighters category!"); - return false; + return true; + } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: Type /LeaveMinigame to leave the current minigame!" + }; } } diff --git a/src/alisolarflare/components/minigames/commands/ListFighters.java b/src/alisolarflare/components/minigames/commands/ListFighters.java index f0d1738..acf2a67 100644 --- a/src/alisolarflare/components/minigames/commands/ListFighters.java +++ b/src/alisolarflare/components/minigames/commands/ListFighters.java @@ -15,6 +15,12 @@ public class ListFighters extends PlayerCommand { @Override public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { sender.sendMessage(lobby.fighters.toString()); - return false; + return true; + } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: Type /ListFighters to get the list of fighters in the current minigame" + }; } } diff --git a/src/alisolarflare/components/minigames/commands/SetColourSpawn.java b/src/alisolarflare/components/minigames/commands/SetColourSpawn.java index eb44a5d..5582fec 100644 --- a/src/alisolarflare/components/minigames/commands/SetColourSpawn.java +++ b/src/alisolarflare/components/minigames/commands/SetColourSpawn.java @@ -3,10 +3,10 @@ package alisolarflare.components.minigames.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.components.PlayerCommand; +import alisolarflare.components.ModCommand; import alisolarflare.components.minigames.data.SpawnSet; -public class SetColourSpawn extends PlayerCommand{ +public class SetColourSpawn extends ModCommand{ private SpawnSet spawnSet; public SetColourSpawn(SpawnSet spawnSet){ @@ -14,15 +14,8 @@ public class SetColourSpawn extends PlayerCommand{ } @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (!(sender instanceof Player)) - sender.sendMessage("ERROR: You must be a player to use this command!"); - Player player = (Player) sender; - if(!(player.getName().equalsIgnoreCase("Alisolarflare"))) - player.sendMessage("ERROR: You must be Alisolarflare to use this command!"); - - if(args.length == 0){ sender.sendMessage("ERROR: Arguments required."); return false; @@ -63,6 +56,12 @@ public class SetColourSpawn extends PlayerCommand{ sender.sendMessage("Purple Spawn Set!"); break; } - return false; + return true; + } + public String[] GetHelpText(String alias){ + return new String[] { + "Usage: /SetColourSpawn ", + "Colours: red, orange, yellow, green, blue, purple" + }; } } From d872ca7406e20fe3f4f7d2444de6ba0c2ae319db Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 13 Nov 2016 17:10:24 -0500 Subject: [PATCH 125/263] Removed Warnings --- .../creativeboundaries/CreativeBoundariesComponent.java | 1 - .../listeners/ItemRestrictionListener.java | 8 -------- src/alisolarflare/components/metrics/MetricsModule.java | 2 -- src/graveyard/autouhc/intro/StartMatch.java | 1 + src/graveyard/autouhc/memory/UHCMatch.java | 7 ------- 5 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java b/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java index 466859e..762ebd1 100644 --- a/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java +++ b/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java @@ -10,7 +10,6 @@ import alisolarflare.components.Component; import alisolarflare.components.creativeboundaries.commands.Cbgm0; import alisolarflare.components.creativeboundaries.commands.Cbgm1; import alisolarflare.components.creativeboundaries.commands.SetDickmode; -import alisolarflare.components.creativeboundaries.listeners.ItemRestrictionListener; import alisolarflare.components.creativeboundaries.listeners.PlotChangeListener; diff --git a/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java b/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java index 8b09d5a..ffb9a3d 100644 --- a/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java +++ b/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java @@ -2,13 +2,5 @@ package alisolarflare.components.creativeboundaries.listeners; import org.bukkit.event.Listener; -import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; - public class ItemRestrictionListener implements Listener { - - private CreativeBoundariesComponent module; - - public ItemRestrictionListener(CreativeBoundariesComponent module) { - this.module = module; - } } diff --git a/src/alisolarflare/components/metrics/MetricsModule.java b/src/alisolarflare/components/metrics/MetricsModule.java index 4672898..e758136 100644 --- a/src/alisolarflare/components/metrics/MetricsModule.java +++ b/src/alisolarflare/components/metrics/MetricsModule.java @@ -3,7 +3,6 @@ package alisolarflare.components.metrics; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; -import java.util.List; import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.FileConfiguration; @@ -15,7 +14,6 @@ import alisolarflare.components.Component; public class MetricsModule extends Component{ public FileConfiguration metricsYml; - private List playerList; @Override public void register(JavaPlugin plugin){ diff --git a/src/graveyard/autouhc/intro/StartMatch.java b/src/graveyard/autouhc/intro/StartMatch.java index 26a6948..dfc4f54 100644 --- a/src/graveyard/autouhc/intro/StartMatch.java +++ b/src/graveyard/autouhc/intro/StartMatch.java @@ -6,6 +6,7 @@ import alisolarflare.components.ModCommand; import graveyard.autouhc.memory.MatchState; import graveyard.autouhc.memory.UHCMatch; +/**@deprecated*/ public class StartMatch extends ModCommand { private UHCMatch match; /**@deprecated*/ diff --git a/src/graveyard/autouhc/memory/UHCMatch.java b/src/graveyard/autouhc/memory/UHCMatch.java index a5f4538..3bbf260 100644 --- a/src/graveyard/autouhc/memory/UHCMatch.java +++ b/src/graveyard/autouhc/memory/UHCMatch.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; import org.bukkit.Location; -import org.bukkit.World; import org.bukkit.configuration.file.FileConfiguration; /**@deprecated*/ @@ -14,12 +13,6 @@ public class UHCMatch { private List playerList = new ArrayList(); private Location lobbyLocation; - private Location spawnLocation; - - private World ultraHardcoreWorld; - - private int worldBorderMaxRadius; - private int worldBorderMinRadius; public UHCMatch(FileConfiguration fileConfiguration, MatchState state) { this.config = fileConfiguration; this.matchState = state; From 21bb3a03f90876694b73b0dc64ea5313c94054ca Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 14 Nov 2016 21:32:38 -0500 Subject: [PATCH 126/263] Created a Player Proximity Task --- plugin.yml | 4 +- .../flairdoor/FlairDoorComponent.java | 16 +++++- .../flairdoor/commands/FlairMe.java | 8 ++- .../commands/SetProximityLocation.java | 49 +++++++++++++++++ .../listeners/PlayerProximityTask.java | 54 +++++++++++++++++++ .../PlayerProximityTaskLauncher.java | 12 +++++ .../flairdoor/listeners/PortalListener.java | 15 +++--- 7 files changed, 146 insertions(+), 12 deletions(-) create mode 100644 src/alisolarflare/components/flairdoor/commands/SetProximityLocation.java create mode 100644 src/alisolarflare/components/flairdoor/listeners/PlayerProximityTask.java create mode 100644 src/alisolarflare/components/flairdoor/listeners/PlayerProximityTaskLauncher.java diff --git a/plugin.yml b/plugin.yml index 1bbfbb3..fd3ecae 100644 --- a/plugin.yml +++ b/plugin.yml @@ -56,4 +56,6 @@ commands: starttimer: description: starts an ultrahardcore timer powerall: - description: activate every player's power \ No newline at end of file + description: activate every player's power + setproximitylocation: + description: sets one of two proximity blocks to create a space that players can change their flairs with using flairportals. Ask ali XD \ No newline at end of file diff --git a/src/alisolarflare/components/flairdoor/FlairDoorComponent.java b/src/alisolarflare/components/flairdoor/FlairDoorComponent.java index 34a9ead..7329694 100644 --- a/src/alisolarflare/components/flairdoor/FlairDoorComponent.java +++ b/src/alisolarflare/components/flairdoor/FlairDoorComponent.java @@ -1,15 +1,27 @@ package alisolarflare.components.flairdoor; +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Location; +import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.Component; import alisolarflare.components.flairdoor.commands.FlairMe; +import alisolarflare.components.flairdoor.commands.SetProximityLocation; +import alisolarflare.components.flairdoor.listeners.PlayerProximityTaskLauncher; import alisolarflare.components.flairdoor.listeners.PortalListener; public class FlairDoorComponent extends Component { + public List playersToBeFlaired = new ArrayList(); + public Location startLocation = null; + public Location endLocation = null; @Override public void register(JavaPlugin plugin) { - registerCommand(plugin, new FlairMe()); - registerListener(plugin, new PortalListener(plugin)); + registerCommand(plugin, new FlairMe(this)); + registerCommand(plugin, new SetProximityLocation(this)); + registerListener(plugin, new PortalListener(plugin, this)); + registerListener(plugin, new PlayerProximityTaskLauncher(plugin, this)); } } diff --git a/src/alisolarflare/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java index 8654260..d854304 100644 --- a/src/alisolarflare/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -4,13 +4,17 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.PlayerCommand; -import alisolarflare.components.flairdoor.listeners.PortalListener; +import alisolarflare.components.flairdoor.FlairDoorComponent; public class FlairMe extends PlayerCommand { + private FlairDoorComponent component; + public FlairMe(FlairDoorComponent flairDoorComponent) { + this.component = flairDoorComponent; + } @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { - PortalListener.playersToBeFlaired.add((Player) sender); + component.playersToBeFlaired.add((Player) sender); sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); return true; } diff --git a/src/alisolarflare/components/flairdoor/commands/SetProximityLocation.java b/src/alisolarflare/components/flairdoor/commands/SetProximityLocation.java new file mode 100644 index 0000000..db57a00 --- /dev/null +++ b/src/alisolarflare/components/flairdoor/commands/SetProximityLocation.java @@ -0,0 +1,49 @@ +package alisolarflare.components.flairdoor.commands; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.components.ModCommand; +import alisolarflare.components.flairdoor.FlairDoorComponent; + +public class SetProximityLocation extends ModCommand{ + + private FlairDoorComponent component; + + public SetProximityLocation(FlairDoorComponent flairDoorComponent) { + this.component = flairDoorComponent; + } + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + if (args.length < 1){ + sender.sendMessage("You must enter an argument"); + return false; + } + + Player player = (Player) sender; + String firstChar = args[0].substring(0, 1); + + switch(firstChar){ + case "s": + case "0": + component.startLocation = player.getLocation(); + return true; + case "e": + case "1": + component.endLocation = player.getLocation(); + return true; + default: + player.sendMessage("You must provide a vaild argument!"); + return false; + } + } + public String[] GetHelpText(String alias){ + return new String[] { + "Usage: /SetProximityLocation ", + "Use this command to set a proximity space: all players", + "within this space will become flair-able, and portals will", + "change their colour state." + }; + } +} diff --git a/src/alisolarflare/components/flairdoor/listeners/PlayerProximityTask.java b/src/alisolarflare/components/flairdoor/listeners/PlayerProximityTask.java new file mode 100644 index 0000000..b4d9ffb --- /dev/null +++ b/src/alisolarflare/components/flairdoor/listeners/PlayerProximityTask.java @@ -0,0 +1,54 @@ +package alisolarflare.components.flairdoor.listeners; + +import org.bukkit.Location; +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitRunnable; + +import alisolarflare.components.flairdoor.FlairDoorComponent; + +public class PlayerProximityTask extends BukkitRunnable{ + private JavaPlugin plugin; + private FlairDoorComponent component; + private Location startLocation; + private Location endLocation; + + public PlayerProximityTask(JavaPlugin plugin, FlairDoorComponent component) { + this.plugin = plugin; + this.component = component; + this.startLocation = component.startLocation; + this.endLocation = component.endLocation; + } + + @Override + public void run() { + if (startLocation == null || endLocation == null){ + return; + } + int sX = startLocation.getBlockX(); + int sY = startLocation.getBlockY(); + int sZ = startLocation.getBlockZ(); + int eX = endLocation.getBlockX(); + int eY = endLocation.getBlockY(); + int eZ = endLocation.getBlockZ(); + int playerX; + int playerY; + int playerZ; + for (Player player : plugin.getServer().getOnlinePlayers()){ + playerX = player.getLocation().getBlockX(); + playerY = player.getLocation().getBlockY(); + playerZ = player.getLocation().getBlockZ(); + if(player.getLocation().getWorld() != startLocation.getWorld()) + continue; + if((playerX < sX && playerX < eX) ||(playerX > sX && playerX > eX)) + continue; + if((playerY < sY && playerY < eY) ||(playerY > sY && playerY > eY)) + continue; + if((playerZ < sZ && playerZ < eZ) ||(playerZ > sZ && playerZ > eZ)) + continue; + component.playersToBeFlaired.add(player); + + } + } + +} diff --git a/src/alisolarflare/components/flairdoor/listeners/PlayerProximityTaskLauncher.java b/src/alisolarflare/components/flairdoor/listeners/PlayerProximityTaskLauncher.java new file mode 100644 index 0000000..b7d7192 --- /dev/null +++ b/src/alisolarflare/components/flairdoor/listeners/PlayerProximityTaskLauncher.java @@ -0,0 +1,12 @@ +package alisolarflare.components.flairdoor.listeners; + +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.flairdoor.FlairDoorComponent; + +public class PlayerProximityTaskLauncher implements Listener{ + public PlayerProximityTaskLauncher(JavaPlugin plugin, FlairDoorComponent component){ + new PlayerProximityTask(plugin, component).runTaskTimer(plugin, 0, 20); + } +} diff --git a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java index 2f42642..9d85a62 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -1,8 +1,5 @@ package alisolarflare.components.flairdoor.listeners; -import java.util.ArrayList; -import java.util.List; - import org.bukkit.Bukkit; import org.bukkit.DyeColor; import org.bukkit.Material; @@ -17,14 +14,18 @@ import org.bukkit.plugin.java.JavaPlugin; import com.earth2me.essentials.Essentials; import com.earth2me.essentials.User; +import alisolarflare.components.flairdoor.FlairDoorComponent; + public class PortalListener implements Listener{ - public static List playersToBeFlaired = new ArrayList(); public JavaPlugin plugin; Essentials essentials; + + private FlairDoorComponent component; - public PortalListener(JavaPlugin plugin) { + public PortalListener(JavaPlugin plugin, FlairDoorComponent component) { this.plugin = plugin; + this.component = component; this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials")); } @EventHandler @@ -35,7 +36,7 @@ public class PortalListener implements Listener{ Player player = event.getPlayer(); - if(!(playersToBeFlaired.contains(player))){ + if(!(component.playersToBeFlaired.contains(player))){ return; } @@ -128,6 +129,6 @@ public class PortalListener implements Listener{ player.sendMessage("Adding the colour " + colourChanger + dyecolour.name() + "§f!"); player.sendMessage("Your name is now: " + user.getNickname() +"!"); - playersToBeFlaired.remove(player.getName()); + component.playersToBeFlaired.remove(player.getName()); } } From 7886c052e060b28a40ba8e8d8ca3d4c85ed64d40 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 14 Nov 2016 21:57:50 -0500 Subject: [PATCH 127/263] Cleaned up AliLink Code --- .../components/alilinks/AliLinkComponent.java | 7 ++- .../alilinks/commands/PressAliLink.java | 9 +-- .../alilinks/commands/SetAliLink.java | 12 ++-- .../components/alilinks/entities/Link.java | 60 ++++++++++--------- 4 files changed, 47 insertions(+), 41 deletions(-) diff --git a/src/alisolarflare/components/alilinks/AliLinkComponent.java b/src/alisolarflare/components/alilinks/AliLinkComponent.java index 3879f63..85e1fac 100644 --- a/src/alisolarflare/components/alilinks/AliLinkComponent.java +++ b/src/alisolarflare/components/alilinks/AliLinkComponent.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import org.bukkit.Server; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.Component; @@ -17,7 +18,7 @@ public class AliLinkComponent extends Component { private List> linkData; @Override public void register(JavaPlugin plugin) { - this.linkList = MapToLinkList(plugin.getConfig().getMapList("aliLinkList")); + this.linkList = MapToLinkList(plugin.getConfig().getMapList("aliLinkList"), plugin.getServer()); for (Link link: linkList){ linkData.add(link.toMap()); } @@ -27,10 +28,10 @@ public class AliLinkComponent extends Component { } @SuppressWarnings("unchecked") - private List MapToLinkList(List> mapList) { + private List MapToLinkList(List> mapList, Server server) { List linkList = new ArrayList(); for (Map MapWithLinkData : mapList){ - linkList.add(new Link((Map) MapWithLinkData)); + linkList.add(new Link((Map) MapWithLinkData, server)); } return linkList; } diff --git a/src/alisolarflare/components/alilinks/commands/PressAliLink.java b/src/alisolarflare/components/alilinks/commands/PressAliLink.java index 0f2b0ba..e68fdae 100644 --- a/src/alisolarflare/components/alilinks/commands/PressAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/PressAliLink.java @@ -18,14 +18,15 @@ public class PressAliLink extends PlayerCommand { } @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (args.length < 1) { + public boolean OnCommand(CommandSender sender, String label, String[] inputFrequencies) { + if (inputFrequencies.length < 1) { sender.sendMessage("You must specify a link frequency"); return false; } + for (Link link : linkList) { - for (String inputlink : args) { - if (inputlink.equals(link.frequency)) { + for (String frequency : inputFrequencies) { + if (frequency.equals(link.frequency)) { link.press(plugin); } } diff --git a/src/alisolarflare/components/alilinks/commands/SetAliLink.java b/src/alisolarflare/components/alilinks/commands/SetAliLink.java index 11ffb83..56e9e02 100644 --- a/src/alisolarflare/components/alilinks/commands/SetAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/SetAliLink.java @@ -35,18 +35,18 @@ public class SetAliLink extends PlayerCommand { String frequency = args[0]; World world = player.getWorld(); - Double x = player.getLocation().getX(); - Double y = player.getLocation().getY(); - Double z = player.getLocation().getZ(); + int x = player.getLocation().getBlockX(); + int y = player.getLocation().getBlockY(); + int z = player.getLocation().getBlockZ(); if (args.length > 4) { boolean arg1isNumber = StringUtils.isNumericSpace(args[1]); boolean arg2isNumber = StringUtils.isNumericSpace(args[2]); boolean arg3isNumber = StringUtils.isNumericSpace(args[3]); if (arg1isNumber && arg2isNumber && arg3isNumber) { - x = Double.parseDouble(args[1]); - y = Double.parseDouble(args[2]); - z = Double.parseDouble(args[3]); + x = Integer.parseInt(args[1]); + y = Integer.parseInt(args[2]); + z = Integer.parseInt(args[3]); } } diff --git a/src/alisolarflare/components/alilinks/entities/Link.java b/src/alisolarflare/components/alilinks/entities/Link.java index b27b61b..546f116 100644 --- a/src/alisolarflare/components/alilinks/entities/Link.java +++ b/src/alisolarflare/components/alilinks/entities/Link.java @@ -5,6 +5,7 @@ import java.util.Map; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.Server; import org.bukkit.World; import org.bukkit.plugin.java.JavaPlugin; @@ -12,52 +13,55 @@ import alisolarflare.components.alilinks.tasks.UnpressTask; public class Link{ public String frequency; - public String world; - public String x; - public String y; - public String z; + public World world; + public int x; + public int y; + public int z; - public Link(Map linkFromMap){ - this.frequency = linkFromMap.get("frequency"); - this.world = linkFromMap.get("world"); - this.x = linkFromMap.get("x"); - this.y = linkFromMap.get("y"); - this.z = linkFromMap.get("z"); + public Link (String frequency, World world, int x, int y, int z){ + this.frequency = frequency; + this.world = world; + this.x = x; + this.y = y; + this.z = z; } - public Link(String frequency, Location location){ + public Link(String frequency, Location location, Server server){ this.frequency = frequency; - this.world = location.getWorld().getName(); - this.x = "" + location.getBlockX(); - this.y = "" + location.getBlockY(); - this.z = "" + location.getBlockZ(); + this.world = server.getWorld(location.getWorld().getName()); + this.x = location.getBlockX(); + this.y = location.getBlockY(); + this.z = location.getBlockZ(); //plugin.plugin.getConfig().set("frequency", 10); } - public Link (String frequency, World world, Double x, Double y, Double z){ - this.frequency = frequency; - this.world = world.getName(); - this.x = "" + x; - this.y = "" + y; - this.z = "" + z; + + public Link(Map linkFromMap, Server server){ + this.frequency = linkFromMap.get("frequency"); + this.world = server.getWorld(linkFromMap.get("world")); + this.x = Integer.parseInt(linkFromMap.get("x")); + this.y = Integer.parseInt(linkFromMap.get("y")); + this.z = Integer.parseInt(linkFromMap.get("z")); } + /** * Activates the Ali-Link * @param plugin */ public void press(JavaPlugin plugin) { - Location location = new Location(plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); + Location location = new Location(this.world, this.x, this.y, this.z); location.getBlock().setType(Material.REDSTONE_BLOCK); - UnpressTask unPressTask = new UnpressTask(location); - unPressTask.runTaskTimer(plugin, 2, 1); + new UnpressTask(location).runTaskTimer(plugin, 2, 1); } public Map toMap(){ Map linkAsMap = new HashMap(); + linkAsMap.put("frequency", frequency); - linkAsMap.put("world", world); - linkAsMap.put("x", x); - linkAsMap.put("y", y); - linkAsMap.put("z", z); + linkAsMap.put("world", world.getName()); + linkAsMap.put("x", Integer.toString(this.x)); + linkAsMap.put("y", Integer.toString(this.y)); + linkAsMap.put("z", Integer.toString(this.z)); + return linkAsMap; } } From 74179fffb1bc815e9c2f1393c04e655213847b0a Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 14 Nov 2016 23:55:48 -0500 Subject: [PATCH 128/263] Edited metrics module --- plugin.yml | 4 +++- .../components/metrics/MetricsModule.java | 13 ++++++---- .../metrics/commands/GetMetrics.java | 24 +++++++++++++++++++ 3 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 src/alisolarflare/components/metrics/commands/GetMetrics.java diff --git a/plugin.yml b/plugin.yml index fd3ecae..f90d093 100644 --- a/plugin.yml +++ b/plugin.yml @@ -58,4 +58,6 @@ commands: powerall: description: activate every player's power setproximitylocation: - description: sets one of two proximity blocks to create a space that players can change their flairs with using flairportals. Ask ali XD \ No newline at end of file + description: sets one of two proximity blocks to create a space that players can change their flairs with using flairportals. Ask ali XD + getMetrics: + description: Gets metrics \ No newline at end of file diff --git a/src/alisolarflare/components/metrics/MetricsModule.java b/src/alisolarflare/components/metrics/MetricsModule.java index e758136..8024426 100644 --- a/src/alisolarflare/components/metrics/MetricsModule.java +++ b/src/alisolarflare/components/metrics/MetricsModule.java @@ -3,6 +3,7 @@ package alisolarflare.components.metrics; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; +import java.util.List; import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.FileConfiguration; @@ -10,22 +11,26 @@ import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.Component; +import alisolarflare.components.metrics.commands.GetMetrics; +import alisolarflare.components.metrics.listeners.PlayerLoginListener; public class MetricsModule extends Component{ - public FileConfiguration metricsYml; + public FileConfiguration metricsYml; // DATA - STRING + public List metricsList; @Override public void register(JavaPlugin plugin){ - try { - loadFileConfiguration(plugin, "config.yml"); + metricsYml = loadFileConfiguration(plugin, "metrics.yml"); } catch (IOException | InvalidConfigurationException e) { e.printStackTrace(); return; } - + metricsList = metricsYml.getStringList("playerLogins"); + registerCommand(plugin, new GetMetrics(this)); + registerListener(plugin, new PlayerLoginListener(this)); } private FileConfiguration loadFileConfiguration(JavaPlugin plugin, String fileName) throws FileNotFoundException, IOException, InvalidConfigurationException { diff --git a/src/alisolarflare/components/metrics/commands/GetMetrics.java b/src/alisolarflare/components/metrics/commands/GetMetrics.java new file mode 100644 index 0000000..8a643da --- /dev/null +++ b/src/alisolarflare/components/metrics/commands/GetMetrics.java @@ -0,0 +1,24 @@ +package alisolarflare.components.metrics.commands; + +import org.bukkit.command.CommandSender; + +import alisolarflare.components.ModCommand; +import alisolarflare.components.metrics.MetricsModule; + +public class GetMetrics extends ModCommand{ + + private MetricsModule module; + + public GetMetrics(MetricsModule metricsModule) { + this.module = metricsModule; + } + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + for (String metric : module.metricsList){ + sender.sendMessage(metric); + } + return true; + } + +} From 3dba165e2cdd5457eccd15b788d79a9cf8ca47ae Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Tue, 15 Nov 2016 00:18:30 -0500 Subject: [PATCH 129/263] changed login tracking to print to getmetrics --- .../components/metrics/listeners/PlayerLoginListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java b/src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java index 289c2fd..472b80a 100644 --- a/src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java +++ b/src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java @@ -14,7 +14,8 @@ public class PlayerLoginListener implements Listener{ } @EventHandler public void onPlayerLogin(PlayerLoginEvent event){ - module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis(), event.getPlayer().getName()); + module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis()+event.getPlayer().getName(), event.getPlayer().getName()); + module.metricsList.add("loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); event.getPlayer(); } } From 062a173c32f454de43403e774b100c5ad2fec78d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Tue, 15 Nov 2016 00:25:15 -0500 Subject: [PATCH 130/263] Changed PlayerLoginEvent to PlayerJoinEvent --- .../components/metrics/listeners/PlayerLoginListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java b/src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java index 472b80a..5baab2f 100644 --- a/src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java +++ b/src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java @@ -2,7 +2,7 @@ package alisolarflare.components.metrics.listeners; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerLoginEvent; +import org.bukkit.event.player.PlayerJoinEvent; import alisolarflare.components.metrics.MetricsModule; @@ -13,7 +13,7 @@ public class PlayerLoginListener implements Listener{ this.module = module; } @EventHandler - public void onPlayerLogin(PlayerLoginEvent event){ + public void onPlayerLogin(PlayerJoinEvent event){ module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis()+event.getPlayer().getName(), event.getPlayer().getName()); module.metricsList.add("loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); event.getPlayer(); From 9291ab671f2fc2e21c5fc287d32b720b24987f9a Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Tue, 15 Nov 2016 01:00:11 -0500 Subject: [PATCH 131/263] aaron burr, sir --- src/alisolarflare/components/metrics/MetricsModule.java | 4 ++-- .../{PlayerLoginListener.java => PlayerJoinListener.java} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename src/alisolarflare/components/metrics/listeners/{PlayerLoginListener.java => PlayerJoinListener.java} (85%) diff --git a/src/alisolarflare/components/metrics/MetricsModule.java b/src/alisolarflare/components/metrics/MetricsModule.java index 8024426..f491d2c 100644 --- a/src/alisolarflare/components/metrics/MetricsModule.java +++ b/src/alisolarflare/components/metrics/MetricsModule.java @@ -12,7 +12,7 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.Component; import alisolarflare.components.metrics.commands.GetMetrics; -import alisolarflare.components.metrics.listeners.PlayerLoginListener; +import alisolarflare.components.metrics.listeners.PlayerJoinListener; public class MetricsModule extends Component{ @@ -30,7 +30,7 @@ public class MetricsModule extends Component{ metricsList = metricsYml.getStringList("playerLogins"); registerCommand(plugin, new GetMetrics(this)); - registerListener(plugin, new PlayerLoginListener(this)); + registerListener(plugin, new PlayerJoinListener(this)); } private FileConfiguration loadFileConfiguration(JavaPlugin plugin, String fileName) throws FileNotFoundException, IOException, InvalidConfigurationException { diff --git a/src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java similarity index 85% rename from src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java rename to src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java index 5baab2f..3e0adc2 100644 --- a/src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java +++ b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java @@ -6,10 +6,10 @@ import org.bukkit.event.player.PlayerJoinEvent; import alisolarflare.components.metrics.MetricsModule; -public class PlayerLoginListener implements Listener{ +public class PlayerJoinListener implements Listener{ private MetricsModule module; - public PlayerLoginListener(MetricsModule module){ + public PlayerJoinListener(MetricsModule module){ this.module = module; } @EventHandler From 06dbd69d39562b5b15bf88b558e601efa546fbe2 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 17 Nov 2016 15:06:13 -0500 Subject: [PATCH 132/263] Adjusted Metrics Module --- src/alisolarflare/components/metrics/MetricsModule.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/alisolarflare/components/metrics/MetricsModule.java b/src/alisolarflare/components/metrics/MetricsModule.java index f491d2c..5ee437f 100644 --- a/src/alisolarflare/components/metrics/MetricsModule.java +++ b/src/alisolarflare/components/metrics/MetricsModule.java @@ -3,6 +3,7 @@ package alisolarflare.components.metrics; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; +import java.util.ArrayList; import java.util.List; import org.bukkit.configuration.InvalidConfigurationException; @@ -27,8 +28,9 @@ public class MetricsModule extends Component{ e.printStackTrace(); return; } + //metricsList = metricsYml.getStringList("playerLogins"); - metricsList = metricsYml.getStringList("playerLogins"); + metricsList = new ArrayList(); registerCommand(plugin, new GetMetrics(this)); registerListener(plugin, new PlayerJoinListener(this)); } From 52c97535aba67624474839406fa09892784f3e3d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 17 Nov 2016 15:27:28 -0500 Subject: [PATCH 133/263] Added Potato Debugging Tool --- src/alisolarflare/components/BaseCommand.java | 34 +++++++++++++++++++ src/alisolarflare/components/ModCommand.java | 4 +-- .../components/PlayerCommand.java | 4 +-- 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 src/alisolarflare/components/BaseCommand.java diff --git a/src/alisolarflare/components/BaseCommand.java b/src/alisolarflare/components/BaseCommand.java new file mode 100644 index 0000000..7e6c59d --- /dev/null +++ b/src/alisolarflare/components/BaseCommand.java @@ -0,0 +1,34 @@ +package alisolarflare.components; + +import java.util.Arrays; +import java.util.List; + +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import buttondevteam.lib.chat.TBMCCommandBase; + +public abstract class BaseCommand extends TBMCCommandBase{ + public static ItemStack CreateDebugPotato(List debugMessage){ + ItemStack debugPotato = new ItemStack(Material.BAKED_POTATO); + debugPotato.getItemMeta().setDisplayName("Spicy Debug Potato"); + debugPotato.getItemMeta().setLore(debugMessage); + debugPotato.addEnchantment(Enchantment.ARROW_FIRE, 10); + return debugPotato; + } + public static ItemStack CreateDebugPotato(String debugMessage){ + return CreateDebugPotato(Arrays.asList(debugMessage)); + } + public static void SendDebugPotato(Player player, List debugMessage){ + player.getInventory().addItem(CreateDebugPotato(debugMessage)); + player.getWorld().playSound(player.getLocation(), Sound.ENTITY_SLIME_SQUISH, 0, 0); + return; + } + public static void SendDebugPotato(Player player, String debugMessage){ + SendDebugPotato(player, Arrays.asList(debugMessage)); + } + +} diff --git a/src/alisolarflare/components/ModCommand.java b/src/alisolarflare/components/ModCommand.java index ebe15f8..3c34e4d 100644 --- a/src/alisolarflare/components/ModCommand.java +++ b/src/alisolarflare/components/ModCommand.java @@ -2,9 +2,7 @@ package alisolarflare.components; import org.bukkit.command.CommandSender; -import buttondevteam.lib.chat.TBMCCommandBase; - -public abstract class ModCommand extends TBMCCommandBase{ +public abstract class ModCommand extends BaseCommand{ @Override public abstract boolean OnCommand(CommandSender sender, String alias, String[] args); diff --git a/src/alisolarflare/components/PlayerCommand.java b/src/alisolarflare/components/PlayerCommand.java index 5b32d24..5115c9e 100644 --- a/src/alisolarflare/components/PlayerCommand.java +++ b/src/alisolarflare/components/PlayerCommand.java @@ -1,8 +1,6 @@ package alisolarflare.components; -import buttondevteam.lib.chat.TBMCCommandBase; - -public abstract class PlayerCommand extends TBMCCommandBase{ +public abstract class PlayerCommand extends BaseCommand{ @Override public boolean GetPlayerOnly() { // TODO Auto-generated method stub From 07fb4113afd6a5a18d6f2022f6d6d487ad6d4200 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 17 Nov 2016 15:27:48 -0500 Subject: [PATCH 134/263] Coded the Gold Standard of Insurance --- .../components/insurance/Insurance.java | 71 +++++++++++++++++++ .../insurance/InsuranceComponent.java | 17 +++++ .../components/insurance/getInsurance.java | 52 ++++++++++++++ .../components/insurance/getInsuranceBar.java | 23 ++++++ .../insurance/getInsuranceBlock.java | 23 ++++++ .../insurance/getInsuranceNugget.java | 23 ++++++ .../metrics/commands/TestEnchantment.java | 50 +++++++++++++ 7 files changed, 259 insertions(+) create mode 100644 src/alisolarflare/components/insurance/Insurance.java create mode 100644 src/alisolarflare/components/insurance/InsuranceComponent.java create mode 100644 src/alisolarflare/components/insurance/getInsurance.java create mode 100644 src/alisolarflare/components/insurance/getInsuranceBar.java create mode 100644 src/alisolarflare/components/insurance/getInsuranceBlock.java create mode 100644 src/alisolarflare/components/insurance/getInsuranceNugget.java create mode 100644 src/alisolarflare/components/metrics/commands/TestEnchantment.java diff --git a/src/alisolarflare/components/insurance/Insurance.java b/src/alisolarflare/components/insurance/Insurance.java new file mode 100644 index 0000000..50d458d --- /dev/null +++ b/src/alisolarflare/components/insurance/Insurance.java @@ -0,0 +1,71 @@ +package alisolarflare.components.insurance; + +import java.util.Arrays; +import java.util.List; + +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.ItemStack; + +import alisolarflare.components.BaseCommand; +import alisolarflare.components.insurance.Insurance.InsuranceType; + +public class Insurance { + public static enum InsuranceType{ + Nugget, Ingot, Block + }; + public static ItemStack getInsurance(InsuranceType insuranceType){ + ItemStack insuranceItem; + List lore; + switch(insuranceType){ + case Nugget: + insuranceItem = new ItemStack(Material.GOLD_NUGGET); + lore = Arrays.asList( + "This insurance nugget will protect one inventory slot from death! Be careful" + + "though, insurance is removed whenever you die, with each itemslot costing" + + "one nugget." + ); + break; + case Ingot: + insuranceItem = new ItemStack(Material.GOLD_INGOT); + lore = Arrays.asList( + "This insurance ingot will protect nine inventory slots from death! Be " + + "careful though, insurance is removed whenever you die, with each " + + "inventory row costing one ingot." + ); + break; + case Block: + insuranceItem = new ItemStack(Material.GOLD_BLOCK); + lore = Arrays.asList( + "This insurance block will give your inventory full protection against death! " + + "Be careful though, this block will split into ingots, and you'll lose 3" + + "upon death." + ); + break; + default: + + lore = Arrays.asList( + "The InsuranceType " + insuranceType.toString() + " is not handled by the " + + "Insurance Class in" + Insurance.class.getPackage().getName() + ". Contact a "+ + "developer with a screenshot of this message" + ); + insuranceItem = BaseCommand.CreateDebugPotato(lore); + } + insuranceItem.addEnchantment(Enchantment.DURABILITY, 10); + insuranceItem.getItemMeta().setLore(lore); + return insuranceItem; + } + public static ItemStack getInsurance(InsuranceType insuranceType, int amount){ + ItemStack insurance = Insurance.getInsurance(insuranceType); + insurance.setAmount(amount); + return insurance; + } + public static boolean isInsuranceType(String string){ + for (InsuranceType insuranceType : Insurance.InsuranceType.values()){ + if (string.equalsIgnoreCase(insuranceType.toString())){ + return true; + } + } + return false; + } +} diff --git a/src/alisolarflare/components/insurance/InsuranceComponent.java b/src/alisolarflare/components/insurance/InsuranceComponent.java new file mode 100644 index 0000000..41a36d0 --- /dev/null +++ b/src/alisolarflare/components/insurance/InsuranceComponent.java @@ -0,0 +1,17 @@ +package alisolarflare.components.insurance; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.Component; + +public class InsuranceComponent extends Component { + + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new getInsurance()); + registerCommand(plugin, new getInsuranceNugget()); + registerCommand(plugin, new getInsuranceBar()); + registerCommand(plugin, new getInsuranceBlock()); + } + +} diff --git a/src/alisolarflare/components/insurance/getInsurance.java b/src/alisolarflare/components/insurance/getInsurance.java new file mode 100644 index 0000000..382a572 --- /dev/null +++ b/src/alisolarflare/components/insurance/getInsurance.java @@ -0,0 +1,52 @@ +package alisolarflare.components.insurance; + +import org.apache.commons.lang.StringUtils; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.components.ModCommand; +import alisolarflare.components.insurance.Insurance.InsuranceType; + +public class getInsurance extends ModCommand { + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + Player player = (Player) sender; + if (args.length == 0){ + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block)); + return true; + }else if(args.length == 1){ + if (StringUtils.isNumeric(args[0])){ + int amount = Integer.parseInt(args[0]); + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block, amount)); + return true; + }else{ + if (Insurance.isInsuranceType(args[0])){ + player.getInventory().addItem((Insurance.getInsurance(InsuranceType.valueOf(args[0])))); + return true; + }else{ + return false; + } + } + }else if (args.length >=2){ + if (StringUtils.isNumeric(args[0]) && Insurance.isInsuranceType(args[1])){ + player.getInventory().addItem((Insurance.getInsurance(InsuranceType.valueOf(args[1]), Integer.parseInt(args[0])))); + return true; + }else{ + return false; + } + } + return false; + } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: /getInsurance [amount] [type:nugget/bar/block/compound]", + "Use this command to get gold-standard inventory insurance, that saves ", + "items in an inventory upon death. One nugget saves one ItemStack, a bar", + "saves nine, a block saves 54. Compound converts amount (in nuggets) to a", + "mix of both nuggets, bars and blocks" + }; + } + +} diff --git a/src/alisolarflare/components/insurance/getInsuranceBar.java b/src/alisolarflare/components/insurance/getInsuranceBar.java new file mode 100644 index 0000000..a024f82 --- /dev/null +++ b/src/alisolarflare/components/insurance/getInsuranceBar.java @@ -0,0 +1,23 @@ +package alisolarflare.components.insurance; + +import org.apache.commons.lang3.StringUtils; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.components.ModCommand; +import alisolarflare.components.insurance.Insurance.InsuranceType; + +public class getInsuranceBar extends ModCommand { + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + Player player = (Player) sender; + if (args.length > 0 || StringUtils.isNumeric(args[0])){ + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot, Integer.parseInt(args[0]))); + }else{ + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot)); + } + return false; + } + +} diff --git a/src/alisolarflare/components/insurance/getInsuranceBlock.java b/src/alisolarflare/components/insurance/getInsuranceBlock.java new file mode 100644 index 0000000..223db3e --- /dev/null +++ b/src/alisolarflare/components/insurance/getInsuranceBlock.java @@ -0,0 +1,23 @@ +package alisolarflare.components.insurance; + +import org.apache.commons.lang3.StringUtils; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.components.ModCommand; +import alisolarflare.components.insurance.Insurance.InsuranceType; + +public class getInsuranceBlock extends ModCommand { + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + Player player = (Player) sender; + if (args.length > 0 || StringUtils.isNumeric(args[0])){ + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block, Integer.parseInt(args[0]))); + }else{ + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block)); + } + return false; + } + +} diff --git a/src/alisolarflare/components/insurance/getInsuranceNugget.java b/src/alisolarflare/components/insurance/getInsuranceNugget.java new file mode 100644 index 0000000..c1a0ad3 --- /dev/null +++ b/src/alisolarflare/components/insurance/getInsuranceNugget.java @@ -0,0 +1,23 @@ +package alisolarflare.components.insurance; + +import org.apache.commons.lang3.StringUtils; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import alisolarflare.components.ModCommand; +import alisolarflare.components.insurance.Insurance.InsuranceType; + +public class getInsuranceNugget extends ModCommand { + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + Player player = (Player) sender; + if (args.length > 0 || StringUtils.isNumeric(args[0])){ + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Nugget, Integer.parseInt(args[0]))); + }else{ + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Nugget)); + } + return false; + } + +} diff --git a/src/alisolarflare/components/metrics/commands/TestEnchantment.java b/src/alisolarflare/components/metrics/commands/TestEnchantment.java new file mode 100644 index 0000000..8cde4ff --- /dev/null +++ b/src/alisolarflare/components/metrics/commands/TestEnchantment.java @@ -0,0 +1,50 @@ +package alisolarflare.components.metrics.commands; + +import org.bukkit.enchantments.Enchantment; +import org.bukkit.enchantments.EnchantmentTarget; +import org.bukkit.inventory.ItemStack; + +public class TestEnchantment extends Enchantment { + + public TestEnchantment(int id) { + super(id); + // TODO Auto-generated constructor stub + } + + @Override + public String getName() { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getMaxLevel() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getStartLevel() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public EnchantmentTarget getItemTarget() { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean conflictsWith(Enchantment other) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean canEnchantItem(ItemStack item) { + // TODO Auto-generated method stub + return false; + } + +} From c2f7726ed1bea19f776f7f0bd75f3ca2354fa1ff Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 17 Nov 2016 18:44:32 -0500 Subject: [PATCH 135/263] Used Potato to test metrics --- src/alisolarflare/components/BaseCommand.java | 25 +++++----- .../components/metrics/MetricsModule.java | 5 +- .../metrics/commands/GetMetrics.java | 5 +- .../metrics/commands/TestEnchantment.java | 50 ------------------- .../metrics/listeners/PlayerJoinListener.java | 5 +- 5 files changed, 23 insertions(+), 67 deletions(-) delete mode 100644 src/alisolarflare/components/metrics/commands/TestEnchantment.java diff --git a/src/alisolarflare/components/BaseCommand.java b/src/alisolarflare/components/BaseCommand.java index 7e6c59d..ad0dcd2 100644 --- a/src/alisolarflare/components/BaseCommand.java +++ b/src/alisolarflare/components/BaseCommand.java @@ -12,23 +12,24 @@ import org.bukkit.inventory.ItemStack; import buttondevteam.lib.chat.TBMCCommandBase; public abstract class BaseCommand extends TBMCCommandBase{ - public static ItemStack CreateDebugPotato(List debugMessage){ - ItemStack debugPotato = new ItemStack(Material.BAKED_POTATO); - debugPotato.getItemMeta().setDisplayName("Spicy Debug Potato"); - debugPotato.getItemMeta().setLore(debugMessage); - debugPotato.addEnchantment(Enchantment.ARROW_FIRE, 10); - return debugPotato; + public static ItemStack CreateDebugPotato(List message){ + ItemStack potato = new ItemStack(Material.BAKED_POTATO); + potato.getItemMeta().setDisplayName("Spicy Debug Potato"); + potato.getItemMeta().setLore(message); + potato.addEnchantment(Enchantment.ARROW_FIRE, 10); + return potato; } - public static ItemStack CreateDebugPotato(String debugMessage){ - return CreateDebugPotato(Arrays.asList(debugMessage)); + public static ItemStack CreateDebugPotato(String message){ + return CreateDebugPotato(Arrays.asList(message)); } - public static void SendDebugPotato(Player player, List debugMessage){ - player.getInventory().addItem(CreateDebugPotato(debugMessage)); + + public static void SendDebugPotato(Player player, List message){ + player.getInventory().addItem(CreateDebugPotato(message)); player.getWorld().playSound(player.getLocation(), Sound.ENTITY_SLIME_SQUISH, 0, 0); return; } - public static void SendDebugPotato(Player player, String debugMessage){ - SendDebugPotato(player, Arrays.asList(debugMessage)); + public static void SendDebugPotato(Player player, String message){ + SendDebugPotato(player, Arrays.asList(message)); } } diff --git a/src/alisolarflare/components/metrics/MetricsModule.java b/src/alisolarflare/components/metrics/MetricsModule.java index 5ee437f..9def30c 100644 --- a/src/alisolarflare/components/metrics/MetricsModule.java +++ b/src/alisolarflare/components/metrics/MetricsModule.java @@ -22,6 +22,9 @@ public class MetricsModule extends Component{ @Override public void register(JavaPlugin plugin){ + registerCommand(plugin, new GetMetrics(this)); + registerListener(plugin, new PlayerJoinListener(this)); + try { metricsYml = loadFileConfiguration(plugin, "metrics.yml"); } catch (IOException | InvalidConfigurationException e) { @@ -31,8 +34,6 @@ public class MetricsModule extends Component{ //metricsList = metricsYml.getStringList("playerLogins"); metricsList = new ArrayList(); - registerCommand(plugin, new GetMetrics(this)); - registerListener(plugin, new PlayerJoinListener(this)); } private FileConfiguration loadFileConfiguration(JavaPlugin plugin, String fileName) throws FileNotFoundException, IOException, InvalidConfigurationException { diff --git a/src/alisolarflare/components/metrics/commands/GetMetrics.java b/src/alisolarflare/components/metrics/commands/GetMetrics.java index 8a643da..9ca2186 100644 --- a/src/alisolarflare/components/metrics/commands/GetMetrics.java +++ b/src/alisolarflare/components/metrics/commands/GetMetrics.java @@ -1,6 +1,7 @@ package alisolarflare.components.metrics.commands; import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; import alisolarflare.components.metrics.MetricsModule; @@ -15,8 +16,10 @@ public class GetMetrics extends ModCommand{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { + Player player = (Player) sender; for (String metric : module.metricsList){ - sender.sendMessage(metric); + SendDebugPotato(player, module.metricsList); + SendDebugPotato(player, metric); } return true; } diff --git a/src/alisolarflare/components/metrics/commands/TestEnchantment.java b/src/alisolarflare/components/metrics/commands/TestEnchantment.java deleted file mode 100644 index 8cde4ff..0000000 --- a/src/alisolarflare/components/metrics/commands/TestEnchantment.java +++ /dev/null @@ -1,50 +0,0 @@ -package alisolarflare.components.metrics.commands; - -import org.bukkit.enchantments.Enchantment; -import org.bukkit.enchantments.EnchantmentTarget; -import org.bukkit.inventory.ItemStack; - -public class TestEnchantment extends Enchantment { - - public TestEnchantment(int id) { - super(id); - // TODO Auto-generated constructor stub - } - - @Override - public String getName() { - // TODO Auto-generated method stub - return null; - } - - @Override - public int getMaxLevel() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public int getStartLevel() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public EnchantmentTarget getItemTarget() { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean conflictsWith(Enchantment other) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean canEnchantItem(ItemStack item) { - // TODO Auto-generated method stub - return false; - } - -} diff --git a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java index 3e0adc2..9fa249b 100644 --- a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java +++ b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java @@ -4,6 +4,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; +import alisolarflare.components.BaseCommand; import alisolarflare.components.metrics.MetricsModule; public class PlayerJoinListener implements Listener{ @@ -13,9 +14,9 @@ public class PlayerJoinListener implements Listener{ this.module = module; } @EventHandler - public void onPlayerLogin(PlayerJoinEvent event){ + public void onPlayerJoin(PlayerJoinEvent event){ module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis()+event.getPlayer().getName(), event.getPlayer().getName()); module.metricsList.add("loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); - event.getPlayer(); + BaseCommand.SendDebugPotato(event.getPlayer(), "loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); } } From 5c3c9f5a8d243d8ebd5ccf36207653ad966c30cd Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 17 Nov 2016 18:55:29 -0500 Subject: [PATCH 136/263] Linked metrics up to main plugin --- src/alisolarflare/AliPresents.java | 16 +++++++++++----- ...{MetricsModule.java => MetricsComponent.java} | 10 ++++++---- .../components/metrics/commands/GetMetrics.java | 6 +++--- .../metrics/listeners/PlayerJoinListener.java | 9 +++++---- ...inigameModule.java => MinigameComponent.java} | 2 +- .../minigames/commands/JoinMinigame.java | 6 +++--- .../minigames/commands/LeaveMinigame.java | 6 +++--- .../minigames/commands/ListFighters.java | 6 +++--- 8 files changed, 35 insertions(+), 26 deletions(-) rename src/alisolarflare/components/metrics/{MetricsModule.java => MetricsComponent.java} (86%) rename src/alisolarflare/components/minigames/{MinigameModule.java => MinigameComponent.java} (92%) diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index a68d201..f895dfc 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -10,8 +10,11 @@ import alisolarflare.components.alilinks.AliLinkComponent; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; import alisolarflare.components.easyuhc.EasyUHCComponent; import alisolarflare.components.flairdoor.FlairDoorComponent; +import alisolarflare.components.gpowers.GPowerComponent; +import alisolarflare.components.insurance.InsuranceComponent; import alisolarflare.components.magic.MagicComponent; -import alisolarflare.components.minigames.MinigameModule; +import alisolarflare.components.metrics.MetricsComponent; +import alisolarflare.components.minigames.MinigameComponent; public class AliPresents extends JavaPlugin{ public void onEnable(){ @@ -21,12 +24,15 @@ public class AliPresents extends JavaPlugin{ logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); - new FlairDoorComponent().register(this); new AliLinkComponent().register(this); - new EasyUHCComponent().register(this); - new MagicComponent().register(this); - new MinigameModule().register(this); new CreativeBoundariesComponent().register(this); + new EasyUHCComponent().register(this); + new FlairDoorComponent().register(this); + new GPowerComponent().register(this); + new InsuranceComponent().register(this); + new MagicComponent().register(this); + new MetricsComponent().register(this); + new MinigameComponent().register(this); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); diff --git a/src/alisolarflare/components/metrics/MetricsModule.java b/src/alisolarflare/components/metrics/MetricsComponent.java similarity index 86% rename from src/alisolarflare/components/metrics/MetricsModule.java rename to src/alisolarflare/components/metrics/MetricsComponent.java index 9def30c..d6b6cca 100644 --- a/src/alisolarflare/components/metrics/MetricsModule.java +++ b/src/alisolarflare/components/metrics/MetricsComponent.java @@ -14,8 +14,9 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.Component; import alisolarflare.components.metrics.commands.GetMetrics; import alisolarflare.components.metrics.listeners.PlayerJoinListener; +import buttondevteam.lib.TBMCCoreAPI; -public class MetricsModule extends Component{ +public class MetricsComponent extends Component{ public FileConfiguration metricsYml; // DATA - STRING public List metricsList; @@ -24,16 +25,17 @@ public class MetricsModule extends Component{ public void register(JavaPlugin plugin){ registerCommand(plugin, new GetMetrics(this)); registerListener(plugin, new PlayerJoinListener(this)); + + metricsList = new ArrayList(); try { metricsYml = loadFileConfiguration(plugin, "metrics.yml"); + metricsList = metricsYml.getStringList("playerLogins"); } catch (IOException | InvalidConfigurationException e) { - e.printStackTrace(); + TBMCCoreAPI.SendException("metrics.yml in AliPresents could not be created!", e); return; } - //metricsList = metricsYml.getStringList("playerLogins"); - metricsList = new ArrayList(); } private FileConfiguration loadFileConfiguration(JavaPlugin plugin, String fileName) throws FileNotFoundException, IOException, InvalidConfigurationException { diff --git a/src/alisolarflare/components/metrics/commands/GetMetrics.java b/src/alisolarflare/components/metrics/commands/GetMetrics.java index 9ca2186..d36579b 100644 --- a/src/alisolarflare/components/metrics/commands/GetMetrics.java +++ b/src/alisolarflare/components/metrics/commands/GetMetrics.java @@ -4,13 +4,13 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; -import alisolarflare.components.metrics.MetricsModule; +import alisolarflare.components.metrics.MetricsComponent; public class GetMetrics extends ModCommand{ - private MetricsModule module; + private MetricsComponent module; - public GetMetrics(MetricsModule metricsModule) { + public GetMetrics(MetricsComponent metricsModule) { this.module = metricsModule; } diff --git a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java index 9fa249b..953b5bb 100644 --- a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java +++ b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java @@ -5,18 +5,19 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; import alisolarflare.components.BaseCommand; -import alisolarflare.components.metrics.MetricsModule; +import alisolarflare.components.metrics.MetricsComponent; public class PlayerJoinListener implements Listener{ - private MetricsModule module; - public PlayerJoinListener(MetricsModule module){ + private MetricsComponent module; + public PlayerJoinListener(MetricsComponent module){ this.module = module; } @EventHandler public void onPlayerJoin(PlayerJoinEvent event){ + BaseCommand.SendDebugPotato(event.getPlayer(), "loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis()+event.getPlayer().getName(), event.getPlayer().getName()); module.metricsList.add("loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); - BaseCommand.SendDebugPotato(event.getPlayer(), "loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); + } } diff --git a/src/alisolarflare/components/minigames/MinigameModule.java b/src/alisolarflare/components/minigames/MinigameComponent.java similarity index 92% rename from src/alisolarflare/components/minigames/MinigameModule.java rename to src/alisolarflare/components/minigames/MinigameComponent.java index 51e332c..aa9d96b 100644 --- a/src/alisolarflare/components/minigames/MinigameModule.java +++ b/src/alisolarflare/components/minigames/MinigameComponent.java @@ -11,7 +11,7 @@ import alisolarflare.components.minigames.commands.ListFighters; import alisolarflare.components.minigames.commands.SetColourSpawn; import alisolarflare.components.minigames.data.SpawnSet; -public class MinigameModule extends Component{ +public class MinigameComponent extends Component{ public SpawnSet spawnSet; public List fighters; private GameState gameState; diff --git a/src/alisolarflare/components/minigames/commands/JoinMinigame.java b/src/alisolarflare/components/minigames/commands/JoinMinigame.java index 304c407..f7169d5 100644 --- a/src/alisolarflare/components/minigames/commands/JoinMinigame.java +++ b/src/alisolarflare/components/minigames/commands/JoinMinigame.java @@ -3,12 +3,12 @@ package alisolarflare.components.minigames.commands; import org.bukkit.command.CommandSender; import alisolarflare.components.PlayerCommand; -import alisolarflare.components.minigames.MinigameModule; +import alisolarflare.components.minigames.MinigameComponent; public class JoinMinigame extends PlayerCommand { - private MinigameModule module; + private MinigameComponent module; - public JoinMinigame(MinigameModule module) { + public JoinMinigame(MinigameComponent module) { this.module = module; } diff --git a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java index a05199f..c286607 100644 --- a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java +++ b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java @@ -4,13 +4,13 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.PlayerCommand; -import alisolarflare.components.minigames.MinigameModule; +import alisolarflare.components.minigames.MinigameComponent; public class LeaveMinigame extends PlayerCommand { - private MinigameModule module; + private MinigameComponent module; - public LeaveMinigame(MinigameModule module) { + public LeaveMinigame(MinigameComponent module) { this.module = module; } diff --git a/src/alisolarflare/components/minigames/commands/ListFighters.java b/src/alisolarflare/components/minigames/commands/ListFighters.java index acf2a67..613d1fd 100644 --- a/src/alisolarflare/components/minigames/commands/ListFighters.java +++ b/src/alisolarflare/components/minigames/commands/ListFighters.java @@ -3,12 +3,12 @@ package alisolarflare.components.minigames.commands; import org.bukkit.command.CommandSender; import alisolarflare.components.PlayerCommand; -import alisolarflare.components.minigames.MinigameModule; +import alisolarflare.components.minigames.MinigameComponent; public class ListFighters extends PlayerCommand { - private MinigameModule lobby; + private MinigameComponent lobby; - public ListFighters(MinigameModule lobby) { + public ListFighters(MinigameComponent lobby) { this.lobby = lobby; } From 4a0f711682ebd34137fccd4757adc55547f5d0dd Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 17 Nov 2016 19:01:04 -0500 Subject: [PATCH 137/263] Updated plugin.yml --- plugin.yml | 12 ++++++++++-- .../components/metrics/MetricsComponent.java | 4 ++-- .../{GetMetrics.java => GetLoginMetrics.java} | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) rename src/alisolarflare/components/metrics/commands/{GetMetrics.java => GetLoginMetrics.java} (84%) diff --git a/plugin.yml b/plugin.yml index f90d093..43d4195 100644 --- a/plugin.yml +++ b/plugin.yml @@ -59,5 +59,13 @@ commands: description: activate every player's power setproximitylocation: description: sets one of two proximity blocks to create a space that players can change their flairs with using flairportals. Ask ali XD - getMetrics: - description: Gets metrics \ No newline at end of file + getLoginMetrics: + description: Gets metrics + getInsurance: + description: Gets insurance + getInsuranceNugget: + description: Gets insurance nugget + getInsuranceBar: + description: Gets insurance bar + getInsuranceBlock: + description: Gets insurance block \ No newline at end of file diff --git a/src/alisolarflare/components/metrics/MetricsComponent.java b/src/alisolarflare/components/metrics/MetricsComponent.java index d6b6cca..078b649 100644 --- a/src/alisolarflare/components/metrics/MetricsComponent.java +++ b/src/alisolarflare/components/metrics/MetricsComponent.java @@ -12,7 +12,7 @@ import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.Component; -import alisolarflare.components.metrics.commands.GetMetrics; +import alisolarflare.components.metrics.commands.GetLoginMetrics; import alisolarflare.components.metrics.listeners.PlayerJoinListener; import buttondevteam.lib.TBMCCoreAPI; @@ -23,7 +23,7 @@ public class MetricsComponent extends Component{ @Override public void register(JavaPlugin plugin){ - registerCommand(plugin, new GetMetrics(this)); + registerCommand(plugin, new GetLoginMetrics(this)); registerListener(plugin, new PlayerJoinListener(this)); metricsList = new ArrayList(); diff --git a/src/alisolarflare/components/metrics/commands/GetMetrics.java b/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java similarity index 84% rename from src/alisolarflare/components/metrics/commands/GetMetrics.java rename to src/alisolarflare/components/metrics/commands/GetLoginMetrics.java index d36579b..49d6bc2 100644 --- a/src/alisolarflare/components/metrics/commands/GetMetrics.java +++ b/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java @@ -6,11 +6,11 @@ import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; import alisolarflare.components.metrics.MetricsComponent; -public class GetMetrics extends ModCommand{ +public class GetLoginMetrics extends ModCommand{ private MetricsComponent module; - public GetMetrics(MetricsComponent metricsModule) { + public GetLoginMetrics(MetricsComponent metricsModule) { this.module = metricsModule; } From bdc565492bb8fcf35022b78e6938a91bdb727fa1 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 17 Nov 2016 19:07:55 -0500 Subject: [PATCH 138/263] Attempted to fix error: Internal error: Command not registered to command caller --- .../components/metrics/MetricsComponent.java | 16 +++++----------- .../metrics/commands/GetLoginMetrics.java | 4 ++++ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/alisolarflare/components/metrics/MetricsComponent.java b/src/alisolarflare/components/metrics/MetricsComponent.java index 078b649..387734c 100644 --- a/src/alisolarflare/components/metrics/MetricsComponent.java +++ b/src/alisolarflare/components/metrics/MetricsComponent.java @@ -1,20 +1,14 @@ package alisolarflare.components.metrics; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.Component; import alisolarflare.components.metrics.commands.GetLoginMetrics; import alisolarflare.components.metrics.listeners.PlayerJoinListener; -import buttondevteam.lib.TBMCCoreAPI; public class MetricsComponent extends Component{ @@ -25,19 +19,19 @@ public class MetricsComponent extends Component{ public void register(JavaPlugin plugin){ registerCommand(plugin, new GetLoginMetrics(this)); registerListener(plugin, new PlayerJoinListener(this)); - - metricsList = new ArrayList(); + metricsList = new ArrayList(); + /* try { metricsYml = loadFileConfiguration(plugin, "metrics.yml"); metricsList = metricsYml.getStringList("playerLogins"); } catch (IOException | InvalidConfigurationException e) { TBMCCoreAPI.SendException("metrics.yml in AliPresents could not be created!", e); return; - } + }*/ } - + /* private FileConfiguration loadFileConfiguration(JavaPlugin plugin, String fileName) throws FileNotFoundException, IOException, InvalidConfigurationException { File file = new File(plugin.getDataFolder(), fileName); @@ -52,5 +46,5 @@ public class MetricsComponent extends Component{ config.load(file); return config; - } + }*/ } diff --git a/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java b/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java index 49d6bc2..0722cad 100644 --- a/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java +++ b/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java @@ -23,5 +23,9 @@ public class GetLoginMetrics extends ModCommand{ } return true; } + @Override + public String GetCommandPath(){ + return "getLoginMetrics"; + } } From 0a866df10e6ebb307caf15f5af1a32d22427e75d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 17 Nov 2016 19:15:41 -0500 Subject: [PATCH 139/263] Tried to get potatoes to even work --- .../components/magic/tricks/AliArrowListener.java | 13 ++++++++----- .../metrics/commands/GetLoginMetrics.java | 1 + .../metrics/listeners/PlayerJoinListener.java | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/alisolarflare/components/magic/tricks/AliArrowListener.java b/src/alisolarflare/components/magic/tricks/AliArrowListener.java index cbbe46c..10ee0f0 100644 --- a/src/alisolarflare/components/magic/tricks/AliArrowListener.java +++ b/src/alisolarflare/components/magic/tricks/AliArrowListener.java @@ -8,6 +8,8 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.ProjectileLaunchEvent; import org.bukkit.plugin.java.JavaPlugin; +import alisolarflare.components.BaseCommand; + public class AliArrowListener implements Listener { private final JavaPlugin plugin; @@ -24,12 +26,13 @@ public class AliArrowListener implements Listener { if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player)){ return; } + Player player = (Player) arrow.getShooter(); + String username = player.getName(); - String user = ((Player) arrow.getShooter()).getName(); - - for (String permittedUser : AliArrowTask.permittedUsers){ - if(permittedUser.equalsIgnoreCase(user)){ - new AliArrowTask(arrow,user).runTaskTimer(plugin, 2, 1); + for (String permittedUsername : AliArrowTask.permittedUsers){ + if(permittedUsername.equalsIgnoreCase(username)){ + BaseCommand.SendDebugPotato(player, "HAHAHAHHAHA NICE"); + new AliArrowTask(arrow,username).runTaskTimer(plugin, 2, 1); break; } } diff --git a/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java b/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java index 0722cad..1555df6 100644 --- a/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java +++ b/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java @@ -17,6 +17,7 @@ public class GetLoginMetrics extends ModCommand{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { Player player = (Player) sender; + SendDebugPotato(player, "FIREEED"); for (String metric : module.metricsList){ SendDebugPotato(player, module.metricsList); SendDebugPotato(player, metric); diff --git a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java index 953b5bb..dcc5a6b 100644 --- a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java +++ b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java @@ -15,6 +15,7 @@ public class PlayerJoinListener implements Listener{ } @EventHandler public void onPlayerJoin(PlayerJoinEvent event){ + BaseCommand.SendDebugPotato(event.getPlayer(), "PLAYERJOIIIN"); BaseCommand.SendDebugPotato(event.getPlayer(), "loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis()+event.getPlayer().getName(), event.getPlayer().getName()); module.metricsList.add("loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); From 8ea667ed0b25bae8b51afd920a7a4058b9d58327 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 17 Nov 2016 19:24:31 -0500 Subject: [PATCH 140/263] Removed potatoes... They lag the game --- src/alisolarflare/components/BaseCommand.java | 2 +- src/alisolarflare/components/Component.java | 1 - .../components/magic/tricks/AliArrowListener.java | 1 - .../components/metrics/commands/GetLoginMetrics.java | 4 +--- .../components/metrics/listeners/PlayerJoinListener.java | 5 +---- 5 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/alisolarflare/components/BaseCommand.java b/src/alisolarflare/components/BaseCommand.java index ad0dcd2..31980f1 100644 --- a/src/alisolarflare/components/BaseCommand.java +++ b/src/alisolarflare/components/BaseCommand.java @@ -16,7 +16,7 @@ public abstract class BaseCommand extends TBMCCommandBase{ ItemStack potato = new ItemStack(Material.BAKED_POTATO); potato.getItemMeta().setDisplayName("Spicy Debug Potato"); potato.getItemMeta().setLore(message); - potato.addEnchantment(Enchantment.ARROW_FIRE, 10); + potato.addUnsafeEnchantment(Enchantment.ARROW_FIRE, 10); return potato; } public static ItemStack CreateDebugPotato(String message){ diff --git a/src/alisolarflare/components/Component.java b/src/alisolarflare/components/Component.java index 13bfeab..86a31e7 100644 --- a/src/alisolarflare/components/Component.java +++ b/src/alisolarflare/components/Component.java @@ -50,7 +50,6 @@ public abstract class Component{ } public void saveData(FileConfiguration config, String pathToData, Object data){ - config.set("moduledata." + this.getClassName() + "." + pathToData, data); } public Object getData(FileConfiguration config, String pathToData, Object data){ diff --git a/src/alisolarflare/components/magic/tricks/AliArrowListener.java b/src/alisolarflare/components/magic/tricks/AliArrowListener.java index 10ee0f0..9816beb 100644 --- a/src/alisolarflare/components/magic/tricks/AliArrowListener.java +++ b/src/alisolarflare/components/magic/tricks/AliArrowListener.java @@ -31,7 +31,6 @@ public class AliArrowListener implements Listener { for (String permittedUsername : AliArrowTask.permittedUsers){ if(permittedUsername.equalsIgnoreCase(username)){ - BaseCommand.SendDebugPotato(player, "HAHAHAHHAHA NICE"); new AliArrowTask(arrow,username).runTaskTimer(plugin, 2, 1); break; } diff --git a/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java b/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java index 1555df6..59a6828 100644 --- a/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java +++ b/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java @@ -17,10 +17,8 @@ public class GetLoginMetrics extends ModCommand{ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { Player player = (Player) sender; - SendDebugPotato(player, "FIREEED"); for (String metric : module.metricsList){ - SendDebugPotato(player, module.metricsList); - SendDebugPotato(player, metric); + player.sendMessage(metric); } return true; } diff --git a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java index dcc5a6b..45cbb20 100644 --- a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java +++ b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java @@ -4,7 +4,6 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; -import alisolarflare.components.BaseCommand; import alisolarflare.components.metrics.MetricsComponent; public class PlayerJoinListener implements Listener{ @@ -15,9 +14,7 @@ public class PlayerJoinListener implements Listener{ } @EventHandler public void onPlayerJoin(PlayerJoinEvent event){ - BaseCommand.SendDebugPotato(event.getPlayer(), "PLAYERJOIIIN"); - BaseCommand.SendDebugPotato(event.getPlayer(), "loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); - module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis()+event.getPlayer().getName(), event.getPlayer().getName()); + //module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis()+event.getPlayer().getName(), event.getPlayer().getName()); module.metricsList.add("loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); } From 18c808095132f173a4294e7f09a838cab34b3dae Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 19 Nov 2016 12:14:36 -0500 Subject: [PATCH 141/263] Created Potatoes without Static Command --- .../components/insurance/getInsuranceBar.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/alisolarflare/components/insurance/getInsuranceBar.java b/src/alisolarflare/components/insurance/getInsuranceBar.java index a024f82..6c5e0b1 100644 --- a/src/alisolarflare/components/insurance/getInsuranceBar.java +++ b/src/alisolarflare/components/insurance/getInsuranceBar.java @@ -1,8 +1,13 @@ package alisolarflare.components.insurance; +import java.util.Arrays; + import org.apache.commons.lang3.StringUtils; +import org.bukkit.Material; import org.bukkit.command.CommandSender; +import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; import alisolarflare.components.ModCommand; import alisolarflare.components.insurance.Insurance.InsuranceType; @@ -16,6 +21,12 @@ public class getInsuranceBar extends ModCommand { player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot, Integer.parseInt(args[0]))); }else{ player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot)); + + ItemStack potato = new ItemStack(Material.BAKED_POTATO); + potato.getItemMeta().setDisplayName("Spicy Debug Potato"); + potato.getItemMeta().setLore(Arrays.asList("Hwat the fuck")); + potato.addUnsafeEnchantment(Enchantment.ARROW_FIRE, 10); + player.getInventory().addItem(potato); } return false; } From 5570c06cdbf6dcb1b53940def00581c1c786c9e9 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 19 Nov 2016 12:21:30 -0500 Subject: [PATCH 142/263] cleaned up code --- .../components/insurance/getInsurance.java | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/src/alisolarflare/components/insurance/getInsurance.java b/src/alisolarflare/components/insurance/getInsurance.java index 382a572..f5ed916 100644 --- a/src/alisolarflare/components/insurance/getInsurance.java +++ b/src/alisolarflare/components/insurance/getInsurance.java @@ -8,35 +8,40 @@ import alisolarflare.components.ModCommand; import alisolarflare.components.insurance.Insurance.InsuranceType; public class getInsurance extends ModCommand { - + private final int defaultAmount = 1; + private final InsuranceType defaultInsuranceType = InsuranceType.Block; @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { Player player = (Player) sender; - if (args.length == 0){ - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block)); - return true; - }else if(args.length == 1){ + + int amount = defaultAmount; + InsuranceType insuranceType = defaultInsuranceType; + + switch(args.length){ + case 0: + break; + case 1: if (StringUtils.isNumeric(args[0])){ - int amount = Integer.parseInt(args[0]); - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block, amount)); - return true; + amount = Integer.parseInt(args[0]); + break; + }else if (Insurance.isInsuranceType(args[0])){ + insuranceType = InsuranceType.valueOf(args[0]); + break; }else{ - if (Insurance.isInsuranceType(args[0])){ - player.getInventory().addItem((Insurance.getInsurance(InsuranceType.valueOf(args[0])))); - return true; - }else{ - return false; - } + return false; } - }else if (args.length >=2){ + default: if (StringUtils.isNumeric(args[0]) && Insurance.isInsuranceType(args[1])){ - player.getInventory().addItem((Insurance.getInsurance(InsuranceType.valueOf(args[1]), Integer.parseInt(args[0])))); - return true; + amount = Integer.parseInt(args[0]); + insuranceType = InsuranceType.valueOf(args[0]); + break; }else{ return false; } } - return false; + + player.getInventory().addItem(Insurance.getInsurance(insuranceType, amount)); + return true; } @Override public String[] GetHelpText(String alias){ From c40ab37afa663501d704e266160640effcb3bd71 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 19 Nov 2016 12:24:22 -0500 Subject: [PATCH 143/263] Declared Enchantment unsafe --- src/alisolarflare/components/insurance/Insurance.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/alisolarflare/components/insurance/Insurance.java b/src/alisolarflare/components/insurance/Insurance.java index 50d458d..7a90e2b 100644 --- a/src/alisolarflare/components/insurance/Insurance.java +++ b/src/alisolarflare/components/insurance/Insurance.java @@ -8,7 +8,6 @@ import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import alisolarflare.components.BaseCommand; -import alisolarflare.components.insurance.Insurance.InsuranceType; public class Insurance { public static enum InsuranceType{ @@ -51,7 +50,7 @@ public class Insurance { ); insuranceItem = BaseCommand.CreateDebugPotato(lore); } - insuranceItem.addEnchantment(Enchantment.DURABILITY, 10); + insuranceItem.addUnsafeEnchantment(Enchantment.DURABILITY, 10); insuranceItem.getItemMeta().setLore(lore); return insuranceItem; } From 4fc14bbfa5577ce952cb1ee3ac7ac3e4dfd900c9 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 19 Nov 2016 12:52:05 -0500 Subject: [PATCH 144/263] Removed references to static methods The Static Insurance class to be more prescise --- src/alisolarflare/components/insurance/Insurance.java | 2 +- src/alisolarflare/components/insurance/getInsuranceBar.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/alisolarflare/components/insurance/Insurance.java b/src/alisolarflare/components/insurance/Insurance.java index 7a90e2b..50805cc 100644 --- a/src/alisolarflare/components/insurance/Insurance.java +++ b/src/alisolarflare/components/insurance/Insurance.java @@ -9,7 +9,7 @@ import org.bukkit.inventory.ItemStack; import alisolarflare.components.BaseCommand; -public class Insurance { +public abstract class Insurance { public static enum InsuranceType{ Nugget, Ingot, Block }; diff --git a/src/alisolarflare/components/insurance/getInsuranceBar.java b/src/alisolarflare/components/insurance/getInsuranceBar.java index 6c5e0b1..c0a268e 100644 --- a/src/alisolarflare/components/insurance/getInsuranceBar.java +++ b/src/alisolarflare/components/insurance/getInsuranceBar.java @@ -10,7 +10,6 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import alisolarflare.components.ModCommand; -import alisolarflare.components.insurance.Insurance.InsuranceType; public class getInsuranceBar extends ModCommand { @@ -18,9 +17,9 @@ public class getInsuranceBar extends ModCommand { public boolean OnCommand(CommandSender sender, String alias, String[] args) { Player player = (Player) sender; if (args.length > 0 || StringUtils.isNumeric(args[0])){ - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot, Integer.parseInt(args[0]))); + //player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot, Integer.parseInt(args[0]))); }else{ - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot)); + //player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot)); ItemStack potato = new ItemStack(Material.BAKED_POTATO); potato.getItemMeta().setDisplayName("Spicy Debug Potato"); From f31e183153c745a49ec0f0d808aa0876cd1348fa Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 19 Nov 2016 13:15:07 -0500 Subject: [PATCH 145/263] huh. ok --- plugin.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin.yml b/plugin.yml index 43d4195..e8a276a 100644 --- a/plugin.yml +++ b/plugin.yml @@ -61,11 +61,11 @@ commands: description: sets one of two proximity blocks to create a space that players can change their flairs with using flairportals. Ask ali XD getLoginMetrics: description: Gets metrics - getInsurance: + getinsurance: description: Gets insurance - getInsuranceNugget: + getinsurancenugget: description: Gets insurance nugget - getInsuranceBar: + getinsurancebar: description: Gets insurance bar - getInsuranceBlock: + getinsuranceblock: description: Gets insurance block \ No newline at end of file From a400bb9acba7659c6c110ed63742ae15506b6ca8 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 19 Nov 2016 13:32:49 -0500 Subject: [PATCH 146/263] Adjusted Meta setting --- src/alisolarflare/components/BaseCommand.java | 7 +++++-- src/alisolarflare/components/insurance/Insurance.java | 6 +++++- .../components/insurance/getInsuranceBar.java | 2 +- .../components/insurance/getInsuranceBlock.java | 2 +- .../components/insurance/getInsuranceNugget.java | 2 +- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/alisolarflare/components/BaseCommand.java b/src/alisolarflare/components/BaseCommand.java index 31980f1..83c20d8 100644 --- a/src/alisolarflare/components/BaseCommand.java +++ b/src/alisolarflare/components/BaseCommand.java @@ -8,14 +8,17 @@ import org.bukkit.Sound; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; import buttondevteam.lib.chat.TBMCCommandBase; public abstract class BaseCommand extends TBMCCommandBase{ public static ItemStack CreateDebugPotato(List message){ ItemStack potato = new ItemStack(Material.BAKED_POTATO); - potato.getItemMeta().setDisplayName("Spicy Debug Potato"); - potato.getItemMeta().setLore(message); + ItemMeta meta = potato.getItemMeta(); + meta.setDisplayName("Spicy Debug Potato"); + meta.setLore(message); + potato.setItemMeta(meta); potato.addUnsafeEnchantment(Enchantment.ARROW_FIRE, 10); return potato; } diff --git a/src/alisolarflare/components/insurance/Insurance.java b/src/alisolarflare/components/insurance/Insurance.java index 50805cc..10fba5d 100644 --- a/src/alisolarflare/components/insurance/Insurance.java +++ b/src/alisolarflare/components/insurance/Insurance.java @@ -6,6 +6,7 @@ import java.util.List; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; import alisolarflare.components.BaseCommand; @@ -51,7 +52,10 @@ public abstract class Insurance { insuranceItem = BaseCommand.CreateDebugPotato(lore); } insuranceItem.addUnsafeEnchantment(Enchantment.DURABILITY, 10); - insuranceItem.getItemMeta().setLore(lore); + ItemMeta meta = insuranceItem.getItemMeta(); + meta.setLore(lore); + meta.setDisplayName("Insurance " + insuranceType.toString()); + insuranceItem.setItemMeta(meta); return insuranceItem; } public static ItemStack getInsurance(InsuranceType insuranceType, int amount){ diff --git a/src/alisolarflare/components/insurance/getInsuranceBar.java b/src/alisolarflare/components/insurance/getInsuranceBar.java index c0a268e..e58331b 100644 --- a/src/alisolarflare/components/insurance/getInsuranceBar.java +++ b/src/alisolarflare/components/insurance/getInsuranceBar.java @@ -16,7 +16,7 @@ public class getInsuranceBar extends ModCommand { @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { Player player = (Player) sender; - if (args.length > 0 || StringUtils.isNumeric(args[0])){ + if (args.length > 0 && StringUtils.isNumeric(args[0])){ //player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot, Integer.parseInt(args[0]))); }else{ //player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot)); diff --git a/src/alisolarflare/components/insurance/getInsuranceBlock.java b/src/alisolarflare/components/insurance/getInsuranceBlock.java index 223db3e..29ef322 100644 --- a/src/alisolarflare/components/insurance/getInsuranceBlock.java +++ b/src/alisolarflare/components/insurance/getInsuranceBlock.java @@ -12,7 +12,7 @@ public class getInsuranceBlock extends ModCommand { @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { Player player = (Player) sender; - if (args.length > 0 || StringUtils.isNumeric(args[0])){ + if (args.length > 0 && StringUtils.isNumeric(args[0])){ player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block, Integer.parseInt(args[0]))); }else{ player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block)); diff --git a/src/alisolarflare/components/insurance/getInsuranceNugget.java b/src/alisolarflare/components/insurance/getInsuranceNugget.java index c1a0ad3..e6de4f4 100644 --- a/src/alisolarflare/components/insurance/getInsuranceNugget.java +++ b/src/alisolarflare/components/insurance/getInsuranceNugget.java @@ -12,7 +12,7 @@ public class getInsuranceNugget extends ModCommand { @Override public boolean OnCommand(CommandSender sender, String alias, String[] args) { Player player = (Player) sender; - if (args.length > 0 || StringUtils.isNumeric(args[0])){ + if (args.length > 0 && StringUtils.isNumeric(args[0])){ player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Nugget, Integer.parseInt(args[0]))); }else{ player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Nugget)); From ce3101acf5f6ea07d364a9c57d6309841538d106 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 19 Nov 2016 13:52:27 -0500 Subject: [PATCH 147/263] Reintroduced DEBUG POTATOOOOEEESSSSS --- .../components/insurance/Insurance.java | 31 ++++++++++++------- .../components/insurance/getInsuranceBar.java | 16 +++------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/alisolarflare/components/insurance/Insurance.java b/src/alisolarflare/components/insurance/Insurance.java index 10fba5d..a46d861 100644 --- a/src/alisolarflare/components/insurance/Insurance.java +++ b/src/alisolarflare/components/insurance/Insurance.java @@ -21,33 +21,40 @@ public abstract class Insurance { case Nugget: insuranceItem = new ItemStack(Material.GOLD_NUGGET); lore = Arrays.asList( - "This insurance nugget will protect one inventory slot from death! Be careful" - + "though, insurance is removed whenever you die, with each itemslot costing" - + "one nugget." + "This insurance nugget will protect ", + "one inventory slot from death! Be careful", + "though, insurance is removed whenever ", + "you die, with each itemslot costing", + "one nugget." ); break; case Ingot: insuranceItem = new ItemStack(Material.GOLD_INGOT); lore = Arrays.asList( - "This insurance ingot will protect nine inventory slots from death! Be " - + "careful though, insurance is removed whenever you die, with each " - + "inventory row costing one ingot." + "This insurance ingot will protect ", + "nine inventory slots from death! Be ", + "careful though, insurance is removed ", + "whenever you die, with each inventory ", + "row costing one ingot." ); break; case Block: insuranceItem = new ItemStack(Material.GOLD_BLOCK); lore = Arrays.asList( - "This insurance block will give your inventory full protection against death! " - + "Be careful though, this block will split into ingots, and you'll lose 3" - + "upon death." + "This insurance block will give your ", + "inventory full protection against death! ", + "Be careful though, this block will split ", + "into ingots, and you'll lose 3 upon ", + "death." ); break; default: lore = Arrays.asList( - "The InsuranceType " + insuranceType.toString() + " is not handled by the " + - "Insurance Class in" + Insurance.class.getPackage().getName() + ". Contact a "+ - "developer with a screenshot of this message" + "The InsuranceType " + insuranceType.toString() + " ", + "is not handled by the Insurance Class in: ", + Insurance.class.getPackage().getName() + ".", + "Contact a developer with a screenshot of this message" ); insuranceItem = BaseCommand.CreateDebugPotato(lore); } diff --git a/src/alisolarflare/components/insurance/getInsuranceBar.java b/src/alisolarflare/components/insurance/getInsuranceBar.java index e58331b..78e859b 100644 --- a/src/alisolarflare/components/insurance/getInsuranceBar.java +++ b/src/alisolarflare/components/insurance/getInsuranceBar.java @@ -1,15 +1,11 @@ package alisolarflare.components.insurance; -import java.util.Arrays; - import org.apache.commons.lang3.StringUtils; -import org.bukkit.Material; import org.bukkit.command.CommandSender; -import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; import alisolarflare.components.ModCommand; +import alisolarflare.components.insurance.Insurance.InsuranceType; public class getInsuranceBar extends ModCommand { @@ -17,15 +13,11 @@ public class getInsuranceBar extends ModCommand { public boolean OnCommand(CommandSender sender, String alias, String[] args) { Player player = (Player) sender; if (args.length > 0 && StringUtils.isNumeric(args[0])){ - //player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot, Integer.parseInt(args[0]))); + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot, Integer.parseInt(args[0]))); }else{ - //player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot)); + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot)); - ItemStack potato = new ItemStack(Material.BAKED_POTATO); - potato.getItemMeta().setDisplayName("Spicy Debug Potato"); - potato.getItemMeta().setLore(Arrays.asList("Hwat the fuck")); - potato.addUnsafeEnchantment(Enchantment.ARROW_FIRE, 10); - player.getInventory().addItem(potato); + SendDebugPotato(player, "Hwat the fuck!"); } return false; } From ffec075d5355fbe296b467dfcf647da058c7a282 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 19 Nov 2016 13:54:51 -0500 Subject: [PATCH 148/263] Attempted to reintroduce metrics saving --- .../components/metrics/MetricsComponent.java | 12 ++++++++---- .../metrics/listeners/PlayerJoinListener.java | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/alisolarflare/components/metrics/MetricsComponent.java b/src/alisolarflare/components/metrics/MetricsComponent.java index 387734c..fc0673b 100644 --- a/src/alisolarflare/components/metrics/MetricsComponent.java +++ b/src/alisolarflare/components/metrics/MetricsComponent.java @@ -1,14 +1,20 @@ package alisolarflare.components.metrics; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.Component; import alisolarflare.components.metrics.commands.GetLoginMetrics; import alisolarflare.components.metrics.listeners.PlayerJoinListener; +import buttondevteam.lib.TBMCCoreAPI; public class MetricsComponent extends Component{ @@ -21,17 +27,15 @@ public class MetricsComponent extends Component{ registerListener(plugin, new PlayerJoinListener(this)); metricsList = new ArrayList(); - /* try { metricsYml = loadFileConfiguration(plugin, "metrics.yml"); metricsList = metricsYml.getStringList("playerLogins"); } catch (IOException | InvalidConfigurationException e) { TBMCCoreAPI.SendException("metrics.yml in AliPresents could not be created!", e); return; - }*/ + } } - /* private FileConfiguration loadFileConfiguration(JavaPlugin plugin, String fileName) throws FileNotFoundException, IOException, InvalidConfigurationException { File file = new File(plugin.getDataFolder(), fileName); @@ -46,5 +50,5 @@ public class MetricsComponent extends Component{ config.load(file); return config; - }*/ + } } diff --git a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java index 45cbb20..b82b210 100644 --- a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java +++ b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java @@ -14,7 +14,7 @@ public class PlayerJoinListener implements Listener{ } @EventHandler public void onPlayerJoin(PlayerJoinEvent event){ - //module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis()+event.getPlayer().getName(), event.getPlayer().getName()); + module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis()+event.getPlayer().getName(), event.getPlayer().getName()); module.metricsList.add("loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); } From 5f9502bf10e1a618f9e6a0d989ecf8e2eca45706 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 19 Nov 2016 14:21:01 -0500 Subject: [PATCH 149/263] Adjusted so that error messages fit --- plugin.yml | 2 +- src/alisolarflare/components/BaseCommand.java | 28 +++++++++++++++++-- .../components/insurance/getInsuranceBar.java | 5 +--- .../metrics/commands/GetLoginMetrics.java | 5 ---- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/plugin.yml b/plugin.yml index e8a276a..57cf268 100644 --- a/plugin.yml +++ b/plugin.yml @@ -59,7 +59,7 @@ commands: description: activate every player's power setproximitylocation: description: sets one of two proximity blocks to create a space that players can change their flairs with using flairportals. Ask ali XD - getLoginMetrics: + getloginmetrics: description: Gets metrics getinsurance: description: Gets insurance diff --git a/src/alisolarflare/components/BaseCommand.java b/src/alisolarflare/components/BaseCommand.java index 83c20d8..8818639 100644 --- a/src/alisolarflare/components/BaseCommand.java +++ b/src/alisolarflare/components/BaseCommand.java @@ -1,5 +1,6 @@ package alisolarflare.components; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -25,14 +26,37 @@ public abstract class BaseCommand extends TBMCCommandBase{ public static ItemStack CreateDebugPotato(String message){ return CreateDebugPotato(Arrays.asList(message)); } - public static void SendDebugPotato(Player player, List message){ player.getInventory().addItem(CreateDebugPotato(message)); player.getWorld().playSound(player.getLocation(), Sound.ENTITY_SLIME_SQUISH, 0, 0); return; } - public static void SendDebugPotato(Player player, String message){ + public static void SendDebugPotato(Player player, String[] message){ SendDebugPotato(player, Arrays.asList(message)); } + public static void SendDebugPotato(Player player, String message){ + + SendDebugPotato(player, StringToMessage(message)); + } + public static List StringToMessage(String message){ + String[] splitString = message.split("\\s+"); + List newMessage = new ArrayList(); + String currentLine = ""; + int currentLineLength = 0; + int wordlength; + int maxLineLength = 40; + for (String word : splitString){ + wordlength = word.length(); + if (currentLineLength == 0 || (currentLineLength + wordlength) < maxLineLength){ + currentLine += word + " "; + currentLineLength += wordlength +1; + }else{ + newMessage.add(currentLine); + currentLine = word + " "; + currentLineLength = word.length(); + } + } + return newMessage; + } } diff --git a/src/alisolarflare/components/insurance/getInsuranceBar.java b/src/alisolarflare/components/insurance/getInsuranceBar.java index 78e859b..4e7a95f 100644 --- a/src/alisolarflare/components/insurance/getInsuranceBar.java +++ b/src/alisolarflare/components/insurance/getInsuranceBar.java @@ -16,10 +16,7 @@ public class getInsuranceBar extends ModCommand { player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot, Integer.parseInt(args[0]))); }else{ player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot)); - - SendDebugPotato(player, "Hwat the fuck!"); } - return false; + return true; } - } diff --git a/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java b/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java index 59a6828..9536258 100644 --- a/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java +++ b/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java @@ -22,9 +22,4 @@ public class GetLoginMetrics extends ModCommand{ } return true; } - @Override - public String GetCommandPath(){ - return "getLoginMetrics"; - } - } From f3283c5fd365dee75ec25ab93b463d0bcf029602 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 19 Nov 2016 14:47:14 -0500 Subject: [PATCH 150/263] Added DebugPotatoAPI --- src/alisolarflare/components/BaseCommand.java | 56 ------------------ .../debugPotatos/DebugPotatoAPI.java | 59 +++++++++++++++++++ .../components/insurance/Insurance.java | 4 +- 3 files changed, 61 insertions(+), 58 deletions(-) create mode 100644 src/alisolarflare/components/debugPotatos/DebugPotatoAPI.java diff --git a/src/alisolarflare/components/BaseCommand.java b/src/alisolarflare/components/BaseCommand.java index 8818639..59a09db 100644 --- a/src/alisolarflare/components/BaseCommand.java +++ b/src/alisolarflare/components/BaseCommand.java @@ -1,62 +1,6 @@ package alisolarflare.components; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.bukkit.Material; -import org.bukkit.Sound; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; - import buttondevteam.lib.chat.TBMCCommandBase; public abstract class BaseCommand extends TBMCCommandBase{ - public static ItemStack CreateDebugPotato(List message){ - ItemStack potato = new ItemStack(Material.BAKED_POTATO); - ItemMeta meta = potato.getItemMeta(); - meta.setDisplayName("Spicy Debug Potato"); - meta.setLore(message); - potato.setItemMeta(meta); - potato.addUnsafeEnchantment(Enchantment.ARROW_FIRE, 10); - return potato; - } - public static ItemStack CreateDebugPotato(String message){ - return CreateDebugPotato(Arrays.asList(message)); - } - public static void SendDebugPotato(Player player, List message){ - player.getInventory().addItem(CreateDebugPotato(message)); - player.getWorld().playSound(player.getLocation(), Sound.ENTITY_SLIME_SQUISH, 0, 0); - return; - } - public static void SendDebugPotato(Player player, String[] message){ - SendDebugPotato(player, Arrays.asList(message)); - } - public static void SendDebugPotato(Player player, String message){ - - SendDebugPotato(player, StringToMessage(message)); - } - public static List StringToMessage(String message){ - String[] splitString = message.split("\\s+"); - List newMessage = new ArrayList(); - String currentLine = ""; - int currentLineLength = 0; - int wordlength; - int maxLineLength = 40; - for (String word : splitString){ - wordlength = word.length(); - if (currentLineLength == 0 || (currentLineLength + wordlength) < maxLineLength){ - currentLine += word + " "; - currentLineLength += wordlength +1; - }else{ - newMessage.add(currentLine); - currentLine = word + " "; - currentLineLength = word.length(); - } - } - return newMessage; - } - } diff --git a/src/alisolarflare/components/debugPotatos/DebugPotatoAPI.java b/src/alisolarflare/components/debugPotatos/DebugPotatoAPI.java new file mode 100644 index 0000000..8d3bdee --- /dev/null +++ b/src/alisolarflare/components/debugPotatos/DebugPotatoAPI.java @@ -0,0 +1,59 @@ +package alisolarflare.components.debugPotatos; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +public class DebugPotatoAPI { + public static ItemStack CreateDebugPotato(List message){ + ItemStack potato = new ItemStack(Material.BAKED_POTATO); + ItemMeta meta = potato.getItemMeta(); + meta.setDisplayName("Spicy Debug Potato"); + meta.setLore(message); + potato.setItemMeta(meta); + potato.addUnsafeEnchantment(Enchantment.ARROW_FIRE, 10); + return potato; + } + public static ItemStack CreateDebugPotato(String message){ + return CreateDebugPotato(Arrays.asList(message)); + } + public static void SendDebugPotato(Player player, List message){ + player.getInventory().addItem(CreateDebugPotato(message)); + player.getWorld().playSound(player.getLocation(), Sound.ENTITY_SLIME_SQUISH, 0, 0); + return; + } + public static void SendDebugPotato(Player player, String[] message){ + SendDebugPotato(player, Arrays.asList(message)); + } + public static void SendDebugPotato(Player player, String message){ + + SendDebugPotato(player, StringToMessage(message)); + } + public static List StringToMessage(String message){ + String[] splitString = message.split("\\s+"); + List newMessage = new ArrayList(); + String currentLine = ""; + int currentLineLength = 0; + int wordlength; + int maxLineLength = 40; + for (String word : splitString){ + wordlength = word.length(); + if (currentLineLength == 0 || (currentLineLength + wordlength) < maxLineLength){ + currentLine += word + " "; + currentLineLength += wordlength +1; + }else{ + newMessage.add(currentLine); + currentLine = word + " "; + currentLineLength = word.length(); + } + } + return newMessage; + } +} diff --git a/src/alisolarflare/components/insurance/Insurance.java b/src/alisolarflare/components/insurance/Insurance.java index a46d861..72a34b9 100644 --- a/src/alisolarflare/components/insurance/Insurance.java +++ b/src/alisolarflare/components/insurance/Insurance.java @@ -8,7 +8,7 @@ import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; -import alisolarflare.components.BaseCommand; +import alisolarflare.components.debugPotatos.DebugPotatoAPI; public abstract class Insurance { public static enum InsuranceType{ @@ -56,7 +56,7 @@ public abstract class Insurance { Insurance.class.getPackage().getName() + ".", "Contact a developer with a screenshot of this message" ); - insuranceItem = BaseCommand.CreateDebugPotato(lore); + insuranceItem = DebugPotatoAPI.CreateDebugPotato(lore); } insuranceItem.addUnsafeEnchantment(Enchantment.DURABILITY, 10); ItemMeta meta = insuranceItem.getItemMeta(); From 7a62d5b0c37da7aa2d6b7cc2aa6415cc73ce736b Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 19 Nov 2016 14:48:37 -0500 Subject: [PATCH 151/263] Removed Debug Message For Boom Bow --- src/alisolarflare/components/magic/tricks/BoomBowListener.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/alisolarflare/components/magic/tricks/BoomBowListener.java b/src/alisolarflare/components/magic/tricks/BoomBowListener.java index 6aaca6a..5450f06 100644 --- a/src/alisolarflare/components/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/components/magic/tricks/BoomBowListener.java @@ -96,7 +96,6 @@ public class BoomBowListener implements Listener { player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); player.damage(7.42425, player); - player.sendMessage(player.getLastDamage() + ""); boomBow.setDurability((short) (boomBow.getDurability() + 3)); if(boomBow.getDurability() < 0){ player.getInventory().setItemInMainHand(null); From c4e79bd449c85498a6119bd60a808130d579d2d2 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 19 Nov 2016 23:40:31 +0100 Subject: [PATCH 152/263] Moved debug potatoes to the Core --- .../debugPotatos/DebugPotatoAPI.java | 59 ------------------- .../components/insurance/Insurance.java | 2 +- 2 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 src/alisolarflare/components/debugPotatos/DebugPotatoAPI.java diff --git a/src/alisolarflare/components/debugPotatos/DebugPotatoAPI.java b/src/alisolarflare/components/debugPotatos/DebugPotatoAPI.java deleted file mode 100644 index 8d3bdee..0000000 --- a/src/alisolarflare/components/debugPotatos/DebugPotatoAPI.java +++ /dev/null @@ -1,59 +0,0 @@ -package alisolarflare.components.debugPotatos; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.bukkit.Material; -import org.bukkit.Sound; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; - -public class DebugPotatoAPI { - public static ItemStack CreateDebugPotato(List message){ - ItemStack potato = new ItemStack(Material.BAKED_POTATO); - ItemMeta meta = potato.getItemMeta(); - meta.setDisplayName("Spicy Debug Potato"); - meta.setLore(message); - potato.setItemMeta(meta); - potato.addUnsafeEnchantment(Enchantment.ARROW_FIRE, 10); - return potato; - } - public static ItemStack CreateDebugPotato(String message){ - return CreateDebugPotato(Arrays.asList(message)); - } - public static void SendDebugPotato(Player player, List message){ - player.getInventory().addItem(CreateDebugPotato(message)); - player.getWorld().playSound(player.getLocation(), Sound.ENTITY_SLIME_SQUISH, 0, 0); - return; - } - public static void SendDebugPotato(Player player, String[] message){ - SendDebugPotato(player, Arrays.asList(message)); - } - public static void SendDebugPotato(Player player, String message){ - - SendDebugPotato(player, StringToMessage(message)); - } - public static List StringToMessage(String message){ - String[] splitString = message.split("\\s+"); - List newMessage = new ArrayList(); - String currentLine = ""; - int currentLineLength = 0; - int wordlength; - int maxLineLength = 40; - for (String word : splitString){ - wordlength = word.length(); - if (currentLineLength == 0 || (currentLineLength + wordlength) < maxLineLength){ - currentLine += word + " "; - currentLineLength += wordlength +1; - }else{ - newMessage.add(currentLine); - currentLine = word + " "; - currentLineLength = word.length(); - } - } - return newMessage; - } -} diff --git a/src/alisolarflare/components/insurance/Insurance.java b/src/alisolarflare/components/insurance/Insurance.java index 72a34b9..ea909c2 100644 --- a/src/alisolarflare/components/insurance/Insurance.java +++ b/src/alisolarflare/components/insurance/Insurance.java @@ -8,7 +8,7 @@ import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; -import alisolarflare.components.debugPotatos.DebugPotatoAPI; +import buttondevteam.lib.DebugPotatoAPI; public abstract class Insurance { public static enum InsuranceType{ From b21ce61d7f0149784e955419111ae5c0775d374c Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 19 Nov 2016 21:14:17 -0500 Subject: [PATCH 153/263] Updated potatoes --- src/alisolarflare/components/ModCommand.java | 1 - .../components/PlayerCommand.java | 6 +- .../components/insurance/Insurance.java | 165 +++++++++--------- .../magic/tricks/BoomBowDeathListener.java | 2 - .../magic/tricks/BoomBowListener.java | 3 +- 5 files changed, 89 insertions(+), 88 deletions(-) diff --git a/src/alisolarflare/components/ModCommand.java b/src/alisolarflare/components/ModCommand.java index 3c34e4d..ddc0940 100644 --- a/src/alisolarflare/components/ModCommand.java +++ b/src/alisolarflare/components/ModCommand.java @@ -11,7 +11,6 @@ public abstract class ModCommand extends BaseCommand{ public String[] GetHelpText(String alias){ return new String[] { "This command doesn't have help text, ask a dev to add one", - " using public String[] GetHelpText. ", "If you're a dev, write the help text you lazy bastard. -Ali" }; } diff --git a/src/alisolarflare/components/PlayerCommand.java b/src/alisolarflare/components/PlayerCommand.java index 5115c9e..201c275 100644 --- a/src/alisolarflare/components/PlayerCommand.java +++ b/src/alisolarflare/components/PlayerCommand.java @@ -15,9 +15,9 @@ public abstract class PlayerCommand extends BaseCommand{ @Override public String[] GetHelpText(String alias){ return new String[] { - "This command doesn't have help text, ask a mod to ask a ", - "dev to add one using public String[] GetHelpText. ", - "If you're a mod, ask a dev to write the help text.", + "This command doesn't have help text. ", + "If you're a player, ask a mod to write one", + "If you're a mod, ask a dev to write one", "If you're a dev, write the help text you lazy bastard. -Ali" }; } diff --git a/src/alisolarflare/components/insurance/Insurance.java b/src/alisolarflare/components/insurance/Insurance.java index ea909c2..721bc2b 100644 --- a/src/alisolarflare/components/insurance/Insurance.java +++ b/src/alisolarflare/components/insurance/Insurance.java @@ -1,81 +1,84 @@ -package alisolarflare.components.insurance; - -import java.util.Arrays; -import java.util.List; - -import org.bukkit.Material; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; - -import buttondevteam.lib.DebugPotatoAPI; - -public abstract class Insurance { - public static enum InsuranceType{ - Nugget, Ingot, Block - }; - public static ItemStack getInsurance(InsuranceType insuranceType){ - ItemStack insuranceItem; - List lore; - switch(insuranceType){ - case Nugget: - insuranceItem = new ItemStack(Material.GOLD_NUGGET); - lore = Arrays.asList( - "This insurance nugget will protect ", - "one inventory slot from death! Be careful", - "though, insurance is removed whenever ", - "you die, with each itemslot costing", - "one nugget." - ); - break; - case Ingot: - insuranceItem = new ItemStack(Material.GOLD_INGOT); - lore = Arrays.asList( - "This insurance ingot will protect ", - "nine inventory slots from death! Be ", - "careful though, insurance is removed ", - "whenever you die, with each inventory ", - "row costing one ingot." - ); - break; - case Block: - insuranceItem = new ItemStack(Material.GOLD_BLOCK); - lore = Arrays.asList( - "This insurance block will give your ", - "inventory full protection against death! ", - "Be careful though, this block will split ", - "into ingots, and you'll lose 3 upon ", - "death." - ); - break; - default: - - lore = Arrays.asList( - "The InsuranceType " + insuranceType.toString() + " ", - "is not handled by the Insurance Class in: ", - Insurance.class.getPackage().getName() + ".", - "Contact a developer with a screenshot of this message" - ); - insuranceItem = DebugPotatoAPI.CreateDebugPotato(lore); - } - insuranceItem.addUnsafeEnchantment(Enchantment.DURABILITY, 10); - ItemMeta meta = insuranceItem.getItemMeta(); - meta.setLore(lore); - meta.setDisplayName("Insurance " + insuranceType.toString()); - insuranceItem.setItemMeta(meta); - return insuranceItem; - } - public static ItemStack getInsurance(InsuranceType insuranceType, int amount){ - ItemStack insurance = Insurance.getInsurance(insuranceType); - insurance.setAmount(amount); - return insurance; - } - public static boolean isInsuranceType(String string){ - for (InsuranceType insuranceType : Insurance.InsuranceType.values()){ - if (string.equalsIgnoreCase(insuranceType.toString())){ - return true; - } - } - return false; - } -} +package alisolarflare.components.insurance; + +import java.util.Arrays; +import java.util.List; + +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +import buttondevteam.lib.DebugPotato; +import buttondevteam.lib.DebugPotatoAPI; + +public abstract class Insurance { + public static enum InsuranceType{ + Nugget, Ingot, Block + }; + public static ItemStack getInsurance(InsuranceType insuranceType){ + ItemStack insuranceItem; + List lore; + switch(insuranceType){ + case Nugget: + insuranceItem = new ItemStack(Material.GOLD_NUGGET); + lore = Arrays.asList( + "This insurance nugget will protect ", + "one inventory slot from death! Be careful", + "though, insurance is removed whenever ", + "you die, with each itemslot costing", + "one nugget." + ); + break; + case Ingot: + insuranceItem = new ItemStack(Material.GOLD_INGOT); + lore = Arrays.asList( + "This insurance ingot will protect ", + "nine inventory slots from death! Be ", + "careful though, insurance is removed ", + "whenever you die, with each inventory ", + "row costing one ingot." + ); + break; + case Block: + insuranceItem = new ItemStack(Material.GOLD_BLOCK); + lore = Arrays.asList( + "This insurance block will give your ", + "inventory full protection against death! ", + "Be careful though, this block will split ", + "into ingots, and you'll lose 3 upon ", + "death." + ); + break; + default: + + lore = Arrays.asList( + "The InsuranceType " + insuranceType.toString() + " ", + "is not handled by the Insurance Class in: ", + Insurance.class.getPackage().getName() + ".", + "Contact a developer with a screenshot of this message" + ); + DebugPotato potato = new DebugPotato(); + potato.setMessage(lore); + insuranceItem = potato.toItemStack(); + } + insuranceItem.addUnsafeEnchantment(Enchantment.DURABILITY, 10); + ItemMeta meta = insuranceItem.getItemMeta(); + meta.setLore(lore); + meta.setDisplayName("Insurance " + insuranceType.toString()); + insuranceItem.setItemMeta(meta); + return insuranceItem; + } + public static ItemStack getInsurance(InsuranceType insuranceType, int amount){ + ItemStack insurance = Insurance.getInsurance(insuranceType); + insurance.setAmount(amount); + return insurance; + } + public static boolean isInsuranceType(String string){ + for (InsuranceType insuranceType : Insurance.InsuranceType.values()){ + if (string.equalsIgnoreCase(insuranceType.toString())){ + return true; + } + } + return false; + } +} diff --git a/src/alisolarflare/components/magic/tricks/BoomBowDeathListener.java b/src/alisolarflare/components/magic/tricks/BoomBowDeathListener.java index 1b55fe4..3d60143 100644 --- a/src/alisolarflare/components/magic/tricks/BoomBowDeathListener.java +++ b/src/alisolarflare/components/magic/tricks/BoomBowDeathListener.java @@ -9,9 +9,7 @@ public class BoomBowDeathListener implements Listener{ @EventHandler public void onBoomBowDeath(PlayerDeathEvent event){ Player player = event.getEntity(); - if (player.getLastDamage() > 7.42420 && player.getLastDamage() < 7.42429){ - player.sendMessage("42!"); event.setDeathMessage(player.getName() + " got trigger happy with the [Boom Bow]"); } } diff --git a/src/alisolarflare/components/magic/tricks/BoomBowListener.java b/src/alisolarflare/components/magic/tricks/BoomBowListener.java index 5450f06..aee7e22 100644 --- a/src/alisolarflare/components/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/components/magic/tricks/BoomBowListener.java @@ -99,7 +99,8 @@ public class BoomBowListener implements Listener { boomBow.setDurability((short) (boomBow.getDurability() + 3)); if(boomBow.getDurability() < 0){ player.getInventory().setItemInMainHand(null); - player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0); + player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0) + ; } } From 5e1826bacdbc2805497207257e211df4400bf948 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 20 Nov 2016 14:35:36 -0500 Subject: [PATCH 154/263] Put potatoes on NPE --- .../components/insurance/Insurance.java | 1 - .../magic/tricks/AliArrowListener.java | 2 -- .../metrics/listeners/PlayerJoinListener.java | 20 ++++++++++++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/alisolarflare/components/insurance/Insurance.java b/src/alisolarflare/components/insurance/Insurance.java index 721bc2b..afa8856 100644 --- a/src/alisolarflare/components/insurance/Insurance.java +++ b/src/alisolarflare/components/insurance/Insurance.java @@ -9,7 +9,6 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import buttondevteam.lib.DebugPotato; -import buttondevteam.lib.DebugPotatoAPI; public abstract class Insurance { public static enum InsuranceType{ diff --git a/src/alisolarflare/components/magic/tricks/AliArrowListener.java b/src/alisolarflare/components/magic/tricks/AliArrowListener.java index 9816beb..694e8a8 100644 --- a/src/alisolarflare/components/magic/tricks/AliArrowListener.java +++ b/src/alisolarflare/components/magic/tricks/AliArrowListener.java @@ -8,8 +8,6 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.ProjectileLaunchEvent; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.BaseCommand; - public class AliArrowListener implements Listener { private final JavaPlugin plugin; diff --git a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java index b82b210..c457618 100644 --- a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java +++ b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java @@ -5,6 +5,8 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; import alisolarflare.components.metrics.MetricsComponent; +import buttondevteam.lib.DebugPotato; +import buttondevteam.lib.DebugPotatoAPI; public class PlayerJoinListener implements Listener{ @@ -14,7 +16,23 @@ public class PlayerJoinListener implements Listener{ } @EventHandler public void onPlayerJoin(PlayerJoinEvent event){ - module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis()+event.getPlayer().getName(), event.getPlayer().getName()); + try{ + module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis()+event.getPlayer().getName(), event.getPlayer().getName()); + }catch(NullPointerException e){ + try{ + DebugPotato potato = new DebugPotato(); + potato.setMessage(new String[]{ + "Module: "+ module.toString(), + "Time: " + System.currentTimeMillis(), + "MetricsYML: " + module.metricsYml.toString() + }); + DebugPotatoAPI.SendDebugPotato(potato, event.getPlayer()); + }catch (Exception ex){ + DebugPotato potato = new DebugPotato(); + potato.setMessage("Something went REALLLY wrong"); + DebugPotatoAPI.SendDebugPotato(potato, event.getPlayer()); + } + } module.metricsList.add("loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); } From b66f1a0735f05a8a9dd1db4e22a08b65da02303b Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 21 Nov 2016 13:32:46 -0500 Subject: [PATCH 155/263] Adjusted Potato usage to reflect API change --- src/alisolarflare/AliPresents.java | 2 ++ .../components/bankchest/BankChestComponent.java | 15 +++++++++++++++ .../components/bankchest/BankChestListener.java | 6 ++++++ .../components/bankchest/CreateBankChest.java | 15 +++++++++++++++ .../metrics/listeners/PlayerJoinListener.java | 5 ++--- 5 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 src/alisolarflare/components/bankchest/BankChestComponent.java create mode 100644 src/alisolarflare/components/bankchest/BankChestListener.java create mode 100644 src/alisolarflare/components/bankchest/CreateBankChest.java diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index f895dfc..bc334b6 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -7,6 +7,7 @@ import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.alilinks.AliLinkComponent; +import alisolarflare.components.bankchest.BankChestComponent; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; import alisolarflare.components.easyuhc.EasyUHCComponent; import alisolarflare.components.flairdoor.FlairDoorComponent; @@ -25,6 +26,7 @@ public class AliPresents extends JavaPlugin{ new AliLinkComponent().register(this); + new BankChestComponent().register(this); new CreativeBoundariesComponent().register(this); new EasyUHCComponent().register(this); new FlairDoorComponent().register(this); diff --git a/src/alisolarflare/components/bankchest/BankChestComponent.java b/src/alisolarflare/components/bankchest/BankChestComponent.java new file mode 100644 index 0000000..0fe9ea6 --- /dev/null +++ b/src/alisolarflare/components/bankchest/BankChestComponent.java @@ -0,0 +1,15 @@ +package alisolarflare.components.bankchest; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.Component; + +public class BankChestComponent extends Component { + + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new CreateBankChest()); + registerListener(plugin, new BankChestListener()); + } + +} diff --git a/src/alisolarflare/components/bankchest/BankChestListener.java b/src/alisolarflare/components/bankchest/BankChestListener.java new file mode 100644 index 0000000..d413bad --- /dev/null +++ b/src/alisolarflare/components/bankchest/BankChestListener.java @@ -0,0 +1,6 @@ +package alisolarflare.components.bankchest; + +import org.bukkit.event.Listener; + +public class BankChestListener implements Listener { +} diff --git a/src/alisolarflare/components/bankchest/CreateBankChest.java b/src/alisolarflare/components/bankchest/CreateBankChest.java new file mode 100644 index 0000000..deb1c9a --- /dev/null +++ b/src/alisolarflare/components/bankchest/CreateBankChest.java @@ -0,0 +1,15 @@ +package alisolarflare.components.bankchest; + +import org.bukkit.command.CommandSender; + +import alisolarflare.components.ModCommand; + +public class CreateBankChest extends ModCommand { + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java index c457618..83ce00a 100644 --- a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java +++ b/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java @@ -6,7 +6,6 @@ import org.bukkit.event.player.PlayerJoinEvent; import alisolarflare.components.metrics.MetricsComponent; import buttondevteam.lib.DebugPotato; -import buttondevteam.lib.DebugPotatoAPI; public class PlayerJoinListener implements Listener{ @@ -26,11 +25,11 @@ public class PlayerJoinListener implements Listener{ "Time: " + System.currentTimeMillis(), "MetricsYML: " + module.metricsYml.toString() }); - DebugPotatoAPI.SendDebugPotato(potato, event.getPlayer()); + potato.Send(event.getPlayer()); }catch (Exception ex){ DebugPotato potato = new DebugPotato(); potato.setMessage("Something went REALLLY wrong"); - DebugPotatoAPI.SendDebugPotato(potato, event.getPlayer()); + potato.Send(event.getPlayer()); } } module.metricsList.add("loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); From 7ef80f1a4e7eda868a0d9dbf54f9613106c99abf Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 21 Nov 2016 20:53:53 -0500 Subject: [PATCH 156/263] Updated AliPresents to 1.11 --- plugin.yml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.yml b/plugin.yml index 57cf268..b5025ea 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,6 +1,6 @@ main: alisolarflare.AliPresents name: AliPresents -version: 2.0.1 +version: 2.0.2 commands: flairme: diff --git a/pom.xml b/pom.xml index 3561116..e753309 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ org.spigotmc spigot-api - 1.9.2-R0.1-SNAPSHOT + 1.11-R0.1-SNAPSHOT From ef4610294ffe02b6fc6937f103e496764327a86b Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 21 Nov 2016 21:03:39 -0500 Subject: [PATCH 157/263] Fixed plugin.yml --- plugin.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin.yml b/plugin.yml index b5025ea..83f16c2 100644 --- a/plugin.yml +++ b/plugin.yml @@ -68,4 +68,6 @@ commands: getinsurancebar: description: Gets insurance bar getinsuranceblock: - description: Gets insurance block \ No newline at end of file + description: Gets insurance block + createbankchest: + description: Creates a Bank Chest \ No newline at end of file From d323ccaafddf9f3765ab87147d4b20904f7f79c2 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Tue, 22 Nov 2016 14:07:49 -0500 Subject: [PATCH 158/263] Fully Disabled AliPresents for Release --- src/alisolarflare/AliPresents.java | 20 +++++++++---------- .../alilinks/commands/SetAliLink.java | 1 - 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index bc334b6..945b870 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -25,16 +25,16 @@ public class AliPresents extends JavaPlugin{ logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); - new AliLinkComponent().register(this); - new BankChestComponent().register(this); - new CreativeBoundariesComponent().register(this); - new EasyUHCComponent().register(this); - new FlairDoorComponent().register(this); - new GPowerComponent().register(this); - new InsuranceComponent().register(this); - new MagicComponent().register(this); - new MetricsComponent().register(this); - new MinigameComponent().register(this); + //new AliLinkComponent().register(this); + //new BankChestComponent().register(this); + //new CreativeBoundariesComponent().register(this); + //new EasyUHCComponent().register(this); + //new FlairDoorComponent().register(this); + //new GPowerComponent().register(this); + //new InsuranceComponent().register(this); + //new MagicComponent().register(this); + //new MetricsComponent().register(this); + //new MinigameComponent().register(this); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); diff --git a/src/alisolarflare/components/alilinks/commands/SetAliLink.java b/src/alisolarflare/components/alilinks/commands/SetAliLink.java index 56e9e02..5aec78d 100644 --- a/src/alisolarflare/components/alilinks/commands/SetAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/SetAliLink.java @@ -54,7 +54,6 @@ public class SetAliLink extends PlayerCommand { linkList.add(link); linkData.add(link.toMap()); saveLinkList(); - return true; } private void saveLinkList(){ From e3a3dac942103c74bb2ad87fbdffe2a4d4c36b21 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 23 Nov 2016 11:16:25 -0500 Subject: [PATCH 159/263] Re-activated AliPresents cuz no release --- src/alisolarflare/AliPresents.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 945b870..bc334b6 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -25,16 +25,16 @@ public class AliPresents extends JavaPlugin{ logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); - //new AliLinkComponent().register(this); - //new BankChestComponent().register(this); - //new CreativeBoundariesComponent().register(this); - //new EasyUHCComponent().register(this); - //new FlairDoorComponent().register(this); - //new GPowerComponent().register(this); - //new InsuranceComponent().register(this); - //new MagicComponent().register(this); - //new MetricsComponent().register(this); - //new MinigameComponent().register(this); + new AliLinkComponent().register(this); + new BankChestComponent().register(this); + new CreativeBoundariesComponent().register(this); + new EasyUHCComponent().register(this); + new FlairDoorComponent().register(this); + new GPowerComponent().register(this); + new InsuranceComponent().register(this); + new MagicComponent().register(this); + new MetricsComponent().register(this); + new MinigameComponent().register(this); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); From 1554f3f2f01718e84ad691168d2a72d94490a9da Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 23 Nov 2016 12:20:34 -0500 Subject: [PATCH 160/263] initialized metrics.yml --- metrics.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 metrics.yml diff --git a/metrics.yml b/metrics.yml new file mode 100644 index 0000000..e69de29 From 63a6c775a4e9dfff78f68d5ca59207ad903acf44 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 24 Nov 2016 21:48:10 -0500 Subject: [PATCH 161/263] Re-did how OnCommand works in AliPresents Removed CommandSender sender for all Player and Mod Commands, replaced with Player player --- src/alisolarflare/components/ModCommand.java | 13 +-- .../components/PlayerCommand.java | 8 ++ .../components/bankchest/CreateBankChest.java | 6 +- .../creativeboundaries/commands/Cbgm0.java | 9 +- .../creativeboundaries/commands/Cbgm1.java | 6 +- .../easyuhc/commands/ActivatePowers.java | 4 +- .../flairdoor/commands/FlairMe.java | 7 +- .../components/gpowers/commands/GPower.java | 4 +- .../components/insurance/getInsurance.java | 5 +- .../components/insurance/getInsuranceBar.java | 4 +- .../insurance/getInsuranceBlock.java | 4 +- .../insurance/getInsuranceNugget.java | 4 +- .../components/magic/tricks/BoomBowRule.java | 8 +- .../metrics/commands/GetLoginMetrics.java | 7 +- .../minigames/commands/JoinMinigame.java | 10 +- .../minigames/commands/LeaveMinigame.java | 13 +-- .../minigames/commands/ListFighters.java | 6 +- src/graveyard/autouhc/idle/AddToUHC.java | 110 +++++++++--------- src/graveyard/autouhc/idle/JoinUHC.java | 96 +++++++-------- .../autouhc/intro/ConfigureMatch.java | 38 +++--- .../autouhc/intro/IntroductionCutscene.java | 10 +- .../listeners/MatchCyclingListener.java | 38 +++--- .../autouhc/listeners/MatchMainLoop.java | 24 ++-- src/graveyard/autouhc/memory/MatchState.java | 24 ++-- 24 files changed, 213 insertions(+), 245 deletions(-) diff --git a/src/alisolarflare/components/ModCommand.java b/src/alisolarflare/components/ModCommand.java index ddc0940..6813f4f 100644 --- a/src/alisolarflare/components/ModCommand.java +++ b/src/alisolarflare/components/ModCommand.java @@ -1,11 +1,6 @@ package alisolarflare.components; -import org.bukkit.command.CommandSender; - -public abstract class ModCommand extends BaseCommand{ - - @Override - public abstract boolean OnCommand(CommandSender sender, String alias, String[] args); +public abstract class ModCommand extends PlayerCommand{ @Override public String[] GetHelpText(String alias){ @@ -15,12 +10,6 @@ public abstract class ModCommand extends BaseCommand{ }; } - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return true; - } - @Override public boolean GetModOnly() { // TODO Auto-generated method stub diff --git a/src/alisolarflare/components/PlayerCommand.java b/src/alisolarflare/components/PlayerCommand.java index 201c275..9fa4439 100644 --- a/src/alisolarflare/components/PlayerCommand.java +++ b/src/alisolarflare/components/PlayerCommand.java @@ -1,6 +1,14 @@ package alisolarflare.components; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + public abstract class PlayerCommand extends BaseCommand{ + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args){ + return OnCommand((Player) sender, alias, args); + } + public abstract boolean OnCommand(Player player, String alias, String[] args); @Override public boolean GetPlayerOnly() { // TODO Auto-generated method stub diff --git a/src/alisolarflare/components/bankchest/CreateBankChest.java b/src/alisolarflare/components/bankchest/CreateBankChest.java index deb1c9a..41c85c6 100644 --- a/src/alisolarflare/components/bankchest/CreateBankChest.java +++ b/src/alisolarflare/components/bankchest/CreateBankChest.java @@ -1,15 +1,15 @@ package alisolarflare.components.bankchest; -import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; public class CreateBankChest extends ModCommand { @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { + public boolean OnCommand(Player player, String alias, String[] args) { // TODO Auto-generated method stub return false; } -} +} diff --git a/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java index b1e597b..607dc8f 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java +++ b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java @@ -3,7 +3,6 @@ package alisolarflare.components.creativeboundaries.commands; import java.util.List; import org.bukkit.GameMode; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.PlayerCommand; @@ -18,13 +17,7 @@ public class Cbgm0 extends PlayerCommand{ } @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - return false; - } - - Player player = (Player) sender; + public boolean OnCommand(Player player, String arg2, String[] arg3) { player.setGameMode(GameMode.SURVIVAL); cbCreatives.remove(player); return true; diff --git a/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java b/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java index 845de5e..5416aba 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java +++ b/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java @@ -3,7 +3,6 @@ package alisolarflare.components.creativeboundaries.commands; import java.util.List; import org.bukkit.GameMode; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; @@ -24,10 +23,7 @@ public class Cbgm1 extends PlayerCommand { } @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - - - Player player = (Player) sender; + public boolean OnCommand(Player player, String arg2, String[] arg3) { TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); if (tb == null) { diff --git a/src/alisolarflare/components/easyuhc/commands/ActivatePowers.java b/src/alisolarflare/components/easyuhc/commands/ActivatePowers.java index 7c19b02..0933d54 100644 --- a/src/alisolarflare/components/easyuhc/commands/ActivatePowers.java +++ b/src/alisolarflare/components/easyuhc/commands/ActivatePowers.java @@ -1,13 +1,13 @@ package alisolarflare.components.easyuhc.commands; -import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; public class ActivatePowers extends ModCommand{ @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { + public boolean OnCommand(Player player, String alias, String[] args) { return false; } } diff --git a/src/alisolarflare/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java index d854304..822a43a 100644 --- a/src/alisolarflare/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -1,6 +1,5 @@ package alisolarflare.components.flairdoor.commands; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.PlayerCommand; @@ -13,9 +12,9 @@ public class FlairMe extends PlayerCommand { this.component = flairDoorComponent; } @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - component.playersToBeFlaired.add((Player) sender); - sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); + public boolean OnCommand(Player player, String label, String[] args) { + component.playersToBeFlaired.add(player); + player.sendMessage("Setup Successful! Walk through a portal to get your flair"); return true; } @Override diff --git a/src/alisolarflare/components/gpowers/commands/GPower.java b/src/alisolarflare/components/gpowers/commands/GPower.java index 3a2561d..ae5870d 100644 --- a/src/alisolarflare/components/gpowers/commands/GPower.java +++ b/src/alisolarflare/components/gpowers/commands/GPower.java @@ -1,6 +1,5 @@ package alisolarflare.components.gpowers.commands; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.PlayerCommand; @@ -15,8 +14,7 @@ public class GPower extends PlayerCommand { } @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - Player player = (Player) sender; + public boolean OnCommand(Player player, String label, String[] args) { if (args.length < 2) { player.sendMessage("Proper Usage to test G-Powers:"); player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); diff --git a/src/alisolarflare/components/insurance/getInsurance.java b/src/alisolarflare/components/insurance/getInsurance.java index f5ed916..642f953 100644 --- a/src/alisolarflare/components/insurance/getInsurance.java +++ b/src/alisolarflare/components/insurance/getInsurance.java @@ -1,7 +1,6 @@ package alisolarflare.components.insurance; import org.apache.commons.lang.StringUtils; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; @@ -11,9 +10,7 @@ public class getInsurance extends ModCommand { private final int defaultAmount = 1; private final InsuranceType defaultInsuranceType = InsuranceType.Block; @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - Player player = (Player) sender; - + public boolean OnCommand(Player player, String alias, String[] args) { int amount = defaultAmount; InsuranceType insuranceType = defaultInsuranceType; diff --git a/src/alisolarflare/components/insurance/getInsuranceBar.java b/src/alisolarflare/components/insurance/getInsuranceBar.java index 4e7a95f..ec5341f 100644 --- a/src/alisolarflare/components/insurance/getInsuranceBar.java +++ b/src/alisolarflare/components/insurance/getInsuranceBar.java @@ -1,7 +1,6 @@ package alisolarflare.components.insurance; import org.apache.commons.lang3.StringUtils; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; @@ -10,8 +9,7 @@ import alisolarflare.components.insurance.Insurance.InsuranceType; public class getInsuranceBar extends ModCommand { @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - Player player = (Player) sender; + public boolean OnCommand(Player player, String alias, String[] args) { if (args.length > 0 && StringUtils.isNumeric(args[0])){ player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot, Integer.parseInt(args[0]))); }else{ diff --git a/src/alisolarflare/components/insurance/getInsuranceBlock.java b/src/alisolarflare/components/insurance/getInsuranceBlock.java index 29ef322..401760b 100644 --- a/src/alisolarflare/components/insurance/getInsuranceBlock.java +++ b/src/alisolarflare/components/insurance/getInsuranceBlock.java @@ -1,7 +1,6 @@ package alisolarflare.components.insurance; import org.apache.commons.lang3.StringUtils; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; @@ -10,8 +9,7 @@ import alisolarflare.components.insurance.Insurance.InsuranceType; public class getInsuranceBlock extends ModCommand { @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - Player player = (Player) sender; + public boolean OnCommand(Player player, String alias, String[] args) { if (args.length > 0 && StringUtils.isNumeric(args[0])){ player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block, Integer.parseInt(args[0]))); }else{ diff --git a/src/alisolarflare/components/insurance/getInsuranceNugget.java b/src/alisolarflare/components/insurance/getInsuranceNugget.java index e6de4f4..9f38bfa 100644 --- a/src/alisolarflare/components/insurance/getInsuranceNugget.java +++ b/src/alisolarflare/components/insurance/getInsuranceNugget.java @@ -1,7 +1,6 @@ package alisolarflare.components.insurance; import org.apache.commons.lang3.StringUtils; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; @@ -10,8 +9,7 @@ import alisolarflare.components.insurance.Insurance.InsuranceType; public class getInsuranceNugget extends ModCommand { @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - Player player = (Player) sender; + public boolean OnCommand(Player player, String alias, String[] args) { if (args.length > 0 && StringUtils.isNumeric(args[0])){ player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Nugget, Integer.parseInt(args[0]))); }else{ diff --git a/src/alisolarflare/components/magic/tricks/BoomBowRule.java b/src/alisolarflare/components/magic/tricks/BoomBowRule.java index 44cea27..ca81e35 100644 --- a/src/alisolarflare/components/magic/tricks/BoomBowRule.java +++ b/src/alisolarflare/components/magic/tricks/BoomBowRule.java @@ -1,6 +1,5 @@ package alisolarflare.components.magic.tricks; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; @@ -11,12 +10,7 @@ public class BoomBowRule extends ModCommand{ public static boolean endCrystal; public static boolean localized;; @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (sender instanceof Player == false){ - sender.sendMessage("You must be a player to use this command"); - return false; - } - Player player = (Player) sender; + public boolean OnCommand(Player player, String label, String[] args) { if (player.getName().equals("alisolarflare") == false){ player.sendMessage("You must be alisolarflare to use this command"); return false; diff --git a/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java b/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java index 9536258..d05a2fd 100644 --- a/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java +++ b/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java @@ -1,6 +1,5 @@ package alisolarflare.components.metrics.commands; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; @@ -15,11 +14,13 @@ public class GetLoginMetrics extends ModCommand{ } @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - Player player = (Player) sender; + public boolean OnCommand(Player player, String alias, String[] args) { for (String metric : module.metricsList){ player.sendMessage(metric); } + if (args.length < 1){ + return true; + } return true; } } diff --git a/src/alisolarflare/components/minigames/commands/JoinMinigame.java b/src/alisolarflare/components/minigames/commands/JoinMinigame.java index f7169d5..f3ef12f 100644 --- a/src/alisolarflare/components/minigames/commands/JoinMinigame.java +++ b/src/alisolarflare/components/minigames/commands/JoinMinigame.java @@ -1,6 +1,6 @@ package alisolarflare.components.minigames.commands; -import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import alisolarflare.components.PlayerCommand; import alisolarflare.components.minigames.MinigameComponent; @@ -13,17 +13,17 @@ public class JoinMinigame extends PlayerCommand { } @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - String name = sender.getName(); + public boolean OnCommand(Player player, String arg2, String[] arg3) { + String name = player.getName(); if (module.fighters.contains(name)) { - sender.sendMessage("You are already in the minigame!"); + player.sendMessage("You are already in the minigame!"); return true; } module.fighters.add(name); if (module.fighters.contains(name)) { - sender.sendMessage("You have joined the minigame!"); + player.sendMessage("You have joined the minigame!"); } return true; } diff --git a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java index c286607..5592fdb 100644 --- a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java +++ b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java @@ -1,6 +1,5 @@ package alisolarflare.components.minigames.commands; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.PlayerCommand; @@ -15,21 +14,21 @@ public class LeaveMinigame extends PlayerCommand { } @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - if(!(sender instanceof Player)) - sender.sendMessage("You must be a player to use this command!"); + public boolean OnCommand(Player player, String arg2, String[] arg3) { + if(!(player instanceof Player)) + player.sendMessage("You must be a player to use this command!"); - String name = sender.getName(); + String name = player.getName(); if (!(module.fighters.contains(name))) { - sender.sendMessage("You are not fighting!"); + player.sendMessage("You are not fighting!"); return true; } while(module.fighters.contains(name)){ module.fighters.remove(name); } - sender.sendMessage("You have left the fighters category!"); + player.sendMessage("You have left the fighters category!"); return true; } diff --git a/src/alisolarflare/components/minigames/commands/ListFighters.java b/src/alisolarflare/components/minigames/commands/ListFighters.java index 613d1fd..ba63a5b 100644 --- a/src/alisolarflare/components/minigames/commands/ListFighters.java +++ b/src/alisolarflare/components/minigames/commands/ListFighters.java @@ -1,6 +1,6 @@ package alisolarflare.components.minigames.commands; -import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import alisolarflare.components.PlayerCommand; import alisolarflare.components.minigames.MinigameComponent; @@ -13,8 +13,8 @@ public class ListFighters extends PlayerCommand { } @Override - public boolean OnCommand(CommandSender sender, String arg2, String[] arg3) { - sender.sendMessage(lobby.fighters.toString()); + public boolean OnCommand(Player player, String arg2, String[] arg3) { + player.sendMessage(lobby.fighters.toString()); return true; } @Override diff --git a/src/graveyard/autouhc/idle/AddToUHC.java b/src/graveyard/autouhc/idle/AddToUHC.java index 030fb85..9c4de01 100644 --- a/src/graveyard/autouhc/idle/AddToUHC.java +++ b/src/graveyard/autouhc/idle/AddToUHC.java @@ -1,55 +1,55 @@ -package graveyard.autouhc.idle; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.components.ModCommand; -import graveyard.autouhc.memory.UHCMatch; - -/** - * This class handles the specific command /addToUHC which, in-game, adds a player to a specific UltraHardcore match, that is defined by the constructor: {@linkplain #AddToUHC(UHCMatch)} - * - * @author Alisolarflare - */ -/**@deprecated*/ -public class AddToUHC extends ModCommand { - private UHCMatch match; - - public AddToUHC(UHCMatch match) { - this.match = match; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - // INPUT SANITATION - Player player = (Player) sender; - if (!player.getName().equalsIgnoreCase("alisolarflare") && !player.getName().equalsIgnoreCase("Arsen_Derby_FTW")) { - sender.sendMessage("You must be Ali to add someone else to a UHC, send her a message to change the permissions"); - return false; - } - if (args.length <= 1) { - sender.sendMessage("You must supply at least one playername"); - } - - switch(match.getMatchState()){ - case IDLE: - case WAITING: - case SETUP: - case INTRO: - // Adds players to memory - sender.sendMessage("Adding Players to matchList!"); - for (int i = 0; i > args.length; i++) { - match.getPlayerList().add(args[i]); - }sender.sendMessage("Finished!"); - case PEACE: - case TENSION: - case POWER: - case END: - sender.sendMessage("There is already a match going on!"); - } - - - - return false; - } -} +//package graveyard.autouhc.idle; +// +//import org.bukkit.command.CommandSender; +//import org.bukkit.entity.Player; +// +//import alisolarflare.components.ModCommand; +//import graveyard.autouhc.memory.UHCMatch; +// +///** +// * This class handles the specific command /addToUHC which, in-game, adds a player to a specific UltraHardcore match, that is defined by the constructor: {@linkplain #AddToUHC(UHCMatch)} +// * +// * @author Alisolarflare +// */ +///**@deprecated*/ +//public class AddToUHC extends ModCommand { +// private UHCMatch match; +// +// public AddToUHC(UHCMatch match) { +// this.match = match; +// } +// +// @Override +// public boolean OnCommand(CommandSender sender, String label, String[] args) { +// // INPUT SANITATION +// Player player = (Player) sender; +// if (!player.getName().equalsIgnoreCase("alisolarflare") && !player.getName().equalsIgnoreCase("Arsen_Derby_FTW")) { +// sender.sendMessage("You must be Ali to add someone else to a UHC, send her a message to change the permissions"); +// return false; +// } +// if (args.length <= 1) { +// sender.sendMessage("You must supply at least one playername"); +// } +// +// switch(match.getMatchState()){ +// case IDLE: +// case WAITING: +// case SETUP: +// case INTRO: +// // Adds players to memory +// sender.sendMessage("Adding Players to matchList!"); +// for (int i = 0; i > args.length; i++) { +// match.getPlayerList().add(args[i]); +// }sender.sendMessage("Finished!"); +// case PEACE: +// case TENSION: +// case POWER: +// case END: +// sender.sendMessage("There is already a match going on!"); +// } +// +// +// +// return false; +// } +//} diff --git a/src/graveyard/autouhc/idle/JoinUHC.java b/src/graveyard/autouhc/idle/JoinUHC.java index f1a09a1..1236cd9 100644 --- a/src/graveyard/autouhc/idle/JoinUHC.java +++ b/src/graveyard/autouhc/idle/JoinUHC.java @@ -1,48 +1,48 @@ -package graveyard.autouhc.idle; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.components.ModCommand; -import graveyard.autouhc.memory.UHCMatch; -/**@deprecated*/ -public class JoinUHC extends ModCommand{ - - private UHCMatch match; - - public JoinUHC(UHCMatch match) { - this.match = match; - } - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - if (!(sender instanceof Player)) - return false; - Player player = (Player) sender; - player.sendMessage("Adding you to the UltraHardcore match!"); - switch(match.getMatchState()){ - - //Before the game - case IDLE: - case WAITING: - case SETUP: - case INTRO: - player.sendMessage("Adding you to the UltraHardcore match!"); - match.getPlayerList().add(player.getName()); - break; - - //During the game - case PEACE: - case TENSION: - case POWER: - player.sendMessage("There is currently an UltraHardcore match going on! #POINTTOSPECTATORMODE, tell Ali asap if you see this"); - - //After the game - case END: - player.sendMessage("There is currently an ending ceremony going on! #POINTTOCEREMONY, tell Ali ASAP if you see this"); - - } - - return false; - } -} +//package graveyard.autouhc.idle; +// +//import org.bukkit.command.CommandSender; +//import org.bukkit.entity.Player; +// +//import alisolarflare.components.ModCommand; +//import graveyard.autouhc.memory.UHCMatch; +///**@deprecated*/ +//public class JoinUHC extends ModCommand{ +// +// private UHCMatch match; +// +// public JoinUHC(UHCMatch match) { +// this.match = match; +// } +// +// @Override +// public boolean OnCommand(CommandSender sender, String alias, String[] args) { +// if (!(sender instanceof Player)) +// return false; +// Player player = (Player) sender; +// player.sendMessage("Adding you to the UltraHardcore match!"); +// switch(match.getMatchState()){ +// +// //Before the game +// case IDLE: +// case WAITING: +// case SETUP: +// case INTRO: +// player.sendMessage("Adding you to the UltraHardcore match!"); +// match.getPlayerList().add(player.getName()); +// break; +// +// //During the game +// case PEACE: +// case TENSION: +// case POWER: +// player.sendMessage("There is currently an UltraHardcore match going on! #POINTTOSPECTATORMODE, tell Ali asap if you see this"); +// +// //After the game +// case END: +// player.sendMessage("There is currently an ending ceremony going on! #POINTTOCEREMONY, tell Ali ASAP if you see this"); +// +// } +// +// return false; +// } +//} diff --git a/src/graveyard/autouhc/intro/ConfigureMatch.java b/src/graveyard/autouhc/intro/ConfigureMatch.java index 50ac73d..be784c8 100644 --- a/src/graveyard/autouhc/intro/ConfigureMatch.java +++ b/src/graveyard/autouhc/intro/ConfigureMatch.java @@ -1,19 +1,19 @@ -package graveyard.autouhc.intro; - -import org.bukkit.command.CommandSender; - -import alisolarflare.components.ModCommand; -import graveyard.autouhc.memory.UHCMatch; -/**@deprecated*/ -public class ConfigureMatch extends ModCommand{ - - public ConfigureMatch(UHCMatch match) { - // TODO Auto-generated constructor stub - } - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } -} +//package graveyard.autouhc.intro; +// +//import org.bukkit.command.CommandSender; +// +//import alisolarflare.components.ModCommand; +//import graveyard.autouhc.memory.UHCMatch; +///**@deprecated*/ +//public class ConfigureMatch extends ModCommand{ +// +// public ConfigureMatch(UHCMatch match) { +// // TODO Auto-generated constructor stub +// } +// +// @Override +// public boolean OnCommand(CommandSender sender, String alias, String[] args) { +// // TODO Auto-generated method stub +// return false; +// } +//} diff --git a/src/graveyard/autouhc/intro/IntroductionCutscene.java b/src/graveyard/autouhc/intro/IntroductionCutscene.java index e548dc8..376c3d5 100644 --- a/src/graveyard/autouhc/intro/IntroductionCutscene.java +++ b/src/graveyard/autouhc/intro/IntroductionCutscene.java @@ -1,5 +1,5 @@ -package graveyard.autouhc.intro; -/**@deprecated*/ -public class IntroductionCutscene { - //TODO: Teleport all players to the area. -} +//package graveyard.autouhc.intro; +///**@deprecated*/ +//public class IntroductionCutscene { +// //TODO: Teleport all players to the area. +//} diff --git a/src/graveyard/autouhc/listeners/MatchCyclingListener.java b/src/graveyard/autouhc/listeners/MatchCyclingListener.java index c15fbcd..5ee5bfc 100644 --- a/src/graveyard/autouhc/listeners/MatchCyclingListener.java +++ b/src/graveyard/autouhc/listeners/MatchCyclingListener.java @@ -1,19 +1,19 @@ -package graveyard.autouhc.listeners; - -import org.bukkit.event.Listener; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.scheduler.BukkitTask; - -/** - * Main launcher for the repeating task that activates the - * ghostie powers if an Ultrahardcore Match is going on, - * and it's time for powers to activate - */ -/**@deprecated*/ -public class MatchCyclingListener implements Listener { - public BukkitTask PowerCyclingTask; - - public MatchCyclingListener(JavaPlugin plugin){ - PowerCyclingTask = (new MatchMainLoop()).runTaskTimer(plugin, 20, 20); - } -} +//package graveyard.autouhc.listeners; +// +//import org.bukkit.event.Listener; +//import org.bukkit.plugin.java.JavaPlugin; +//import org.bukkit.scheduler.BukkitTask; +// +///** +// * Main launcher for the repeating task that activates the +// * ghostie powers if an Ultrahardcore Match is going on, +// * and it's time for powers to activate +// */ +///**@deprecated*/ +//public class MatchCyclingListener implements Listener { +// public BukkitTask PowerCyclingTask; +// +// public MatchCyclingListener(JavaPlugin plugin){ +// PowerCyclingTask = (new MatchMainLoop()).runTaskTimer(plugin, 20, 20); +// } +//} diff --git a/src/graveyard/autouhc/listeners/MatchMainLoop.java b/src/graveyard/autouhc/listeners/MatchMainLoop.java index e300596..6b10fb6 100644 --- a/src/graveyard/autouhc/listeners/MatchMainLoop.java +++ b/src/graveyard/autouhc/listeners/MatchMainLoop.java @@ -1,12 +1,12 @@ -package graveyard.autouhc.listeners; - -import org.bukkit.scheduler.BukkitRunnable; -/**@deprecated*/ -public class MatchMainLoop extends BukkitRunnable{ - @Override - public void run() { - - } - - -} +//package graveyard.autouhc.listeners; +// +//import org.bukkit.scheduler.BukkitRunnable; +///**@deprecated*/ +//public class MatchMainLoop extends BukkitRunnable{ +// @Override +// public void run() { +// +// } +// +// +//} diff --git a/src/graveyard/autouhc/memory/MatchState.java b/src/graveyard/autouhc/memory/MatchState.java index 68a6c48..f309e8b 100644 --- a/src/graveyard/autouhc/memory/MatchState.java +++ b/src/graveyard/autouhc/memory/MatchState.java @@ -1,12 +1,12 @@ -package graveyard.autouhc.memory; -/**@deprecated*/ -public enum MatchState { - IDLE, //Idle: Configure Match, Wait: Schedule Match, Intro: Start Match - WAITING, //SETUP: Scheduled Time, INTRO: No Setup - SETUP, //INTRO: Done - INTRO, //Peace: Done, and players ready - PEACE, //Tension: Timer, End: All dead - TENSION, //Power: Timer, End: All dead - POWER, //End: All dead - END//IDLE: Ceremony over -} +//package graveyard.autouhc.memory; +///**@deprecated*/ +//public enum MatchState { +// IDLE, //Idle: Configure Match, Wait: Schedule Match, Intro: Start Match +// WAITING, //SETUP: Scheduled Time, INTRO: No Setup +// SETUP, //INTRO: Done +// INTRO, //Peace: Done, and players ready +// PEACE, //Tension: Timer, End: All dead +// TENSION, //Power: Timer, End: All dead +// POWER, //End: All dead +// END//IDLE: Ceremony over +//} From 6d0ee4e2245de7936664f055a30bf01af544c6d8 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 24 Nov 2016 21:48:27 -0500 Subject: [PATCH 162/263] commented out a *SHIT TON* of code --- .../alilinks/commands/PressAliLink.java | 8 +- .../alilinks/commands/SetAliLink.java | 9 +- .../commands/SetDickmode.java | 10 +- .../easyuhc/commands/SetUHCLobby.java | 5 +- .../easyuhc/commands/SetWorldBorders.java | 4 +- .../easyuhc/commands/ShrinkWorldBorders.java | 4 +- .../easyuhc/commands/SpreadPlayers.java | 4 +- .../easyuhc/commands/StartTimer.java | 4 +- .../components/easyuhc/commands/StartUHC.java | 4 +- .../easyuhc/commands/TeleportToUHC.java | 4 +- .../commands/SetProximityLocation.java | 7 +- .../components/gpowers/commands/PowerAll.java | 4 +- .../gpowers/commands/PowerDown.java | 4 +- .../components/gpowers/commands/PowerUp.java | 7 +- .../minigames/commands/SetColourSpawn.java | 31 ++-- src/graveyard/autouhc/UHCModule.java | 60 ++++---- .../autouhc/controller/SetMatchState.java | 142 +++++++++--------- .../autouhc/intro/ScheduleMatch.java | 38 ++--- src/graveyard/autouhc/intro/StartMatch.java | 104 ++++++------- src/graveyard/autouhc/memory/UHCMatch.java | 102 ++++++------- 20 files changed, 269 insertions(+), 286 deletions(-) diff --git a/src/alisolarflare/components/alilinks/commands/PressAliLink.java b/src/alisolarflare/components/alilinks/commands/PressAliLink.java index e68fdae..68c82fb 100644 --- a/src/alisolarflare/components/alilinks/commands/PressAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/PressAliLink.java @@ -2,7 +2,7 @@ package alisolarflare.components.alilinks.commands; import java.util.List; -import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.PlayerCommand; @@ -18,9 +18,9 @@ public class PressAliLink extends PlayerCommand { } @Override - public boolean OnCommand(CommandSender sender, String label, String[] inputFrequencies) { + public boolean OnCommand(Player player, String label, String[] inputFrequencies) { if (inputFrequencies.length < 1) { - sender.sendMessage("You must specify a link frequency"); + player.sendMessage("You must specify a link frequency"); return false; } @@ -31,7 +31,7 @@ public class PressAliLink extends PlayerCommand { } } } - sender.sendMessage("Link pressed!"); + player.sendMessage("Link pressed!"); return true; } @Override diff --git a/src/alisolarflare/components/alilinks/commands/SetAliLink.java b/src/alisolarflare/components/alilinks/commands/SetAliLink.java index 5aec78d..f253f31 100644 --- a/src/alisolarflare/components/alilinks/commands/SetAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/SetAliLink.java @@ -5,7 +5,6 @@ import java.util.Map; import org.apache.commons.lang3.StringUtils; import org.bukkit.World; -import org.bukkit.command.CommandSender; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; @@ -24,12 +23,10 @@ public class SetAliLink extends PlayerCommand { } @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - Player player = (Player) sender; - player.sendMessage("you pressed"); + public boolean OnCommand(Player player, String label, String[] args) { if (args == null || args.length < 1) { - sender.sendMessage("You must specify a link frequency"); - sender.sendMessage("/pressalilink [name]"); + player.sendMessage("You must specify a link frequency"); + player.sendMessage("/pressalilink [name]"); return false; } diff --git a/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java b/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java index 134ffb0..0d0c5ff 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java +++ b/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java @@ -1,6 +1,6 @@ package alisolarflare.components.creativeboundaries.commands; -import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; @@ -13,19 +13,19 @@ public class SetDickmode extends ModCommand{ } @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { + public boolean OnCommand(Player player, String label, String[] args) { if(args.length < 1){ - sender.sendMessage("You must use True, False, 1, or 0 as arguments!"); + player.sendMessage("You must use True, False, 1, or 0 as arguments!"); return false; } String firstArgument = args[0]; if(firstArgument.startsWith("t") || firstArgument.equals("1")){ - sender.sendMessage("Dickmode has been turned on!"); + player.sendMessage("Dickmode has been turned on!"); dickMode = true; return true; } if(firstArgument.startsWith("f") || firstArgument.equals("0")){ - sender.sendMessage("Dickmode has been turned off!"); + player.sendMessage("Dickmode has been turned off!"); dickMode = false; return true; } diff --git a/src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java b/src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java index 907a1b8..f7e6bd4 100644 --- a/src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java +++ b/src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java @@ -1,6 +1,5 @@ package alisolarflare.components.easyuhc.commands; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; @@ -13,8 +12,8 @@ public class SetUHCLobby extends ModCommand{ } @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - module.lobbyLocation = ((Player) sender).getLocation(); + public boolean OnCommand(Player player, String alias, String[] args) { + module.lobbyLocation = player.getLocation(); return false; } diff --git a/src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java b/src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java index 69ff39a..24d5b2e 100644 --- a/src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java +++ b/src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java @@ -1,13 +1,13 @@ package alisolarflare.components.easyuhc.commands; -import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; public class SetWorldBorders extends ModCommand { @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { + public boolean OnCommand(Player player, String alias, String[] args) { return false; } diff --git a/src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java b/src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java index 4cf60d2..0f80ff7 100644 --- a/src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java +++ b/src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java @@ -1,13 +1,13 @@ package alisolarflare.components.easyuhc.commands; -import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; public class ShrinkWorldBorders extends ModCommand { @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { + public boolean OnCommand(Player player, String alias, String[] args) { // TODO Auto-generated method stub return false; } diff --git a/src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java b/src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java index cb9e621..2c054b6 100644 --- a/src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java +++ b/src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java @@ -1,13 +1,13 @@ package alisolarflare.components.easyuhc.commands; -import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; public class SpreadPlayers extends ModCommand{ @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { + public boolean OnCommand(Player player, String alias, String[] args) { // TODO Auto-generated method stub return false; } diff --git a/src/alisolarflare/components/easyuhc/commands/StartTimer.java b/src/alisolarflare/components/easyuhc/commands/StartTimer.java index 9af948a..b7c09fe 100644 --- a/src/alisolarflare/components/easyuhc/commands/StartTimer.java +++ b/src/alisolarflare/components/easyuhc/commands/StartTimer.java @@ -1,13 +1,13 @@ package alisolarflare.components.easyuhc.commands; -import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; public class StartTimer extends ModCommand{ @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { + public boolean OnCommand(Player player, String alias, String[] args) { // TODO Auto-generated method stub return false; } diff --git a/src/alisolarflare/components/easyuhc/commands/StartUHC.java b/src/alisolarflare/components/easyuhc/commands/StartUHC.java index 04bb96a..334245c 100644 --- a/src/alisolarflare/components/easyuhc/commands/StartUHC.java +++ b/src/alisolarflare/components/easyuhc/commands/StartUHC.java @@ -1,13 +1,13 @@ package alisolarflare.components.easyuhc.commands; -import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; public class StartUHC extends ModCommand{ @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { + public boolean OnCommand(Player player, String alias, String[] args) { // TODO Auto-generated method stub return false; } diff --git a/src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java b/src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java index 856b4ab..8fe3876 100644 --- a/src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java +++ b/src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java @@ -1,13 +1,13 @@ package alisolarflare.components.easyuhc.commands; -import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import alisolarflare.components.PlayerCommand; public class TeleportToUHC extends PlayerCommand{ @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { + public boolean OnCommand(Player player, String alias, String[] args) { // TODO Auto-generated method stub return false; } diff --git a/src/alisolarflare/components/flairdoor/commands/SetProximityLocation.java b/src/alisolarflare/components/flairdoor/commands/SetProximityLocation.java index db57a00..8277889 100644 --- a/src/alisolarflare/components/flairdoor/commands/SetProximityLocation.java +++ b/src/alisolarflare/components/flairdoor/commands/SetProximityLocation.java @@ -1,6 +1,5 @@ package alisolarflare.components.flairdoor.commands; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; @@ -15,13 +14,11 @@ public class SetProximityLocation extends ModCommand{ } @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { + public boolean OnCommand(Player player, String alias, String[] args) { if (args.length < 1){ - sender.sendMessage("You must enter an argument"); + player.sendMessage("You must enter an argument"); return false; } - - Player player = (Player) sender; String firstChar = args[0].substring(0, 1); switch(firstChar){ diff --git a/src/alisolarflare/components/gpowers/commands/PowerAll.java b/src/alisolarflare/components/gpowers/commands/PowerAll.java index e69874a..1203005 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerAll.java +++ b/src/alisolarflare/components/gpowers/commands/PowerAll.java @@ -1,6 +1,6 @@ package alisolarflare.components.gpowers.commands; -import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; import alisolarflare.components.gpowers.GPowerMemory; @@ -13,7 +13,7 @@ public class PowerAll extends ModCommand{ this.gPowerMemory = gPowerMemory; } @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { + public boolean OnCommand(Player player, String alias, String[] args) { for (poweredPlayer poweredPlayer : gPowerMemory.poweredPlayerList.values()){ poweredPlayer.isPowersActive = true; } diff --git a/src/alisolarflare/components/gpowers/commands/PowerDown.java b/src/alisolarflare/components/gpowers/commands/PowerDown.java index 1dbe47b..d19c679 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/components/gpowers/commands/PowerDown.java @@ -1,6 +1,5 @@ package alisolarflare.components.gpowers.commands; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.PlayerCommand; @@ -15,8 +14,7 @@ public class PowerDown extends PlayerCommand { } @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - Player player = (Player) sender; + public boolean OnCommand(Player player, String label, String[] args) { gPowerMemory.PowerDownPlayer(player); return true; } diff --git a/src/alisolarflare/components/gpowers/commands/PowerUp.java b/src/alisolarflare/components/gpowers/commands/PowerUp.java index 00de691..c64a623 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/components/gpowers/commands/PowerUp.java @@ -1,6 +1,5 @@ package alisolarflare.components.gpowers.commands; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.PlayerCommand; @@ -15,11 +14,7 @@ public class PowerUp extends PlayerCommand { } @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - if (!(sender instanceof Player)) - sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong"); - - Player player = (Player) sender; + public boolean OnCommand(Player player, String label, String[] args) { gPowerMemory.PowerUpPlayer(player); return true; } diff --git a/src/alisolarflare/components/minigames/commands/SetColourSpawn.java b/src/alisolarflare/components/minigames/commands/SetColourSpawn.java index 5582fec..0a46cf3 100644 --- a/src/alisolarflare/components/minigames/commands/SetColourSpawn.java +++ b/src/alisolarflare/components/minigames/commands/SetColourSpawn.java @@ -1,6 +1,5 @@ package alisolarflare.components.minigames.commands; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import alisolarflare.components.ModCommand; @@ -13,11 +12,9 @@ public class SetColourSpawn extends ModCommand{ this.spawnSet = spawnSet; } @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - Player player = (Player) sender; - + public boolean OnCommand(Player player, String label, String[] args) { if(args.length == 0){ - sender.sendMessage("ERROR: Arguments required."); + player.sendMessage("ERROR: Arguments required."); return false; } @@ -26,34 +23,34 @@ public class SetColourSpawn extends ModCommand{ input.toLowerCase(); switch(input){ case ("r"): - sender.sendMessage("Setting Red Spawn..."); + player.sendMessage("Setting Red Spawn..."); spawnSet.setRSpawn(player.getLocation()); - sender.sendMessage("Red Spawn Set!"); + player.sendMessage("Red Spawn Set!"); break; case ("o"): - sender.sendMessage("Setting Orange Spawn..."); + player.sendMessage("Setting Orange Spawn..."); spawnSet.setRSpawn(player.getLocation()); - sender.sendMessage("Orange Spawn Set!"); + player.sendMessage("Orange Spawn Set!"); break; case ("y"): - sender.sendMessage("Setting Yellow Spawn..."); + player.sendMessage("Setting Yellow Spawn..."); spawnSet.setRSpawn(player.getLocation()); - sender.sendMessage("Yellow Spawn Set!"); + player.sendMessage("Yellow Spawn Set!"); break; case ("g"): - sender.sendMessage("Setting Green Spawn..."); + player.sendMessage("Setting Green Spawn..."); spawnSet.setRSpawn(player.getLocation()); - sender.sendMessage("Green Spawn Set!"); + player.sendMessage("Green Spawn Set!"); break; case ("b"): - sender.sendMessage("Setting Blue Spawn..."); + player.sendMessage("Setting Blue Spawn..."); spawnSet.setRSpawn(player.getLocation()); - sender.sendMessage("Blue Spawn Set!"); + player.sendMessage("Blue Spawn Set!"); break; case ("p"): - sender.sendMessage("Setting Purple Spawn..."); + player.sendMessage("Setting Purple Spawn..."); spawnSet.setRSpawn(player.getLocation()); - sender.sendMessage("Purple Spawn Set!"); + player.sendMessage("Purple Spawn Set!"); break; } return true; diff --git a/src/graveyard/autouhc/UHCModule.java b/src/graveyard/autouhc/UHCModule.java index 861a834..b33ce22 100644 --- a/src/graveyard/autouhc/UHCModule.java +++ b/src/graveyard/autouhc/UHCModule.java @@ -1,30 +1,30 @@ -package graveyard.autouhc; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.components.Component; -import graveyard.autouhc.memory.MatchState; -import graveyard.autouhc.memory.UHCMatch; - -/**@deprecated*/ -public class UHCModule extends Component { - public UHCMatch match; - - public void register(JavaPlugin plugin) { - - - if (plugin.getConfig().contains("UHCMatchState")){ - match = new UHCMatch(plugin.getConfig(), MatchState.valueOf(plugin.getConfig().getString("UHCMatchState"))); - }else{ - match = new UHCMatch(plugin.getConfig(), MatchState.IDLE); - } - - - //registerCommand(plugin, new SetMatchState(match)); - //registerCommand(plugin, new AddToUHC(match)); - //registerCommand(plugin, new JoinUHC(match)); - //registerCommand(plugin, new StartMatch(match)); - //registerCommand(plugin, new ConfigureMatch(match)); - //registerCommand(plugin, new ScheduleMatch(match)); - - } -} +//package graveyard.autouhc; +//import org.bukkit.plugin.java.JavaPlugin; +// +//import alisolarflare.components.Component; +//import graveyard.autouhc.memory.MatchState; +//import graveyard.autouhc.memory.UHCMatch; +// +///**@deprecated*/ +//public class UHCModule extends Component { +// public UHCMatch match; +// +// public void register(JavaPlugin plugin) { +// +// +// if (plugin.getConfig().contains("UHCMatchState")){ +// match = new UHCMatch(plugin.getConfig(), MatchState.valueOf(plugin.getConfig().getString("UHCMatchState"))); +// }else{ +// match = new UHCMatch(plugin.getConfig(), MatchState.IDLE); +// } +// +// +// //registerCommand(plugin, new SetMatchState(match)); +// //registerCommand(plugin, new AddToUHC(match)); +// //registerCommand(plugin, new JoinUHC(match)); +// //registerCommand(plugin, new StartMatch(match)); +// //registerCommand(plugin, new ConfigureMatch(match)); +// //registerCommand(plugin, new ScheduleMatch(match)); +// +// } +//} diff --git a/src/graveyard/autouhc/controller/SetMatchState.java b/src/graveyard/autouhc/controller/SetMatchState.java index bced5be..0f858f8 100644 --- a/src/graveyard/autouhc/controller/SetMatchState.java +++ b/src/graveyard/autouhc/controller/SetMatchState.java @@ -1,71 +1,71 @@ -package graveyard.autouhc.controller; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import alisolarflare.components.ModCommand; -import graveyard.autouhc.memory.MatchState; -import graveyard.autouhc.memory.UHCMatch; -/**@deprecated*/ -public class SetMatchState extends ModCommand{ - - UHCMatch match; - public SetMatchState(UHCMatch match) { - this.match = match; - } - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - if (!(sender instanceof Player)){ - sender.sendMessage("You must be a player to use this command!"); - return false; - } - - Player player = (Player) sender; - - if (player.getName().equalsIgnoreCase("alisolarflare") && player.getName().equalsIgnoreCase("Arsen_Derby_FTW")){ - sender.sendMessage("You must be either Ali or Arsen to use this command!"); - return false; - } - - - if(args.length < 1 ){ - player.sendMessage("Usage: /setMatchState [stateToBeSet]"); - player.sendMessage("States: IDLE, WAITING, SETUP, INTRO, PEACE, POWER, TENSION, END"); - return false; - } - - String inputState = args[0]; - boolean inputIsValidState = false; - for (MatchState defaultMatchState : MatchState.values()){ - if(inputState.equalsIgnoreCase(defaultMatchState.toString())){ - inputIsValidState = true; - } - } - - if (inputIsValidState){ - match.setMatchState(MatchState.valueOf(inputState)); - player.sendMessage("Match State set to: " + match.getMatchState().toString() + "!"); - }else{ - player.sendMessage("Error, could not parse state."); - player.sendMessage("Valid States: IDLE, WAITING, SETUP, INTRO, PEACE, POWER, TENSION, END"); - return false; - } - - - return false; - } - - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return true; - } - - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - -} +//package graveyard.autouhc.controller; +// +//import org.bukkit.command.CommandSender; +//import org.bukkit.entity.Player; +// +//import alisolarflare.components.ModCommand; +//import graveyard.autouhc.memory.MatchState; +//import graveyard.autouhc.memory.UHCMatch; +///**@deprecated*/ +//public class SetMatchState extends ModCommand{ +// +// UHCMatch match; +// public SetMatchState(UHCMatch match) { +// this.match = match; +// } +// +// @Override +// public boolean OnCommand(CommandSender sender, String alias, String[] args) { +// if (!(sender instanceof Player)){ +// sender.sendMessage("You must be a player to use this command!"); +// return false; +// } +// +// Player player = (Player) sender; +// +// if (player.getName().equalsIgnoreCase("alisolarflare") && player.getName().equalsIgnoreCase("Arsen_Derby_FTW")){ +// sender.sendMessage("You must be either Ali or Arsen to use this command!"); +// return false; +// } +// +// +// if(args.length < 1 ){ +// player.sendMessage("Usage: /setMatchState [stateToBeSet]"); +// player.sendMessage("States: IDLE, WAITING, SETUP, INTRO, PEACE, POWER, TENSION, END"); +// return false; +// } +// +// String inputState = args[0]; +// boolean inputIsValidState = false; +// for (MatchState defaultMatchState : MatchState.values()){ +// if(inputState.equalsIgnoreCase(defaultMatchState.toString())){ +// inputIsValidState = true; +// } +// } +// +// if (inputIsValidState){ +// match.setMatchState(MatchState.valueOf(inputState)); +// player.sendMessage("Match State set to: " + match.getMatchState().toString() + "!"); +// }else{ +// player.sendMessage("Error, could not parse state."); +// player.sendMessage("Valid States: IDLE, WAITING, SETUP, INTRO, PEACE, POWER, TENSION, END"); +// return false; +// } +// +// +// return false; +// } +// +// @Override +// public boolean GetPlayerOnly() { +// // TODO Auto-generated method stub +// return true; +// } +// +// @Override +// public boolean GetModOnly() { +// // TODO Auto-generated method stub +// return false; +// } +// +//} diff --git a/src/graveyard/autouhc/intro/ScheduleMatch.java b/src/graveyard/autouhc/intro/ScheduleMatch.java index 670826e..b887e1c 100644 --- a/src/graveyard/autouhc/intro/ScheduleMatch.java +++ b/src/graveyard/autouhc/intro/ScheduleMatch.java @@ -1,19 +1,19 @@ -package graveyard.autouhc.intro; - -import org.bukkit.command.CommandSender; - -import alisolarflare.components.ModCommand; -import graveyard.autouhc.memory.UHCMatch; -/**@deprecated*/ -public class ScheduleMatch extends ModCommand{ - - public ScheduleMatch(UHCMatch match) { - // TODO Auto-generated constructor stub - } - - @Override - public boolean OnCommand(CommandSender sender, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } -} +//package graveyard.autouhc.intro; +// +//import org.bukkit.command.CommandSender; +// +//import alisolarflare.components.ModCommand; +//import graveyard.autouhc.memory.UHCMatch; +///**@deprecated*/ +//public class ScheduleMatch extends ModCommand{ +// +// public ScheduleMatch(UHCMatch match) { +// // TODO Auto-generated constructor stub +// } +// +// @Override +// public boolean OnCommand(CommandSender sender, String alias, String[] args) { +// // TODO Auto-generated method stub +// return false; +// } +//} diff --git a/src/graveyard/autouhc/intro/StartMatch.java b/src/graveyard/autouhc/intro/StartMatch.java index dfc4f54..5ba3fae 100644 --- a/src/graveyard/autouhc/intro/StartMatch.java +++ b/src/graveyard/autouhc/intro/StartMatch.java @@ -1,52 +1,52 @@ -package graveyard.autouhc.intro; - -import org.bukkit.command.CommandSender; - -import alisolarflare.components.ModCommand; -import graveyard.autouhc.memory.MatchState; -import graveyard.autouhc.memory.UHCMatch; - -/**@deprecated*/ -public class StartMatch extends ModCommand { - private UHCMatch match; - /**@deprecated*/ - public StartMatch(UHCMatch match) { - this.match = match; - } - - @Override - public boolean OnCommand(CommandSender sender, String label, String[] args) { - - if (!sender.hasPermission("moderator") && !(sender.getName() == "")) - sender.sendMessage("You must be a moderator or Arsenalis to use this command! " - + "Contact a TBMC dev if you think this is wrong"); - - //ACTIVATES MATCH - switch(match.getMatchState()){ - case IDLE: - sender.sendMessage("There is currently a match ready... Activating..."); - match.setMatchState(MatchState.INTRO); - break; - - case WAITING: - sender.sendMessage("There currently a match planned for: TIME:TIME:TIME"); - break; - - case END: - sender.sendMessage("The match has ended! Would you like to restart using current settings?"); - break; - - default: - sender.sendMessage("You cannot start a match now, one is already in progress!"); - } - - return false; - - - } - - @Override - public String GetCommandPath() { - return "startmatch"; - } -} +//package graveyard.autouhc.intro; +// +//import org.bukkit.command.CommandSender; +// +//import alisolarflare.components.ModCommand; +//import graveyard.autouhc.memory.MatchState; +//import graveyard.autouhc.memory.UHCMatch; +// +///**@deprecated*/ +//public class StartMatch extends ModCommand { +// private UHCMatch match; +// /**@deprecated*/ +// public StartMatch(UHCMatch match) { +// this.match = match; +// } +// +// @Override +// public boolean OnCommand(CommandSender sender, String label, String[] args) { +// +// if (!sender.hasPermission("moderator") && !(sender.getName() == "")) +// sender.sendMessage("You must be a moderator or Arsenalis to use this command! " +// + "Contact a TBMC dev if you think this is wrong"); +// +// //ACTIVATES MATCH +// switch(match.getMatchState()){ +// case IDLE: +// sender.sendMessage("There is currently a match ready... Activating..."); +// match.setMatchState(MatchState.INTRO); +// break; +// +// case WAITING: +// sender.sendMessage("There currently a match planned for: TIME:TIME:TIME"); +// break; +// +// case END: +// sender.sendMessage("The match has ended! Would you like to restart using current settings?"); +// break; +// +// default: +// sender.sendMessage("You cannot start a match now, one is already in progress!"); +// } +// +// return false; +// +// +// } +// +// @Override +// public String GetCommandPath() { +// return "startmatch"; +// } +//} diff --git a/src/graveyard/autouhc/memory/UHCMatch.java b/src/graveyard/autouhc/memory/UHCMatch.java index 3bbf260..bf43e13 100644 --- a/src/graveyard/autouhc/memory/UHCMatch.java +++ b/src/graveyard/autouhc/memory/UHCMatch.java @@ -1,51 +1,51 @@ -package graveyard.autouhc.memory; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.Location; -import org.bukkit.configuration.file.FileConfiguration; - -/**@deprecated*/ -public class UHCMatch { - private FileConfiguration config; - private MatchState matchState = MatchState.IDLE; - private List playerList = new ArrayList(); - - private Location lobbyLocation; - public UHCMatch(FileConfiguration fileConfiguration, MatchState state) { - this.config = fileConfiguration; - this.matchState = state; - } - - public MatchState getMatchState(){ - return matchState; - } - - public void setMatchState(MatchState newMS){ - matchState = newMS; - config.set("UHCMatchState", newMS.toString()); - switch(newMS){ - default: - break; - } - } - - public List getPlayerList() { - return playerList; - } - - public void setPlayerList(List playerList) { - this.playerList = playerList; - } - - public Location getLobbyLocation() { - - return lobbyLocation; - } - - public void setLobbyLocation(Location lobbyLocation) { - this.lobbyLocation = lobbyLocation; - } - -} +//package graveyard.autouhc.memory; +// +//import java.util.ArrayList; +//import java.util.List; +// +//import org.bukkit.Location; +//import org.bukkit.configuration.file.FileConfiguration; +// +///**@deprecated*/ +//public class UHCMatch { +// private FileConfiguration config; +// private MatchState matchState = MatchState.IDLE; +// private List playerList = new ArrayList(); +// +// private Location lobbyLocation; +// public UHCMatch(FileConfiguration fileConfiguration, MatchState state) { +// this.config = fileConfiguration; +// this.matchState = state; +// } +// +// public MatchState getMatchState(){ +// return matchState; +// } +// +// public void setMatchState(MatchState newMS){ +// matchState = newMS; +// config.set("UHCMatchState", newMS.toString()); +// switch(newMS){ +// default: +// break; +// } +// } +// +// public List getPlayerList() { +// return playerList; +// } +// +// public void setPlayerList(List playerList) { +// this.playerList = playerList; +// } +// +// public Location getLobbyLocation() { +// +// return lobbyLocation; +// } +// +// public void setLobbyLocation(Location lobbyLocation) { +// this.lobbyLocation = lobbyLocation; +// } +// +//} From 173c0d5a70123f937c28d2b2fea1a078a613939c Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 24 Nov 2016 22:12:09 -0500 Subject: [PATCH 163/263] Changed a bit of architecture --- .../{components => architecture}/Component.java | 2 +- .../commands}/BaseCommand.java | 2 +- .../commands}/ModCommand.java | 2 +- .../commands}/PlayerCommand.java | 2 +- .../components/alilinks/AliLinkComponent.java | 2 +- .../alilinks/commands/PressAliLink.java | 2 +- .../alilinks/commands/SetAliLink.java | 2 +- .../bankchest/BankChestComponent.java | 2 +- .../components/bankchest/CreateBankChest.java | 2 +- .../CreativeBoundariesComponent.java | 2 +- .../creativeboundaries/commands/Cbgm0.java | 2 +- .../creativeboundaries/commands/Cbgm1.java | 2 +- .../commands/SetDickmode.java | 2 +- .../components/easyuhc/EasyUHCComponent.java | 2 +- .../easyuhc/commands/ActivatePowers.java | 2 +- .../easyuhc/commands/SetUHCLobby.java | 2 +- .../easyuhc/commands/SetWorldBorders.java | 2 +- .../easyuhc/commands/ShrinkWorldBorders.java | 2 +- .../easyuhc/commands/SpreadPlayers.java | 2 +- .../components/easyuhc/commands/StartTimer.java | 2 +- .../components/easyuhc/commands/StartUHC.java | 2 +- .../easyuhc/commands/TeleportToUHC.java | 2 +- .../flairdoor/FlairDoorComponent.java | 8 ++++---- .../{commands => flairme}/FlairMe.java | 4 ++-- .../PlayerProximityTask.java | 2 +- .../PlayerProximityTaskLauncher.java | 2 +- .../SetProximityLocation.java | 4 ++-- .../components/gpowers/GPowerComponent.java | 10 +++++----- .../components/gpowers/commands/GPower.java | 2 +- .../Enchanter.java} | 17 +++++++++++------ .../gpowers/listeners/gPowerListener.java | 13 ------------- .../{commands => powerstate}/PowerAll.java | 4 ++-- .../{commands => powerstate}/PowerDown.java | 4 ++-- .../{commands => powerstate}/PowerUp.java | 4 ++-- .../insurance/InsuranceComponent.java | 2 +- .../components/insurance/getInsurance.java | 2 +- .../components/insurance/getInsuranceBar.java | 2 +- .../components/insurance/getInsuranceBlock.java | 2 +- .../insurance/getInsuranceNugget.java | 2 +- .../components/magic/MagicComponent.java | 2 +- .../components/magic/tricks/BoomBowRule.java | 2 +- .../components/metrics/MetricsComponent.java | 6 +++--- .../PlayerJoinListener.java | 2 +- .../{commands => output}/GetLoginMetrics.java | 4 ++-- .../components/minigames/MinigameComponent.java | 2 +- .../minigames/commands/JoinMinigame.java | 2 +- .../minigames/commands/LeaveMinigame.java | 2 +- .../minigames/commands/ListFighters.java | 2 +- .../minigames/commands/SetColourSpawn.java | 2 +- src/graveyard/shulker/AliShulkerModule.java | 2 +- 50 files changed, 74 insertions(+), 82 deletions(-) rename src/alisolarflare/{components => architecture}/Component.java (95%) rename src/alisolarflare/{components => architecture/commands}/BaseCommand.java (70%) rename src/alisolarflare/{components => architecture/commands}/ModCommand.java (85%) rename src/alisolarflare/{components => architecture/commands}/PlayerCommand.java (94%) rename src/alisolarflare/components/flairdoor/{commands => flairme}/FlairMe.java (83%) rename src/alisolarflare/components/flairdoor/{listeners => playerproximity}/PlayerProximityTask.java (96%) rename src/alisolarflare/components/flairdoor/{listeners => playerproximity}/PlayerProximityTaskLauncher.java (86%) rename src/alisolarflare/components/flairdoor/{commands => playerproximity}/SetProximityLocation.java (90%) rename src/alisolarflare/components/gpowers/{listeners/gPowerApplyingTask.java => enchant/Enchanter.java} (85%) delete mode 100644 src/alisolarflare/components/gpowers/listeners/gPowerListener.java rename src/alisolarflare/components/gpowers/{commands => powerstate}/PowerAll.java (86%) rename src/alisolarflare/components/gpowers/{commands => powerstate}/PowerDown.java (79%) rename src/alisolarflare/components/gpowers/{commands => powerstate}/PowerUp.java (79%) rename src/alisolarflare/components/metrics/{listeners => collection}/PlayerJoinListener.java (95%) rename src/alisolarflare/components/metrics/{commands => output}/GetLoginMetrics.java (82%) diff --git a/src/alisolarflare/components/Component.java b/src/alisolarflare/architecture/Component.java similarity index 95% rename from src/alisolarflare/components/Component.java rename to src/alisolarflare/architecture/Component.java index 86a31e7..e2c4cd2 100644 --- a/src/alisolarflare/components/Component.java +++ b/src/alisolarflare/architecture/Component.java @@ -1,4 +1,4 @@ -package alisolarflare.components; +package alisolarflare.architecture; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.event.Listener; diff --git a/src/alisolarflare/components/BaseCommand.java b/src/alisolarflare/architecture/commands/BaseCommand.java similarity index 70% rename from src/alisolarflare/components/BaseCommand.java rename to src/alisolarflare/architecture/commands/BaseCommand.java index 59a09db..bece01e 100644 --- a/src/alisolarflare/components/BaseCommand.java +++ b/src/alisolarflare/architecture/commands/BaseCommand.java @@ -1,4 +1,4 @@ -package alisolarflare.components; +package alisolarflare.architecture.commands; import buttondevteam.lib.chat.TBMCCommandBase; diff --git a/src/alisolarflare/components/ModCommand.java b/src/alisolarflare/architecture/commands/ModCommand.java similarity index 85% rename from src/alisolarflare/components/ModCommand.java rename to src/alisolarflare/architecture/commands/ModCommand.java index 6813f4f..3c13446 100644 --- a/src/alisolarflare/components/ModCommand.java +++ b/src/alisolarflare/architecture/commands/ModCommand.java @@ -1,4 +1,4 @@ -package alisolarflare.components; +package alisolarflare.architecture.commands; public abstract class ModCommand extends PlayerCommand{ diff --git a/src/alisolarflare/components/PlayerCommand.java b/src/alisolarflare/architecture/commands/PlayerCommand.java similarity index 94% rename from src/alisolarflare/components/PlayerCommand.java rename to src/alisolarflare/architecture/commands/PlayerCommand.java index 9fa4439..8d85fbf 100644 --- a/src/alisolarflare/components/PlayerCommand.java +++ b/src/alisolarflare/architecture/commands/PlayerCommand.java @@ -1,4 +1,4 @@ -package alisolarflare.components; +package alisolarflare.architecture.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/alisolarflare/components/alilinks/AliLinkComponent.java b/src/alisolarflare/components/alilinks/AliLinkComponent.java index 85e1fac..8812dbf 100644 --- a/src/alisolarflare/components/alilinks/AliLinkComponent.java +++ b/src/alisolarflare/components/alilinks/AliLinkComponent.java @@ -7,7 +7,7 @@ import java.util.Map; import org.bukkit.Server; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.Component; +import alisolarflare.architecture.Component; import alisolarflare.components.alilinks.commands.PressAliLink; import alisolarflare.components.alilinks.commands.SetAliLink; import alisolarflare.components.alilinks.entities.Link; diff --git a/src/alisolarflare/components/alilinks/commands/PressAliLink.java b/src/alisolarflare/components/alilinks/commands/PressAliLink.java index 68c82fb..8f9486a 100644 --- a/src/alisolarflare/components/alilinks/commands/PressAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/PressAliLink.java @@ -5,7 +5,7 @@ import java.util.List; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.PlayerCommand; +import alisolarflare.architecture.commands.PlayerCommand; import alisolarflare.components.alilinks.entities.Link; public class PressAliLink extends PlayerCommand { diff --git a/src/alisolarflare/components/alilinks/commands/SetAliLink.java b/src/alisolarflare/components/alilinks/commands/SetAliLink.java index f253f31..a7eda06 100644 --- a/src/alisolarflare/components/alilinks/commands/SetAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/SetAliLink.java @@ -8,7 +8,7 @@ import org.bukkit.World; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; -import alisolarflare.components.PlayerCommand; +import alisolarflare.architecture.commands.PlayerCommand; import alisolarflare.components.alilinks.entities.Link; public class SetAliLink extends PlayerCommand { diff --git a/src/alisolarflare/components/bankchest/BankChestComponent.java b/src/alisolarflare/components/bankchest/BankChestComponent.java index 0fe9ea6..e331e28 100644 --- a/src/alisolarflare/components/bankchest/BankChestComponent.java +++ b/src/alisolarflare/components/bankchest/BankChestComponent.java @@ -2,7 +2,7 @@ package alisolarflare.components.bankchest; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.Component; +import alisolarflare.architecture.Component; public class BankChestComponent extends Component { diff --git a/src/alisolarflare/components/bankchest/CreateBankChest.java b/src/alisolarflare/components/bankchest/CreateBankChest.java index 41c85c6..e73a27f 100644 --- a/src/alisolarflare/components/bankchest/CreateBankChest.java +++ b/src/alisolarflare/components/bankchest/CreateBankChest.java @@ -2,7 +2,7 @@ package alisolarflare.components.bankchest; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; public class CreateBankChest extends ModCommand { diff --git a/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java b/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java index 762ebd1..999036c 100644 --- a/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java +++ b/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java @@ -6,7 +6,7 @@ import java.util.List; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.Component; +import alisolarflare.architecture.Component; import alisolarflare.components.creativeboundaries.commands.Cbgm0; import alisolarflare.components.creativeboundaries.commands.Cbgm1; import alisolarflare.components.creativeboundaries.commands.SetDickmode; diff --git a/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java index 607dc8f..eba221e 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java +++ b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java @@ -5,7 +5,7 @@ import java.util.List; import org.bukkit.GameMode; import org.bukkit.entity.Player; -import alisolarflare.components.PlayerCommand; +import alisolarflare.architecture.commands.PlayerCommand; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class Cbgm0 extends PlayerCommand{ diff --git a/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java b/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java index 5416aba..cf0dd7d 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java +++ b/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java @@ -11,7 +11,7 @@ import com.palmergames.bukkit.towny.object.Town; import com.palmergames.bukkit.towny.object.TownBlock; import com.palmergames.bukkit.towny.object.TownyUniverse; -import alisolarflare.components.PlayerCommand; +import alisolarflare.architecture.commands.PlayerCommand; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class Cbgm1 extends PlayerCommand { diff --git a/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java b/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java index 0d0c5ff..f4c484b 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java +++ b/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java @@ -2,7 +2,7 @@ package alisolarflare.components.creativeboundaries.commands; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class SetDickmode extends ModCommand{ diff --git a/src/alisolarflare/components/easyuhc/EasyUHCComponent.java b/src/alisolarflare/components/easyuhc/EasyUHCComponent.java index 3487368..15d0e3d 100644 --- a/src/alisolarflare/components/easyuhc/EasyUHCComponent.java +++ b/src/alisolarflare/components/easyuhc/EasyUHCComponent.java @@ -3,7 +3,7 @@ package alisolarflare.components.easyuhc; import org.bukkit.Location; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.Component; +import alisolarflare.architecture.Component; import alisolarflare.components.easyuhc.commands.ActivatePowers; import alisolarflare.components.easyuhc.commands.SetUHCLobby; import alisolarflare.components.easyuhc.commands.SetWorldBorders; diff --git a/src/alisolarflare/components/easyuhc/commands/ActivatePowers.java b/src/alisolarflare/components/easyuhc/commands/ActivatePowers.java index 0933d54..7af36e2 100644 --- a/src/alisolarflare/components/easyuhc/commands/ActivatePowers.java +++ b/src/alisolarflare/components/easyuhc/commands/ActivatePowers.java @@ -2,7 +2,7 @@ package alisolarflare.components.easyuhc.commands; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; public class ActivatePowers extends ModCommand{ diff --git a/src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java b/src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java index f7e6bd4..0a56438 100644 --- a/src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java +++ b/src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java @@ -2,7 +2,7 @@ package alisolarflare.components.easyuhc.commands; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; import alisolarflare.components.easyuhc.EasyUHCComponent; public class SetUHCLobby extends ModCommand{ diff --git a/src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java b/src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java index 24d5b2e..bfc52d9 100644 --- a/src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java +++ b/src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java @@ -2,7 +2,7 @@ package alisolarflare.components.easyuhc.commands; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; public class SetWorldBorders extends ModCommand { diff --git a/src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java b/src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java index 0f80ff7..af993f2 100644 --- a/src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java +++ b/src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java @@ -2,7 +2,7 @@ package alisolarflare.components.easyuhc.commands; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; public class ShrinkWorldBorders extends ModCommand { diff --git a/src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java b/src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java index 2c054b6..6e402c2 100644 --- a/src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java +++ b/src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java @@ -2,7 +2,7 @@ package alisolarflare.components.easyuhc.commands; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; public class SpreadPlayers extends ModCommand{ diff --git a/src/alisolarflare/components/easyuhc/commands/StartTimer.java b/src/alisolarflare/components/easyuhc/commands/StartTimer.java index b7c09fe..2859935 100644 --- a/src/alisolarflare/components/easyuhc/commands/StartTimer.java +++ b/src/alisolarflare/components/easyuhc/commands/StartTimer.java @@ -2,7 +2,7 @@ package alisolarflare.components.easyuhc.commands; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; public class StartTimer extends ModCommand{ diff --git a/src/alisolarflare/components/easyuhc/commands/StartUHC.java b/src/alisolarflare/components/easyuhc/commands/StartUHC.java index 334245c..4f5dff4 100644 --- a/src/alisolarflare/components/easyuhc/commands/StartUHC.java +++ b/src/alisolarflare/components/easyuhc/commands/StartUHC.java @@ -2,7 +2,7 @@ package alisolarflare.components.easyuhc.commands; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; public class StartUHC extends ModCommand{ diff --git a/src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java b/src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java index 8fe3876..3b64c82 100644 --- a/src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java +++ b/src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java @@ -2,7 +2,7 @@ package alisolarflare.components.easyuhc.commands; import org.bukkit.entity.Player; -import alisolarflare.components.PlayerCommand; +import alisolarflare.architecture.commands.PlayerCommand; public class TeleportToUHC extends PlayerCommand{ diff --git a/src/alisolarflare/components/flairdoor/FlairDoorComponent.java b/src/alisolarflare/components/flairdoor/FlairDoorComponent.java index 7329694..9b2901c 100644 --- a/src/alisolarflare/components/flairdoor/FlairDoorComponent.java +++ b/src/alisolarflare/components/flairdoor/FlairDoorComponent.java @@ -7,11 +7,11 @@ import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.Component; -import alisolarflare.components.flairdoor.commands.FlairMe; -import alisolarflare.components.flairdoor.commands.SetProximityLocation; -import alisolarflare.components.flairdoor.listeners.PlayerProximityTaskLauncher; +import alisolarflare.architecture.Component; +import alisolarflare.components.flairdoor.flairme.FlairMe; import alisolarflare.components.flairdoor.listeners.PortalListener; +import alisolarflare.components.flairdoor.playerproximity.PlayerProximityTaskLauncher; +import alisolarflare.components.flairdoor.playerproximity.SetProximityLocation; public class FlairDoorComponent extends Component { public List playersToBeFlaired = new ArrayList(); diff --git a/src/alisolarflare/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/flairme/FlairMe.java similarity index 83% rename from src/alisolarflare/components/flairdoor/commands/FlairMe.java rename to src/alisolarflare/components/flairdoor/flairme/FlairMe.java index 822a43a..d41fb1f 100644 --- a/src/alisolarflare/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/flairme/FlairMe.java @@ -1,8 +1,8 @@ -package alisolarflare.components.flairdoor.commands; +package alisolarflare.components.flairdoor.flairme; import org.bukkit.entity.Player; -import alisolarflare.components.PlayerCommand; +import alisolarflare.architecture.commands.PlayerCommand; import alisolarflare.components.flairdoor.FlairDoorComponent; public class FlairMe extends PlayerCommand { diff --git a/src/alisolarflare/components/flairdoor/listeners/PlayerProximityTask.java b/src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTask.java similarity index 96% rename from src/alisolarflare/components/flairdoor/listeners/PlayerProximityTask.java rename to src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTask.java index b4d9ffb..864aa0f 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PlayerProximityTask.java +++ b/src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTask.java @@ -1,4 +1,4 @@ -package alisolarflare.components.flairdoor.listeners; +package alisolarflare.components.flairdoor.playerproximity; import org.bukkit.Location; import org.bukkit.entity.Player; diff --git a/src/alisolarflare/components/flairdoor/listeners/PlayerProximityTaskLauncher.java b/src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTaskLauncher.java similarity index 86% rename from src/alisolarflare/components/flairdoor/listeners/PlayerProximityTaskLauncher.java rename to src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTaskLauncher.java index b7d7192..2a4edd7 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PlayerProximityTaskLauncher.java +++ b/src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTaskLauncher.java @@ -1,4 +1,4 @@ -package alisolarflare.components.flairdoor.listeners; +package alisolarflare.components.flairdoor.playerproximity; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; diff --git a/src/alisolarflare/components/flairdoor/commands/SetProximityLocation.java b/src/alisolarflare/components/flairdoor/playerproximity/SetProximityLocation.java similarity index 90% rename from src/alisolarflare/components/flairdoor/commands/SetProximityLocation.java rename to src/alisolarflare/components/flairdoor/playerproximity/SetProximityLocation.java index 8277889..41a3704 100644 --- a/src/alisolarflare/components/flairdoor/commands/SetProximityLocation.java +++ b/src/alisolarflare/components/flairdoor/playerproximity/SetProximityLocation.java @@ -1,8 +1,8 @@ -package alisolarflare.components.flairdoor.commands; +package alisolarflare.components.flairdoor.playerproximity; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; import alisolarflare.components.flairdoor.FlairDoorComponent; public class SetProximityLocation extends ModCommand{ diff --git a/src/alisolarflare/components/gpowers/GPowerComponent.java b/src/alisolarflare/components/gpowers/GPowerComponent.java index 91ea408..51aae3e 100644 --- a/src/alisolarflare/components/gpowers/GPowerComponent.java +++ b/src/alisolarflare/components/gpowers/GPowerComponent.java @@ -2,11 +2,11 @@ package alisolarflare.components.gpowers; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.Component; +import alisolarflare.architecture.Component; import alisolarflare.components.gpowers.commands.GPower; -import alisolarflare.components.gpowers.commands.PowerDown; -import alisolarflare.components.gpowers.commands.PowerUp; -import alisolarflare.components.gpowers.listeners.gPowerListener; +import alisolarflare.components.gpowers.enchant.Enchanter; +import alisolarflare.components.gpowers.powerstate.PowerDown; +import alisolarflare.components.gpowers.powerstate.PowerUp; public class GPowerComponent extends Component { @@ -17,7 +17,7 @@ public class GPowerComponent extends Component { registerCommand(plugin, new PowerUp(gPowerMemory)); registerCommand(plugin, new PowerDown(gPowerMemory)); - registerListener(plugin, new gPowerListener(plugin, gPowerMemory)); + registerListener(plugin, new Enchanter(plugin, gPowerMemory)); } diff --git a/src/alisolarflare/components/gpowers/commands/GPower.java b/src/alisolarflare/components/gpowers/commands/GPower.java index ae5870d..a4aed7d 100644 --- a/src/alisolarflare/components/gpowers/commands/GPower.java +++ b/src/alisolarflare/components/gpowers/commands/GPower.java @@ -2,7 +2,7 @@ package alisolarflare.components.gpowers.commands; import org.bukkit.entity.Player; -import alisolarflare.components.PlayerCommand; +import alisolarflare.architecture.commands.PlayerCommand; import alisolarflare.components.gpowers.GPowerMemory; public class GPower extends PlayerCommand { diff --git a/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/components/gpowers/enchant/Enchanter.java similarity index 85% rename from src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java rename to src/alisolarflare/components/gpowers/enchant/Enchanter.java index d32e5fa..9f68877 100644 --- a/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/components/gpowers/enchant/Enchanter.java @@ -1,4 +1,4 @@ -package alisolarflare.components.gpowers.listeners; +package alisolarflare.components.gpowers.enchant; import java.util.Map; import java.util.UUID; @@ -6,21 +6,26 @@ import java.util.UUID; import org.bukkit.Color; import org.bukkit.Server; import org.bukkit.entity.Player; +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitRunnable; +import alisolarflare.components.gpowers.GPowerMemory; import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; -public class gPowerApplyingTask extends BukkitRunnable{ +public class Enchanter extends BukkitRunnable implements Listener{ private int powerLength = 300; private Server server; private Map poweredPlayerList; - public gPowerApplyingTask(Server server, Map poweredPlayerList) { - this.server = server; - this.poweredPlayerList = poweredPlayerList; - } + + public Enchanter(JavaPlugin plugin, GPowerMemory gPowerMemory){ + this.server = plugin.getServer(); + this.poweredPlayerList = gPowerMemory.poweredPlayerList; + this.runTaskTimer(plugin, 0, 190); + } //REPEATS EVERY 5 SECONDS @Override diff --git a/src/alisolarflare/components/gpowers/listeners/gPowerListener.java b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java deleted file mode 100644 index 6ef02dd..0000000 --- a/src/alisolarflare/components/gpowers/listeners/gPowerListener.java +++ /dev/null @@ -1,13 +0,0 @@ -package alisolarflare.components.gpowers.listeners; - -import org.bukkit.event.Listener; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.components.gpowers.GPowerMemory; - -public class gPowerListener implements Listener{ - - public gPowerListener(JavaPlugin plugin, GPowerMemory gPowerMemory){ - new gPowerApplyingTask(plugin.getServer(), gPowerMemory.poweredPlayerList).runTaskTimer(plugin, 0, 190); - } -} \ No newline at end of file diff --git a/src/alisolarflare/components/gpowers/commands/PowerAll.java b/src/alisolarflare/components/gpowers/powerstate/PowerAll.java similarity index 86% rename from src/alisolarflare/components/gpowers/commands/PowerAll.java rename to src/alisolarflare/components/gpowers/powerstate/PowerAll.java index 1203005..ae8380d 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerAll.java +++ b/src/alisolarflare/components/gpowers/powerstate/PowerAll.java @@ -1,8 +1,8 @@ -package alisolarflare.components.gpowers.commands; +package alisolarflare.components.gpowers.powerstate; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; import alisolarflare.components.gpowers.GPowerMemory; import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; diff --git a/src/alisolarflare/components/gpowers/commands/PowerDown.java b/src/alisolarflare/components/gpowers/powerstate/PowerDown.java similarity index 79% rename from src/alisolarflare/components/gpowers/commands/PowerDown.java rename to src/alisolarflare/components/gpowers/powerstate/PowerDown.java index d19c679..1e3bb45 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/components/gpowers/powerstate/PowerDown.java @@ -1,8 +1,8 @@ -package alisolarflare.components.gpowers.commands; +package alisolarflare.components.gpowers.powerstate; import org.bukkit.entity.Player; -import alisolarflare.components.PlayerCommand; +import alisolarflare.architecture.commands.PlayerCommand; import alisolarflare.components.gpowers.GPowerMemory; public class PowerDown extends PlayerCommand { diff --git a/src/alisolarflare/components/gpowers/commands/PowerUp.java b/src/alisolarflare/components/gpowers/powerstate/PowerUp.java similarity index 79% rename from src/alisolarflare/components/gpowers/commands/PowerUp.java rename to src/alisolarflare/components/gpowers/powerstate/PowerUp.java index c64a623..e62203a 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/components/gpowers/powerstate/PowerUp.java @@ -1,8 +1,8 @@ -package alisolarflare.components.gpowers.commands; +package alisolarflare.components.gpowers.powerstate; import org.bukkit.entity.Player; -import alisolarflare.components.PlayerCommand; +import alisolarflare.architecture.commands.PlayerCommand; import alisolarflare.components.gpowers.GPowerMemory; public class PowerUp extends PlayerCommand { diff --git a/src/alisolarflare/components/insurance/InsuranceComponent.java b/src/alisolarflare/components/insurance/InsuranceComponent.java index 41a36d0..14f8d5d 100644 --- a/src/alisolarflare/components/insurance/InsuranceComponent.java +++ b/src/alisolarflare/components/insurance/InsuranceComponent.java @@ -2,7 +2,7 @@ package alisolarflare.components.insurance; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.Component; +import alisolarflare.architecture.Component; public class InsuranceComponent extends Component { diff --git a/src/alisolarflare/components/insurance/getInsurance.java b/src/alisolarflare/components/insurance/getInsurance.java index 642f953..13bf55d 100644 --- a/src/alisolarflare/components/insurance/getInsurance.java +++ b/src/alisolarflare/components/insurance/getInsurance.java @@ -3,7 +3,7 @@ package alisolarflare.components.insurance; import org.apache.commons.lang.StringUtils; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; import alisolarflare.components.insurance.Insurance.InsuranceType; public class getInsurance extends ModCommand { diff --git a/src/alisolarflare/components/insurance/getInsuranceBar.java b/src/alisolarflare/components/insurance/getInsuranceBar.java index ec5341f..47bc004 100644 --- a/src/alisolarflare/components/insurance/getInsuranceBar.java +++ b/src/alisolarflare/components/insurance/getInsuranceBar.java @@ -3,7 +3,7 @@ package alisolarflare.components.insurance; import org.apache.commons.lang3.StringUtils; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; import alisolarflare.components.insurance.Insurance.InsuranceType; public class getInsuranceBar extends ModCommand { diff --git a/src/alisolarflare/components/insurance/getInsuranceBlock.java b/src/alisolarflare/components/insurance/getInsuranceBlock.java index 401760b..60c76b3 100644 --- a/src/alisolarflare/components/insurance/getInsuranceBlock.java +++ b/src/alisolarflare/components/insurance/getInsuranceBlock.java @@ -3,7 +3,7 @@ package alisolarflare.components.insurance; import org.apache.commons.lang3.StringUtils; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; import alisolarflare.components.insurance.Insurance.InsuranceType; public class getInsuranceBlock extends ModCommand { diff --git a/src/alisolarflare/components/insurance/getInsuranceNugget.java b/src/alisolarflare/components/insurance/getInsuranceNugget.java index 9f38bfa..24f1694 100644 --- a/src/alisolarflare/components/insurance/getInsuranceNugget.java +++ b/src/alisolarflare/components/insurance/getInsuranceNugget.java @@ -3,7 +3,7 @@ package alisolarflare.components.insurance; import org.apache.commons.lang3.StringUtils; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; import alisolarflare.components.insurance.Insurance.InsuranceType; public class getInsuranceNugget extends ModCommand { diff --git a/src/alisolarflare/components/magic/MagicComponent.java b/src/alisolarflare/components/magic/MagicComponent.java index 835c80e..eeec5cd 100644 --- a/src/alisolarflare/components/magic/MagicComponent.java +++ b/src/alisolarflare/components/magic/MagicComponent.java @@ -2,7 +2,7 @@ package alisolarflare.components.magic; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.Component; +import alisolarflare.architecture.Component; import alisolarflare.components.magic.tricks.AliArrowListener; import alisolarflare.components.magic.tricks.BoomBowDeathListener; import alisolarflare.components.magic.tricks.BoomBowListener; diff --git a/src/alisolarflare/components/magic/tricks/BoomBowRule.java b/src/alisolarflare/components/magic/tricks/BoomBowRule.java index ca81e35..40cac59 100644 --- a/src/alisolarflare/components/magic/tricks/BoomBowRule.java +++ b/src/alisolarflare/components/magic/tricks/BoomBowRule.java @@ -2,7 +2,7 @@ package alisolarflare.components.magic.tricks; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; //HEHEHHEHEH EAASSSTER EGGS public class BoomBowRule extends ModCommand{ public static boolean boomDecay; diff --git a/src/alisolarflare/components/metrics/MetricsComponent.java b/src/alisolarflare/components/metrics/MetricsComponent.java index fc0673b..2706f66 100644 --- a/src/alisolarflare/components/metrics/MetricsComponent.java +++ b/src/alisolarflare/components/metrics/MetricsComponent.java @@ -11,9 +11,9 @@ import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.Component; -import alisolarflare.components.metrics.commands.GetLoginMetrics; -import alisolarflare.components.metrics.listeners.PlayerJoinListener; +import alisolarflare.architecture.Component; +import alisolarflare.components.metrics.collection.PlayerJoinListener; +import alisolarflare.components.metrics.output.GetLoginMetrics; import buttondevteam.lib.TBMCCoreAPI; public class MetricsComponent extends Component{ diff --git a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java b/src/alisolarflare/components/metrics/collection/PlayerJoinListener.java similarity index 95% rename from src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java rename to src/alisolarflare/components/metrics/collection/PlayerJoinListener.java index 83ce00a..7744389 100644 --- a/src/alisolarflare/components/metrics/listeners/PlayerJoinListener.java +++ b/src/alisolarflare/components/metrics/collection/PlayerJoinListener.java @@ -1,4 +1,4 @@ -package alisolarflare.components.metrics.listeners; +package alisolarflare.components.metrics.collection; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; diff --git a/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java b/src/alisolarflare/components/metrics/output/GetLoginMetrics.java similarity index 82% rename from src/alisolarflare/components/metrics/commands/GetLoginMetrics.java rename to src/alisolarflare/components/metrics/output/GetLoginMetrics.java index d05a2fd..045f14a 100644 --- a/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java +++ b/src/alisolarflare/components/metrics/output/GetLoginMetrics.java @@ -1,8 +1,8 @@ -package alisolarflare.components.metrics.commands; +package alisolarflare.components.metrics.output; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; import alisolarflare.components.metrics.MetricsComponent; public class GetLoginMetrics extends ModCommand{ diff --git a/src/alisolarflare/components/minigames/MinigameComponent.java b/src/alisolarflare/components/minigames/MinigameComponent.java index aa9d96b..a4f8322 100644 --- a/src/alisolarflare/components/minigames/MinigameComponent.java +++ b/src/alisolarflare/components/minigames/MinigameComponent.java @@ -4,7 +4,7 @@ import java.util.List; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.Component; +import alisolarflare.architecture.Component; import alisolarflare.components.minigames.commands.JoinMinigame; import alisolarflare.components.minigames.commands.LeaveMinigame; import alisolarflare.components.minigames.commands.ListFighters; diff --git a/src/alisolarflare/components/minigames/commands/JoinMinigame.java b/src/alisolarflare/components/minigames/commands/JoinMinigame.java index f3ef12f..6eea609 100644 --- a/src/alisolarflare/components/minigames/commands/JoinMinigame.java +++ b/src/alisolarflare/components/minigames/commands/JoinMinigame.java @@ -2,7 +2,7 @@ package alisolarflare.components.minigames.commands; import org.bukkit.entity.Player; -import alisolarflare.components.PlayerCommand; +import alisolarflare.architecture.commands.PlayerCommand; import alisolarflare.components.minigames.MinigameComponent; public class JoinMinigame extends PlayerCommand { diff --git a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java index 5592fdb..d1e4345 100644 --- a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java +++ b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java @@ -2,7 +2,7 @@ package alisolarflare.components.minigames.commands; import org.bukkit.entity.Player; -import alisolarflare.components.PlayerCommand; +import alisolarflare.architecture.commands.PlayerCommand; import alisolarflare.components.minigames.MinigameComponent; public class LeaveMinigame extends PlayerCommand { diff --git a/src/alisolarflare/components/minigames/commands/ListFighters.java b/src/alisolarflare/components/minigames/commands/ListFighters.java index ba63a5b..c5a9f10 100644 --- a/src/alisolarflare/components/minigames/commands/ListFighters.java +++ b/src/alisolarflare/components/minigames/commands/ListFighters.java @@ -2,7 +2,7 @@ package alisolarflare.components.minigames.commands; import org.bukkit.entity.Player; -import alisolarflare.components.PlayerCommand; +import alisolarflare.architecture.commands.PlayerCommand; import alisolarflare.components.minigames.MinigameComponent; public class ListFighters extends PlayerCommand { diff --git a/src/alisolarflare/components/minigames/commands/SetColourSpawn.java b/src/alisolarflare/components/minigames/commands/SetColourSpawn.java index 0a46cf3..24a23d4 100644 --- a/src/alisolarflare/components/minigames/commands/SetColourSpawn.java +++ b/src/alisolarflare/components/minigames/commands/SetColourSpawn.java @@ -2,7 +2,7 @@ package alisolarflare.components.minigames.commands; import org.bukkit.entity.Player; -import alisolarflare.components.ModCommand; +import alisolarflare.architecture.commands.ModCommand; import alisolarflare.components.minigames.data.SpawnSet; public class SetColourSpawn extends ModCommand{ diff --git a/src/graveyard/shulker/AliShulkerModule.java b/src/graveyard/shulker/AliShulkerModule.java index 04c6037..8ffde1e 100644 --- a/src/graveyard/shulker/AliShulkerModule.java +++ b/src/graveyard/shulker/AliShulkerModule.java @@ -2,7 +2,7 @@ package graveyard.shulker; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.Component; +import alisolarflare.architecture.Component; import graveyard.shulker.commands.AliShulker; /**@deprecated*/ From 630d8ee23e24fa2974d18f147a7e7c56f302de73 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 25 Nov 2016 19:23:34 -0500 Subject: [PATCH 164/263] Saved Player Metrics to .txt file --- metrics/playerLogins.txt | 1 + pom.xml | 174 +++++++++--------- .../flairdoor/FlairDoorComponent.java | 54 +++--- .../PlayerProximityTaskLauncher.java | 12 -- .../PlayerProximityLoop.java} | 8 +- .../SetProximityLocation.java | 2 +- .../components/gpowers/GPowerComponent.java | 4 +- .../{Enchanter.java => EnchantingLoop.java} | 150 +++++++-------- .../components/metrics/MetricsComponent.java | 41 +---- .../collection/PlayerJoinListener.java | 24 +-- .../components/metrics/files/MetricsFile.java | 50 +++++ .../metrics/output/GetLoginMetrics.java | 5 +- 12 files changed, 267 insertions(+), 258 deletions(-) create mode 100644 metrics/playerLogins.txt delete mode 100644 src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTaskLauncher.java rename src/alisolarflare/components/flairdoor/{playerproximity/PlayerProximityTask.java => proximitydetector/PlayerProximityLoop.java} (84%) rename src/alisolarflare/components/flairdoor/{playerproximity => proximitydetector}/SetProximityLocation.java (94%) rename src/alisolarflare/components/gpowers/enchant/{Enchanter.java => EnchantingLoop.java} (94%) create mode 100644 src/alisolarflare/components/metrics/files/MetricsFile.java diff --git a/metrics/playerLogins.txt b/metrics/playerLogins.txt new file mode 100644 index 0000000..b710586 --- /dev/null +++ b/metrics/playerLogins.txt @@ -0,0 +1 @@ +Login List: diff --git a/pom.xml b/pom.xml index e753309..b182c38 100644 --- a/pom.xml +++ b/pom.xml @@ -1,82 +1,92 @@ - - 4.0.0 - com.github.tbmcplugins - AliPresents - 0.0.1-SNAPSHOT - AliPresents - A bucket of aaall the stuff Ali makes. It's a bit smelly. - - src - - - src - - **/*.java - - - - . - - *.yml - - - - - - maven-compiler-plugin - 3.3 - - 1.8 - 1.8 - - - - - - UTF-8 - - - - - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots/ - - - jcenter - http://jcenter.bintray.com - - - jitpack.io - https://jitpack.io - - - ess-repo - http://repo.ess3.net/content/groups/essentials - - - - - - org.spigotmc - spigot-api - 1.11-R0.1-SNAPSHOT - - - - org.apache.commons - commons-lang3 - 3.4 - - - com.github.TBMCPlugins.ButtonCore - ButtonCore - master-SNAPSHOT - - - net.ess3 - Essentials - 2.13.1 - - - + + 4.0.0 + com.github.tbmcplugins + AliPresents + 0.0.1-SNAPSHOT + AliPresents + A bucket of aaall the stuff Ali makes. It's a bit smelly. + + src + + + src + + **/*.java + + + + . + + *.yml + + + + + + maven-compiler-plugin + 3.3 + + 1.8 + 1.8 + + + + + + UTF-8 + + + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + jcenter + http://jcenter.bintray.com + + + jitpack.io + https://jitpack.io + + + ess-repo + http://repo.ess3.net/content/groups/essentials + + + + + + org.spigotmc + spigot-api + 1.11-R0.1-SNAPSHOT + + + + org.apache.commons + commons-lang3 + 3.4 + + + com.github.TBMCPlugins.ButtonCore + ButtonCore + master-SNAPSHOT + + + net.ess3 + Essentials + 2.13.1 + + + org.apache.logging.log4j + log4j-api + 2.7 + + + org.apache.logging.log4j + log4j-core + 2.7 + + + diff --git a/src/alisolarflare/components/flairdoor/FlairDoorComponent.java b/src/alisolarflare/components/flairdoor/FlairDoorComponent.java index 9b2901c..b7886f6 100644 --- a/src/alisolarflare/components/flairdoor/FlairDoorComponent.java +++ b/src/alisolarflare/components/flairdoor/FlairDoorComponent.java @@ -1,27 +1,27 @@ -package alisolarflare.components.flairdoor; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.Location; -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.architecture.Component; -import alisolarflare.components.flairdoor.flairme.FlairMe; -import alisolarflare.components.flairdoor.listeners.PortalListener; -import alisolarflare.components.flairdoor.playerproximity.PlayerProximityTaskLauncher; -import alisolarflare.components.flairdoor.playerproximity.SetProximityLocation; - -public class FlairDoorComponent extends Component { - public List playersToBeFlaired = new ArrayList(); - public Location startLocation = null; - public Location endLocation = null; - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new FlairMe(this)); - registerCommand(plugin, new SetProximityLocation(this)); - registerListener(plugin, new PortalListener(plugin, this)); - registerListener(plugin, new PlayerProximityTaskLauncher(plugin, this)); - } -} +package alisolarflare.components.flairdoor; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Location; +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.architecture.Component; +import alisolarflare.components.flairdoor.flairme.FlairMe; +import alisolarflare.components.flairdoor.listeners.PortalListener; +import alisolarflare.components.flairdoor.proximitydetector.PlayerProximityLoop; +import alisolarflare.components.flairdoor.proximitydetector.SetProximityLocation; + +public class FlairDoorComponent extends Component { + public List playersToBeFlaired = new ArrayList(); + public Location startLocation = null; + public Location endLocation = null; + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new FlairMe(this)); + registerCommand(plugin, new SetProximityLocation(this)); + registerListener(plugin, new PortalListener(plugin, this)); + registerListener(plugin, new PlayerProximityLoop(plugin, this)); + } +} diff --git a/src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTaskLauncher.java b/src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTaskLauncher.java deleted file mode 100644 index 2a4edd7..0000000 --- a/src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTaskLauncher.java +++ /dev/null @@ -1,12 +0,0 @@ -package alisolarflare.components.flairdoor.playerproximity; - -import org.bukkit.event.Listener; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.components.flairdoor.FlairDoorComponent; - -public class PlayerProximityTaskLauncher implements Listener{ - public PlayerProximityTaskLauncher(JavaPlugin plugin, FlairDoorComponent component){ - new PlayerProximityTask(plugin, component).runTaskTimer(plugin, 0, 20); - } -} diff --git a/src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTask.java b/src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java similarity index 84% rename from src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTask.java rename to src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java index 864aa0f..b8a3a8a 100644 --- a/src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTask.java +++ b/src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java @@ -1,23 +1,25 @@ -package alisolarflare.components.flairdoor.playerproximity; +package alisolarflare.components.flairdoor.proximitydetector; import org.bukkit.Location; import org.bukkit.entity.Player; +import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; import alisolarflare.components.flairdoor.FlairDoorComponent; -public class PlayerProximityTask extends BukkitRunnable{ +public class PlayerProximityLoop extends BukkitRunnable implements Listener{ private JavaPlugin plugin; private FlairDoorComponent component; private Location startLocation; private Location endLocation; - public PlayerProximityTask(JavaPlugin plugin, FlairDoorComponent component) { + public PlayerProximityLoop(JavaPlugin plugin, FlairDoorComponent component) { this.plugin = plugin; this.component = component; this.startLocation = component.startLocation; this.endLocation = component.endLocation; + this.runTaskTimer(plugin, 0, 20); } @Override diff --git a/src/alisolarflare/components/flairdoor/playerproximity/SetProximityLocation.java b/src/alisolarflare/components/flairdoor/proximitydetector/SetProximityLocation.java similarity index 94% rename from src/alisolarflare/components/flairdoor/playerproximity/SetProximityLocation.java rename to src/alisolarflare/components/flairdoor/proximitydetector/SetProximityLocation.java index 41a3704..f19ce48 100644 --- a/src/alisolarflare/components/flairdoor/playerproximity/SetProximityLocation.java +++ b/src/alisolarflare/components/flairdoor/proximitydetector/SetProximityLocation.java @@ -1,4 +1,4 @@ -package alisolarflare.components.flairdoor.playerproximity; +package alisolarflare.components.flairdoor.proximitydetector; import org.bukkit.entity.Player; diff --git a/src/alisolarflare/components/gpowers/GPowerComponent.java b/src/alisolarflare/components/gpowers/GPowerComponent.java index 51aae3e..978c30b 100644 --- a/src/alisolarflare/components/gpowers/GPowerComponent.java +++ b/src/alisolarflare/components/gpowers/GPowerComponent.java @@ -4,7 +4,7 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.architecture.Component; import alisolarflare.components.gpowers.commands.GPower; -import alisolarflare.components.gpowers.enchant.Enchanter; +import alisolarflare.components.gpowers.enchant.EnchantingLoop; import alisolarflare.components.gpowers.powerstate.PowerDown; import alisolarflare.components.gpowers.powerstate.PowerUp; @@ -17,7 +17,7 @@ public class GPowerComponent extends Component { registerCommand(plugin, new PowerUp(gPowerMemory)); registerCommand(plugin, new PowerDown(gPowerMemory)); - registerListener(plugin, new Enchanter(plugin, gPowerMemory)); + registerListener(plugin, new EnchantingLoop(plugin, gPowerMemory)); } diff --git a/src/alisolarflare/components/gpowers/enchant/Enchanter.java b/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java similarity index 94% rename from src/alisolarflare/components/gpowers/enchant/Enchanter.java rename to src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java index 9f68877..2f22b0f 100644 --- a/src/alisolarflare/components/gpowers/enchant/Enchanter.java +++ b/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java @@ -1,75 +1,75 @@ -package alisolarflare.components.gpowers.enchant; - -import java.util.Map; -import java.util.UUID; - -import org.bukkit.Color; -import org.bukkit.Server; -import org.bukkit.entity.Player; -import org.bukkit.event.Listener; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import alisolarflare.components.gpowers.GPowerMemory; -import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; - -public class Enchanter extends BukkitRunnable implements Listener{ - private int powerLength = 300; - private Server server; - private Map poweredPlayerList; - - - public Enchanter(JavaPlugin plugin, GPowerMemory gPowerMemory){ - this.server = plugin.getServer(); - this.poweredPlayerList = gPowerMemory.poweredPlayerList; - this.runTaskTimer(plugin, 0, 190); - } - - //REPEATS EVERY 5 SECONDS - @Override - public void run() { - //server.broadcastMessage("ping!"); - for (Player player : server.getOnlinePlayers()){ - if(poweredPlayerList.containsKey(player.getUniqueId()) && poweredPlayerList.get(player.getUniqueId()).isPowersActive){ - activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); - } - } - } - - private void activatePower(Player player, String colour) { - //GREY - for (PotionEffect potionEffect : player.getActivePotionEffects()){ - player.removePotionEffect(potionEffect.getType()); - } - if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.GRAY), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, powerLength+100, 0, true, false, Color.GRAY), true); - //RED - }else if (colour.startsWith("r")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, powerLength, 0, true, false, Color.RED), true); - //ORANGE - }else if (colour.startsWith("o")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); - //YELLOW - }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.YELLOW), true); - //GREEN - }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, powerLength, 1, true, false, Color.GREEN), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, powerLength, 0, true, false, Color.GREEN), true); - //BLUE - }else if (colour.startsWith("b")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, powerLength, 1, true, false, Color.BLUE), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, powerLength, 0, true, false, Color.BLUE), true); - //PURPLE - }else if (colour.startsWith("p")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, powerLength, 0, true, false, Color.PURPLE), true); - //NULL - }else{ - } - } - -} +package alisolarflare.components.gpowers.enchant; + +import java.util.Map; +import java.util.UUID; + +import org.bukkit.Color; +import org.bukkit.Server; +import org.bukkit.entity.Player; +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +import alisolarflare.components.gpowers.GPowerMemory; +import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; + +public class EnchantingLoop extends BukkitRunnable implements Listener{ + private int powerLength = 300; + private Server server; + private Map poweredPlayerList; + + + public EnchantingLoop(JavaPlugin plugin, GPowerMemory gPowerMemory){ + this.server = plugin.getServer(); + this.poweredPlayerList = gPowerMemory.poweredPlayerList; + this.runTaskTimer(plugin, 0, 190); + } + + //REPEATS EVERY 5 SECONDS + @Override + public void run() { + //server.broadcastMessage("ping!"); + for (Player player : server.getOnlinePlayers()){ + if(poweredPlayerList.containsKey(player.getUniqueId()) && poweredPlayerList.get(player.getUniqueId()).isPowersActive){ + activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); + } + } + } + + private void activatePower(Player player, String colour) { + //GREY + for (PotionEffect potionEffect : player.getActivePotionEffects()){ + player.removePotionEffect(potionEffect.getType()); + } + if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.GRAY), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, powerLength+100, 0, true, false, Color.GRAY), true); + //RED + }else if (colour.startsWith("r")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, powerLength, 0, true, false, Color.RED), true); + //ORANGE + }else if (colour.startsWith("o")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); + //YELLOW + }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.YELLOW), true); + //GREEN + }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, powerLength, 1, true, false, Color.GREEN), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, powerLength, 0, true, false, Color.GREEN), true); + //BLUE + }else if (colour.startsWith("b")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, powerLength, 1, true, false, Color.BLUE), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, powerLength, 0, true, false, Color.BLUE), true); + //PURPLE + }else if (colour.startsWith("p")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, powerLength, 0, true, false, Color.PURPLE), true); + //NULL + }else{ + } + } + +} diff --git a/src/alisolarflare/components/metrics/MetricsComponent.java b/src/alisolarflare/components/metrics/MetricsComponent.java index 2706f66..3bb855f 100644 --- a/src/alisolarflare/components/metrics/MetricsComponent.java +++ b/src/alisolarflare/components/metrics/MetricsComponent.java @@ -1,54 +1,29 @@ package alisolarflare.components.metrics; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.bukkit.configuration.InvalidConfigurationException; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.architecture.Component; import alisolarflare.components.metrics.collection.PlayerJoinListener; +import alisolarflare.components.metrics.files.MetricsFile; import alisolarflare.components.metrics.output.GetLoginMetrics; -import buttondevteam.lib.TBMCCoreAPI; public class MetricsComponent extends Component{ - - public FileConfiguration metricsYml; // DATA - STRING + String defaultPath = "metrics"; + String defaultFilePath = (defaultPath + "/metrics.txt"); + String playerLoginsFilePath = (defaultPath + "/playerLogins.txt"); + + public MetricsFile playerLoginsFile; // DATA - STRING public List metricsList; @Override public void register(JavaPlugin plugin){ + playerLoginsFile = new MetricsFile(playerLoginsFilePath); registerCommand(plugin, new GetLoginMetrics(this)); - registerListener(plugin, new PlayerJoinListener(this)); + registerListener(plugin, new PlayerJoinListener(this, playerLoginsFile)); metricsList = new ArrayList(); - try { - metricsYml = loadFileConfiguration(plugin, "metrics.yml"); - metricsList = metricsYml.getStringList("playerLogins"); - } catch (IOException | InvalidConfigurationException e) { - TBMCCoreAPI.SendException("metrics.yml in AliPresents could not be created!", e); - return; - } - - } - private FileConfiguration loadFileConfiguration(JavaPlugin plugin, String fileName) throws FileNotFoundException, IOException, InvalidConfigurationException { - - File file = new File(plugin.getDataFolder(), fileName); - - if (!file.exists()) { - file.getParentFile().mkdirs(); - plugin.saveResource(fileName, false); - } - - FileConfiguration config = new YamlConfiguration(); - - config.load(file); - - return config; } } diff --git a/src/alisolarflare/components/metrics/collection/PlayerJoinListener.java b/src/alisolarflare/components/metrics/collection/PlayerJoinListener.java index 7744389..d997d32 100644 --- a/src/alisolarflare/components/metrics/collection/PlayerJoinListener.java +++ b/src/alisolarflare/components/metrics/collection/PlayerJoinListener.java @@ -5,33 +5,19 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; import alisolarflare.components.metrics.MetricsComponent; -import buttondevteam.lib.DebugPotato; +import alisolarflare.components.metrics.files.MetricsFile; public class PlayerJoinListener implements Listener{ private MetricsComponent module; - public PlayerJoinListener(MetricsComponent module){ + private MetricsFile playerLoginsFile; + public PlayerJoinListener(MetricsComponent module, MetricsFile playerLoginsFile){ this.module = module; + this.playerLoginsFile = playerLoginsFile; } @EventHandler public void onPlayerJoin(PlayerJoinEvent event){ - try{ - module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis()+event.getPlayer().getName(), event.getPlayer().getName()); - }catch(NullPointerException e){ - try{ - DebugPotato potato = new DebugPotato(); - potato.setMessage(new String[]{ - "Module: "+ module.toString(), - "Time: " + System.currentTimeMillis(), - "MetricsYML: " + module.metricsYml.toString() - }); - potato.Send(event.getPlayer()); - }catch (Exception ex){ - DebugPotato potato = new DebugPotato(); - potato.setMessage("Something went REALLLY wrong"); - potato.Send(event.getPlayer()); - } - } + playerLoginsFile.AddLine("loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); module.metricsList.add("loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); } diff --git a/src/alisolarflare/components/metrics/files/MetricsFile.java b/src/alisolarflare/components/metrics/files/MetricsFile.java new file mode 100644 index 0000000..bc55b13 --- /dev/null +++ b/src/alisolarflare/components/metrics/files/MetricsFile.java @@ -0,0 +1,50 @@ +package alisolarflare.components.metrics.files; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import buttondevteam.lib.TBMCCoreAPI; + +public class MetricsFile { + private String fileName = "metrics/playerLogins.txt"; + public MetricsFile(String directory){ + this.fileName = directory; + } + public void AddLine(String string){ + BufferedWriter outputStream = null; + try { + outputStream = new BufferedWriter(new FileWriter(fileName, true)); + outputStream.write(string); + outputStream.newLine(); + outputStream.close(); + } catch (IOException e) { + TBMCCoreAPI.SendException(fileName +" Output Stream could not be created!", e); + } + } + public List toArrayList(){ + BufferedReader inputStream = null; + try { + inputStream = new BufferedReader(new FileReader(fileName)); + + List outputList = new ArrayList(); + String currentLine; + + while ((currentLine = inputStream.readLine()) != null){ + outputList.add(currentLine); + } + inputStream.close(); + return outputList; + } catch (FileNotFoundException e) { + TBMCCoreAPI.SendException(" could not be found", e); + } catch (IOException e1) { + TBMCCoreAPI.SendException("encountered an I/O Exception!", e1); + } + return new ArrayList(); + } +} diff --git a/src/alisolarflare/components/metrics/output/GetLoginMetrics.java b/src/alisolarflare/components/metrics/output/GetLoginMetrics.java index 045f14a..7fc8f78 100644 --- a/src/alisolarflare/components/metrics/output/GetLoginMetrics.java +++ b/src/alisolarflare/components/metrics/output/GetLoginMetrics.java @@ -15,12 +15,9 @@ public class GetLoginMetrics extends ModCommand{ @Override public boolean OnCommand(Player player, String alias, String[] args) { - for (String metric : module.metricsList){ + for (String metric : module.playerLoginsFile.toArrayList()){ player.sendMessage(metric); } - if (args.length < 1){ - return true; - } return true; } } From 1bb5453b04dfe250316801e6d6bb5aec45269fef Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 25 Nov 2016 23:21:15 -0500 Subject: [PATCH 165/263] Added the *cannon bow* --- .../components/magic/MagicComponent.java | 38 ++++++++------- .../magic/tricks/CannonBowListener.java | 47 +++++++++++++++++++ 2 files changed, 67 insertions(+), 18 deletions(-) create mode 100644 src/alisolarflare/components/magic/tricks/CannonBowListener.java diff --git a/src/alisolarflare/components/magic/MagicComponent.java b/src/alisolarflare/components/magic/MagicComponent.java index eeec5cd..8d5dcc9 100644 --- a/src/alisolarflare/components/magic/MagicComponent.java +++ b/src/alisolarflare/components/magic/MagicComponent.java @@ -1,18 +1,20 @@ -package alisolarflare.components.magic; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.architecture.Component; -import alisolarflare.components.magic.tricks.AliArrowListener; -import alisolarflare.components.magic.tricks.BoomBowDeathListener; -import alisolarflare.components.magic.tricks.BoomBowListener; - -public class MagicComponent extends Component{ - - @Override - public void register(JavaPlugin plugin) { - registerListener(plugin, new AliArrowListener(plugin)); - registerListener(plugin, new BoomBowDeathListener()); - registerListener(plugin, new BoomBowListener(plugin)); - } -} +package alisolarflare.components.magic; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.architecture.Component; +import alisolarflare.components.magic.tricks.AliArrowListener; +import alisolarflare.components.magic.tricks.BoomBowDeathListener; +import alisolarflare.components.magic.tricks.BoomBowListener; +import alisolarflare.components.magic.tricks.CannonBowListener; + +public class MagicComponent extends Component{ + + @Override + public void register(JavaPlugin plugin) { + registerListener(plugin, new AliArrowListener(plugin)); + registerListener(plugin, new BoomBowDeathListener()); + registerListener(plugin, new BoomBowListener(plugin)); + registerListener(plugin, new CannonBowListener()); + } +} diff --git a/src/alisolarflare/components/magic/tricks/CannonBowListener.java b/src/alisolarflare/components/magic/tricks/CannonBowListener.java new file mode 100644 index 0000000..83cf9f1 --- /dev/null +++ b/src/alisolarflare/components/magic/tricks/CannonBowListener.java @@ -0,0 +1,47 @@ +package alisolarflare.components.magic.tricks; + +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Arrow; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.ProjectileLaunchEvent; +import org.bukkit.inventory.ItemStack; + +public class CannonBowListener implements Listener { + + public CannonBowListener(){ + } + + @EventHandler + public void onProjectileLaunch(ProjectileLaunchEvent event){ + if(event.getEntity().getType() != EntityType.ARROW) + return; + Arrow arrow = (Arrow) event.getEntity(); + if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player)) + return; + Player player = (Player) arrow.getShooter(); + ItemStack bow; + if ((bow = player.getInventory().getItemInMainHand()).getType() != Material.BOW) + return; + if (!bow.containsEnchantment(Enchantment.PROTECTION_EXPLOSIONS)) + return; + if(!(bow.getEnchantmentLevel(Enchantment.PROTECTION_EXPLOSIONS) == 10)) + return; + if (!bow.getItemMeta().getDisplayName().toUpperCase().contains("CANNON BOW")) + return; + if (!player.getInventory().contains(Material.TNT)) + return; + + Entity tnt = arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.PRIMED_TNT); + tnt.setVelocity(arrow.getVelocity()); + arrow.remove(); + + + return; + + } +} \ No newline at end of file From 4c0dae261a8d0bdad806bf12df97de4cbf61092b Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 25 Nov 2016 23:58:00 -0500 Subject: [PATCH 166/263] Adjusted the Style of the cannon bows --- .../components/magic/tricks/CannonBowListener.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/alisolarflare/components/magic/tricks/CannonBowListener.java b/src/alisolarflare/components/magic/tricks/CannonBowListener.java index 83cf9f1..efabd5e 100644 --- a/src/alisolarflare/components/magic/tricks/CannonBowListener.java +++ b/src/alisolarflare/components/magic/tricks/CannonBowListener.java @@ -1,11 +1,13 @@ package alisolarflare.components.magic.tricks; +import org.bukkit.Effect; import org.bukkit.Material; +import org.bukkit.Sound; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Arrow; -import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; +import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.ProjectileLaunchEvent; @@ -36,10 +38,14 @@ public class CannonBowListener implements Listener { if (!player.getInventory().contains(Material.TNT)) return; - Entity tnt = arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.PRIMED_TNT); - tnt.setVelocity(arrow.getVelocity()); - arrow.remove(); + TNTPrimed tnt = (TNTPrimed) arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.PRIMED_TNT); + tnt.setVelocity(arrow.getVelocity().normalize().multiply(3.0)); + tnt.setCustomName("CANNON BOW TNT"); + player.setVelocity(arrow.getVelocity().multiply(-1).normalize()); + player.getWorld().playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0, 0); + player.getWorld().playEffect(player.getLocation(), Effect.EXPLOSION, 1); + arrow.remove(); return; From 68f8a3fd7727f9c4bdea81dbbcfa9e6e9796ebcf Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 26 Nov 2016 00:18:53 -0500 Subject: [PATCH 167/263] Removed Cannon Bow's Damaging effect --- .../components/magic/MagicComponent.java | 2 +- .../magic/tricks/CannonBowListener.java | 20 ++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/alisolarflare/components/magic/MagicComponent.java b/src/alisolarflare/components/magic/MagicComponent.java index 8d5dcc9..d49f08b 100644 --- a/src/alisolarflare/components/magic/MagicComponent.java +++ b/src/alisolarflare/components/magic/MagicComponent.java @@ -15,6 +15,6 @@ public class MagicComponent extends Component{ registerListener(plugin, new AliArrowListener(plugin)); registerListener(plugin, new BoomBowDeathListener()); registerListener(plugin, new BoomBowListener(plugin)); - registerListener(plugin, new CannonBowListener()); + registerListener(plugin, new CannonBowListener(plugin)); } } diff --git a/src/alisolarflare/components/magic/tricks/CannonBowListener.java b/src/alisolarflare/components/magic/tricks/CannonBowListener.java index efabd5e..0dcc7be 100644 --- a/src/alisolarflare/components/magic/tricks/CannonBowListener.java +++ b/src/alisolarflare/components/magic/tricks/CannonBowListener.java @@ -10,14 +10,18 @@ import org.bukkit.entity.Player; import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.ProjectileLaunchEvent; import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.java.JavaPlugin; public class CannonBowListener implements Listener { - - public CannonBowListener(){ + JavaPlugin plugin; + public CannonBowListener(JavaPlugin plugin){ + this.plugin = plugin; } + @SuppressWarnings("deprecation") @EventHandler public void onProjectileLaunch(ProjectileLaunchEvent event){ if(event.getEntity().getType() != EntityType.ARROW) @@ -46,8 +50,18 @@ public class CannonBowListener implements Listener { player.getWorld().playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0, 0); player.getWorld().playEffect(player.getLocation(), Effect.EXPLOSION, 1); arrow.remove(); - return; } + + @EventHandler + public void onTnTExplode(EntityExplodeEvent event) { + if (event.getEntityType() != EntityType.PRIMED_TNT) + return; + if (!event.getEntity().getCustomName().equals("CANNON BOW TNT")) + return; + event.setYield(0); + + + } } \ No newline at end of file From 30686980e6a26177f09d1937f7ff90e0501af73a Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 26 Nov 2016 02:23:11 -0500 Subject: [PATCH 168/263] Breaks boom bow when durability = 0 --- .../magic/tricks/BoomBowListener.java | 217 +++++++++--------- 1 file changed, 110 insertions(+), 107 deletions(-) diff --git a/src/alisolarflare/components/magic/tricks/BoomBowListener.java b/src/alisolarflare/components/magic/tricks/BoomBowListener.java index aee7e22..ef79278 100644 --- a/src/alisolarflare/components/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/components/magic/tricks/BoomBowListener.java @@ -1,107 +1,110 @@ -package alisolarflare.components.magic.tricks; - -import org.bukkit.GameMode; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Particle; -import org.bukkit.Sound; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; - -public class BoomBowListener implements Listener { - JavaPlugin plugin; - public BoomBowListener(JavaPlugin plugin){ - this.plugin = plugin; - } - @EventHandler - public void ClickEvent(PlayerInteractEvent event){ - FlyBowBoost(event); - - } - public void FlyBowBoost(PlayerInteractEvent event){ - - //ACTION SANITATION - if(!(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK)) return; - if(!(event.getPlayer().isGliding())) return; - if(!(event.getMaterial() == Material.BOW)) return; - - //BOW SANITATION - ItemStack bow = event.getItem(); - if(!(bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK))) return; - if(!(bow.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) == 3)) return; - if(!(bow.getItemMeta().getDisplayName().contains("BOOM BOW"))) return; - - //PLAYER SANITATION - Player player = event.getPlayer(); - if(player.getGameMode().equals(GameMode.CREATIVE))return; - - if(bow.containsEnchantment(Enchantment.ARROW_INFINITE)){ - //HAS INIFINITY - Activate(event); - - }else if((player.getInventory().contains(Material.TNT))){ - //HAS TNT - Activate(event); - - //Reduce tnt by 1 - int tntSlot = player.getInventory().first(Material.TNT); - ItemStack tntStack = player.getInventory().getItem(tntSlot); - if(tntStack.getAmount() > 3){ - tntStack.setAmount(tntStack.getAmount()-3); - }else{ - player.getInventory().remove(tntStack); - } - - }else{ - return; - } - } - - - - public void Activate(PlayerInteractEvent event){ - //INIT - Player variables - Player player = event.getPlayer(); - Location playerLocation = player.getLocation(); - ItemStack boomBow = player.getInventory().getItemInMainHand(); - - //TODO: NERF - boomDecay - //TODO: NERF - endCrystal - //TODO: NERF - healthReduction - //TODO: NERF - localized - - if(BoomBowRule.boomDecay) - new BoomDecayTask(player).runTaskTimer(plugin, 1, 1); - if(BoomBowRule.endCrystal){ - //BoomBowCyrstalSpawn - } - if(BoomBowRule.healthReduction){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1)); - } - if(BoomBowRule.localized); - - - //SET - Player Velocity - player.setVelocity(playerLocation.getDirection().normalize().multiply(3.0)); - - //CREATE - Explosion + damage - player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); - player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); - player.damage(7.42425, player); - boomBow.setDurability((short) (boomBow.getDurability() + 3)); - if(boomBow.getDurability() < 0){ - player.getInventory().setItemInMainHand(null); - player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0) - ; - } - - } -} +package alisolarflare.components.magic.tricks; + +import org.bukkit.GameMode; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Particle; +import org.bukkit.Sound; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +public class BoomBowListener implements Listener { + JavaPlugin plugin; + public BoomBowListener(JavaPlugin plugin){ + this.plugin = plugin; + } + @EventHandler + public void ClickEvent(PlayerInteractEvent event){ + FlyBowBoost(event); + + } + public void FlyBowBoost(PlayerInteractEvent event){ + + //ACTION SANITATION + if(!(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK)) return; + if(!(event.getPlayer().isGliding())) return; + if(!(event.getMaterial() == Material.BOW)) return; + + //BOW SANITATION + ItemStack bow = event.getItem(); + if(!(bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK))) return; + if(!(bow.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) == 3)) return; + if(!(bow.getItemMeta().getDisplayName().contains("BOOM BOW"))) return; + + //PLAYER SANITATION + Player player = event.getPlayer(); + if(player.getGameMode().equals(GameMode.CREATIVE))return; + + if(bow.containsEnchantment(Enchantment.ARROW_INFINITE)){ + //HAS INIFINITY + Activate(event); + + }else if((player.getInventory().contains(Material.TNT))){ + //HAS TNT + Activate(event); + + //Reduce tnt by 1 + int tntSlot = player.getInventory().first(Material.TNT); + ItemStack tntStack = player.getInventory().getItem(tntSlot); + if(tntStack.getAmount() > 3){ + tntStack.setAmount(tntStack.getAmount()-3); + }else{ + player.getInventory().remove(tntStack); + } + if (bow.getDurability() < 0){ + player.getInventory().clear(player.getInventory().getHeldItemSlot()); + } + + }else{ + return; + } + } + + + + public void Activate(PlayerInteractEvent event){ + //INIT - Player variables + Player player = event.getPlayer(); + Location playerLocation = player.getLocation(); + ItemStack boomBow = player.getInventory().getItemInMainHand(); + + //TODO: NERF - boomDecay + //TODO: NERF - endCrystal + //TODO: NERF - healthReduction + //TODO: NERF - localized + + if(BoomBowRule.boomDecay) + new BoomDecayTask(player).runTaskTimer(plugin, 1, 1); + if(BoomBowRule.endCrystal){ + //BoomBowCyrstalSpawn + } + if(BoomBowRule.healthReduction){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1)); + } + if(BoomBowRule.localized); + + + //SET - Player Velocity + player.setVelocity(playerLocation.getDirection().normalize().multiply(3.0)); + + //CREATE - Explosion + damage + player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); + player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); + player.damage(7.42425, player); + boomBow.setDurability((short) (boomBow.getDurability() + 3)); + if(boomBow.getDurability() < 0){ + player.getInventory().setItemInMainHand(null); + player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0) + ; + } + + } +} From e5e5ece83af2a55ddb2ba7d657df744597d9f3a2 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 26 Nov 2016 18:17:29 -0500 Subject: [PATCH 169/263] Adjusted cannon bow to not destroy blocks --- .../magic/tricks/CannonBowListener.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/alisolarflare/components/magic/tricks/CannonBowListener.java b/src/alisolarflare/components/magic/tricks/CannonBowListener.java index 0dcc7be..5891fdf 100644 --- a/src/alisolarflare/components/magic/tricks/CannonBowListener.java +++ b/src/alisolarflare/components/magic/tricks/CannonBowListener.java @@ -1,7 +1,8 @@ package alisolarflare.components.magic.tricks; -import org.bukkit.Effect; +import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.Particle; import org.bukkit.Sound; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Arrow; @@ -21,7 +22,6 @@ public class CannonBowListener implements Listener { this.plugin = plugin; } - @SuppressWarnings("deprecation") @EventHandler public void onProjectileLaunch(ProjectileLaunchEvent event){ if(event.getEntity().getType() != EntityType.ARROW) @@ -43,12 +43,13 @@ public class CannonBowListener implements Listener { return; TNTPrimed tnt = (TNTPrimed) arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.PRIMED_TNT); - tnt.setVelocity(arrow.getVelocity().normalize().multiply(3.0)); + tnt.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(2.0)); tnt.setCustomName("CANNON BOW TNT"); + tnt.setFuseTicks(20); - player.setVelocity(arrow.getVelocity().multiply(-1).normalize()); - player.getWorld().playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0, 0); - player.getWorld().playEffect(player.getLocation(), Effect.EXPLOSION, 1); + player.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(-1)); + player.getWorld().playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 2.0F, 0); + player.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, player.getLocation(), 1); arrow.remove(); return; @@ -60,7 +61,9 @@ public class CannonBowListener implements Listener { return; if (!event.getEntity().getCustomName().equals("CANNON BOW TNT")) return; - event.setYield(0); + Location loc = event.getEntity().getLocation(); + event.getEntity().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 3, false, false); + event.setCancelled(true); } From bdc467db30f8fa2e29bf0bad4c0c6b676f0a9600 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 26 Nov 2016 18:24:55 -0500 Subject: [PATCH 170/263] Adjusted Cannon Bow for slower arc --- .../components/magic/tricks/CannonBowListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/alisolarflare/components/magic/tricks/CannonBowListener.java b/src/alisolarflare/components/magic/tricks/CannonBowListener.java index 5891fdf..097f685 100644 --- a/src/alisolarflare/components/magic/tricks/CannonBowListener.java +++ b/src/alisolarflare/components/magic/tricks/CannonBowListener.java @@ -43,9 +43,9 @@ public class CannonBowListener implements Listener { return; TNTPrimed tnt = (TNTPrimed) arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.PRIMED_TNT); - tnt.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(2.0)); + tnt.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(1.0)); tnt.setCustomName("CANNON BOW TNT"); - tnt.setFuseTicks(20); + tnt.setFuseTicks(40); player.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(-1)); player.getWorld().playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 2.0F, 0); From 7e5b2445850390364417341cef48dc6da25af292 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 26 Nov 2016 18:51:27 -0500 Subject: [PATCH 171/263] Tried to fix Metrics Output Stream issue --- metrics/metrics.txt | 0 .../components/metrics/files/MetricsFile.java | 28 +++++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 metrics/metrics.txt diff --git a/metrics/metrics.txt b/metrics/metrics.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/alisolarflare/components/metrics/files/MetricsFile.java b/src/alisolarflare/components/metrics/files/MetricsFile.java index bc55b13..cbff71a 100644 --- a/src/alisolarflare/components/metrics/files/MetricsFile.java +++ b/src/alisolarflare/components/metrics/files/MetricsFile.java @@ -2,6 +2,7 @@ package alisolarflare.components.metrics.files; import java.io.BufferedReader; import java.io.BufferedWriter; +import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; @@ -17,33 +18,36 @@ public class MetricsFile { this.fileName = directory; } public void AddLine(String string){ - BufferedWriter outputStream = null; + BufferedWriter inputStream = null; try { - outputStream = new BufferedWriter(new FileWriter(fileName, true)); - outputStream.write(string); - outputStream.newLine(); - outputStream.close(); + File file = new File("metrics/playerLogins.txt"); + TBMCCoreAPI.sendDebugMessage("Metrics File Exists: " + file.exists()); + inputStream = new BufferedWriter(new FileWriter(fileName, true)); + TBMCCoreAPI.sendDebugMessage("Input Stream Created!"); + inputStream.write(string); + inputStream.newLine(); + inputStream.close(); } catch (IOException e) { - TBMCCoreAPI.SendException(fileName +" Output Stream could not be created!", e); + TBMCCoreAPI.SendException(fileName +" Input Stream could not be created! ", e); } } public List toArrayList(){ - BufferedReader inputStream = null; + BufferedReader outputStream = null; try { - inputStream = new BufferedReader(new FileReader(fileName)); + outputStream = new BufferedReader(new FileReader(fileName)); List outputList = new ArrayList(); String currentLine; - while ((currentLine = inputStream.readLine()) != null){ + while ((currentLine = outputStream.readLine()) != null){ outputList.add(currentLine); } - inputStream.close(); + outputStream.close(); return outputList; } catch (FileNotFoundException e) { - TBMCCoreAPI.SendException(" could not be found", e); + TBMCCoreAPI.SendException(fileName + " could not be found", e); } catch (IOException e1) { - TBMCCoreAPI.SendException("encountered an I/O Exception!", e1); + TBMCCoreAPI.SendException(fileName + "encountered an I/O Exception!", e1); } return new ArrayList(); } From 0e9df75f17fbc33794e6171d09c0190aeaf55a4d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 26 Nov 2016 19:45:10 -0500 Subject: [PATCH 172/263] Attempted to fix Metrics IO error --- .../components/metrics/MetricsComponent.java | 2 +- .../components/metrics/files/MetricsFile.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/alisolarflare/components/metrics/MetricsComponent.java b/src/alisolarflare/components/metrics/MetricsComponent.java index 3bb855f..a01c0a8 100644 --- a/src/alisolarflare/components/metrics/MetricsComponent.java +++ b/src/alisolarflare/components/metrics/MetricsComponent.java @@ -11,7 +11,7 @@ import alisolarflare.components.metrics.files.MetricsFile; import alisolarflare.components.metrics.output.GetLoginMetrics; public class MetricsComponent extends Component{ - String defaultPath = "metrics"; + String defaultPath = "AliPresents/metrics"; String defaultFilePath = (defaultPath + "/metrics.txt"); String playerLoginsFilePath = (defaultPath + "/playerLogins.txt"); diff --git a/src/alisolarflare/components/metrics/files/MetricsFile.java b/src/alisolarflare/components/metrics/files/MetricsFile.java index cbff71a..2420cd7 100644 --- a/src/alisolarflare/components/metrics/files/MetricsFile.java +++ b/src/alisolarflare/components/metrics/files/MetricsFile.java @@ -13,17 +13,17 @@ import java.util.List; import buttondevteam.lib.TBMCCoreAPI; public class MetricsFile { - private String fileName = "metrics/playerLogins.txt"; + private String fileName = "AliPresents/metrics/playerLogins.txt"; public MetricsFile(String directory){ this.fileName = directory; } public void AddLine(String string){ BufferedWriter inputStream = null; try { - File file = new File("metrics/playerLogins.txt"); - TBMCCoreAPI.sendDebugMessage("Metrics File Exists: " + file.exists()); + File file = new File(fileName); + TBMCCoreAPI.SendException("Metrics File Exists: " + file.exists(), new IOException()); inputStream = new BufferedWriter(new FileWriter(fileName, true)); - TBMCCoreAPI.sendDebugMessage("Input Stream Created!"); + TBMCCoreAPI.SendException("Input Stream Created!", new IOException()); inputStream.write(string); inputStream.newLine(); inputStream.close(); From 3326c6523c4f4719ab7ae59fae1fc520baabbe94 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 26 Nov 2016 20:35:34 -0500 Subject: [PATCH 173/263] Added a single slash. pls work --- src/alisolarflare/components/metrics/MetricsComponent.java | 2 +- src/alisolarflare/components/metrics/files/MetricsFile.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/alisolarflare/components/metrics/MetricsComponent.java b/src/alisolarflare/components/metrics/MetricsComponent.java index a01c0a8..7b572fb 100644 --- a/src/alisolarflare/components/metrics/MetricsComponent.java +++ b/src/alisolarflare/components/metrics/MetricsComponent.java @@ -11,7 +11,7 @@ import alisolarflare.components.metrics.files.MetricsFile; import alisolarflare.components.metrics.output.GetLoginMetrics; public class MetricsComponent extends Component{ - String defaultPath = "AliPresents/metrics"; + String defaultPath = "/AliPresents/metrics"; String defaultFilePath = (defaultPath + "/metrics.txt"); String playerLoginsFilePath = (defaultPath + "/playerLogins.txt"); diff --git a/src/alisolarflare/components/metrics/files/MetricsFile.java b/src/alisolarflare/components/metrics/files/MetricsFile.java index 2420cd7..ed0bde0 100644 --- a/src/alisolarflare/components/metrics/files/MetricsFile.java +++ b/src/alisolarflare/components/metrics/files/MetricsFile.java @@ -13,7 +13,7 @@ import java.util.List; import buttondevteam.lib.TBMCCoreAPI; public class MetricsFile { - private String fileName = "AliPresents/metrics/playerLogins.txt"; + private String fileName = "/AliPresents/metrics/playerLogins.txt"; public MetricsFile(String directory){ this.fileName = directory; } @@ -21,9 +21,9 @@ public class MetricsFile { BufferedWriter inputStream = null; try { File file = new File(fileName); - TBMCCoreAPI.SendException("Metrics File Exists: " + file.exists(), new IOException()); + TBMCCoreAPI.sendDebugMessage("Metrics File Exists: " + file.exists()); inputStream = new BufferedWriter(new FileWriter(fileName, true)); - TBMCCoreAPI.SendException("Input Stream Created!", new IOException()); + TBMCCoreAPI.sendDebugMessage("Input Stream Created!"); inputStream.write(string); inputStream.newLine(); inputStream.close(); From 8f06eb47c035cb31945af25a07b5df48b081f43c Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 26 Nov 2016 20:41:21 -0500 Subject: [PATCH 174/263] Updated pom.xml as per @Norbi's suggestion --- pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pom.xml b/pom.xml index b182c38..fe909ed 100644 --- a/pom.xml +++ b/pom.xml @@ -21,6 +21,10 @@ *.yml + + metrics + **/*.txt + From 9b4f3f38034b39501c6e18ced71ad723ab545add Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 26 Nov 2016 20:45:47 -0500 Subject: [PATCH 175/263] Added @NorbiPeti --- pom.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fe909ed..de5c61e 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,9 @@ metrics - **/*.txt + + **/*.txt + From c120f2e46f7061491740c5c9140e53784b2977f7 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 28 Nov 2016 13:59:25 -0500 Subject: [PATCH 176/263] A whole bunch of assorted changes --- .settings/org.eclipse.core.resources.prefs | 7 +- plugin.yml | 6 +- .../commands/subcommands/ModSubCommand.java | 15 ++ .../subcommands/PlayerSubCommand.java | 16 ++ .../commands/subcommands/SubCommand.java | 10 + .../components/alilinks/AliLinkComponent.java | 10 +- .../{SetAliLink.java => AliLink.java} | 151 ++++++------ .../alilinks/commands/PressAliLink.java | 43 ---- .../components/alilinks/entities/Link.java | 1 + .../creativeboundaries/commands/Cbgm0.java | 4 +- .../listeners/ItemRestrictionListener.java | 6 - .../components/easyuhc/EasyUHCComponent.java | 25 +- .../easyuhc/commands/ActivatePowers.java | 13 -- .../easyuhc/commands/SetUHCLobby.java | 20 -- .../easyuhc/commands/SetWorldBorders.java | 14 -- .../easyuhc/commands/ShrinkWorldBorders.java | 14 -- .../easyuhc/commands/SpreadPlayers.java | 15 -- .../easyuhc/commands/StartTimer.java | 14 -- .../components/easyuhc/commands/StartUHC.java | 14 -- .../easyuhc/commands/TeleportToUHC.java | 14 -- .../PlayerProximityLoop.java | 48 ++-- .../magic/tricks/BoomBowListener.java | 221 +++++++++--------- .../magic/tricks/CannonBowListener.java | 41 ++-- .../minigames/MinigameComponent.java | 15 +- .../minigames/commands/JoinMinigame.java | 21 +- .../minigames/commands/LeaveMinigame.java | 16 +- .../minigames/commands/ListFighters.java | 8 +- .../minigames/commands/SetColourSpawn.java | 20 +- .../components/minigames/data/SpawnSet.java | 26 +-- .../minigames/entities/Fighter.java | 11 - 30 files changed, 359 insertions(+), 480 deletions(-) create mode 100644 src/alisolarflare/architecture/commands/subcommands/ModSubCommand.java create mode 100644 src/alisolarflare/architecture/commands/subcommands/PlayerSubCommand.java create mode 100644 src/alisolarflare/architecture/commands/subcommands/SubCommand.java rename src/alisolarflare/components/alilinks/commands/{SetAliLink.java => AliLink.java} (51%) delete mode 100644 src/alisolarflare/components/alilinks/commands/PressAliLink.java delete mode 100644 src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java delete mode 100644 src/alisolarflare/components/easyuhc/commands/ActivatePowers.java delete mode 100644 src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java delete mode 100644 src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java delete mode 100644 src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java delete mode 100644 src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java delete mode 100644 src/alisolarflare/components/easyuhc/commands/StartTimer.java delete mode 100644 src/alisolarflare/components/easyuhc/commands/StartUHC.java delete mode 100644 src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java delete mode 100644 src/alisolarflare/components/minigames/entities/Fighter.java diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index 7a53139..e18f795 100644 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,4 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 -encoding/src=UTF-8 +eclipse.preferences.version=1 +encoding/=UTF-8 +encoding/metrics=UTF-8 +encoding/src=UTF-8 diff --git a/plugin.yml b/plugin.yml index 83f16c2..3bc12b6 100644 --- a/plugin.yml +++ b/plugin.yml @@ -11,10 +11,8 @@ commands: description: Official g-power command that activates the ghostie powerups powerdown: description: Offical g-power command that deactivates the ghostie powerups - pressalilink: - description: Presses an Ali Link pressalilink frequency - setalilink: - description: Creates an Ali Link setalilink frequency + alilink: + description: Arguments: cbgm0: description: Creative Boundaries Gamemode 0 - allows players to return to survival cbgm1: diff --git a/src/alisolarflare/architecture/commands/subcommands/ModSubCommand.java b/src/alisolarflare/architecture/commands/subcommands/ModSubCommand.java new file mode 100644 index 0000000..ec3ee25 --- /dev/null +++ b/src/alisolarflare/architecture/commands/subcommands/ModSubCommand.java @@ -0,0 +1,15 @@ +package alisolarflare.architecture.commands.subcommands; + +public abstract class ModSubCommand extends SubCommand{ + @Override + public boolean getPlayerOnly() { + // TODO Auto-generated method stub + return true; + } + + @Override + public boolean getModOnly() { + // TODO Auto-generated method stub + return true; + } +} diff --git a/src/alisolarflare/architecture/commands/subcommands/PlayerSubCommand.java b/src/alisolarflare/architecture/commands/subcommands/PlayerSubCommand.java new file mode 100644 index 0000000..c71665e --- /dev/null +++ b/src/alisolarflare/architecture/commands/subcommands/PlayerSubCommand.java @@ -0,0 +1,16 @@ +package alisolarflare.architecture.commands.subcommands; + +public abstract class PlayerSubCommand extends SubCommand{ + @Override + public boolean getModOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean getPlayerOnly() { + // TODO Auto-generated method stub + return true; + } + +} diff --git a/src/alisolarflare/architecture/commands/subcommands/SubCommand.java b/src/alisolarflare/architecture/commands/subcommands/SubCommand.java new file mode 100644 index 0000000..119fb70 --- /dev/null +++ b/src/alisolarflare/architecture/commands/subcommands/SubCommand.java @@ -0,0 +1,10 @@ +package alisolarflare.architecture.commands.subcommands; + +import org.bukkit.entity.Player; + +public abstract class SubCommand { + public abstract boolean run(Player player, String label, String[] args); + public abstract boolean getPlayerOnly(); + public abstract boolean getModOnly(); + public abstract String[] GetHelpText(String alias); +} diff --git a/src/alisolarflare/components/alilinks/AliLinkComponent.java b/src/alisolarflare/components/alilinks/AliLinkComponent.java index 8812dbf..78095d6 100644 --- a/src/alisolarflare/components/alilinks/AliLinkComponent.java +++ b/src/alisolarflare/components/alilinks/AliLinkComponent.java @@ -8,23 +8,21 @@ import org.bukkit.Server; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.architecture.Component; -import alisolarflare.components.alilinks.commands.PressAliLink; -import alisolarflare.components.alilinks.commands.SetAliLink; +import alisolarflare.components.alilinks.commands.AliLink; import alisolarflare.components.alilinks.entities.Link; public class AliLinkComponent extends Component { private List linkList; - private List> linkData; + private List> linkMap; @Override public void register(JavaPlugin plugin) { this.linkList = MapToLinkList(plugin.getConfig().getMapList("aliLinkList"), plugin.getServer()); for (Link link: linkList){ - linkData.add(link.toMap()); + linkMap.add(link.toMap()); } - registerCommand(plugin, new PressAliLink(plugin, linkList)); - registerCommand(plugin, new SetAliLink(plugin.getConfig(), linkList, linkData)); + registerCommand(plugin, new AliLink(plugin, linkList)); } @SuppressWarnings("unchecked") diff --git a/src/alisolarflare/components/alilinks/commands/SetAliLink.java b/src/alisolarflare/components/alilinks/commands/AliLink.java similarity index 51% rename from src/alisolarflare/components/alilinks/commands/SetAliLink.java rename to src/alisolarflare/components/alilinks/commands/AliLink.java index a7eda06..362a8ab 100644 --- a/src/alisolarflare/components/alilinks/commands/SetAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/AliLink.java @@ -1,65 +1,86 @@ -package alisolarflare.components.alilinks.commands; - -import java.util.List; -import java.util.Map; - -import org.apache.commons.lang3.StringUtils; -import org.bukkit.World; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.entity.Player; - -import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.alilinks.entities.Link; - -public class SetAliLink extends PlayerCommand { - public List linkList; - public List> linkData; - private FileConfiguration config; - - public SetAliLink(FileConfiguration config, List linkList, List> linkData) { - this.linkList = linkList; - this.linkData = linkData; - this.config = config; - } - - @Override - public boolean OnCommand(Player player, String label, String[] args) { - if (args == null || args.length < 1) { - player.sendMessage("You must specify a link frequency"); - player.sendMessage("/pressalilink [name]"); - return false; - } - - String frequency = args[0]; - World world = player.getWorld(); - int x = player.getLocation().getBlockX(); - int y = player.getLocation().getBlockY(); - int z = player.getLocation().getBlockZ(); - - if (args.length > 4) { - boolean arg1isNumber = StringUtils.isNumericSpace(args[1]); - boolean arg2isNumber = StringUtils.isNumericSpace(args[2]); - boolean arg3isNumber = StringUtils.isNumericSpace(args[3]); - if (arg1isNumber && arg2isNumber && arg3isNumber) { - x = Integer.parseInt(args[1]); - y = Integer.parseInt(args[2]); - z = Integer.parseInt(args[3]); - } - } - - Link link = new Link(frequency, world, x, y, z); - linkList.add(link); - linkData.add(link.toMap()); - saveLinkList(); - return true; - } - private void saveLinkList(){ - config.set("aliLinkList", linkData); - } - @Override - public String[] GetHelpText(String alias){ - return new String[]{ - "Usage: /setalilink [x] [y] [z]" - }; - } -} +package alisolarflare.components.alilinks.commands; + +import java.util.Arrays; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.bukkit.World; +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.architecture.commands.PlayerCommand; +import alisolarflare.components.alilinks.entities.Link; + +public class AliLink extends PlayerCommand{ + private JavaPlugin plugin; + private List linkList; + + public AliLink(JavaPlugin plugin, List linkList) { + this.plugin = plugin; + this.linkList = linkList; + } + @Override + public boolean OnCommand(Player player, String alias, String[] args) { + if(args.length < 1) + return false; + + switch (args[0].toLowerCase()){ + case "press": + return press(player, alias, args); + case "set": + return set(player, alias, args); + default: + return false; + } + + } + /**"Usage: /pressalilink "*/ + private boolean press(Player player, String alias, String[] inputFrequencies) { + if (inputFrequencies.length == 0) { + player.sendMessage("You must specify a link frequency"); + return false; + } + + List inputFrequencyList= Arrays.asList(inputFrequencies); + for (Link link : linkList) { + if(inputFrequencyList.contains(link.frequency)){ + link.press(plugin); + } + } + + player.sendMessage("Link pressed!"); + + return true; + } + + /**Usage: /setalilink [x] [y] [z]*/ + public boolean set(Player player, String label, String[] args) { + if (args == null || args.length < 1) { + player.sendMessage("You must specify a link frequency"); + player.sendMessage("/pressalilink [name]"); + return false; + } + + String frequency = args[0]; + World world = player.getWorld(); + int x = player.getLocation().getBlockX(); + int y = player.getLocation().getBlockY(); + int z = player.getLocation().getBlockZ(); + + if (args.length > 4) { + boolean arg1isNumber = StringUtils.isNumericSpace(args[1]); + boolean arg2isNumber = StringUtils.isNumericSpace(args[2]); + boolean arg3isNumber = StringUtils.isNumericSpace(args[3]); + if (arg1isNumber && arg2isNumber && arg3isNumber) { + x = Integer.parseInt(args[1]); + y = Integer.parseInt(args[2]); + z = Integer.parseInt(args[3]); + } + } + + Link link = new Link(frequency, world, x, y, z); + linkList.add(link); + return true; + } + +} diff --git a/src/alisolarflare/components/alilinks/commands/PressAliLink.java b/src/alisolarflare/components/alilinks/commands/PressAliLink.java deleted file mode 100644 index 8f9486a..0000000 --- a/src/alisolarflare/components/alilinks/commands/PressAliLink.java +++ /dev/null @@ -1,43 +0,0 @@ -package alisolarflare.components.alilinks.commands; - -import java.util.List; - -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.alilinks.entities.Link; - -public class PressAliLink extends PlayerCommand { - private JavaPlugin plugin; - private List linkList; - - public PressAliLink(JavaPlugin plugin, List linkList) { - this.plugin = plugin; - this.linkList = linkList; - } - - @Override - public boolean OnCommand(Player player, String label, String[] inputFrequencies) { - if (inputFrequencies.length < 1) { - player.sendMessage("You must specify a link frequency"); - return false; - } - - for (Link link : linkList) { - for (String frequency : inputFrequencies) { - if (frequency.equals(link.frequency)) { - link.press(plugin); - } - } - } - player.sendMessage("Link pressed!"); - return true; - } - @Override - public String[] GetHelpText(String alias){ - return new String[]{ - "Usage: /pressalilink " - }; - } -} diff --git a/src/alisolarflare/components/alilinks/entities/Link.java b/src/alisolarflare/components/alilinks/entities/Link.java index 546f116..a2ea8f1 100644 --- a/src/alisolarflare/components/alilinks/entities/Link.java +++ b/src/alisolarflare/components/alilinks/entities/Link.java @@ -12,6 +12,7 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.alilinks.tasks.UnpressTask; public class Link{ + public String frequency; public World world; public int x; diff --git a/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java index eba221e..7ef2fb8 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java +++ b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java @@ -23,8 +23,6 @@ public class Cbgm0 extends PlayerCommand{ return true; } public String[] GetHelpText(String alias){ - return new String[]{ - "Creative Boundaries Usage: /cbgm0" - }; + return new String[]{"Creative Boundaries Usage: /cbgm0"}; } } diff --git a/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java b/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java deleted file mode 100644 index ffb9a3d..0000000 --- a/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java +++ /dev/null @@ -1,6 +0,0 @@ -package alisolarflare.components.creativeboundaries.listeners; - -import org.bukkit.event.Listener; - -public class ItemRestrictionListener implements Listener { -} diff --git a/src/alisolarflare/components/easyuhc/EasyUHCComponent.java b/src/alisolarflare/components/easyuhc/EasyUHCComponent.java index 15d0e3d..1eeae35 100644 --- a/src/alisolarflare/components/easyuhc/EasyUHCComponent.java +++ b/src/alisolarflare/components/easyuhc/EasyUHCComponent.java @@ -4,13 +4,6 @@ import org.bukkit.Location; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.architecture.Component; -import alisolarflare.components.easyuhc.commands.ActivatePowers; -import alisolarflare.components.easyuhc.commands.SetUHCLobby; -import alisolarflare.components.easyuhc.commands.SetWorldBorders; -import alisolarflare.components.easyuhc.commands.SpreadPlayers; -import alisolarflare.components.easyuhc.commands.StartTimer; -import alisolarflare.components.easyuhc.commands.StartUHC; -import alisolarflare.components.easyuhc.commands.TeleportToUHC; public class EasyUHCComponent extends Component{ public Location lobbyLocation; @@ -19,14 +12,14 @@ public class EasyUHCComponent extends Component{ - registerCommand(plugin, new ActivatePowers()); - registerCommand(plugin, new SetUHCLobby(this)); - registerCommand(plugin, new SetWorldBorders()); - registerCommand(plugin, new SetWorldBorders()); - registerCommand(plugin, new SpreadPlayers()); - registerCommand(plugin, new StartTimer()); - registerCommand(plugin, new StartUHC()); - registerCommand(plugin, new TeleportToUHC()); - +// registerCommand(plugin, new ActivatePowers()); +// registerCommand(plugin, new SetUHCLobby(this)); +// registerCommand(plugin, new SetWorldBorders()); +// registerCommand(plugin, new SetWorldBorders()); +// registerCommand(plugin, new SpreadPlayers()); +// registerCommand(plugin, new StartTimer()); +// registerCommand(plugin, new StartUHC()); +// registerCommand(plugin, new TeleportToUHC()); + } } diff --git a/src/alisolarflare/components/easyuhc/commands/ActivatePowers.java b/src/alisolarflare/components/easyuhc/commands/ActivatePowers.java deleted file mode 100644 index 7af36e2..0000000 --- a/src/alisolarflare/components/easyuhc/commands/ActivatePowers.java +++ /dev/null @@ -1,13 +0,0 @@ -package alisolarflare.components.easyuhc.commands; - -import org.bukkit.entity.Player; - -import alisolarflare.architecture.commands.ModCommand; - -public class ActivatePowers extends ModCommand{ - - @Override - public boolean OnCommand(Player player, String alias, String[] args) { - return false; - } -} diff --git a/src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java b/src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java deleted file mode 100644 index 0a56438..0000000 --- a/src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java +++ /dev/null @@ -1,20 +0,0 @@ -package alisolarflare.components.easyuhc.commands; - -import org.bukkit.entity.Player; - -import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.easyuhc.EasyUHCComponent; - -public class SetUHCLobby extends ModCommand{ - EasyUHCComponent module; - public SetUHCLobby(EasyUHCComponent easyUHCModule) { - this.module = easyUHCModule; - } - - @Override - public boolean OnCommand(Player player, String alias, String[] args) { - module.lobbyLocation = player.getLocation(); - return false; - } - -} diff --git a/src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java b/src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java deleted file mode 100644 index bfc52d9..0000000 --- a/src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java +++ /dev/null @@ -1,14 +0,0 @@ -package alisolarflare.components.easyuhc.commands; - -import org.bukkit.entity.Player; - -import alisolarflare.architecture.commands.ModCommand; - -public class SetWorldBorders extends ModCommand { - - @Override - public boolean OnCommand(Player player, String alias, String[] args) { - - return false; - } -} diff --git a/src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java b/src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java deleted file mode 100644 index af993f2..0000000 --- a/src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java +++ /dev/null @@ -1,14 +0,0 @@ -package alisolarflare.components.easyuhc.commands; - -import org.bukkit.entity.Player; - -import alisolarflare.architecture.commands.ModCommand; - -public class ShrinkWorldBorders extends ModCommand { - - @Override - public boolean OnCommand(Player player, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } -} diff --git a/src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java b/src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java deleted file mode 100644 index 6e402c2..0000000 --- a/src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java +++ /dev/null @@ -1,15 +0,0 @@ -package alisolarflare.components.easyuhc.commands; - -import org.bukkit.entity.Player; - -import alisolarflare.architecture.commands.ModCommand; - -public class SpreadPlayers extends ModCommand{ - - @Override - public boolean OnCommand(Player player, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } - -} diff --git a/src/alisolarflare/components/easyuhc/commands/StartTimer.java b/src/alisolarflare/components/easyuhc/commands/StartTimer.java deleted file mode 100644 index 2859935..0000000 --- a/src/alisolarflare/components/easyuhc/commands/StartTimer.java +++ /dev/null @@ -1,14 +0,0 @@ -package alisolarflare.components.easyuhc.commands; - -import org.bukkit.entity.Player; - -import alisolarflare.architecture.commands.ModCommand; - -public class StartTimer extends ModCommand{ - - @Override - public boolean OnCommand(Player player, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } -} diff --git a/src/alisolarflare/components/easyuhc/commands/StartUHC.java b/src/alisolarflare/components/easyuhc/commands/StartUHC.java deleted file mode 100644 index 4f5dff4..0000000 --- a/src/alisolarflare/components/easyuhc/commands/StartUHC.java +++ /dev/null @@ -1,14 +0,0 @@ -package alisolarflare.components.easyuhc.commands; - -import org.bukkit.entity.Player; - -import alisolarflare.architecture.commands.ModCommand; - -public class StartUHC extends ModCommand{ - - @Override - public boolean OnCommand(Player player, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } -} diff --git a/src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java b/src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java deleted file mode 100644 index 3b64c82..0000000 --- a/src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java +++ /dev/null @@ -1,14 +0,0 @@ -package alisolarflare.components.easyuhc.commands; - -import org.bukkit.entity.Player; - -import alisolarflare.architecture.commands.PlayerCommand; - -public class TeleportToUHC extends PlayerCommand{ - - @Override - public boolean OnCommand(Player player, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } -} diff --git a/src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java b/src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java index b8a3a8a..a1727a6 100644 --- a/src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java +++ b/src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java @@ -14,39 +14,57 @@ public class PlayerProximityLoop extends BukkitRunnable implements Listener{ private Location startLocation; private Location endLocation; + private int sX; + private int sY; + private int sZ; + private int eX; + private int eY; + private int eZ; + public PlayerProximityLoop(JavaPlugin plugin, FlairDoorComponent component) { this.plugin = plugin; this.component = component; - this.startLocation = component.startLocation; - this.endLocation = component.endLocation; + setStartLocation(component.startLocation); + setEndLocation(component.endLocation); this.runTaskTimer(plugin, 0, 20); } + public void setStartLocation(Location location){ + this.sX = startLocation.getBlockX(); + this.sY = startLocation.getBlockY(); + this.sZ = startLocation.getBlockZ(); + this.startLocation = location; + this.endLocation.setWorld(location.getWorld()); + } + public void setEndLocation(Location location){ + this.eX = startLocation.getBlockX(); + this.eY = startLocation.getBlockY(); + this.eZ = startLocation.getBlockZ(); + this.endLocation = location; + this.startLocation.setWorld(location.getWorld()); + } @Override public void run() { if (startLocation == null || endLocation == null){ return; } - int sX = startLocation.getBlockX(); - int sY = startLocation.getBlockY(); - int sZ = startLocation.getBlockZ(); - int eX = endLocation.getBlockX(); - int eY = endLocation.getBlockY(); - int eZ = endLocation.getBlockZ(); int playerX; int playerY; int playerZ; + Location playerLocation; for (Player player : plugin.getServer().getOnlinePlayers()){ - playerX = player.getLocation().getBlockX(); - playerY = player.getLocation().getBlockY(); - playerZ = player.getLocation().getBlockZ(); - if(player.getLocation().getWorld() != startLocation.getWorld()) + playerLocation = player.getLocation(); + if(playerLocation.getWorld() != startLocation.getWorld()) continue; - if((playerX < sX && playerX < eX) ||(playerX > sX && playerX > eX)) + + playerX = playerLocation.getBlockX(); + if((playerX < sX && playerX < eX) || (playerX > sX && playerX > eX)) continue; - if((playerY < sY && playerY < eY) ||(playerY > sY && playerY > eY)) + playerY = playerLocation.getBlockY(); + if((playerY < sY && playerY < eY) || (playerY > sY && playerY > eY)) continue; - if((playerZ < sZ && playerZ < eZ) ||(playerZ > sZ && playerZ > eZ)) + playerZ = playerLocation.getBlockZ(); + if((playerZ < sZ && playerZ < eZ) || (playerZ > sZ && playerZ > eZ)) continue; component.playersToBeFlaired.add(player); diff --git a/src/alisolarflare/components/magic/tricks/BoomBowListener.java b/src/alisolarflare/components/magic/tricks/BoomBowListener.java index ef79278..bdb5b02 100644 --- a/src/alisolarflare/components/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/components/magic/tricks/BoomBowListener.java @@ -1,110 +1,111 @@ -package alisolarflare.components.magic.tricks; - -import org.bukkit.GameMode; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Particle; -import org.bukkit.Sound; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; - -public class BoomBowListener implements Listener { - JavaPlugin plugin; - public BoomBowListener(JavaPlugin plugin){ - this.plugin = plugin; - } - @EventHandler - public void ClickEvent(PlayerInteractEvent event){ - FlyBowBoost(event); - - } - public void FlyBowBoost(PlayerInteractEvent event){ - - //ACTION SANITATION - if(!(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK)) return; - if(!(event.getPlayer().isGliding())) return; - if(!(event.getMaterial() == Material.BOW)) return; - - //BOW SANITATION - ItemStack bow = event.getItem(); - if(!(bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK))) return; - if(!(bow.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) == 3)) return; - if(!(bow.getItemMeta().getDisplayName().contains("BOOM BOW"))) return; - - //PLAYER SANITATION - Player player = event.getPlayer(); - if(player.getGameMode().equals(GameMode.CREATIVE))return; - - if(bow.containsEnchantment(Enchantment.ARROW_INFINITE)){ - //HAS INIFINITY - Activate(event); - - }else if((player.getInventory().contains(Material.TNT))){ - //HAS TNT - Activate(event); - - //Reduce tnt by 1 - int tntSlot = player.getInventory().first(Material.TNT); - ItemStack tntStack = player.getInventory().getItem(tntSlot); - if(tntStack.getAmount() > 3){ - tntStack.setAmount(tntStack.getAmount()-3); - }else{ - player.getInventory().remove(tntStack); - } - if (bow.getDurability() < 0){ - player.getInventory().clear(player.getInventory().getHeldItemSlot()); - } - - }else{ - return; - } - } - - - - public void Activate(PlayerInteractEvent event){ - //INIT - Player variables - Player player = event.getPlayer(); - Location playerLocation = player.getLocation(); - ItemStack boomBow = player.getInventory().getItemInMainHand(); - - //TODO: NERF - boomDecay - //TODO: NERF - endCrystal - //TODO: NERF - healthReduction - //TODO: NERF - localized - - if(BoomBowRule.boomDecay) - new BoomDecayTask(player).runTaskTimer(plugin, 1, 1); - if(BoomBowRule.endCrystal){ - //BoomBowCyrstalSpawn - } - if(BoomBowRule.healthReduction){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1)); - } - if(BoomBowRule.localized); - - - //SET - Player Velocity - player.setVelocity(playerLocation.getDirection().normalize().multiply(3.0)); - - //CREATE - Explosion + damage - player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); - player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); - player.damage(7.42425, player); - boomBow.setDurability((short) (boomBow.getDurability() + 3)); - if(boomBow.getDurability() < 0){ - player.getInventory().setItemInMainHand(null); - player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0) - ; - } - - } -} +package alisolarflare.components.magic.tricks; + +import org.bukkit.GameMode; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Particle; +import org.bukkit.Sound; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.PlayerInventory; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +public class BoomBowListener implements Listener { + JavaPlugin plugin; + public BoomBowListener(JavaPlugin plugin){ + this.plugin = plugin; + } + @EventHandler + public void ClickEvent(PlayerInteractEvent event){ + FlyBowBoost(event); + + } + public void FlyBowBoost(PlayerInteractEvent event){ + + //ACTION SANITATION + if(!(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK)) return; + if(!(event.getPlayer().isGliding())) return; + if(!(event.getMaterial() == Material.BOW)) return; + + //BOW SANITATION + ItemStack bow = event.getItem(); + if(!(bow.containsEnchantment(Enchantment.ARROW_KNOCKBACK))) return; + if(!(bow.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) == 3)) return; + if(!(bow.getItemMeta().getDisplayName().contains("BOOM BOW"))) return; + + //PLAYER SANITATION + Player player = event.getPlayer(); + PlayerInventory inventory = player.getInventory(); + if(player.getGameMode().equals(GameMode.SPECTATOR))return; + + if(bow.containsEnchantment(Enchantment.ARROW_INFINITE)){ + //HAS INIFINITY + Activate(event); + + }else if((inventory.contains(Material.TNT))){ + //HAS TNT + Activate(event); + + //Reduce TNT + ItemStack tnt = inventory.getItem(inventory.first(Material.TNT)); + + if(tnt.getAmount() > 3){ + tnt.setAmount(tnt.getAmount()-3); + }else{ + inventory.remove(tnt); + } + if (bow.getDurability() < 0){ + inventory.clear(inventory.getHeldItemSlot()); + } + + }else{ + return; + } + } + + + + public void Activate(PlayerInteractEvent event){ + //INIT - Player variables + Player player = event.getPlayer(); + Location playerLocation = player.getLocation(); + ItemStack boomBow = player.getInventory().getItemInMainHand(); + + //TODO: NERF - boomDecay + //TODO: NERF - endCrystal + //TODO: NERF - healthReduction + //TODO: NERF - localized + + if(BoomBowRule.boomDecay) + new BoomDecayTask(player).runTaskTimer(plugin, 1, 1); + if(BoomBowRule.endCrystal){ + //BoomBowCyrstalSpawn + } + if(BoomBowRule.healthReduction){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 400, -1)); + } + if(BoomBowRule.localized); + + + //SET - Player Velocity + player.setVelocity(playerLocation.getDirection().normalize().multiply(3.0)); + + //CREATE - Explosion + damage + player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); + player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); + player.damage(7.42425, player); + boomBow.setDurability((short) (boomBow.getDurability() + 3)); + if(boomBow.getDurability() > 385){ + player.getInventory().setItemInMainHand(null); + player.getWorld().playSound(playerLocation, Sound.ENTITY_ITEM_BREAK, 0, 0); + } + + } +} diff --git a/src/alisolarflare/components/magic/tricks/CannonBowListener.java b/src/alisolarflare/components/magic/tricks/CannonBowListener.java index 097f685..9eb0515 100644 --- a/src/alisolarflare/components/magic/tricks/CannonBowListener.java +++ b/src/alisolarflare/components/magic/tricks/CannonBowListener.java @@ -17,6 +17,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; public class CannonBowListener implements Listener { + public final static String launchedTNTName = "CANNON BOW TNT:42170"; JavaPlugin plugin; public CannonBowListener(JavaPlugin plugin){ this.plugin = plugin; @@ -24,32 +25,33 @@ public class CannonBowListener implements Listener { @EventHandler public void onProjectileLaunch(ProjectileLaunchEvent event){ - if(event.getEntity().getType() != EntityType.ARROW) - return; + //ENTITY SANITATION + if(event.getEntity().getType() != EntityType.ARROW)return; + + //ARROW SANITATION Arrow arrow = (Arrow) event.getEntity(); - if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player)) - return; + if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player))return; + + //PLAYER SANITATION Player player = (Player) arrow.getShooter(); + if (!player.getInventory().contains(Material.TNT))return; + + //BOW SANITATION ItemStack bow; - if ((bow = player.getInventory().getItemInMainHand()).getType() != Material.BOW) - return; - if (!bow.containsEnchantment(Enchantment.PROTECTION_EXPLOSIONS)) - return; - if(!(bow.getEnchantmentLevel(Enchantment.PROTECTION_EXPLOSIONS) == 10)) - return; - if (!bow.getItemMeta().getDisplayName().toUpperCase().contains("CANNON BOW")) - return; - if (!player.getInventory().contains(Material.TNT)) - return; + if (!((bow = player.getInventory().getItemInMainHand()).getType() == Material.BOW))return; + if (!(bow.containsEnchantment(Enchantment.PROTECTION_EXPLOSIONS)))return; + if (!(bow.getEnchantmentLevel(Enchantment.PROTECTION_EXPLOSIONS) == 10))return; + if (!(bow.getItemMeta().getDisplayName().toUpperCase().contains("CANNON BOW")))return; TNTPrimed tnt = (TNTPrimed) arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.PRIMED_TNT); tnt.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(1.0)); - tnt.setCustomName("CANNON BOW TNT"); + tnt.setCustomName(launchedTNTName); tnt.setFuseTicks(40); player.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(-1)); player.getWorld().playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 2.0F, 0); - player.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, player.getLocation(), 1); + player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, player.getLocation(), 2); + arrow.remove(); return; @@ -57,10 +59,9 @@ public class CannonBowListener implements Listener { @EventHandler public void onTnTExplode(EntityExplodeEvent event) { - if (event.getEntityType() != EntityType.PRIMED_TNT) - return; - if (!event.getEntity().getCustomName().equals("CANNON BOW TNT")) - return; + if (event.getEntityType() != EntityType.PRIMED_TNT) return; + if (!event.getEntity().getCustomName().equals(launchedTNTName)) return; + Location loc = event.getEntity().getLocation(); event.getEntity().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 3, false, false); event.setCancelled(true); diff --git a/src/alisolarflare/components/minigames/MinigameComponent.java b/src/alisolarflare/components/minigames/MinigameComponent.java index a4f8322..5b662e1 100644 --- a/src/alisolarflare/components/minigames/MinigameComponent.java +++ b/src/alisolarflare/components/minigames/MinigameComponent.java @@ -2,6 +2,7 @@ package alisolarflare.components.minigames; import java.util.List; +import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.architecture.Component; @@ -14,7 +15,7 @@ import alisolarflare.components.minigames.data.SpawnSet; public class MinigameComponent extends Component{ public SpawnSet spawnSet; public List fighters; - private GameState gameState; + public GameState gameState; @Override public void register(JavaPlugin plugin) { @@ -25,9 +26,11 @@ public class MinigameComponent extends Component{ registerCommand(plugin, new ListFighters(this)); } - - public GameState getGameState() {return gameState;} - public void setGameState(GameState gameState) {this.gameState = gameState;} - - + public class Fighter { + public Player player; + public String colour; + public Fighter(Player player, String colour){ + this.colour = colour; + } + } } diff --git a/src/alisolarflare/components/minigames/commands/JoinMinigame.java b/src/alisolarflare/components/minigames/commands/JoinMinigame.java index 6eea609..8dc07d2 100644 --- a/src/alisolarflare/components/minigames/commands/JoinMinigame.java +++ b/src/alisolarflare/components/minigames/commands/JoinMinigame.java @@ -1,28 +1,25 @@ package alisolarflare.components.minigames.commands; +import java.util.List; + import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; import alisolarflare.components.minigames.MinigameComponent; public class JoinMinigame extends PlayerCommand { - private MinigameComponent module; + private List fighterList; - public JoinMinigame(MinigameComponent module) { - this.module = module; + public JoinMinigame(MinigameComponent component) { + this.fighterList = component.fighters; } @Override - public boolean OnCommand(Player player, String arg2, String[] arg3) { - String name = player.getName(); - if (module.fighters.contains(name)) { + public boolean OnCommand(Player player, String arg2, String[] arg3) { + if (fighterList.contains(player.getName())) { player.sendMessage("You are already in the minigame!"); - return true; - } - - module.fighters.add(name); - - if (module.fighters.contains(name)) { + }else{ + fighterList.add(player.getName()); player.sendMessage("You have joined the minigame!"); } return true; diff --git a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java index d1e4345..c7c5f9c 100644 --- a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java +++ b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java @@ -1,16 +1,17 @@ package alisolarflare.components.minigames.commands; +import java.util.List; + import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; import alisolarflare.components.minigames.MinigameComponent; public class LeaveMinigame extends PlayerCommand { + private List fighters; - private MinigameComponent module; - - public LeaveMinigame(MinigameComponent module) { - this.module = module; + public LeaveMinigame(MinigameComponent components) { + this.fighters = components.fighters; } @Override @@ -18,15 +19,14 @@ public class LeaveMinigame extends PlayerCommand { if(!(player instanceof Player)) player.sendMessage("You must be a player to use this command!"); - String name = player.getName(); - if (!(module.fighters.contains(name))) { + if (!(fighters.contains(name))) { player.sendMessage("You are not fighting!"); return true; } - while(module.fighters.contains(name)){ - module.fighters.remove(name); + while(fighters.contains(name)){ + fighters.remove(name); } player.sendMessage("You have left the fighters category!"); diff --git a/src/alisolarflare/components/minigames/commands/ListFighters.java b/src/alisolarflare/components/minigames/commands/ListFighters.java index c5a9f10..6904914 100644 --- a/src/alisolarflare/components/minigames/commands/ListFighters.java +++ b/src/alisolarflare/components/minigames/commands/ListFighters.java @@ -6,15 +6,15 @@ import alisolarflare.architecture.commands.PlayerCommand; import alisolarflare.components.minigames.MinigameComponent; public class ListFighters extends PlayerCommand { - private MinigameComponent lobby; + private MinigameComponent component; - public ListFighters(MinigameComponent lobby) { - this.lobby = lobby; + public ListFighters(MinigameComponent component) { + this.component = component; } @Override public boolean OnCommand(Player player, String arg2, String[] arg3) { - player.sendMessage(lobby.fighters.toString()); + player.sendMessage(component.fighters.toString()); return true; } @Override diff --git a/src/alisolarflare/components/minigames/commands/SetColourSpawn.java b/src/alisolarflare/components/minigames/commands/SetColourSpawn.java index 24a23d4..bb29f3e 100644 --- a/src/alisolarflare/components/minigames/commands/SetColourSpawn.java +++ b/src/alisolarflare/components/minigames/commands/SetColourSpawn.java @@ -7,7 +7,7 @@ import alisolarflare.components.minigames.data.SpawnSet; public class SetColourSpawn extends ModCommand{ private SpawnSet spawnSet; - + public SetColourSpawn(SpawnSet spawnSet){ this.spawnSet = spawnSet; } @@ -17,41 +17,41 @@ public class SetColourSpawn extends ModCommand{ player.sendMessage("ERROR: Arguments required."); return false; } - + String input = args[0]; - + input.toLowerCase(); switch(input){ case ("r"): player.sendMessage("Setting Red Spawn..."); - spawnSet.setRSpawn(player.getLocation()); + spawnSet.RSpawn = player.getLocation(); player.sendMessage("Red Spawn Set!"); break; case ("o"): player.sendMessage("Setting Orange Spawn..."); - spawnSet.setRSpawn(player.getLocation()); + spawnSet.OSpawn = player.getLocation(); player.sendMessage("Orange Spawn Set!"); break; case ("y"): player.sendMessage("Setting Yellow Spawn..."); - spawnSet.setRSpawn(player.getLocation()); + spawnSet.YSpawn = player.getLocation(); player.sendMessage("Yellow Spawn Set!"); break; case ("g"): player.sendMessage("Setting Green Spawn..."); - spawnSet.setRSpawn(player.getLocation()); + spawnSet.GSpawn = player.getLocation(); player.sendMessage("Green Spawn Set!"); break; case ("b"): player.sendMessage("Setting Blue Spawn..."); - spawnSet.setRSpawn(player.getLocation()); + spawnSet.BSpawn = player.getLocation(); player.sendMessage("Blue Spawn Set!"); break; case ("p"): player.sendMessage("Setting Purple Spawn..."); - spawnSet.setRSpawn(player.getLocation()); + spawnSet.PSpawn = player.getLocation(); player.sendMessage("Purple Spawn Set!"); - break; + break; } return true; } diff --git a/src/alisolarflare/components/minigames/data/SpawnSet.java b/src/alisolarflare/components/minigames/data/SpawnSet.java index dfd2ba9..be34825 100644 --- a/src/alisolarflare/components/minigames/data/SpawnSet.java +++ b/src/alisolarflare/components/minigames/data/SpawnSet.java @@ -3,25 +3,11 @@ package alisolarflare.components.minigames.data; import org.bukkit.Location; public class SpawnSet { - private Location RSpawn; - private Location OSpawn; - private Location YSpawn; - private Location GSpawn; - private Location BSpawn; - private Location PSpawn; - - public Location getRSpawn(){return RSpawn;} - public Location getOSpawn(){return OSpawn;} - public Location getYSpawn(){return YSpawn;} - public Location getGSpawn(){return GSpawn;} - public Location getBSpawn(){return BSpawn;} - public Location getPSpawn(){return PSpawn;} - - public void setRSpawn(Location RSpawn){this.RSpawn = RSpawn; return;} - public void setOSpawn(Location OSpawn){this.OSpawn = OSpawn; return;} - public void setYSpawn(Location YSpawn){this.YSpawn = YSpawn; return;} - public void setGSpawn(Location GSpawn){this.GSpawn = GSpawn; return;} - public void setBSpawn(Location BSpawn){this.BSpawn = BSpawn; return;} - public void setPSpawn(Location PSpawn){this.PSpawn = PSpawn; return;} + public Location RSpawn; + public Location OSpawn; + public Location YSpawn; + public Location GSpawn; + public Location BSpawn; + public Location PSpawn; } diff --git a/src/alisolarflare/components/minigames/entities/Fighter.java b/src/alisolarflare/components/minigames/entities/Fighter.java deleted file mode 100644 index 79fc62a..0000000 --- a/src/alisolarflare/components/minigames/entities/Fighter.java +++ /dev/null @@ -1,11 +0,0 @@ -package alisolarflare.components.minigames.entities; - -import org.bukkit.entity.Player; - -public class Fighter { - public Player player; - public String colour; - public Fighter(Player player, String colour){ - this.colour = colour; - } -} From f8127b978ff17f5b03d89fd90449b2e84b02d175 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 28 Nov 2016 18:31:16 -0500 Subject: [PATCH 177/263] Removed illegal character --- plugin.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.yml b/plugin.yml index 3bc12b6..ebb15ed 100644 --- a/plugin.yml +++ b/plugin.yml @@ -12,11 +12,11 @@ commands: powerdown: description: Offical g-power command that deactivates the ghostie powerups alilink: - description: Arguments: + description: Arguments - press or set cbgm0: description: Creative Boundaries Gamemode 0 - allows players to return to survival cbgm1: - description: Creative Boundaries Gamemode 1 - allows players to access creative within their towns. Creative is removed outside of towns, so be careful + description: Creative Boundaries Gamemode 1 - allows players to access creative within their towns. Creative is removed outside of towns so be careful setdickmode: description: Should players automatically return to creative when outside town borders? Dickmode says yes. joinminigame: From d66e8b697bb74ca5f7c8bf70d875b56a1c1fb522 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 28 Nov 2016 18:41:01 -0500 Subject: [PATCH 178/263] Attempt at brute-force finding metrics.txt --- .../metrics/output/GetLoginMetrics.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/alisolarflare/components/metrics/output/GetLoginMetrics.java b/src/alisolarflare/components/metrics/output/GetLoginMetrics.java index 7fc8f78..cd5dee8 100644 --- a/src/alisolarflare/components/metrics/output/GetLoginMetrics.java +++ b/src/alisolarflare/components/metrics/output/GetLoginMetrics.java @@ -1,9 +1,17 @@ package alisolarflare.components.metrics.output; +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + import org.bukkit.entity.Player; import alisolarflare.architecture.commands.ModCommand; import alisolarflare.components.metrics.MetricsComponent; +import buttondevteam.lib.TBMCCoreAPI; public class GetLoginMetrics extends ModCommand{ @@ -15,6 +23,27 @@ public class GetLoginMetrics extends ModCommand{ @Override public boolean OnCommand(Player player, String alias, String[] args) { + if (args.length == 1){ + BufferedReader outputStream = null; + try { + outputStream = new BufferedReader(new FileReader(args[0])); + + List outputList = new ArrayList(); + String currentLine; + + while ((currentLine = outputStream.readLine()) != null){ + outputList.add(currentLine); + } + outputStream.close(); + for (String metric: outputList){ + player.sendMessage(metric); + } + } catch (FileNotFoundException e) { + TBMCCoreAPI.SendException(args[0] + " could not be found", e); + } catch (IOException e1) { + TBMCCoreAPI.SendException(args[0] + "encountered an I/O Exception!", e1); + } + } for (String metric : module.playerLoginsFile.toArrayList()){ player.sendMessage(metric); } From 3b1ed89717dbc3000219012ae1f113d673bdf54b Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 28 Nov 2016 18:49:29 -0500 Subject: [PATCH 179/263] is it broken for no reason whatsoever?! --- .../metrics/output/GetLoginMetrics.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/alisolarflare/components/metrics/output/GetLoginMetrics.java b/src/alisolarflare/components/metrics/output/GetLoginMetrics.java index cd5dee8..ce6b76e 100644 --- a/src/alisolarflare/components/metrics/output/GetLoginMetrics.java +++ b/src/alisolarflare/components/metrics/output/GetLoginMetrics.java @@ -23,6 +23,7 @@ public class GetLoginMetrics extends ModCommand{ @Override public boolean OnCommand(Player player, String alias, String[] args) { + player.sendMessage("FIRED"); if (args.length == 1){ BufferedReader outputStream = null; try { @@ -40,12 +41,27 @@ public class GetLoginMetrics extends ModCommand{ } } catch (FileNotFoundException e) { TBMCCoreAPI.SendException(args[0] + " could not be found", e); + if (outputStream != null){ + try { + outputStream.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } } catch (IOException e1) { TBMCCoreAPI.SendException(args[0] + "encountered an I/O Exception!", e1); + if (outputStream != null){ + try { + outputStream.close(); + } catch (IOException e2) { + e2.printStackTrace(); + } + } + } + }else{ + for (String metric : module.playerLoginsFile.toArrayList()){ + player.sendMessage(metric); } - } - for (String metric : module.playerLoginsFile.toArrayList()){ - player.sendMessage(metric); } return true; } From 3a06ba7b9c701ad1950c3aad49a3189fa31e895e Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 28 Nov 2016 19:19:46 -0500 Subject: [PATCH 180/263] Adjusted pom.xml metrics directory --- pom.xml | 196 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 98 insertions(+), 98 deletions(-) diff --git a/pom.xml b/pom.xml index de5c61e..49f277d 100644 --- a/pom.xml +++ b/pom.xml @@ -1,98 +1,98 @@ - - 4.0.0 - com.github.tbmcplugins - AliPresents - 0.0.1-SNAPSHOT - AliPresents - A bucket of aaall the stuff Ali makes. It's a bit smelly. - - src - - - src - - **/*.java - - - - . - - *.yml - - - - metrics - - **/*.txt - - - - - - maven-compiler-plugin - 3.3 - - 1.8 - 1.8 - - - - - - UTF-8 - - - - - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots/ - - - jcenter - http://jcenter.bintray.com - - - jitpack.io - https://jitpack.io - - - ess-repo - http://repo.ess3.net/content/groups/essentials - - - - - - org.spigotmc - spigot-api - 1.11-R0.1-SNAPSHOT - - - - org.apache.commons - commons-lang3 - 3.4 - - - com.github.TBMCPlugins.ButtonCore - ButtonCore - master-SNAPSHOT - - - net.ess3 - Essentials - 2.13.1 - - - org.apache.logging.log4j - log4j-api - 2.7 - - - org.apache.logging.log4j - log4j-core - 2.7 - - - + + 4.0.0 + com.github.tbmcplugins + AliPresents + 0.0.1-SNAPSHOT + AliPresents + A bucket of aaall the stuff Ali makes. It's a bit smelly. + + src + + + src + + **/*.java + + + + . + + *.yml + + + + metrics + + **/*.txt + + + + + + maven-compiler-plugin + 3.3 + + 1.8 + 1.8 + + + + + + UTF-8 + + + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + jcenter + http://jcenter.bintray.com + + + jitpack.io + https://jitpack.io + + + ess-repo + http://repo.ess3.net/content/groups/essentials + + + + + + org.spigotmc + spigot-api + 1.11-R0.1-SNAPSHOT + + + + org.apache.commons + commons-lang3 + 3.4 + + + com.github.TBMCPlugins.ButtonCore + ButtonCore + master-SNAPSHOT + + + net.ess3 + Essentials + 2.13.1 + + + org.apache.logging.log4j + log4j-api + 2.7 + + + org.apache.logging.log4j + log4j-core + 2.7 + + + From 13176ab2888be968eb174c2819474a9074a3e8cd Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 28 Nov 2016 19:20:13 -0500 Subject: [PATCH 181/263] correctly adjusted pom.xml metrics dir --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 49f277d..52f03b8 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ metrics - **/*.txt + *.txt From 00402bd3a99c42b90646b1ceb49761bfbb460c9d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 30 Nov 2016 00:31:41 -0500 Subject: [PATCH 182/263] WELP, Distraction Blocker kicked in --- plugin.yml | 2 +- .../commands/SetDickmode.java | 34 ------------------- .../listeners/PlotChangeListener.java | 27 ++++----------- .../components/easyuhc/EasyUHCComponent.java | 25 -------------- 4 files changed, 8 insertions(+), 80 deletions(-) delete mode 100644 src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java delete mode 100644 src/alisolarflare/components/easyuhc/EasyUHCComponent.java diff --git a/plugin.yml b/plugin.yml index ebb15ed..da90a29 100644 --- a/plugin.yml +++ b/plugin.yml @@ -17,7 +17,7 @@ commands: description: Creative Boundaries Gamemode 0 - allows players to return to survival cbgm1: description: Creative Boundaries Gamemode 1 - allows players to access creative within their towns. Creative is removed outside of towns so be careful - setdickmode: + setforceboundaries: description: Should players automatically return to creative when outside town borders? Dickmode says yes. joinminigame: description: Join a Button Minigame diff --git a/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java b/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java deleted file mode 100644 index f4c484b..0000000 --- a/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java +++ /dev/null @@ -1,34 +0,0 @@ -package alisolarflare.components.creativeboundaries.commands; - -import org.bukkit.entity.Player; - -import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; - -public class SetDickmode extends ModCommand{ - boolean dickMode; - - public SetDickmode(CreativeBoundariesComponent component){ - this.dickMode = component.dickmode; - } - - @Override - public boolean OnCommand(Player player, String label, String[] args) { - if(args.length < 1){ - player.sendMessage("You must use True, False, 1, or 0 as arguments!"); - return false; - } - String firstArgument = args[0]; - if(firstArgument.startsWith("t") || firstArgument.equals("1")){ - player.sendMessage("Dickmode has been turned on!"); - dickMode = true; - return true; - } - if(firstArgument.startsWith("f") || firstArgument.equals("0")){ - player.sendMessage("Dickmode has been turned off!"); - dickMode = false; - return true; - } - return false; - } -} diff --git a/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java b/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java index 856cf90..aa575e9 100644 --- a/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java +++ b/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java @@ -1,7 +1,5 @@ package alisolarflare.components.creativeboundaries.listeners; -import java.util.List; - import org.bukkit.GameMode; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -14,49 +12,39 @@ import com.palmergames.bukkit.towny.object.Town; import com.palmergames.bukkit.towny.object.TownBlock; import com.palmergames.bukkit.towny.object.TownyUniverse; -import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; +import alisolarflare.components.creativeboundaries.CreativeBoundariesAPI; public class PlotChangeListener implements Listener{ - private boolean dickmode; - private List cbCreatives; - - public PlotChangeListener(CreativeBoundariesComponent module){ - this.dickmode = module.dickmode; - this.cbCreatives = module.cbCreatives; - } @EventHandler public void onPlayerPlotChange(PlayerChangePlotEvent plotEvent){ Player player = plotEvent.getPlayer(); - if (dickmode == false){ + if (CreativeBoundariesAPI.getforceBoundaries() == false){ return; } if (plotEvent.getPlayer().getGameMode() != GameMode.CREATIVE){ return; } - if (!(cbCreatives.contains(plotEvent.getPlayer()))){ + if (!(CreativeBoundariesAPI.isCBCreative(player))){ return; } TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); if (tb == null) { - player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!"); - cbCreatives.remove(player); + CreativeBoundariesAPI.toSurvival(player); return; } Town town; try { town = tb.getTown(); } catch (NotRegisteredException e) { - player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!!"); - cbCreatives.remove(player); + CreativeBoundariesAPI.toSurvival(player); return; } if (town == null) { - player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!!!"); - cbCreatives.remove(player); + CreativeBoundariesAPI.toSurvival(player); return; } boolean townHasRes = false; @@ -66,9 +54,8 @@ public class PlotChangeListener implements Listener{ } } if (!townHasRes){ - player.setGameMode(GameMode.SURVIVAL); player.sendMessage("You have left your town boundaries!!!!"); - cbCreatives.remove(player); + CreativeBoundariesAPI.toSurvival(player); } } } diff --git a/src/alisolarflare/components/easyuhc/EasyUHCComponent.java b/src/alisolarflare/components/easyuhc/EasyUHCComponent.java deleted file mode 100644 index 1eeae35..0000000 --- a/src/alisolarflare/components/easyuhc/EasyUHCComponent.java +++ /dev/null @@ -1,25 +0,0 @@ -package alisolarflare.components.easyuhc; - -import org.bukkit.Location; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.architecture.Component; - -public class EasyUHCComponent extends Component{ - public Location lobbyLocation; - @Override - public void register(JavaPlugin plugin) { - - - -// registerCommand(plugin, new ActivatePowers()); -// registerCommand(plugin, new SetUHCLobby(this)); -// registerCommand(plugin, new SetWorldBorders()); -// registerCommand(plugin, new SetWorldBorders()); -// registerCommand(plugin, new SpreadPlayers()); -// registerCommand(plugin, new StartTimer()); -// registerCommand(plugin, new StartUHC()); -// registerCommand(plugin, new TeleportToUHC()); - - } -} From 6a9004ea13c85c9d2f18745d907b52603d40ae45 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 30 Nov 2016 00:32:04 -0500 Subject: [PATCH 183/263] Anyways, it's time for me to sleep, --- .../creativeboundaries/commands/Cbgm1.java | 49 +------------------ 1 file changed, 2 insertions(+), 47 deletions(-) diff --git a/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java b/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java index cf0dd7d..b4602ff 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java +++ b/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java @@ -1,59 +1,14 @@ package alisolarflare.components.creativeboundaries.commands; -import java.util.List; - -import org.bukkit.GameMode; import org.bukkit.entity.Player; -import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; -import com.palmergames.bukkit.towny.object.Resident; -import com.palmergames.bukkit.towny.object.Town; -import com.palmergames.bukkit.towny.object.TownBlock; -import com.palmergames.bukkit.towny.object.TownyUniverse; - import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; +import alisolarflare.components.creativeboundaries.CreativeBoundariesAPI; public class Cbgm1 extends PlayerCommand { - - List cbCreatives; - - public Cbgm1(CreativeBoundariesComponent component) { - this.cbCreatives = component.cbCreatives; - } - @Override public boolean OnCommand(Player player, String arg2, String[] arg3) { - TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); - - if (tb == null) { - player.sendMessage("Some error occured."); - player.sendMessage("TownBlock is null."); - return false; - } - Town town; - try { - town = tb.getTown(); - } catch (NotRegisteredException e) { - player.sendMessage("You aren't standing in a town, head to your home town to use this command."); - return false; - } - - boolean playerIsInTown = false; - for(Resident res : town.getResidents()){ - if (res.getName().toString().equals(player.getName().toString())){ - playerIsInTown = true; - break; - } - } - if (!playerIsInTown){ - player.sendMessage("Sorry, you're not part of this town"); - return false; - } - - player.setGameMode(GameMode.CREATIVE); - cbCreatives.add(player); - return true; + return CreativeBoundariesAPI.toCreative(player); } @Override public String[] GetHelpText(String alias){ From e69c20be77360c97c846f39356760f050b98d046 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 30 Nov 2016 00:32:30 -0500 Subject: [PATCH 184/263] I'll look at the convo tomorrow, --- src/alisolarflare/AliPresents.java | 2 -- .../CreativeBoundariesComponent.java | 17 +++++------------ .../creativeboundaries/commands/Cbgm0.java | 15 ++------------- 3 files changed, 7 insertions(+), 27 deletions(-) diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index bc334b6..b135968 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -9,7 +9,6 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.alilinks.AliLinkComponent; import alisolarflare.components.bankchest.BankChestComponent; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; -import alisolarflare.components.easyuhc.EasyUHCComponent; import alisolarflare.components.flairdoor.FlairDoorComponent; import alisolarflare.components.gpowers.GPowerComponent; import alisolarflare.components.insurance.InsuranceComponent; @@ -28,7 +27,6 @@ public class AliPresents extends JavaPlugin{ new AliLinkComponent().register(this); new BankChestComponent().register(this); new CreativeBoundariesComponent().register(this); - new EasyUHCComponent().register(this); new FlairDoorComponent().register(this); new GPowerComponent().register(this); new InsuranceComponent().register(this); diff --git a/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java b/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java index 999036c..4c96ef3 100644 --- a/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java +++ b/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java @@ -1,28 +1,21 @@ package alisolarflare.components.creativeboundaries; -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.architecture.Component; import alisolarflare.components.creativeboundaries.commands.Cbgm0; import alisolarflare.components.creativeboundaries.commands.Cbgm1; -import alisolarflare.components.creativeboundaries.commands.SetDickmode; +import alisolarflare.components.creativeboundaries.commands.SetForceBoundaries; import alisolarflare.components.creativeboundaries.listeners.PlotChangeListener; public class CreativeBoundariesComponent extends Component{ - public boolean dickmode; - public List cbCreatives = new ArrayList(); @Override public void register(JavaPlugin plugin) { - registerCommand(plugin, new Cbgm1(this)); - registerCommand(plugin, new Cbgm0(this)); - registerCommand(plugin, new SetDickmode(this)); - - registerListener(plugin, new PlotChangeListener(this)); + registerCommand(plugin, new Cbgm1()); + registerCommand(plugin, new Cbgm0()); + registerCommand(plugin, new SetForceBoundaries()); + registerListener(plugin, new PlotChangeListener()); //registerListener(plugin, new ItemRestrictionListener(this)); } diff --git a/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java index 7ef2fb8..106f1d6 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java +++ b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java @@ -1,25 +1,14 @@ package alisolarflare.components.creativeboundaries.commands; -import java.util.List; - -import org.bukkit.GameMode; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; +import alisolarflare.components.creativeboundaries.CreativeBoundariesAPI; public class Cbgm0 extends PlayerCommand{ - - private List cbCreatives; - - public Cbgm0(CreativeBoundariesComponent component) { - this.cbCreatives = component.cbCreatives; - } - @Override public boolean OnCommand(Player player, String arg2, String[] arg3) { - player.setGameMode(GameMode.SURVIVAL); - cbCreatives.remove(player); + CreativeBoundariesAPI.toSurvival(player); return true; } public String[] GetHelpText(String alias){ From 535cf70f002884291a1056c42ab23924519363e1 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 30 Nov 2016 00:32:55 -0500 Subject: [PATCH 185/263] Until then, cya'll later! --- .../commands/SetForceBoundaries.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/alisolarflare/components/creativeboundaries/commands/SetForceBoundaries.java diff --git a/src/alisolarflare/components/creativeboundaries/commands/SetForceBoundaries.java b/src/alisolarflare/components/creativeboundaries/commands/SetForceBoundaries.java new file mode 100644 index 0000000..55c67cf --- /dev/null +++ b/src/alisolarflare/components/creativeboundaries/commands/SetForceBoundaries.java @@ -0,0 +1,17 @@ +package alisolarflare.components.creativeboundaries.commands; + +import org.bukkit.entity.Player; + +import alisolarflare.architecture.commands.ModCommand; +import alisolarflare.components.creativeboundaries.CreativeBoundariesAPI; + +public class SetForceBoundaries extends ModCommand{ + @Override + public boolean OnCommand(Player player, String label, String[] args) { + return (CreativeBoundariesAPI.setForceBoundaries(player, args)); + } + @Override + public String[] GetHelpText(String alias){ + return new String[]{"Usage: /SetForceBoundaries "}; + } +} From 2ec5f2673796b9b48c338844f32cd703283fe3dd Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 30 Nov 2016 00:33:10 -0500 Subject: [PATCH 186/263] Created CreativeBoundariesAPI --- .../CreativeBoundariesAPI.java | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 src/alisolarflare/components/creativeboundaries/CreativeBoundariesAPI.java diff --git a/src/alisolarflare/components/creativeboundaries/CreativeBoundariesAPI.java b/src/alisolarflare/components/creativeboundaries/CreativeBoundariesAPI.java new file mode 100644 index 0000000..77b7996 --- /dev/null +++ b/src/alisolarflare/components/creativeboundaries/CreativeBoundariesAPI.java @@ -0,0 +1,84 @@ +package alisolarflare.components.creativeboundaries; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.GameMode; +import org.bukkit.entity.Player; + +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.Resident; +import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.towny.object.TownBlock; +import com.palmergames.bukkit.towny.object.TownyUniverse; + +public class CreativeBoundariesAPI { + private static List cbCreatives = new ArrayList(); + private static boolean forceBoundaries = false; + public CreativeBoundariesAPI(List cbCreatives){ + CreativeBoundariesAPI.cbCreatives = cbCreatives; + } + public static void toSurvival(Player player){ + player.setGameMode(GameMode.SURVIVAL); + cbCreatives.remove(player); + } + public static boolean toCreative(Player player){ + TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); + + if (tb == null) { + player.sendMessage("Some error occured."); + player.sendMessage("TownBlock is null."); + return false; + } + Town town; + try { + town = tb.getTown(); + } catch (NotRegisteredException e) { + player.sendMessage("You aren't standing in a town, head to your home town to use this command."); + return false; + } + + boolean playerIsInTown = false; + for(Resident res : town.getResidents()){ + if (res.getName().toString().equals(player.getName().toString())){ + playerIsInTown = true; + break; + } + } + if (!playerIsInTown){ + player.sendMessage("Sorry, you're not part of this town"); + return false; + } + + player.setGameMode(GameMode.CREATIVE); + cbCreatives.add(player); + return true; + } + public static void setForceBoundaries(boolean forceBoundaries){ + CreativeBoundariesAPI.forceBoundaries = forceBoundaries; + } + public static boolean setForceBoundaries(Player player, String[] args){ + if(args.length < 1){ + player.sendMessage("You must use True, False, 1, or 0 as arguments!"); + return false; + } + String firstArgument = args[0]; + if(firstArgument.startsWith("t") || firstArgument.equals("1")){ + player.sendMessage("Dickmode has been turned on!"); + forceBoundaries = true; + return true; + } + if(firstArgument.startsWith("f") || firstArgument.equals("0")){ + player.sendMessage("Dickmode has been turned off!"); + forceBoundaries = false; + return true; + } + return false; + } + public static boolean getforceBoundaries(){ + return forceBoundaries; + } + public static boolean isCBCreative(Player player){ + return cbCreatives.contains(player); + } +} From e605f72b4b24a9f7867d6dc524500b18835f46cf Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 30 Nov 2016 10:57:10 -0500 Subject: [PATCH 187/263] Write GPowerAPI --- src/alisolarflare/AliPresents.java | 2 - .../components/gpowers/GPowerAPI.java | 90 +++++ .../components/gpowers/GPowerComponent.java | 9 +- .../components/gpowers/GPowerMemory.java | 52 --- .../components/gpowers/PoweredPlayer.java | 18 + .../components/gpowers/commands/GPower.java | 11 +- .../gpowers/enchant/EnchantingLoop.java | 107 ++---- .../gpowers/powerstate/PowerAll.java | 12 +- .../gpowers/powerstate/PowerDown.java | 11 +- .../gpowers/powerstate/PowerUp.java | 11 +- .../minigames/GameState.java | 3 +- .../minigames/MinigameComponent.java | 13 +- .../minigames/commands/JoinMinigame.java | 5 +- .../minigames/commands/LeaveMinigame.java | 5 +- .../minigames/commands/ListFighters.java | 5 +- .../minigames/commands/SetColourSpawn.java | 5 +- .../minigames/data/SpawnSet.java | 3 +- .../thebuttonrebirth/ButtonRebirthPlugin.java | 3 +- .../thebuttonrebirth/admin/CreateShrine.java | 11 +- .../thebuttonrebirth/commands/ShowBars.java | 3 +- .../listeners/CyclicalDisplayListener.java | 3 +- .../listeners/MidnightListener.java | 3 +- .../listeners/StealChestListener.java | 3 +- .../tasks/CheckChestTask.java | 338 +++++++++--------- .../tasks/CyclicalDisplayTask.java | 5 +- .../tasks/StealChestTask.java | 5 +- 26 files changed, 366 insertions(+), 370 deletions(-) create mode 100644 src/alisolarflare/components/gpowers/GPowerAPI.java delete mode 100644 src/alisolarflare/components/gpowers/GPowerMemory.java create mode 100644 src/alisolarflare/components/gpowers/PoweredPlayer.java rename src/{alisolarflare/components => graveyard}/minigames/GameState.java (52%) rename src/{alisolarflare/components => graveyard}/minigames/MinigameComponent.java (65%) rename src/{alisolarflare/components => graveyard}/minigames/commands/JoinMinigame.java (83%) rename src/{alisolarflare/components => graveyard}/minigames/commands/LeaveMinigame.java (85%) rename src/{alisolarflare/components => graveyard}/minigames/commands/ListFighters.java (80%) rename src/{alisolarflare/components => graveyard}/minigames/commands/SetColourSpawn.java (90%) rename src/{alisolarflare/components => graveyard}/minigames/data/SpawnSet.java (77%) diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index b135968..dcc97a9 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -14,7 +14,6 @@ import alisolarflare.components.gpowers.GPowerComponent; import alisolarflare.components.insurance.InsuranceComponent; import alisolarflare.components.magic.MagicComponent; import alisolarflare.components.metrics.MetricsComponent; -import alisolarflare.components.minigames.MinigameComponent; public class AliPresents extends JavaPlugin{ public void onEnable(){ @@ -32,7 +31,6 @@ public class AliPresents extends JavaPlugin{ new InsuranceComponent().register(this); new MagicComponent().register(this); new MetricsComponent().register(this); - new MinigameComponent().register(this); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); diff --git a/src/alisolarflare/components/gpowers/GPowerAPI.java b/src/alisolarflare/components/gpowers/GPowerAPI.java new file mode 100644 index 0000000..aa8bef0 --- /dev/null +++ b/src/alisolarflare/components/gpowers/GPowerAPI.java @@ -0,0 +1,90 @@ +package alisolarflare.components.gpowers; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.bukkit.Color; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +public class GPowerAPI{ + public static final int defaultPowerLength = 300; + public static Map poweredPlayerList = new HashMap(); + + public static void addPlayer(Player player, String colour, boolean powerIsActive){ + poweredPlayerList.put(player.getUniqueId(), new PoweredPlayer(player.getUniqueId(), colour, true)); + } + public static void PowerUpPlayer(Player player){ + player.sendMessage("Powering up!"); + if(poweredPlayerList.containsKey(player.getUniqueId())){ + poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; + player.sendMessage("Powered up!"); + }else{ + player.sendMessage("You must instantiate your power settings using /GPower"); + } + } + public static void PowerUpAllPlayers(){ + for (PoweredPlayer poweredPlayer : GPowerAPI.poweredPlayerList.values()){ + poweredPlayer.isPowersActive = true; + } + } + + public static void PowerDownPlayer(Player player){ + player.sendMessage("Powering down!"); + if (poweredPlayerList.containsKey(player.getUniqueId())){ + player.sendMessage("Powered down!"); + poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; + }else{ + player.sendMessage("P down!"); + return; + } + + } + public static void activatePower(Player player){ + activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour, defaultPowerLength); + } + public static void activatePower(Player player, String colour){ + activatePower(player, colour, defaultPowerLength); + } + public static void activatePower(Player player, String colour, int powerLength) { + //GREY + for (PotionEffect potionEffect : player.getActivePotionEffects()){ + player.removePotionEffect(potionEffect.getType()); + } + if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.GRAY), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, powerLength+100, 0, true, false, Color.GRAY), true); + //RED + }else if (colour.startsWith("r")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, powerLength, 0, true, false, Color.RED), true); + //ORANGE + }else if (colour.startsWith("o")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); + //YELLOW + }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.YELLOW), true); + //GREEN + }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, powerLength, 1, true, false, Color.GREEN), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, powerLength, 0, true, false, Color.GREEN), true); + //BLUE + }else if (colour.startsWith("b")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, powerLength, 1, true, false, Color.BLUE), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, powerLength, 0, true, false, Color.BLUE), true); + //PURPLE + }else if (colour.startsWith("p")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, powerLength, 0, true, false, Color.PURPLE), true); + //NULL + }else{ + } + } + public static boolean playerHasActivePowers(Player player){ + return poweredPlayerList.containsKey(player.getUniqueId()) && poweredPlayerList.get(player.getUniqueId()).isPowersActive; + } + + +} + diff --git a/src/alisolarflare/components/gpowers/GPowerComponent.java b/src/alisolarflare/components/gpowers/GPowerComponent.java index 978c30b..64d33cc 100644 --- a/src/alisolarflare/components/gpowers/GPowerComponent.java +++ b/src/alisolarflare/components/gpowers/GPowerComponent.java @@ -12,12 +12,11 @@ public class GPowerComponent extends Component { @Override public void register(JavaPlugin plugin) { - GPowerMemory gPowerMemory = new GPowerMemory(); - registerCommand(plugin, new GPower(gPowerMemory)); - registerCommand(plugin, new PowerUp(gPowerMemory)); - registerCommand(plugin, new PowerDown(gPowerMemory)); + registerCommand(plugin, new GPower()); + registerCommand(plugin, new PowerUp()); + registerCommand(plugin, new PowerDown()); - registerListener(plugin, new EnchantingLoop(plugin, gPowerMemory)); + registerListener(plugin, new EnchantingLoop(plugin)); } diff --git a/src/alisolarflare/components/gpowers/GPowerMemory.java b/src/alisolarflare/components/gpowers/GPowerMemory.java deleted file mode 100644 index 44e0089..0000000 --- a/src/alisolarflare/components/gpowers/GPowerMemory.java +++ /dev/null @@ -1,52 +0,0 @@ -package alisolarflare.components.gpowers; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.bukkit.entity.Player; - -public class GPowerMemory{ - public Map poweredPlayerList = new HashMap(); - - public void configurePlayer(Player player, String colour, boolean powerIsActive){ - poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); - } - public void PowerUpPlayer(Player player){ - player.sendMessage("Powering up!"); - if(poweredPlayerList.containsKey(player.getUniqueId())){ - poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; - player.sendMessage("Powered up!"); - }else{ - player.sendMessage("You must instantiate your power settings using /GPower"); - } - } - - public void PowerDownPlayer(Player player){ - player.sendMessage("Powering down!"); - if (poweredPlayerList.containsKey(player.getUniqueId())){ - player.sendMessage("Powered down!"); - poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; - }else{ - player.sendMessage("P down!"); - return; - } - - } - - public class poweredPlayer{ - public UUID uuid; - public String colour; - public Boolean isPowersActive; - - public poweredPlayer(UUID uuid, String colour, Boolean activated){ - this.uuid = (uuid); - this.colour = (colour); - this.isPowersActive = (activated); - } - public String toString(){ - return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; - } - } -} - diff --git a/src/alisolarflare/components/gpowers/PoweredPlayer.java b/src/alisolarflare/components/gpowers/PoweredPlayer.java new file mode 100644 index 0000000..27b0116 --- /dev/null +++ b/src/alisolarflare/components/gpowers/PoweredPlayer.java @@ -0,0 +1,18 @@ +package alisolarflare.components.gpowers; + +import java.util.UUID; + +public class PoweredPlayer{ + public UUID uuid; + public String colour; + public Boolean isPowersActive; + + public PoweredPlayer(UUID uuid, String colour, Boolean activated){ + this.uuid = (uuid); + this.colour = (colour); + this.isPowersActive = (activated); + } + public String toString(){ + return "[UUID: "+ uuid.toString() + ", Colour: "+ colour+", IsActivated: "+isPowersActive + "]"; + } +} diff --git a/src/alisolarflare/components/gpowers/commands/GPower.java b/src/alisolarflare/components/gpowers/commands/GPower.java index a4aed7d..3632f44 100644 --- a/src/alisolarflare/components/gpowers/commands/GPower.java +++ b/src/alisolarflare/components/gpowers/commands/GPower.java @@ -3,16 +3,9 @@ package alisolarflare.components.gpowers.commands; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.gpowers.GPowerMemory; +import alisolarflare.components.gpowers.GPowerAPI; public class GPower extends PlayerCommand { - - private GPowerMemory gPowerMemory; - - public GPower(GPowerMemory gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - @Override public boolean OnCommand(Player player, String label, String[] args) { if (args.length < 2) { @@ -39,7 +32,7 @@ public class GPower extends PlayerCommand { } player.sendMessage("Terms Vaild!"); player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); - gPowerMemory.configurePlayer(player, colour, isActive); + GPowerAPI.addPlayer(player, colour, isActive); return true; } diff --git a/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java b/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java index 2f22b0f..098d13b 100644 --- a/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java +++ b/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java @@ -1,75 +1,32 @@ -package alisolarflare.components.gpowers.enchant; - -import java.util.Map; -import java.util.UUID; - -import org.bukkit.Color; -import org.bukkit.Server; -import org.bukkit.entity.Player; -import org.bukkit.event.Listener; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import alisolarflare.components.gpowers.GPowerMemory; -import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; - -public class EnchantingLoop extends BukkitRunnable implements Listener{ - private int powerLength = 300; - private Server server; - private Map poweredPlayerList; - - - public EnchantingLoop(JavaPlugin plugin, GPowerMemory gPowerMemory){ - this.server = plugin.getServer(); - this.poweredPlayerList = gPowerMemory.poweredPlayerList; - this.runTaskTimer(plugin, 0, 190); - } - - //REPEATS EVERY 5 SECONDS - @Override - public void run() { - //server.broadcastMessage("ping!"); - for (Player player : server.getOnlinePlayers()){ - if(poweredPlayerList.containsKey(player.getUniqueId()) && poweredPlayerList.get(player.getUniqueId()).isPowersActive){ - activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); - } - } - } - - private void activatePower(Player player, String colour) { - //GREY - for (PotionEffect potionEffect : player.getActivePotionEffects()){ - player.removePotionEffect(potionEffect.getType()); - } - if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.GRAY), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, powerLength+100, 0, true, false, Color.GRAY), true); - //RED - }else if (colour.startsWith("r")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, powerLength, 0, true, false, Color.RED), true); - //ORANGE - }else if (colour.startsWith("o")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); - //YELLOW - }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.YELLOW), true); - //GREEN - }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, powerLength, 1, true, false, Color.GREEN), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, powerLength, 0, true, false, Color.GREEN), true); - //BLUE - }else if (colour.startsWith("b")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, powerLength, 1, true, false, Color.BLUE), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, powerLength, 0, true, false, Color.BLUE), true); - //PURPLE - }else if (colour.startsWith("p")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, powerLength, 0, true, false, Color.PURPLE), true); - //NULL - }else{ - } - } - -} +package alisolarflare.components.gpowers.enchant; + +import org.bukkit.Server; +import org.bukkit.entity.Player; +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitRunnable; + +import alisolarflare.components.gpowers.GPowerAPI; + +public class EnchantingLoop extends BukkitRunnable implements Listener{ + private Server server; + + + public EnchantingLoop(JavaPlugin plugin){ + this.server = plugin.getServer(); + this.runTaskTimer(plugin, 0, 190); + } + + //REPEATS EVERY 5 SECONDS + @Override + public void run() { + for (Player player : server.getOnlinePlayers()){ + if(GPowerAPI.playerHasActivePowers(player)){ + GPowerAPI.activatePower(player); + } + } + } + + + +} diff --git a/src/alisolarflare/components/gpowers/powerstate/PowerAll.java b/src/alisolarflare/components/gpowers/powerstate/PowerAll.java index ae8380d..6fc8305 100644 --- a/src/alisolarflare/components/gpowers/powerstate/PowerAll.java +++ b/src/alisolarflare/components/gpowers/powerstate/PowerAll.java @@ -3,20 +3,12 @@ package alisolarflare.components.gpowers.powerstate; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.gpowers.GPowerMemory; -import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; +import alisolarflare.components.gpowers.GPowerAPI; public class PowerAll extends ModCommand{ - private GPowerMemory gPowerMemory; - - public PowerAll(GPowerMemory gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } @Override public boolean OnCommand(Player player, String alias, String[] args) { - for (poweredPlayer poweredPlayer : gPowerMemory.poweredPlayerList.values()){ - poweredPlayer.isPowersActive = true; - } + GPowerAPI.PowerUpAllPlayers(); return true; } public String[] GetHelpText(String alias){ diff --git a/src/alisolarflare/components/gpowers/powerstate/PowerDown.java b/src/alisolarflare/components/gpowers/powerstate/PowerDown.java index 1e3bb45..6badc03 100644 --- a/src/alisolarflare/components/gpowers/powerstate/PowerDown.java +++ b/src/alisolarflare/components/gpowers/powerstate/PowerDown.java @@ -3,19 +3,12 @@ package alisolarflare.components.gpowers.powerstate; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.gpowers.GPowerMemory; +import alisolarflare.components.gpowers.GPowerAPI; public class PowerDown extends PlayerCommand { - - private GPowerMemory gPowerMemory; - - public PowerDown(GPowerMemory gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - @Override public boolean OnCommand(Player player, String label, String[] args) { - gPowerMemory.PowerDownPlayer(player); + GPowerAPI.PowerDownPlayer(player); return true; } @Override diff --git a/src/alisolarflare/components/gpowers/powerstate/PowerUp.java b/src/alisolarflare/components/gpowers/powerstate/PowerUp.java index e62203a..50f89d3 100644 --- a/src/alisolarflare/components/gpowers/powerstate/PowerUp.java +++ b/src/alisolarflare/components/gpowers/powerstate/PowerUp.java @@ -3,19 +3,12 @@ package alisolarflare.components.gpowers.powerstate; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.gpowers.GPowerMemory; +import alisolarflare.components.gpowers.GPowerAPI; public class PowerUp extends PlayerCommand { - - private GPowerMemory gPowerMemory; - - public PowerUp(GPowerMemory gPowerMemory) { - this.gPowerMemory = gPowerMemory; - } - @Override public boolean OnCommand(Player player, String label, String[] args) { - gPowerMemory.PowerUpPlayer(player); + GPowerAPI.PowerUpPlayer(player); return true; } @Override diff --git a/src/alisolarflare/components/minigames/GameState.java b/src/graveyard/minigames/GameState.java similarity index 52% rename from src/alisolarflare/components/minigames/GameState.java rename to src/graveyard/minigames/GameState.java index 7a5a953..36ad955 100644 --- a/src/alisolarflare/components/minigames/GameState.java +++ b/src/graveyard/minigames/GameState.java @@ -1,5 +1,6 @@ -package alisolarflare.components.minigames; +/*package graveyard.minigames; public enum GameState { Idle, FreeForAll, Heroes; } +*/ \ No newline at end of file diff --git a/src/alisolarflare/components/minigames/MinigameComponent.java b/src/graveyard/minigames/MinigameComponent.java similarity index 65% rename from src/alisolarflare/components/minigames/MinigameComponent.java rename to src/graveyard/minigames/MinigameComponent.java index 5b662e1..29f375d 100644 --- a/src/alisolarflare/components/minigames/MinigameComponent.java +++ b/src/graveyard/minigames/MinigameComponent.java @@ -1,4 +1,4 @@ -package alisolarflare.components.minigames; +/*package graveyard.minigames; import java.util.List; @@ -6,11 +6,11 @@ import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.architecture.Component; -import alisolarflare.components.minigames.commands.JoinMinigame; -import alisolarflare.components.minigames.commands.LeaveMinigame; -import alisolarflare.components.minigames.commands.ListFighters; -import alisolarflare.components.minigames.commands.SetColourSpawn; -import alisolarflare.components.minigames.data.SpawnSet; +import graveyard.minigames.commands.JoinMinigame; +import graveyard.minigames.commands.LeaveMinigame; +import graveyard.minigames.commands.ListFighters; +import graveyard.minigames.commands.SetColourSpawn; +import graveyard.minigames.data.SpawnSet; public class MinigameComponent extends Component{ public SpawnSet spawnSet; @@ -34,3 +34,4 @@ public class MinigameComponent extends Component{ } } } +*/ \ No newline at end of file diff --git a/src/alisolarflare/components/minigames/commands/JoinMinigame.java b/src/graveyard/minigames/commands/JoinMinigame.java similarity index 83% rename from src/alisolarflare/components/minigames/commands/JoinMinigame.java rename to src/graveyard/minigames/commands/JoinMinigame.java index 8dc07d2..f0a960b 100644 --- a/src/alisolarflare/components/minigames/commands/JoinMinigame.java +++ b/src/graveyard/minigames/commands/JoinMinigame.java @@ -1,11 +1,11 @@ -package alisolarflare.components.minigames.commands; +/*package graveyard.minigames.commands; import java.util.List; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.minigames.MinigameComponent; +import graveyard.minigames.MinigameComponent; public class JoinMinigame extends PlayerCommand { private List fighterList; @@ -31,3 +31,4 @@ public class JoinMinigame extends PlayerCommand { }; } } +*/ \ No newline at end of file diff --git a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java b/src/graveyard/minigames/commands/LeaveMinigame.java similarity index 85% rename from src/alisolarflare/components/minigames/commands/LeaveMinigame.java rename to src/graveyard/minigames/commands/LeaveMinigame.java index c7c5f9c..5a05279 100644 --- a/src/alisolarflare/components/minigames/commands/LeaveMinigame.java +++ b/src/graveyard/minigames/commands/LeaveMinigame.java @@ -1,11 +1,11 @@ -package alisolarflare.components.minigames.commands; +/*package graveyard.minigames.commands; import java.util.List; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.minigames.MinigameComponent; +import graveyard.minigames.MinigameComponent; public class LeaveMinigame extends PlayerCommand { private List fighters; @@ -39,3 +39,4 @@ public class LeaveMinigame extends PlayerCommand { }; } } +*/ \ No newline at end of file diff --git a/src/alisolarflare/components/minigames/commands/ListFighters.java b/src/graveyard/minigames/commands/ListFighters.java similarity index 80% rename from src/alisolarflare/components/minigames/commands/ListFighters.java rename to src/graveyard/minigames/commands/ListFighters.java index 6904914..73b5d80 100644 --- a/src/alisolarflare/components/minigames/commands/ListFighters.java +++ b/src/graveyard/minigames/commands/ListFighters.java @@ -1,9 +1,9 @@ -package alisolarflare.components.minigames.commands; +/*package graveyard.minigames.commands; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.minigames.MinigameComponent; +import graveyard.minigames.MinigameComponent; public class ListFighters extends PlayerCommand { private MinigameComponent component; @@ -24,3 +24,4 @@ public class ListFighters extends PlayerCommand { }; } } +*/ \ No newline at end of file diff --git a/src/alisolarflare/components/minigames/commands/SetColourSpawn.java b/src/graveyard/minigames/commands/SetColourSpawn.java similarity index 90% rename from src/alisolarflare/components/minigames/commands/SetColourSpawn.java rename to src/graveyard/minigames/commands/SetColourSpawn.java index bb29f3e..302ba1e 100644 --- a/src/alisolarflare/components/minigames/commands/SetColourSpawn.java +++ b/src/graveyard/minigames/commands/SetColourSpawn.java @@ -1,9 +1,9 @@ -package alisolarflare.components.minigames.commands; +/*package graveyard.minigames.commands; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.minigames.data.SpawnSet; +import graveyard.minigames.data.SpawnSet; public class SetColourSpawn extends ModCommand{ private SpawnSet spawnSet; @@ -62,3 +62,4 @@ public class SetColourSpawn extends ModCommand{ }; } } +*/ \ No newline at end of file diff --git a/src/alisolarflare/components/minigames/data/SpawnSet.java b/src/graveyard/minigames/data/SpawnSet.java similarity index 77% rename from src/alisolarflare/components/minigames/data/SpawnSet.java rename to src/graveyard/minigames/data/SpawnSet.java index be34825..1878177 100644 --- a/src/alisolarflare/components/minigames/data/SpawnSet.java +++ b/src/graveyard/minigames/data/SpawnSet.java @@ -1,4 +1,4 @@ -package alisolarflare.components.minigames.data; +/*package graveyard.minigames.data; import org.bukkit.Location; @@ -11,3 +11,4 @@ public class SpawnSet { public Location PSpawn; } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java b/src/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java index 13e0096..35c07e6 100644 --- a/src/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java +++ b/src/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth; +/*package graveyard.thebuttonrebirth; import java.util.ArrayList; import java.util.List; @@ -68,3 +68,4 @@ public class ButtonRebirthPlugin extends JavaPlugin{ shrineCreator.createShrine(chestX, chestY, chestZ, 10, Material.BEDROCK); } } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/admin/CreateShrine.java b/src/graveyard/thebuttonrebirth/admin/CreateShrine.java index 3f973e1..7df84c0 100644 --- a/src/graveyard/thebuttonrebirth/admin/CreateShrine.java +++ b/src/graveyard/thebuttonrebirth/admin/CreateShrine.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth.admin; +/*package graveyard.thebuttonrebirth.admin; import org.bukkit.Material; import org.bukkit.World; @@ -96,7 +96,7 @@ public class CreateShrine implements CommandExecutor{ sender.sendMessage("Error in CreateShrine Class: No world defined in config..."); sender.sendMessage("Defining world based on player location."); - /* + //Changes world variable in config file if (sender instanceof Player){ Player player = (Player) sender; @@ -107,14 +107,14 @@ public class CreateShrine implements CommandExecutor{ //Sends player the result of the change sender.sendMessage("World variable set to " + player.getWorld().getName() + "in config file"); } - */ + } - /* + if (!(player.hasPermission("Moderator") || player.hasPermission("Admin"))){ player.sendMessage(ChatColor.RED + "You must be in the group Moderator or Admin to access this command!"); return false; } - */ + chestX = plugin.getConfig().getInt("chestX"); chestY = plugin.getConfig().getInt("chestY"); chestZ = plugin.getConfig().getInt("chestZ"); @@ -126,3 +126,4 @@ public class CreateShrine implements CommandExecutor{ return false; } } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/commands/ShowBars.java b/src/graveyard/thebuttonrebirth/commands/ShowBars.java index 34f9a38..fd52cb7 100644 --- a/src/graveyard/thebuttonrebirth/commands/ShowBars.java +++ b/src/graveyard/thebuttonrebirth/commands/ShowBars.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth.commands; +/*package graveyard.thebuttonrebirth.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -28,3 +28,4 @@ public class ShowBars implements CommandExecutor{ } } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java b/src/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java index 68b6c13..11f1355 100644 --- a/src/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java +++ b/src/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth.listeners; +/*package graveyard.thebuttonrebirth.listeners; import org.bukkit.event.Listener; import org.bukkit.scheduler.BukkitTask; @@ -17,3 +17,4 @@ public class CyclicalDisplayListener implements Listener{ bukkitTask = cyclicalDisplayTask.runTaskTimer(this.plugin, 20, 20); } } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/listeners/MidnightListener.java b/src/graveyard/thebuttonrebirth/listeners/MidnightListener.java index 1e3b155..d8cfa04 100644 --- a/src/graveyard/thebuttonrebirth/listeners/MidnightListener.java +++ b/src/graveyard/thebuttonrebirth/listeners/MidnightListener.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth.listeners; +/*package graveyard.thebuttonrebirth.listeners; import org.bukkit.event.Listener; import org.bukkit.scheduler.BukkitTask; @@ -17,3 +17,4 @@ public class MidnightListener implements Listener{ checkChestTask = new CheckChestTask(this.plugin).runTaskTimer(this.plugin, 20, 60); } } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/listeners/StealChestListener.java b/src/graveyard/thebuttonrebirth/listeners/StealChestListener.java index 1574add..1c6bd4d 100644 --- a/src/graveyard/thebuttonrebirth/listeners/StealChestListener.java +++ b/src/graveyard/thebuttonrebirth/listeners/StealChestListener.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth.listeners; +/*package graveyard.thebuttonrebirth.listeners; import org.bukkit.event.Listener; import org.bukkit.scheduler.BukkitTask; @@ -16,3 +16,4 @@ public class StealChestListener implements Listener{ stealChestTask = new StealChestTask(this.plugin).runTaskTimer(this.plugin, 20, 20); } } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/tasks/CheckChestTask.java b/src/graveyard/thebuttonrebirth/tasks/CheckChestTask.java index dae0446..71b653c 100644 --- a/src/graveyard/thebuttonrebirth/tasks/CheckChestTask.java +++ b/src/graveyard/thebuttonrebirth/tasks/CheckChestTask.java @@ -1,169 +1,169 @@ -package graveyard.thebuttonrebirth.tasks; - -import java.time.Clock; -import java.time.LocalDateTime; - -import org.bukkit.ChatColor; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Sound; -import org.bukkit.World; -import org.bukkit.block.Block; -import org.bukkit.block.Chest; -import org.bukkit.inventory.Inventory; -import org.bukkit.scheduler.BukkitRunnable; - -import graveyard.thebuttonrebirth.ButtonRebirthPlugin; -import graveyard.thebuttonrebirth.admin.CreateShrine; - -public class CheckChestTask extends BukkitRunnable{ - //Plugin - private final ButtonRebirthPlugin BRplugin; - private World world; - - //Chest - private int chestX; - private int chestY; - private int chestZ; - private Block chestBlock; - private Chest shrineChest; - private Inventory shrineInventory; - - //Time - private LocalDateTime currentTime; - private LocalDateTime configTime; - - private int minimumDiamondBlocks; - private int diamondsInserted; - - public CheckChestTask(ButtonRebirthPlugin initBRplugin){ - //INIT - plugin - this.BRplugin = initBRplugin; - - //INIT - chestX, chestY, chestZ - chestX = BRplugin.getConfig().getInt("chestX"); - chestY = BRplugin.getConfig().getInt("chestY"); - chestZ = BRplugin.getConfig().getInt("chestZ"); - - //INIT - World - world = BRplugin.getServer().getWorld(BRplugin.getConfig().getString("world")); - } - - @Override - public void run(){ - //run() activates every 20 server ticks. - - //CHECK - Plugin is Enabled - if (BRplugin.isEnabled() == false){ - this.cancel(); - } - //CHECK - World Exists - if (!(BRplugin.getServer().getWorlds().contains(BRplugin.getServer().getWorld(BRplugin.getConfig().getString("world"))))) { - BRplugin.logger.info("Error: Config world does not exist in Server."); - BRplugin.logger.info("Server Worlds: " + BRplugin.getServer().getWorlds().toString()); - BRplugin.logger.info("Config World: " + BRplugin.getConfig().getString("world")); - BRplugin.logger.info("Turning off Display..."); - this.cancel(); - return; - } - - //INIT - currentTime, configTime - currentTime = LocalDateTime.now(Clock.systemUTC()); - configTime = LocalDateTime.parse(BRplugin.getConfig().getString("lastCheckChestTime")); - - //TIME - Current Time after Config Time - if (currentTime.isAfter(configTime)){ - - //SANITIZE "world" - if (BRplugin.getConfig().getString("world") == null) BRplugin.getServer().broadcastMessage("Error: No world defined in config file."); - if (BRplugin.getServer().getWorlds() == null) BRplugin.getServer().broadcastMessage("Error: plugin.getServer().getWorlds() returns null"); - - //INIT - world, chestBlock - chestBlock = world.getBlockAt(chestX, chestY, chestZ); - - //SANITIZE - chestBlock - if (!(chestBlock.getType() == Material.CHEST)){ - damageShrine(); - reconstructShrine(); - return; - } - - //INIT - shrineChest, shrineInventory - shrineChest = (Chest) chestBlock.getState(); - shrineInventory = shrineChest.getInventory(); - - - //UPDATE - configTime - BRplugin.getConfig().set("lastCheckChestTime", currentTime.plusMinutes(BRplugin.getConfig().getInt("barDuration")).toString()); - BRplugin.saveConfig(); - - //INIT - minimumDiamondBlocks, diamondsInserted - minimumDiamondBlocks = BRplugin.getConfig().getInt("minimumDiamondBlocks"); - diamondsInserted = BRplugin.getConfig().getInt("diamondsInserted"); - - //CHECK - chest for diamonds - if(diamondsInserted > minimumDiamondBlocks || shrineInventory.contains(Material.DIAMOND_BLOCK, (minimumDiamondBlocks - diamondsInserted))){ - //INVENTORY SUCCESS - - //CHECK - First Time - if (minimumDiamondBlocks == 0){ - broadcastExperimentHasBegun(); - }else{ - broadcastButtonRefuled(); - } - - //UPDATE minimumDiamondBlocks - minimumDiamondBlocks++; - BRplugin.getConfig().set("minimumDiamondBlocks", minimumDiamondBlocks); - BRplugin.getConfig().set("diamondsInserted", 0); - BRplugin.saveConfig(); - }else{ - //INVENTORY FAILURE - damageShrine(); - } - - //RESET - shrine, shrineInventory - reconstructShrine(); - shrineInventory.clear(); - BRplugin.getConfig().set("diamondsInserted",0); - - }else{ - //currentTime is before config time. - //therefore wait. - } - - } - private void damageShrine(){ - //UPDATE - buttonHealth - int buttonHealth = BRplugin.getConfig().getInt("buttonHealth"); - buttonHealth--; - BRplugin.getConfig().set("buttonHealth", buttonHealth); - - //DISPLAY AND MAKE SOUND - BRplugin.getServer().broadcastMessage(ChatColor.DARK_RED + "--------------------------"); - BRplugin.getServer().broadcastMessage(ChatColor.DARK_RED + "----- BUTTON DAMAGED -----"); - BRplugin.getServer().broadcastMessage(ChatColor.DARK_RED + "--------------------------"); - BRplugin.getServer().broadcastMessage(ChatColor.RED + " " + buttonHealth + "s of Health left"); - world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_ENDERDRAGON_DEATH,50,1); - world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_LIGHTNING_THUNDER,50,1); - world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_GENERIC_EXPLODE,50,50); - } - private void reconstructShrine(){ - CreateShrine shrineConstructor= new CreateShrine(BRplugin); - shrineConstructor.createShrine(chestX, chestY, chestZ, 10, Material.BEDROCK); - } - private void broadcastExperimentHasBegun(){ - BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "------------------------------------"); - BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "----- THE EXPERIMENT HAS BEGUN -----"); - BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "------------------------------------"); - BRplugin.getServer().broadcastMessage(ChatColor.BLUE + " " + minimumDiamondBlocks + " Blocks required"); - world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_WITHER_SPAWN,50,10); - } - private void broadcastButtonRefuled(){ - BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "--------------------------"); - BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "----- BUTTON REFULED -----"); - BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "--------------------------"); - BRplugin.getServer().broadcastMessage(ChatColor.BLUE + " " + minimumDiamondBlocks + " Blocks required"); - world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_WITHER_SPAWN,50,10); - } -} +//package graveyard.thebuttonrebirth.tasks; +// +//import java.time.Clock; +//import java.time.LocalDateTime; +// +//import org.bukkit.ChatColor; +//import org.bukkit.Location; +//import org.bukkit.Material; +//import org.bukkit.Sound; +//import org.bukkit.World; +//import org.bukkit.block.Block; +//import org.bukkit.block.Chest; +//import org.bukkit.inventory.Inventory; +//import org.bukkit.scheduler.BukkitRunnable; +// +//import graveyard.thebuttonrebirth.ButtonRebirthPlugin; +//import graveyard.thebuttonrebirth.admin.CreateShrine; +// +//public class CheckChestTask extends BukkitRunnable{ +// //Plugin +// private final ButtonRebirthPlugin BRplugin; +// private World world; +// +// //Chest +// private int chestX; +// private int chestY; +// private int chestZ; +// private Block chestBlock; +// private Chest shrineChest; +// private Inventory shrineInventory; +// +// //Time +// private LocalDateTime currentTime; +// private LocalDateTime configTime; +// +// private int minimumDiamondBlocks; +// private int diamondsInserted; +// +// public CheckChestTask(ButtonRebirthPlugin initBRplugin){ +// //INIT - plugin +// this.BRplugin = initBRplugin; +// +// //INIT - chestX, chestY, chestZ +// chestX = BRplugin.getConfig().getInt("chestX"); +// chestY = BRplugin.getConfig().getInt("chestY"); +// chestZ = BRplugin.getConfig().getInt("chestZ"); +// +// //INIT - World +// world = BRplugin.getServer().getWorld(BRplugin.getConfig().getString("world")); +// } +// +// @Override +// public void run(){ +// //run() activates every 20 server ticks. +// +// //CHECK - Plugin is Enabled +// if (BRplugin.isEnabled() == false){ +// this.cancel(); +// } +// //CHECK - World Exists +// if (!(BRplugin.getServer().getWorlds().contains(BRplugin.getServer().getWorld(BRplugin.getConfig().getString("world"))))) { +// BRplugin.logger.info("Error: Config world does not exist in Server."); +// BRplugin.logger.info("Server Worlds: " + BRplugin.getServer().getWorlds().toString()); +// BRplugin.logger.info("Config World: " + BRplugin.getConfig().getString("world")); +// BRplugin.logger.info("Turning off Display..."); +// this.cancel(); +// return; +// } +// +// //INIT - currentTime, configTime +// currentTime = LocalDateTime.now(Clock.systemUTC()); +// configTime = LocalDateTime.parse(BRplugin.getConfig().getString("lastCheckChestTime")); +// +// //TIME - Current Time after Config Time +// if (currentTime.isAfter(configTime)){ +// +// //SANITIZE "world" +// if (BRplugin.getConfig().getString("world") == null) BRplugin.getServer().broadcastMessage("Error: No world defined in config file."); +// if (BRplugin.getServer().getWorlds() == null) BRplugin.getServer().broadcastMessage("Error: plugin.getServer().getWorlds() returns null"); +// +// //INIT - world, chestBlock +// chestBlock = world.getBlockAt(chestX, chestY, chestZ); +// +// //SANITIZE - chestBlock +// if (!(chestBlock.getType() == Material.CHEST)){ +// damageShrine(); +// reconstructShrine(); +// return; +// } +// +// //INIT - shrineChest, shrineInventory +// shrineChest = (Chest) chestBlock.getState(); +// shrineInventory = shrineChest.getInventory(); +// +// +// //UPDATE - configTime +// BRplugin.getConfig().set("lastCheckChestTime", currentTime.plusMinutes(BRplugin.getConfig().getInt("barDuration")).toString()); +// BRplugin.saveConfig(); +// +// //INIT - minimumDiamondBlocks, diamondsInserted +// minimumDiamondBlocks = BRplugin.getConfig().getInt("minimumDiamondBlocks"); +// diamondsInserted = BRplugin.getConfig().getInt("diamondsInserted"); +// +// //CHECK - chest for diamonds +// if(diamondsInserted > minimumDiamondBlocks || shrineInventory.contains(Material.DIAMOND_BLOCK, (minimumDiamondBlocks - diamondsInserted))){ +// //INVENTORY SUCCESS +// +// //CHECK - First Time +// if (minimumDiamondBlocks == 0){ +// broadcastExperimentHasBegun(); +// }else{ +// broadcastButtonRefuled(); +// } +// +// //UPDATE minimumDiamondBlocks +// minimumDiamondBlocks++; +// BRplugin.getConfig().set("minimumDiamondBlocks", minimumDiamondBlocks); +// BRplugin.getConfig().set("diamondsInserted", 0); +// BRplugin.saveConfig(); +// }else{ +// //INVENTORY FAILURE +// damageShrine(); +// } +// +// //RESET - shrine, shrineInventory +// reconstructShrine(); +// shrineInventory.clear(); +// BRplugin.getConfig().set("diamondsInserted",0); +// +// }else{ +// //currentTime is before config time. +// //therefore wait. +// } +// +// } +// private void damageShrine(){ +// //UPDATE - buttonHealth +// int buttonHealth = BRplugin.getConfig().getInt("buttonHealth"); +// buttonHealth--; +// BRplugin.getConfig().set("buttonHealth", buttonHealth); +// +// //DISPLAY AND MAKE SOUND +// BRplugin.getServer().broadcastMessage(ChatColor.DARK_RED + "--------------------------"); +// BRplugin.getServer().broadcastMessage(ChatColor.DARK_RED + "----- BUTTON DAMAGED -----"); +// BRplugin.getServer().broadcastMessage(ChatColor.DARK_RED + "--------------------------"); +// BRplugin.getServer().broadcastMessage(ChatColor.RED + " " + buttonHealth + "s of Health left"); +// world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_ENDERDRAGON_DEATH,50,1); +// world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_LIGHTNING_THUNDER,50,1); +// world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_GENERIC_EXPLODE,50,50); +// } +// private void reconstructShrine(){ +// CreateShrine shrineConstructor= new CreateShrine(BRplugin); +// shrineConstructor.createShrine(chestX, chestY, chestZ, 10, Material.BEDROCK); +// } +// private void broadcastExperimentHasBegun(){ +// BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "------------------------------------"); +// BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "----- THE EXPERIMENT HAS BEGUN -----"); +// BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "------------------------------------"); +// BRplugin.getServer().broadcastMessage(ChatColor.BLUE + " " + minimumDiamondBlocks + " Blocks required"); +// world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_WITHER_SPAWN,50,10); +// } +// private void broadcastButtonRefuled(){ +// BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "--------------------------"); +// BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "----- BUTTON REFULED -----"); +// BRplugin.getServer().broadcastMessage(ChatColor.AQUA + "--------------------------"); +// BRplugin.getServer().broadcastMessage(ChatColor.BLUE + " " + minimumDiamondBlocks + " Blocks required"); +// world.playSound(new Location(world,chestX,chestY,chestZ), Sound.ENTITY_WITHER_SPAWN,50,10); +// } +//} diff --git a/src/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java b/src/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java index 5361af7..4c80a6f 100644 --- a/src/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java +++ b/src/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth.tasks; +/*package graveyard.thebuttonrebirth.tasks; import java.time.Clock; import java.time.Duration; @@ -213,7 +213,7 @@ public class CyclicalDisplayTask extends BukkitRunnable{ if (stack.getType() == Material.DIAMOND_BLOCK){ totalDiamonds += stack.getAmount(); } - }catch(Exception e){/*stack isn't a diamond block*/} + }catch(Exception e){stack isn't a diamond block} } diamondBar.setProgress((diamondsInserted+totalDiamonds)/(double)minimumDiamondBlocks); @@ -243,3 +243,4 @@ public class CyclicalDisplayTask extends BukkitRunnable{ currentBar = barCycleDuration * (bar); } } +*/ \ No newline at end of file diff --git a/src/graveyard/thebuttonrebirth/tasks/StealChestTask.java b/src/graveyard/thebuttonrebirth/tasks/StealChestTask.java index 1bc1239..ef1079e 100644 --- a/src/graveyard/thebuttonrebirth/tasks/StealChestTask.java +++ b/src/graveyard/thebuttonrebirth/tasks/StealChestTask.java @@ -1,4 +1,4 @@ -package graveyard.thebuttonrebirth.tasks; +/*package graveyard.thebuttonrebirth.tasks; import java.time.Clock; import java.time.LocalDateTime; @@ -135,7 +135,7 @@ public class StealChestTask extends BukkitRunnable{ totalDiamonds += (stack.getAmount() *1); } - }catch(Exception e){/*stack is empty*/} + }catch(Exception e){stack is empty} } shrineInventory.clear(); diamondsInserted += totalDiamonds; @@ -198,3 +198,4 @@ public class StealChestTask extends BukkitRunnable{ return closestPlayer; } } +*/ \ No newline at end of file From 068a353d0d3f23c4f3e4fe6a15832842537a14c3 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 30 Nov 2016 22:58:36 -0500 Subject: [PATCH 188/263] Created AliLinkAPI --- .../components/alilinks/AliLinkAPI.java | 60 ++++++++++++++++ .../components/alilinks/AliLinkComponent.java | 4 +- .../components/alilinks/commands/AliLink.java | 70 +++---------------- 3 files changed, 71 insertions(+), 63 deletions(-) create mode 100644 src/alisolarflare/components/alilinks/AliLinkAPI.java diff --git a/src/alisolarflare/components/alilinks/AliLinkAPI.java b/src/alisolarflare/components/alilinks/AliLinkAPI.java new file mode 100644 index 0000000..d957919 --- /dev/null +++ b/src/alisolarflare/components/alilinks/AliLinkAPI.java @@ -0,0 +1,60 @@ +package alisolarflare.components.alilinks; + +import java.util.Arrays; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.bukkit.World; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.alilinks.entities.Link; + +public class AliLinkAPI { + private static List linkList; + /**"Usage: /pressalilink "*/ + public static boolean sendPressEvent(CommandSender sender, String[] inputFrequencies, JavaPlugin plugin) { + if (inputFrequencies.length == 0) { + sender.sendMessage("You must specify a link frequency"); + return false; + } + + List inputFrequencyList= Arrays.asList(inputFrequencies); + for (Link link : linkList) { + if(inputFrequencyList.contains(link.frequency)){ + link.press(plugin); + } + } + sender.sendMessage("Link pressed!"); + return true; + } + public static boolean createAliLink(Player player, String[] args) { + if (args == null || args.length < 1) { + player.sendMessage("You must specify a link frequency"); + player.sendMessage("/pressalilink [name]"); + return false; + } + + String frequency = args[0]; + World world = player.getWorld(); + int x = player.getLocation().getBlockX(); + int y = player.getLocation().getBlockY(); + int z = player.getLocation().getBlockZ(); + + if (args.length > 4) { + boolean arg1isNumber = StringUtils.isNumericSpace(args[1]); + boolean arg2isNumber = StringUtils.isNumericSpace(args[2]); + boolean arg3isNumber = StringUtils.isNumericSpace(args[3]); + if (arg1isNumber && arg2isNumber && arg3isNumber) { + x = Integer.parseInt(args[1]); + y = Integer.parseInt(args[2]); + z = Integer.parseInt(args[3]); + } + } + + Link link = new Link(frequency, world, x, y, z); + linkList.add(link); + return true; + } +} diff --git a/src/alisolarflare/components/alilinks/AliLinkComponent.java b/src/alisolarflare/components/alilinks/AliLinkComponent.java index 78095d6..8b2e98f 100644 --- a/src/alisolarflare/components/alilinks/AliLinkComponent.java +++ b/src/alisolarflare/components/alilinks/AliLinkComponent.java @@ -13,8 +13,8 @@ import alisolarflare.components.alilinks.entities.Link; public class AliLinkComponent extends Component { - private List linkList; private List> linkMap; + private List linkList; @Override public void register(JavaPlugin plugin) { this.linkList = MapToLinkList(plugin.getConfig().getMapList("aliLinkList"), plugin.getServer()); @@ -22,7 +22,7 @@ public class AliLinkComponent extends Component { linkMap.add(link.toMap()); } - registerCommand(plugin, new AliLink(plugin, linkList)); + registerCommand(plugin, new AliLink(plugin)); } @SuppressWarnings("unchecked") diff --git a/src/alisolarflare/components/alilinks/commands/AliLink.java b/src/alisolarflare/components/alilinks/commands/AliLink.java index 362a8ab..2bd3f83 100644 --- a/src/alisolarflare/components/alilinks/commands/AliLink.java +++ b/src/alisolarflare/components/alilinks/commands/AliLink.java @@ -1,86 +1,34 @@ package alisolarflare.components.alilinks.commands; -import java.util.Arrays; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; -import org.bukkit.World; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.alilinks.entities.Link; +import alisolarflare.components.alilinks.AliLinkAPI; public class AliLink extends PlayerCommand{ private JavaPlugin plugin; - private List linkList; - public AliLink(JavaPlugin plugin, List linkList) { + public AliLink(JavaPlugin plugin) { this.plugin = plugin; - this.linkList = linkList; } @Override - public boolean OnCommand(Player player, String alias, String[] args) { - if(args.length < 1) + public boolean OnCommand(Player player, String alias, String[] inputFrequencies) { + if(inputFrequencies.length < 1) return false; - switch (args[0].toLowerCase()){ + switch (inputFrequencies[0].toLowerCase()){ case "press": - return press(player, alias, args); + return AliLinkAPI.sendPressEvent(player, inputFrequencies, plugin); case "set": - return set(player, alias, args); + AliLinkAPI.createAliLink(player, inputFrequencies); default: return false; } } - /**"Usage: /pressalilink "*/ - private boolean press(Player player, String alias, String[] inputFrequencies) { - if (inputFrequencies.length == 0) { - player.sendMessage("You must specify a link frequency"); - return false; - } - - List inputFrequencyList= Arrays.asList(inputFrequencies); - for (Link link : linkList) { - if(inputFrequencyList.contains(link.frequency)){ - link.press(plugin); - } - } - - player.sendMessage("Link pressed!"); - - return true; - } + - /**Usage: /setalilink [x] [y] [z]*/ - public boolean set(Player player, String label, String[] args) { - if (args == null || args.length < 1) { - player.sendMessage("You must specify a link frequency"); - player.sendMessage("/pressalilink [name]"); - return false; - } - - String frequency = args[0]; - World world = player.getWorld(); - int x = player.getLocation().getBlockX(); - int y = player.getLocation().getBlockY(); - int z = player.getLocation().getBlockZ(); - - if (args.length > 4) { - boolean arg1isNumber = StringUtils.isNumericSpace(args[1]); - boolean arg2isNumber = StringUtils.isNumericSpace(args[2]); - boolean arg3isNumber = StringUtils.isNumericSpace(args[3]); - if (arg1isNumber && arg2isNumber && arg3isNumber) { - x = Integer.parseInt(args[1]); - y = Integer.parseInt(args[2]); - z = Integer.parseInt(args[3]); - } - } - - Link link = new Link(frequency, world, x, y, z); - linkList.add(link); - return true; - } + } From 7d73a18d175c104f1b1105af3f510b5f951c7ab9 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 30 Nov 2016 23:42:04 -0500 Subject: [PATCH 189/263] General AliLink Refactoring --- .../components/alilinks/AliLinkAPI.java | 11 +++++ .../components/alilinks/AliLinkComponent.java | 23 ---------- .../components/alilinks/commands/AliLink.java | 2 +- .../components/alilinks/entities/Link.java | 42 +++++++++++-------- .../alilinks/tasks/UnpressTask.java | 1 - 5 files changed, 37 insertions(+), 42 deletions(-) diff --git a/src/alisolarflare/components/alilinks/AliLinkAPI.java b/src/alisolarflare/components/alilinks/AliLinkAPI.java index d957919..d5a990a 100644 --- a/src/alisolarflare/components/alilinks/AliLinkAPI.java +++ b/src/alisolarflare/components/alilinks/AliLinkAPI.java @@ -1,9 +1,12 @@ package alisolarflare.components.alilinks; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Map; import org.apache.commons.lang3.StringUtils; +import org.bukkit.Server; import org.bukkit.World; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -57,4 +60,12 @@ public class AliLinkAPI { linkList.add(link); return true; } + @SuppressWarnings("unchecked") + private List MapToLinkList(List> mapList, Server server) { + List linkList = new ArrayList(); + for (Map MapWithLinkData : mapList){ + linkList.add(new Link((Map) MapWithLinkData, server)); + } + return linkList; + } } diff --git a/src/alisolarflare/components/alilinks/AliLinkComponent.java b/src/alisolarflare/components/alilinks/AliLinkComponent.java index 8b2e98f..5a14d08 100644 --- a/src/alisolarflare/components/alilinks/AliLinkComponent.java +++ b/src/alisolarflare/components/alilinks/AliLinkComponent.java @@ -1,36 +1,13 @@ package alisolarflare.components.alilinks; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.bukkit.Server; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.architecture.Component; import alisolarflare.components.alilinks.commands.AliLink; -import alisolarflare.components.alilinks.entities.Link; public class AliLinkComponent extends Component { - - private List> linkMap; - private List linkList; @Override public void register(JavaPlugin plugin) { - this.linkList = MapToLinkList(plugin.getConfig().getMapList("aliLinkList"), plugin.getServer()); - for (Link link: linkList){ - linkMap.add(link.toMap()); - } - registerCommand(plugin, new AliLink(plugin)); - - } - @SuppressWarnings("unchecked") - private List MapToLinkList(List> mapList, Server server) { - List linkList = new ArrayList(); - for (Map MapWithLinkData : mapList){ - linkList.add(new Link((Map) MapWithLinkData, server)); - } - return linkList; } } diff --git a/src/alisolarflare/components/alilinks/commands/AliLink.java b/src/alisolarflare/components/alilinks/commands/AliLink.java index 2bd3f83..20884db 100644 --- a/src/alisolarflare/components/alilinks/commands/AliLink.java +++ b/src/alisolarflare/components/alilinks/commands/AliLink.java @@ -21,7 +21,7 @@ public class AliLink extends PlayerCommand{ case "press": return AliLinkAPI.sendPressEvent(player, inputFrequencies, plugin); case "set": - AliLinkAPI.createAliLink(player, inputFrequencies); + return AliLinkAPI.createAliLink(player, inputFrequencies); default: return false; } diff --git a/src/alisolarflare/components/alilinks/entities/Link.java b/src/alisolarflare/components/alilinks/entities/Link.java index a2ea8f1..7fe08cf 100644 --- a/src/alisolarflare/components/alilinks/entities/Link.java +++ b/src/alisolarflare/components/alilinks/entities/Link.java @@ -19,23 +19,15 @@ public class Link{ public int y; public int z; - public Link (String frequency, World world, int x, int y, int z){ - this.frequency = frequency; - this.world = world; - this.x = x; - this.y = y; - this.z = z; + /**Constructor for copying links*/ + public Link(Link link){ + this.frequency = link.frequency; + this.world = link.world; + this.x = link.x; + this.y = link.y; + this.z = link.z; } - - public Link(String frequency, Location location, Server server){ - this.frequency = frequency; - this.world = server.getWorld(location.getWorld().getName()); - this.x = location.getBlockX(); - this.y = location.getBlockY(); - this.z = location.getBlockZ(); - //plugin.plugin.getConfig().set("frequency", 10); - } - + /**Constructor for deserialization*/ public Link(Map linkFromMap, Server server){ this.frequency = linkFromMap.get("frequency"); this.world = server.getWorld(linkFromMap.get("world")); @@ -43,6 +35,22 @@ public class Link{ this.y = Integer.parseInt(linkFromMap.get("y")); this.z = Integer.parseInt(linkFromMap.get("z")); } + /**Constructor for Location inputs*/ + public Link(String frequency, Location location){ + this.frequency = frequency; + this.world = location.getWorld(); + this.x = location.getBlockX(); + this.y = location.getBlockY(); + this.z = location.getBlockZ(); + } + /**Pure Constructor*/ + public Link(String frequency, World world, int x, int y, int z){ + this.frequency = frequency; + this.world = world; + this.x = x; + this.y = y; + this.z = z; + } /** * Activates the Ali-Link @@ -51,7 +59,7 @@ public class Link{ public void press(JavaPlugin plugin) { Location location = new Location(this.world, this.x, this.y, this.z); location.getBlock().setType(Material.REDSTONE_BLOCK); - new UnpressTask(location).runTaskTimer(plugin, 2, 1); + new UnpressTask(location).runTaskLater(plugin, 2); } public Map toMap(){ diff --git a/src/alisolarflare/components/alilinks/tasks/UnpressTask.java b/src/alisolarflare/components/alilinks/tasks/UnpressTask.java index 8820778..38a06b0 100644 --- a/src/alisolarflare/components/alilinks/tasks/UnpressTask.java +++ b/src/alisolarflare/components/alilinks/tasks/UnpressTask.java @@ -17,5 +17,4 @@ public class UnpressTask extends BukkitRunnable { location.getBlock().setData((byte) 14); this.cancel(); } - } From 850169533a084e86b2676fd2bdcf6cd322836a18 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 1 Dec 2016 16:09:39 -0500 Subject: [PATCH 190/263] Started GPowerAPI --- src/alisolarflare/components/alilinks/AliLinkAPI.java | 2 +- src/alisolarflare/components/gpowers/{ => api}/GPowerAPI.java | 4 +++- src/alisolarflare/components/gpowers/commands/GPower.java | 2 +- .../components/gpowers/enchant/EnchantingLoop.java | 2 +- src/alisolarflare/components/gpowers/powerstate/PowerAll.java | 2 +- .../components/gpowers/powerstate/PowerDown.java | 2 +- src/alisolarflare/components/gpowers/powerstate/PowerUp.java | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) rename src/alisolarflare/components/gpowers/{ => api}/GPowerAPI.java (95%) diff --git a/src/alisolarflare/components/alilinks/AliLinkAPI.java b/src/alisolarflare/components/alilinks/AliLinkAPI.java index d5a990a..b4d9ea2 100644 --- a/src/alisolarflare/components/alilinks/AliLinkAPI.java +++ b/src/alisolarflare/components/alilinks/AliLinkAPI.java @@ -60,7 +60,7 @@ public class AliLinkAPI { linkList.add(link); return true; } - @SuppressWarnings("unchecked") + @SuppressWarnings({ "unchecked", "unused" }) private List MapToLinkList(List> mapList, Server server) { List linkList = new ArrayList(); for (Map MapWithLinkData : mapList){ diff --git a/src/alisolarflare/components/gpowers/GPowerAPI.java b/src/alisolarflare/components/gpowers/api/GPowerAPI.java similarity index 95% rename from src/alisolarflare/components/gpowers/GPowerAPI.java rename to src/alisolarflare/components/gpowers/api/GPowerAPI.java index aa8bef0..f4c242e 100644 --- a/src/alisolarflare/components/gpowers/GPowerAPI.java +++ b/src/alisolarflare/components/gpowers/api/GPowerAPI.java @@ -1,4 +1,4 @@ -package alisolarflare.components.gpowers; +package alisolarflare.components.gpowers.api; import java.util.HashMap; import java.util.Map; @@ -9,6 +9,8 @@ import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import alisolarflare.components.gpowers.PoweredPlayer; + public class GPowerAPI{ public static final int defaultPowerLength = 300; public static Map poweredPlayerList = new HashMap(); diff --git a/src/alisolarflare/components/gpowers/commands/GPower.java b/src/alisolarflare/components/gpowers/commands/GPower.java index 3632f44..2b7c31f 100644 --- a/src/alisolarflare/components/gpowers/commands/GPower.java +++ b/src/alisolarflare/components/gpowers/commands/GPower.java @@ -3,7 +3,7 @@ package alisolarflare.components.gpowers.commands; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.gpowers.GPowerAPI; +import alisolarflare.components.gpowers.api.GPowerAPI; public class GPower extends PlayerCommand { @Override diff --git a/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java b/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java index 098d13b..98d55c6 100644 --- a/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java +++ b/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java @@ -6,7 +6,7 @@ import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; -import alisolarflare.components.gpowers.GPowerAPI; +import alisolarflare.components.gpowers.api.GPowerAPI; public class EnchantingLoop extends BukkitRunnable implements Listener{ private Server server; diff --git a/src/alisolarflare/components/gpowers/powerstate/PowerAll.java b/src/alisolarflare/components/gpowers/powerstate/PowerAll.java index 6fc8305..4873422 100644 --- a/src/alisolarflare/components/gpowers/powerstate/PowerAll.java +++ b/src/alisolarflare/components/gpowers/powerstate/PowerAll.java @@ -3,7 +3,7 @@ package alisolarflare.components.gpowers.powerstate; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.gpowers.GPowerAPI; +import alisolarflare.components.gpowers.api.GPowerAPI; public class PowerAll extends ModCommand{ @Override diff --git a/src/alisolarflare/components/gpowers/powerstate/PowerDown.java b/src/alisolarflare/components/gpowers/powerstate/PowerDown.java index 6badc03..a2ab7b9 100644 --- a/src/alisolarflare/components/gpowers/powerstate/PowerDown.java +++ b/src/alisolarflare/components/gpowers/powerstate/PowerDown.java @@ -3,7 +3,7 @@ package alisolarflare.components.gpowers.powerstate; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.gpowers.GPowerAPI; +import alisolarflare.components.gpowers.api.GPowerAPI; public class PowerDown extends PlayerCommand { @Override diff --git a/src/alisolarflare/components/gpowers/powerstate/PowerUp.java b/src/alisolarflare/components/gpowers/powerstate/PowerUp.java index 50f89d3..6f7bc03 100644 --- a/src/alisolarflare/components/gpowers/powerstate/PowerUp.java +++ b/src/alisolarflare/components/gpowers/powerstate/PowerUp.java @@ -3,7 +3,7 @@ package alisolarflare.components.gpowers.powerstate; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.gpowers.GPowerAPI; +import alisolarflare.components.gpowers.api.GPowerAPI; public class PowerUp extends PlayerCommand { @Override From e01e9d3f3e5cd315da4437c07e79a6a5677206ba Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 1 Dec 2016 16:46:42 -0500 Subject: [PATCH 191/263] Fixed NPE with a SHIT TON OF STATIC --- .../flairdoor/FlairDoorComponent.java | 51 +++++++++---------- .../PlayerProximityLoop.java | 50 +++++++++--------- .../SetProximityLocation.java | 11 +--- 3 files changed, 50 insertions(+), 62 deletions(-) diff --git a/src/alisolarflare/components/flairdoor/FlairDoorComponent.java b/src/alisolarflare/components/flairdoor/FlairDoorComponent.java index b7886f6..e43389d 100644 --- a/src/alisolarflare/components/flairdoor/FlairDoorComponent.java +++ b/src/alisolarflare/components/flairdoor/FlairDoorComponent.java @@ -1,27 +1,24 @@ -package alisolarflare.components.flairdoor; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.Location; -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.architecture.Component; -import alisolarflare.components.flairdoor.flairme.FlairMe; -import alisolarflare.components.flairdoor.listeners.PortalListener; -import alisolarflare.components.flairdoor.proximitydetector.PlayerProximityLoop; -import alisolarflare.components.flairdoor.proximitydetector.SetProximityLocation; - -public class FlairDoorComponent extends Component { - public List playersToBeFlaired = new ArrayList(); - public Location startLocation = null; - public Location endLocation = null; - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new FlairMe(this)); - registerCommand(plugin, new SetProximityLocation(this)); - registerListener(plugin, new PortalListener(plugin, this)); - registerListener(plugin, new PlayerProximityLoop(plugin, this)); - } -} +package alisolarflare.components.flairdoor; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.architecture.Component; +import alisolarflare.components.flairdoor.flairme.FlairMe; +import alisolarflare.components.flairdoor.listeners.PortalListener; +import alisolarflare.components.flairdoor.proximitydetector.PlayerProximityLoop; +import alisolarflare.components.flairdoor.proximitydetector.SetProximityLocation; + +public class FlairDoorComponent extends Component { + public List playersToBeFlaired = new ArrayList(); + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new FlairMe(this)); + registerCommand(plugin, new SetProximityLocation()); + registerListener(plugin, new PortalListener(plugin, this)); + registerListener(plugin, new PlayerProximityLoop(plugin, this)); + } +} diff --git a/src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java b/src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java index a1727a6..e65eff7 100644 --- a/src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java +++ b/src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java @@ -9,38 +9,36 @@ import org.bukkit.scheduler.BukkitRunnable; import alisolarflare.components.flairdoor.FlairDoorComponent; public class PlayerProximityLoop extends BukkitRunnable implements Listener{ - private JavaPlugin plugin; - private FlairDoorComponent component; - private Location startLocation; - private Location endLocation; + private static JavaPlugin plugin; + private static FlairDoorComponent component; + private static Location startLocation; + private static Location endLocation; - private int sX; - private int sY; - private int sZ; - private int eX; - private int eY; - private int eZ; + private static int sX; + private static int sY; + private static int sZ; + private static int eX; + private static int eY; + private static int eZ; public PlayerProximityLoop(JavaPlugin plugin, FlairDoorComponent component) { - this.plugin = plugin; - this.component = component; - setStartLocation(component.startLocation); - setEndLocation(component.endLocation); + PlayerProximityLoop.plugin = plugin; + PlayerProximityLoop.component = component; this.runTaskTimer(plugin, 0, 20); } - public void setStartLocation(Location location){ - this.sX = startLocation.getBlockX(); - this.sY = startLocation.getBlockY(); - this.sZ = startLocation.getBlockZ(); - this.startLocation = location; - this.endLocation.setWorld(location.getWorld()); + public static void setStartLocation(Location location){ + PlayerProximityLoop.sX = location.getBlockX(); + PlayerProximityLoop.sY = location.getBlockY(); + PlayerProximityLoop.sZ = location.getBlockZ(); + PlayerProximityLoop.startLocation = location; + PlayerProximityLoop.endLocation.setWorld(location.getWorld()); } - public void setEndLocation(Location location){ - this.eX = startLocation.getBlockX(); - this.eY = startLocation.getBlockY(); - this.eZ = startLocation.getBlockZ(); - this.endLocation = location; - this.startLocation.setWorld(location.getWorld()); + public static void setEndLocation(Location location){ + PlayerProximityLoop.eX = location.getBlockX(); + PlayerProximityLoop.eY = location.getBlockY(); + PlayerProximityLoop.eZ = location.getBlockZ(); + PlayerProximityLoop.startLocation.setWorld(location.getWorld()); + PlayerProximityLoop.endLocation = location; } @Override diff --git a/src/alisolarflare/components/flairdoor/proximitydetector/SetProximityLocation.java b/src/alisolarflare/components/flairdoor/proximitydetector/SetProximityLocation.java index f19ce48..372d158 100644 --- a/src/alisolarflare/components/flairdoor/proximitydetector/SetProximityLocation.java +++ b/src/alisolarflare/components/flairdoor/proximitydetector/SetProximityLocation.java @@ -3,16 +3,9 @@ package alisolarflare.components.flairdoor.proximitydetector; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.flairdoor.FlairDoorComponent; public class SetProximityLocation extends ModCommand{ - private FlairDoorComponent component; - - public SetProximityLocation(FlairDoorComponent flairDoorComponent) { - this.component = flairDoorComponent; - } - @Override public boolean OnCommand(Player player, String alias, String[] args) { if (args.length < 1){ @@ -24,11 +17,11 @@ public class SetProximityLocation extends ModCommand{ switch(firstChar){ case "s": case "0": - component.startLocation = player.getLocation(); + PlayerProximityLoop.setStartLocation(player.getLocation()); return true; case "e": case "1": - component.endLocation = player.getLocation(); + PlayerProximityLoop.setEndLocation(player.getLocation()); return true; default: player.sendMessage("You must provide a vaild argument!"); From 96ed0ffc079233f6604400d86561f121469d7588 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 2 Dec 2016 08:39:53 -0500 Subject: [PATCH 192/263] Got Rid of Exception, replaced with BRUTE FORCE SEARCH I am going to find that *god damn metrics file* if it's the last thing I do --- .../components/metrics/MetricsComponent.java | 2 +- .../components/metrics/files/MetricsFile.java | 67 ++++++++++++++----- 2 files changed, 53 insertions(+), 16 deletions(-) diff --git a/src/alisolarflare/components/metrics/MetricsComponent.java b/src/alisolarflare/components/metrics/MetricsComponent.java index 7b572fb..3bb855f 100644 --- a/src/alisolarflare/components/metrics/MetricsComponent.java +++ b/src/alisolarflare/components/metrics/MetricsComponent.java @@ -11,7 +11,7 @@ import alisolarflare.components.metrics.files.MetricsFile; import alisolarflare.components.metrics.output.GetLoginMetrics; public class MetricsComponent extends Component{ - String defaultPath = "/AliPresents/metrics"; + String defaultPath = "metrics"; String defaultFilePath = (defaultPath + "/metrics.txt"); String playerLoginsFilePath = (defaultPath + "/playerLogins.txt"); diff --git a/src/alisolarflare/components/metrics/files/MetricsFile.java b/src/alisolarflare/components/metrics/files/MetricsFile.java index ed0bde0..5fa2d98 100644 --- a/src/alisolarflare/components/metrics/files/MetricsFile.java +++ b/src/alisolarflare/components/metrics/files/MetricsFile.java @@ -13,41 +13,78 @@ import java.util.List; import buttondevteam.lib.TBMCCoreAPI; public class MetricsFile { - private String fileName = "/AliPresents/metrics/playerLogins.txt"; + private String fileName = "AliPresents/metrics/playerLogins.txt"; public MetricsFile(String directory){ this.fileName = directory; } public void AddLine(String string){ BufferedWriter inputStream = null; - try { - File file = new File(fileName); - TBMCCoreAPI.sendDebugMessage("Metrics File Exists: " + file.exists()); - inputStream = new BufferedWriter(new FileWriter(fileName, true)); - TBMCCoreAPI.sendDebugMessage("Input Stream Created!"); - inputStream.write(string); - inputStream.newLine(); - inputStream.close(); - } catch (IOException e) { - TBMCCoreAPI.SendException(fileName +" Input Stream could not be created! ", e); + String[] fileNames = { + "/AliPresents/metrics/playerLogins.txt", + "AliPresents/metrics/playerLogins.txt", + "/metrics/playerLogins.txt", + "metrics/playerLogins.txt", + "/playerLogins.txt", + "playerLogins.txt", + + + "/AliPresents/metrics/playerLogins", + "AliPresents/metrics/playerLogins", + "/metrics/playerLogins", + "metrics/playerLogins", + "/playerLogins", + "playerLogins", + + ".AliPresents.metrics.playerLogins.txt", + "AliPresents.metrics.playerLogins.txt", + ".metrics.playerLogins.txt", + "metrics.playerLogins.txt", + ".playerLogins.txt", + "playerLogins.txt", + + }; + for(String fileName: fileNames){ + try { + TBMCCoreAPI.sendDebugMessage("Trying to Open File: "+fileName+"..."); + File file = new File(fileName); + TBMCCoreAPI.sendDebugMessage("File Exists: " + file.exists()); + inputStream = new BufferedWriter(new FileWriter(fileName, true)); + TBMCCoreAPI.sendDebugMessage("Input Stream Created!"); + TBMCCoreAPI.sendDebugMessage("Trying to write to file..."); + inputStream.write(string); + TBMCCoreAPI.sendDebugMessage("Ending with newLine..."); + inputStream.newLine(); + TBMCCoreAPI.sendDebugMessage("Closing File..."); + inputStream.close(); + TBMCCoreAPI.sendDebugMessage("File Closed!"); + } catch (IOException e) { + TBMCCoreAPI.sendDebugMessage(fileName +" Input Stream could not be created! "); + TBMCCoreAPI.sendDebugMessage(e.toString()); + } } } public List toArrayList(){ BufferedReader outputStream = null; try { - outputStream = new BufferedReader(new FileReader(fileName)); - + TBMCCoreAPI.sendDebugMessage("Creating FileReader: "+fileName); + FileReader reader = new FileReader(fileName); + TBMCCoreAPI.sendDebugMessage("Creating BufferedReader..."); + outputStream = new BufferedReader(reader); + List outputList = new ArrayList(); String currentLine; - while ((currentLine = outputStream.readLine()) != null){ outputList.add(currentLine); } + TBMCCoreAPI.sendDebugMessage("Message! "+outputList.toString()); outputStream.close(); return outputList; } catch (FileNotFoundException e) { - TBMCCoreAPI.SendException(fileName + " could not be found", e); + TBMCCoreAPI.sendDebugMessage(fileName + " could not be found"); + TBMCCoreAPI.sendDebugMessage(e.toString()); } catch (IOException e1) { TBMCCoreAPI.SendException(fileName + "encountered an I/O Exception!", e1); + TBMCCoreAPI.sendDebugMessage(e1.toString()); } return new ArrayList(); } From 913c430a1186c82b7789863490b972c298198201 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 2 Dec 2016 09:17:49 -0500 Subject: [PATCH 193/263] updated pom.xml to include CitizensAPI --- pom.xml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 52f03b8..62a9e7d 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.github.tbmcplugins AliPresents - 0.0.1-SNAPSHOT + 2.0.2-SNAPSHOT AliPresents A bucket of aaall the stuff Ali makes. It's a bit smelly. @@ -23,9 +23,6 @@ metrics - - *.txt - @@ -60,6 +57,10 @@ ess-repo http://repo.ess3.net/content/groups/essentials + + citizensnpcs + http://repo.citizensnpcs.co/ + @@ -84,15 +85,10 @@ Essentials 2.13.1 - - org.apache.logging.log4j - log4j-api - 2.7 - - org.apache.logging.log4j - log4j-core - 2.7 - + net.citizensnpcs + citizens-v1_11_R1 + 2.0.21-SNAPSHOT + From 7bee64db7df3276c7537002b5e2b8c562ea9464d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 2 Dec 2016 09:52:15 -0500 Subject: [PATCH 194/263] added a SHIIIIT ton of colours (and made the flaircolourAPI) --- .../flairdoor/FlairColouringAPI.java | 82 +++++++++++++++++++ .../flairdoor/listeners/PortalListener.java | 70 ++-------------- 2 files changed, 87 insertions(+), 65 deletions(-) create mode 100644 src/alisolarflare/components/flairdoor/FlairColouringAPI.java diff --git a/src/alisolarflare/components/flairdoor/FlairColouringAPI.java b/src/alisolarflare/components/flairdoor/FlairColouringAPI.java new file mode 100644 index 0000000..2163e12 --- /dev/null +++ b/src/alisolarflare/components/flairdoor/FlairColouringAPI.java @@ -0,0 +1,82 @@ +package alisolarflare.components.flairdoor; + +import org.bukkit.DyeColor; + +import com.earth2me.essentials.User; + +public class FlairColouringAPI { + + public static void recolourPlayer(User user, DyeColor dyecolour){ + String name = user._getNickname(); + String sanitizedName = ""; + for(int i = 0; i < name.length(); i++){ + if (name.charAt(i) != '§'){ + sanitizedName += name.charAt(i); + }else{ + i++; + } + } + + String colourChanger = ""; + + switch(dyecolour){ + case WHITE: + colourChanger = "§f"; + break; + case SILVER: + colourChanger = "§7"; + break; + case GRAY: + colourChanger = "§8"; + break; + case BLACK: + colourChanger = "§0"; + break; + case PINK: + colourChanger = "§d"; + break; + case RED: + colourChanger = "§c"; + break; + case ORANGE: + colourChanger = "§6"; + break; + case YELLOW: + colourChanger = "§e"; + break; + case LIME: + colourChanger = "§a"; + break; + case GREEN: + colourChanger = "§2"; + break; + case LIGHT_BLUE: + colourChanger = "&b"; + break; + case CYAN: + colourChanger = "§3"; + break; + case BLUE: + colourChanger = "§9"; + break; + case PURPLE: + colourChanger = "§5"; + break; + case MAGENTA: + colourChanger = "§d"; + break; + case BROWN: + colourChanger = "§4"; //Technically a dark red + break; + default: + colourChanger = "§m"; + break; + } + + String newName = colourChanger + sanitizedName; + user.setNickname(newName); + + user.sendMessage("Adding the colour " + colourChanger + dyecolour.name() + "§f!"); + user.sendMessage("Your name is now: " + user.getNickname() +"!"); + } +} diff --git a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java index 9d85a62..82f8ba5 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -12,8 +12,8 @@ import org.bukkit.material.Wool; import org.bukkit.plugin.java.JavaPlugin; import com.earth2me.essentials.Essentials; -import com.earth2me.essentials.User; +import alisolarflare.components.flairdoor.FlairColouringAPI; import alisolarflare.components.flairdoor.FlairDoorComponent; public class PortalListener implements Listener{ @@ -51,7 +51,8 @@ public class PortalListener implements Listener{ Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); //Block under middle block if(HigherBlock.getType() == Material.STONE){ - recolourPlayer(player, DyeColor.GRAY); + FlairColouringAPI.recolourPlayer(essentials.getUser(player), DyeColor.GRAY); + component.playersToBeFlaired.remove(player.getName()); return; } @@ -66,69 +67,8 @@ public class PortalListener implements Listener{ return; } - recolourPlayer(player, woolColour); - - } - public void recolourPlayer(Player player, DyeColor dyecolour){ - User user = essentials.getUser(player); - - String name = user._getNickname(); - String sanitizedName = ""; - for(int i = 0; i < name.length(); i++){ - if (name.charAt(i) != '§'){ - sanitizedName += name.charAt(i); - }else{ - i++; - } - } - - String colourChanger = ""; - - switch(dyecolour){ - case GRAY: - colourChanger = "§7"; - break; - case RED: - colourChanger = "§4"; - break; - case ORANGE: - colourChanger = "§6"; - break; - case YELLOW: - colourChanger = "§e"; - break; - case LIME: - colourChanger = "§a"; - break; - case GREEN: - colourChanger = "§a"; - break; - case CYAN: - colourChanger = "§9"; - break; - case LIGHT_BLUE: - colourChanger = "§9"; - break; - case BLUE: - colourChanger = "§9"; - break; - case PURPLE: - colourChanger = "§5"; - break; - case WHITE: - colourChanger = "§f"; - break; - default: - player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); - break; - } - - String newName = colourChanger + sanitizedName; - user.setNickname(newName); - - player.sendMessage("Adding the colour " + colourChanger + dyecolour.name() + "§f!"); - player.sendMessage("Your name is now: " + user.getNickname() +"!"); - + FlairColouringAPI.recolourPlayer(essentials.getUser(player), woolColour); component.playersToBeFlaired.remove(player.getName()); + } } From 40b033b119ef83a675f23e9c8d2ff297f25e9742 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 2 Dec 2016 16:35:47 -0500 Subject: [PATCH 195/263] tried to code shiftColoursRight but EH --- .../flairdoor/FlairColouringAPI.java | 74 +++++++++++++++---- 1 file changed, 60 insertions(+), 14 deletions(-) diff --git a/src/alisolarflare/components/flairdoor/FlairColouringAPI.java b/src/alisolarflare/components/flairdoor/FlairColouringAPI.java index 2163e12..2f31fb2 100644 --- a/src/alisolarflare/components/flairdoor/FlairColouringAPI.java +++ b/src/alisolarflare/components/flairdoor/FlairColouringAPI.java @@ -5,21 +5,72 @@ import org.bukkit.DyeColor; import com.earth2me.essentials.User; public class FlairColouringAPI { - public static void recolourPlayer(User user, DyeColor dyecolour){ String name = user._getNickname(); String sanitizedName = ""; for(int i = 0; i < name.length(); i++){ - if (name.charAt(i) != '§'){ - sanitizedName += name.charAt(i); + if (name.charAt(i) == '§'){ + i++;//Skips the data value, the 4 in "§4Alisolarflare" }else{ - i++; + sanitizedName += name.charAt(i); } } - - String colourChanger = ""; - - switch(dyecolour){ + + String colourCode = dyeToColourCode(dyecolour); + String newName = colourCode + sanitizedName; + + user.setNickname(newName); + user.sendMessage("Adding the colour " + colourCode + dyecolour.name() + "§f!"); + user.sendMessage("Your name is now: " + user.getNickname() +"!"); + } + public static String shiftColoursRight(String input){ + String output = ""; + for(int ptr = 0; ptr < input.length(); ptr++){ + if (input.charAt(ptr) == '§'){ + System.out.println(input); + for (int i = ptr + 2; i < input.length(); i++){ + if (i < input.length() - 2){ + if (input.charAt(i - 1) == '§' || input.charAt(i) == '§'){ + continue; + }else{//SecondPtr points to a legal character + System.out.println("Found legal character! "+input.charAt(i)); + System.out.println("Changing String!"+ output + "<" +input.substring(ptr, i)+ "|" +input.charAt(i) + ">" + input.substring(i+1, input.length())); + output += input.charAt(i) + input.substring(ptr, i); + System.out.println("Changed String: " + output); + + ptr = i; + break; + } + }else{ + if (i < input.length() - 1){ + output += input.charAt(i) + input.substring(ptr, i); + System.out.println(output); + ptr = i++; + }else{ + output += input.charAt(i) + input.substring(ptr, i); + ptr = i; + } + } + + } + }else{ + output += input.charAt(ptr); //copy over + } + } + + return output; + } + public static void main(String[] args){ + String yo = "§3A§4lisolarflare"; + for(int i = 0; i < 20; i++){ + yo = shiftColoursRight(yo); + System.out.println(yo); + System.out.println("--------------------"); + } + } + public static String dyeToColourCode(DyeColor dyeColour){ + String colourChanger; + switch(dyeColour){ case WHITE: colourChanger = "§f"; break; @@ -72,11 +123,6 @@ public class FlairColouringAPI { colourChanger = "§m"; break; } - - String newName = colourChanger + sanitizedName; - user.setNickname(newName); - - user.sendMessage("Adding the colour " + colourChanger + dyecolour.name() + "§f!"); - user.sendMessage("Your name is now: " + user.getNickname() +"!"); + return colourChanger; } } From 34f66f78ffa3252eabcae7d7eec250227d17a012 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 2 Dec 2016 20:00:08 -0500 Subject: [PATCH 196/263] Properly made shiftColoursRight function --- .../flairdoor/FlairColouringAPI.java | 45 ++++++------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/src/alisolarflare/components/flairdoor/FlairColouringAPI.java b/src/alisolarflare/components/flairdoor/FlairColouringAPI.java index 2f31fb2..9dce73d 100644 --- a/src/alisolarflare/components/flairdoor/FlairColouringAPI.java +++ b/src/alisolarflare/components/flairdoor/FlairColouringAPI.java @@ -25,33 +25,24 @@ public class FlairColouringAPI { } public static String shiftColoursRight(String input){ String output = ""; + if (input.length() <= 2){ + return input; + } for(int ptr = 0; ptr < input.length(); ptr++){ if (input.charAt(ptr) == '§'){ - System.out.println(input); + boolean foundLegalCharacter = false; for (int i = ptr + 2; i < input.length(); i++){ - if (i < input.length() - 2){ - if (input.charAt(i - 1) == '§' || input.charAt(i) == '§'){ - continue; - }else{//SecondPtr points to a legal character - System.out.println("Found legal character! "+input.charAt(i)); - System.out.println("Changing String!"+ output + "<" +input.substring(ptr, i)+ "|" +input.charAt(i) + ">" + input.substring(i+1, input.length())); - output += input.charAt(i) + input.substring(ptr, i); - System.out.println("Changed String: " + output); - - ptr = i; - break; - } - }else{ - if (i < input.length() - 1){ - output += input.charAt(i) + input.substring(ptr, i); - System.out.println(output); - ptr = i++; - }else{ - output += input.charAt(i) + input.substring(ptr, i); - ptr = i; - } + if (input.charAt(i - 1) == '§' || input.charAt(i) == '§'){ + continue; + }else{//SecondPtr points to a legal character + foundLegalCharacter = true; + output += input.charAt(i) + input.substring(ptr, i); + ptr = i; + break; } - + } + if (foundLegalCharacter == false){ + break; } }else{ output += input.charAt(ptr); //copy over @@ -60,14 +51,6 @@ public class FlairColouringAPI { return output; } - public static void main(String[] args){ - String yo = "§3A§4lisolarflare"; - for(int i = 0; i < 20; i++){ - yo = shiftColoursRight(yo); - System.out.println(yo); - System.out.println("--------------------"); - } - } public static String dyeToColourCode(DyeColor dyeColour){ String colourChanger; switch(dyeColour){ From 324a9730903e9fc4c929b02b029bb7250f05ff26 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 2 Dec 2016 21:26:03 -0500 Subject: [PATCH 197/263] Implemented Letter Dyes for testing --- src/alisolarflare/AliPresents.java | 4 +-- .../FlairColouringAPI.java | 7 ++-- .../FlairColouringComponent.java | 32 +++++++++++++++++++ .../letterdyes/GetLetterDye.java | 14 ++++++++ .../flaircolouring/letterdyes/LetterDye.java | 23 +++++++++++++ .../letterdyes/LetterDyeListener.java | 29 +++++++++++++++++ .../portals}/FlairMe.java | 8 ++--- .../portals}/PlayerProximityLoop.java | 8 ++--- .../portals}/PortalListener.java | 10 +++--- .../portals}/SetProximityLocation.java | 2 +- .../flairdoor/FlairDoorComponent.java | 24 -------------- 11 files changed, 119 insertions(+), 42 deletions(-) rename src/alisolarflare/components/{flairdoor => flaircolouring}/FlairColouringAPI.java (90%) create mode 100644 src/alisolarflare/components/flaircolouring/FlairColouringComponent.java create mode 100644 src/alisolarflare/components/flaircolouring/letterdyes/GetLetterDye.java create mode 100644 src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java create mode 100644 src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java rename src/alisolarflare/components/{flairdoor/flairme => flaircolouring/portals}/FlairMe.java (69%) rename src/alisolarflare/components/{flairdoor/proximitydetector => flaircolouring/portals}/PlayerProximityLoop.java (88%) rename src/alisolarflare/components/{flairdoor/listeners => flaircolouring/portals}/PortalListener.java (84%) rename src/alisolarflare/components/{flairdoor/proximitydetector => flaircolouring/portals}/SetProximityLocation.java (94%) delete mode 100644 src/alisolarflare/components/flairdoor/FlairDoorComponent.java diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index dcc97a9..6b0d4de 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -9,7 +9,7 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.alilinks.AliLinkComponent; import alisolarflare.components.bankchest.BankChestComponent; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; -import alisolarflare.components.flairdoor.FlairDoorComponent; +import alisolarflare.components.flaircolouring.FlairColouringComponent; import alisolarflare.components.gpowers.GPowerComponent; import alisolarflare.components.insurance.InsuranceComponent; import alisolarflare.components.magic.MagicComponent; @@ -26,7 +26,7 @@ public class AliPresents extends JavaPlugin{ new AliLinkComponent().register(this); new BankChestComponent().register(this); new CreativeBoundariesComponent().register(this); - new FlairDoorComponent().register(this); + new FlairColouringComponent().register(this); new GPowerComponent().register(this); new InsuranceComponent().register(this); new MagicComponent().register(this); diff --git a/src/alisolarflare/components/flairdoor/FlairColouringAPI.java b/src/alisolarflare/components/flaircolouring/FlairColouringAPI.java similarity index 90% rename from src/alisolarflare/components/flairdoor/FlairColouringAPI.java rename to src/alisolarflare/components/flaircolouring/FlairColouringAPI.java index 9dce73d..759f761 100644 --- a/src/alisolarflare/components/flairdoor/FlairColouringAPI.java +++ b/src/alisolarflare/components/flaircolouring/FlairColouringAPI.java @@ -1,4 +1,4 @@ -package alisolarflare.components.flairdoor; +package alisolarflare.components.flaircolouring; import org.bukkit.DyeColor; @@ -23,7 +23,10 @@ public class FlairColouringAPI { user.sendMessage("Adding the colour " + colourCode + dyecolour.name() + "§f!"); user.sendMessage("Your name is now: " + user.getNickname() +"!"); } - public static String shiftColoursRight(String input){ + public static String colourShiftRight(String input, DyeColor newDye){ + return dyeToColourCode(newDye) + shiftColoursRight(input); + } + private static String shiftColoursRight(String input){ String output = ""; if (input.length() <= 2){ return input; diff --git a/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java b/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java new file mode 100644 index 0000000..d9c28fa --- /dev/null +++ b/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java @@ -0,0 +1,32 @@ +package alisolarflare.components.flaircolouring; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import com.earth2me.essentials.Essentials; + +import alisolarflare.architecture.Component; +import alisolarflare.components.flaircolouring.letterdyes.GetLetterDye; +import alisolarflare.components.flaircolouring.letterdyes.LetterDyeListener; +import alisolarflare.components.flaircolouring.portals.FlairMe; +import alisolarflare.components.flaircolouring.portals.PlayerProximityLoop; +import alisolarflare.components.flaircolouring.portals.PortalListener; +import alisolarflare.components.flaircolouring.portals.SetProximityLocation; + +public class FlairColouringComponent extends Component { + public List playersToBeFlaired = new ArrayList(); + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new FlairMe(this)); + registerCommand(plugin, new SetProximityLocation()); + registerCommand(plugin, new GetLetterDye()); + + registerListener(plugin, new PortalListener(plugin, this)); + registerListener(plugin, new PlayerProximityLoop(plugin, this)); + registerListener(plugin, new LetterDyeListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); + } +} diff --git a/src/alisolarflare/components/flaircolouring/letterdyes/GetLetterDye.java b/src/alisolarflare/components/flaircolouring/letterdyes/GetLetterDye.java new file mode 100644 index 0000000..438306b --- /dev/null +++ b/src/alisolarflare/components/flaircolouring/letterdyes/GetLetterDye.java @@ -0,0 +1,14 @@ +package alisolarflare.components.flaircolouring.letterdyes; + +import org.bukkit.entity.Player; + +import alisolarflare.architecture.commands.PlayerCommand; + +public class GetLetterDye extends PlayerCommand{ + @Override + public boolean OnCommand(Player player, String alias, String[] args) { + player.getInventory().addItem(LetterDye.getLetterDye()); + return false; + } + +} diff --git a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java new file mode 100644 index 0000000..506f53c --- /dev/null +++ b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java @@ -0,0 +1,23 @@ +package alisolarflare.components.flaircolouring.letterdyes; + +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +public class LetterDye { + public static boolean isLetterDye(ItemStack item){ + if(item.getType() != Material.INK_SACK) return false; + if(item.getItemMeta().hasEnchant(Enchantment.LUCK) && (item.getItemMeta().getEnchantLevel(Enchantment.LUCK) == 10)) return false; + if(item.getItemMeta().getDisplayName() == "LetterDye") return false; + return true; + } + public static ItemStack getLetterDye(){ + ItemStack item = new ItemStack(Material.INK_SACK); + item.addEnchantment(Enchantment.LUCK, 10); + ItemMeta meta = item.getItemMeta(); + meta.setDisplayName("LetterDye"); + item.setItemMeta(meta); + return item; + } +} diff --git a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java new file mode 100644 index 0000000..3befee2 --- /dev/null +++ b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java @@ -0,0 +1,29 @@ +package alisolarflare.components.flaircolouring.letterdyes; + +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.material.Dye; + +import com.earth2me.essentials.Essentials; +import com.earth2me.essentials.User; + +import alisolarflare.components.flaircolouring.FlairColouringAPI; + +public class LetterDyeListener implements Listener{ + private Essentials essentials; + public LetterDyeListener(Essentials essentials) { + this.essentials = essentials; + } + @EventHandler + public void onLetterDye(PlayerInteractEvent event){ + if((event.getAction() == Action.PHYSICAL)) return; + if (LetterDye.isLetterDye(event.getItem())) return; + + Dye dye = (Dye) event.getItem().getData(); + User user = essentials.getUser(event.getPlayer()); + user.setNickname(FlairColouringAPI.colourShiftRight(user._getNickname(), dye.getColor())); + + } +} diff --git a/src/alisolarflare/components/flairdoor/flairme/FlairMe.java b/src/alisolarflare/components/flaircolouring/portals/FlairMe.java similarity index 69% rename from src/alisolarflare/components/flairdoor/flairme/FlairMe.java rename to src/alisolarflare/components/flaircolouring/portals/FlairMe.java index d41fb1f..5d428cc 100644 --- a/src/alisolarflare/components/flairdoor/flairme/FlairMe.java +++ b/src/alisolarflare/components/flaircolouring/portals/FlairMe.java @@ -1,14 +1,14 @@ -package alisolarflare.components.flairdoor.flairme; +package alisolarflare.components.flaircolouring.portals; import org.bukkit.entity.Player; import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.flairdoor.FlairDoorComponent; +import alisolarflare.components.flaircolouring.FlairColouringComponent; public class FlairMe extends PlayerCommand { - private FlairDoorComponent component; - public FlairMe(FlairDoorComponent flairDoorComponent) { + private FlairColouringComponent component; + public FlairMe(FlairColouringComponent flairDoorComponent) { this.component = flairDoorComponent; } @Override diff --git a/src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java b/src/alisolarflare/components/flaircolouring/portals/PlayerProximityLoop.java similarity index 88% rename from src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java rename to src/alisolarflare/components/flaircolouring/portals/PlayerProximityLoop.java index e65eff7..fbbe1f8 100644 --- a/src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java +++ b/src/alisolarflare/components/flaircolouring/portals/PlayerProximityLoop.java @@ -1,4 +1,4 @@ -package alisolarflare.components.flairdoor.proximitydetector; +package alisolarflare.components.flaircolouring.portals; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -6,11 +6,11 @@ import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; -import alisolarflare.components.flairdoor.FlairDoorComponent; +import alisolarflare.components.flaircolouring.FlairColouringComponent; public class PlayerProximityLoop extends BukkitRunnable implements Listener{ private static JavaPlugin plugin; - private static FlairDoorComponent component; + private static FlairColouringComponent component; private static Location startLocation; private static Location endLocation; @@ -21,7 +21,7 @@ public class PlayerProximityLoop extends BukkitRunnable implements Listener{ private static int eY; private static int eZ; - public PlayerProximityLoop(JavaPlugin plugin, FlairDoorComponent component) { + public PlayerProximityLoop(JavaPlugin plugin, FlairColouringComponent component) { PlayerProximityLoop.plugin = plugin; PlayerProximityLoop.component = component; this.runTaskTimer(plugin, 0, 20); diff --git a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flaircolouring/portals/PortalListener.java similarity index 84% rename from src/alisolarflare/components/flairdoor/listeners/PortalListener.java rename to src/alisolarflare/components/flaircolouring/portals/PortalListener.java index 82f8ba5..8286e47 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flaircolouring/portals/PortalListener.java @@ -1,4 +1,4 @@ -package alisolarflare.components.flairdoor.listeners; +package alisolarflare.components.flaircolouring.portals; import org.bukkit.Bukkit; import org.bukkit.DyeColor; @@ -13,17 +13,17 @@ import org.bukkit.plugin.java.JavaPlugin; import com.earth2me.essentials.Essentials; -import alisolarflare.components.flairdoor.FlairColouringAPI; -import alisolarflare.components.flairdoor.FlairDoorComponent; +import alisolarflare.components.flaircolouring.FlairColouringAPI; +import alisolarflare.components.flaircolouring.FlairColouringComponent; public class PortalListener implements Listener{ public JavaPlugin plugin; Essentials essentials; - private FlairDoorComponent component; + private FlairColouringComponent component; - public PortalListener(JavaPlugin plugin, FlairDoorComponent component) { + public PortalListener(JavaPlugin plugin, FlairColouringComponent component) { this.plugin = plugin; this.component = component; this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials")); diff --git a/src/alisolarflare/components/flairdoor/proximitydetector/SetProximityLocation.java b/src/alisolarflare/components/flaircolouring/portals/SetProximityLocation.java similarity index 94% rename from src/alisolarflare/components/flairdoor/proximitydetector/SetProximityLocation.java rename to src/alisolarflare/components/flaircolouring/portals/SetProximityLocation.java index 372d158..f60b8e9 100644 --- a/src/alisolarflare/components/flairdoor/proximitydetector/SetProximityLocation.java +++ b/src/alisolarflare/components/flaircolouring/portals/SetProximityLocation.java @@ -1,4 +1,4 @@ -package alisolarflare.components.flairdoor.proximitydetector; +package alisolarflare.components.flaircolouring.portals; import org.bukkit.entity.Player; diff --git a/src/alisolarflare/components/flairdoor/FlairDoorComponent.java b/src/alisolarflare/components/flairdoor/FlairDoorComponent.java deleted file mode 100644 index e43389d..0000000 --- a/src/alisolarflare/components/flairdoor/FlairDoorComponent.java +++ /dev/null @@ -1,24 +0,0 @@ -package alisolarflare.components.flairdoor; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.architecture.Component; -import alisolarflare.components.flairdoor.flairme.FlairMe; -import alisolarflare.components.flairdoor.listeners.PortalListener; -import alisolarflare.components.flairdoor.proximitydetector.PlayerProximityLoop; -import alisolarflare.components.flairdoor.proximitydetector.SetProximityLocation; - -public class FlairDoorComponent extends Component { - public List playersToBeFlaired = new ArrayList(); - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new FlairMe(this)); - registerCommand(plugin, new SetProximityLocation()); - registerListener(plugin, new PortalListener(plugin, this)); - registerListener(plugin, new PlayerProximityLoop(plugin, this)); - } -} From 2f142476ee3531c71b146bd8b2ac82ddd880d3a0 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 2 Dec 2016 21:31:06 -0500 Subject: [PATCH 198/263] Fixed plugin.yml Bleh --- plugin.yml | 4 +++- .../components/flaircolouring/letterdyes/GetLetterDye.java | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin.yml b/plugin.yml index da90a29..a57eb89 100644 --- a/plugin.yml +++ b/plugin.yml @@ -68,4 +68,6 @@ commands: getinsuranceblock: description: Gets insurance block createbankchest: - description: Creates a Bank Chest \ No newline at end of file + description: Creates a Bank Chest + getletterdye: + description: Creates Letter Dye \ No newline at end of file diff --git a/src/alisolarflare/components/flaircolouring/letterdyes/GetLetterDye.java b/src/alisolarflare/components/flaircolouring/letterdyes/GetLetterDye.java index 438306b..aaf7e0a 100644 --- a/src/alisolarflare/components/flaircolouring/letterdyes/GetLetterDye.java +++ b/src/alisolarflare/components/flaircolouring/letterdyes/GetLetterDye.java @@ -10,5 +10,4 @@ public class GetLetterDye extends PlayerCommand{ player.getInventory().addItem(LetterDye.getLetterDye()); return false; } - } From 8972f7513fc3bc76a0103753ea2ef3a702acffa5 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 2 Dec 2016 21:39:23 -0500 Subject: [PATCH 199/263] Declared Enchantment as Unsafe --- .../components/flaircolouring/letterdyes/LetterDye.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java index 506f53c..68f9b88 100644 --- a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java +++ b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java @@ -14,7 +14,7 @@ public class LetterDye { } public static ItemStack getLetterDye(){ ItemStack item = new ItemStack(Material.INK_SACK); - item.addEnchantment(Enchantment.LUCK, 10); + item.addUnsafeEnchantment(Enchantment.LUCK, 10); ItemMeta meta = item.getItemMeta(); meta.setDisplayName("LetterDye"); item.setItemMeta(meta); From 52b9880713e0038782b198638e902562749156aa Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 2 Dec 2016 22:13:37 -0500 Subject: [PATCH 200/263] Disabled Lag --- src/alisolarflare/AliPresents.java | 3 +-- .../components/flaircolouring/FlairColouringAPI.java | 2 +- .../components/flaircolouring/FlairColouringComponent.java | 2 +- .../components/flaircolouring/letterdyes/LetterDye.java | 3 --- .../flaircolouring/letterdyes/LetterDyeListener.java | 7 +++++++ 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 6b0d4de..f283e7b 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -13,7 +13,6 @@ import alisolarflare.components.flaircolouring.FlairColouringComponent; import alisolarflare.components.gpowers.GPowerComponent; import alisolarflare.components.insurance.InsuranceComponent; import alisolarflare.components.magic.MagicComponent; -import alisolarflare.components.metrics.MetricsComponent; public class AliPresents extends JavaPlugin{ public void onEnable(){ @@ -30,7 +29,7 @@ public class AliPresents extends JavaPlugin{ new GPowerComponent().register(this); new InsuranceComponent().register(this); new MagicComponent().register(this); - new MetricsComponent().register(this); + //new MetricsComponent().register(this); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); diff --git a/src/alisolarflare/components/flaircolouring/FlairColouringAPI.java b/src/alisolarflare/components/flaircolouring/FlairColouringAPI.java index 759f761..293da95 100644 --- a/src/alisolarflare/components/flaircolouring/FlairColouringAPI.java +++ b/src/alisolarflare/components/flaircolouring/FlairColouringAPI.java @@ -88,7 +88,7 @@ public class FlairColouringAPI { colourChanger = "§2"; break; case LIGHT_BLUE: - colourChanger = "&b"; + colourChanger = "§b"; break; case CYAN: colourChanger = "§3"; diff --git a/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java b/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java index d9c28fa..5b07a57 100644 --- a/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java +++ b/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java @@ -27,6 +27,6 @@ public class FlairColouringComponent extends Component { registerListener(plugin, new PortalListener(plugin, this)); registerListener(plugin, new PlayerProximityLoop(plugin, this)); - registerListener(plugin, new LetterDyeListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); + //registerListener(plugin, new LetterDyeListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); } } diff --git a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java index 68f9b88..3b90335 100644 --- a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java +++ b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java @@ -7,9 +7,6 @@ import org.bukkit.inventory.meta.ItemMeta; public class LetterDye { public static boolean isLetterDye(ItemStack item){ - if(item.getType() != Material.INK_SACK) return false; - if(item.getItemMeta().hasEnchant(Enchantment.LUCK) && (item.getItemMeta().getEnchantLevel(Enchantment.LUCK) == 10)) return false; - if(item.getItemMeta().getDisplayName() == "LetterDye") return false; return true; } public static ItemStack getLetterDye(){ diff --git a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java index 3befee2..8bb5aa8 100644 --- a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java +++ b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java @@ -1,9 +1,12 @@ package alisolarflare.components.flaircolouring.letterdyes; +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; import org.bukkit.material.Dye; import com.earth2me.essentials.Essentials; @@ -20,6 +23,10 @@ public class LetterDyeListener implements Listener{ public void onLetterDye(PlayerInteractEvent event){ if((event.getAction() == Action.PHYSICAL)) return; if (LetterDye.isLetterDye(event.getItem())) return; + ItemStack item = event.getItem(); + if(item.getType() != Material.INK_SACK) return; + if(item.getItemMeta().hasEnchant(Enchantment.LUCK) && (item.getItemMeta().getEnchantLevel(Enchantment.LUCK) == 10)) return; + if(item.getItemMeta().getDisplayName() == "LetterDye") return; Dye dye = (Dye) event.getItem().getData(); User user = essentials.getUser(event.getPlayer()); From 3d88f355fb3da8a6b59ab053f069fc832835c275 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 2 Dec 2016 22:33:03 -0500 Subject: [PATCH 201/263] Got rid of some static... that might help? --- .../FlairColouringComponent.java | 4 ---- .../flaircolouring/letterdyes/LetterDye.java | 3 --- .../letterdyes/LetterDyeListener.java | 21 +++++++++++-------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java b/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java index 5b07a57..fe7f149 100644 --- a/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java +++ b/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java @@ -3,15 +3,11 @@ package alisolarflare.components.flaircolouring; import java.util.ArrayList; import java.util.List; -import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import com.earth2me.essentials.Essentials; - import alisolarflare.architecture.Component; import alisolarflare.components.flaircolouring.letterdyes.GetLetterDye; -import alisolarflare.components.flaircolouring.letterdyes.LetterDyeListener; import alisolarflare.components.flaircolouring.portals.FlairMe; import alisolarflare.components.flaircolouring.portals.PlayerProximityLoop; import alisolarflare.components.flaircolouring.portals.PortalListener; diff --git a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java index 3b90335..9c9e5df 100644 --- a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java +++ b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java @@ -6,9 +6,6 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; public class LetterDye { - public static boolean isLetterDye(ItemStack item){ - return true; - } public static ItemStack getLetterDye(){ ItemStack item = new ItemStack(Material.INK_SACK); item.addUnsafeEnchantment(Enchantment.LUCK, 10); diff --git a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java index 8bb5aa8..be65de6 100644 --- a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java +++ b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java @@ -21,16 +21,19 @@ public class LetterDyeListener implements Listener{ } @EventHandler public void onLetterDye(PlayerInteractEvent event){ - if((event.getAction() == Action.PHYSICAL)) return; - if (LetterDye.isLetterDye(event.getItem())) return; - ItemStack item = event.getItem(); - if(item.getType() != Material.INK_SACK) return; - if(item.getItemMeta().hasEnchant(Enchantment.LUCK) && (item.getItemMeta().getEnchantLevel(Enchantment.LUCK) == 10)) return; - if(item.getItemMeta().getDisplayName() == "LetterDye") return; + try{ + if((event.getAction() != Action.RIGHT_CLICK_AIR)) return; + ItemStack item = event.getItem(); + if(item.getType() != Material.INK_SACK) return; + if(item.getItemMeta().hasEnchant(Enchantment.LUCK) && (item.getItemMeta().getEnchantLevel(Enchantment.LUCK) == 10)) return; + if(item.getItemMeta().getDisplayName() == "LetterDye") return; - Dye dye = (Dye) event.getItem().getData(); - User user = essentials.getUser(event.getPlayer()); - user.setNickname(FlairColouringAPI.colourShiftRight(user._getNickname(), dye.getColor())); + Dye dye = (Dye) event.getItem().getData(); + User user = essentials.getUser(event.getPlayer()); + user.setNickname(FlairColouringAPI.colourShiftRight(user._getNickname(), dye.getColor())); + }catch(Exception e){ + event.getPlayer().sendMessage(e.getStackTrace().toString()); + } } } From 46e05f99f7479420d5dfbe56d1587cba85b277b7 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 2 Dec 2016 22:41:32 -0500 Subject: [PATCH 202/263] Fixed NPE? --- .../components/magic/tricks/CannonBowListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alisolarflare/components/magic/tricks/CannonBowListener.java b/src/alisolarflare/components/magic/tricks/CannonBowListener.java index 9eb0515..e2aaa84 100644 --- a/src/alisolarflare/components/magic/tricks/CannonBowListener.java +++ b/src/alisolarflare/components/magic/tricks/CannonBowListener.java @@ -60,7 +60,7 @@ public class CannonBowListener implements Listener { @EventHandler public void onTnTExplode(EntityExplodeEvent event) { if (event.getEntityType() != EntityType.PRIMED_TNT) return; - if (!event.getEntity().getCustomName().equals(launchedTNTName)) return; + if (event.getEntity().getCustomName() != "CANNON BOW TNT:42170") return; Location loc = event.getEntity().getLocation(); event.getEntity().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 3, false, false); From 213fa33d103b83c537a81fc0c1c5272b5ee1b942 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 2 Dec 2016 22:48:00 -0500 Subject: [PATCH 203/263] Reactivated potential LAG --- .../components/flaircolouring/FlairColouringComponent.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java b/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java index fe7f149..d9c28fa 100644 --- a/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java +++ b/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java @@ -3,11 +3,15 @@ package alisolarflare.components.flaircolouring; import java.util.ArrayList; import java.util.List; +import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; +import com.earth2me.essentials.Essentials; + import alisolarflare.architecture.Component; import alisolarflare.components.flaircolouring.letterdyes.GetLetterDye; +import alisolarflare.components.flaircolouring.letterdyes.LetterDyeListener; import alisolarflare.components.flaircolouring.portals.FlairMe; import alisolarflare.components.flaircolouring.portals.PlayerProximityLoop; import alisolarflare.components.flaircolouring.portals.PortalListener; @@ -23,6 +27,6 @@ public class FlairColouringComponent extends Component { registerListener(plugin, new PortalListener(plugin, this)); registerListener(plugin, new PlayerProximityLoop(plugin, this)); - //registerListener(plugin, new LetterDyeListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); + registerListener(plugin, new LetterDyeListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); } } From ba8ad228893bc85d217faccfc3ff462e2ef5bcc9 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 8 Dec 2016 21:01:04 -0500 Subject: [PATCH 204/263] Added CowSpawnLoop Spawns cows every few nights if there are no cows near the player in question --- .settings/org.eclipse.core.resources.prefs | 1 - pom.xml | 3 - src/alisolarflare/AliPresents.java | 2 + .../CreativeBoundariesAPI.java | 5 ++ .../letterdyes/LetterDyeListener.java | 6 +- .../components/metrics/MetricsComponent.java | 2 +- .../components/metrics/files/MetricsFile.java | 64 ++++++------------- .../components/spawn/SpawnComponent.java | 15 +++++ .../components/spawn/cows/CowSpawnLoop.java | 47 ++++++++++++++ .../alisolarflare/resources}/metrics.txt | 0 .../alisolarflare/resources}/playerLogins.txt | 0 11 files changed, 93 insertions(+), 52 deletions(-) create mode 100644 src/alisolarflare/components/spawn/SpawnComponent.java create mode 100644 src/alisolarflare/components/spawn/cows/CowSpawnLoop.java rename {metrics => src/alisolarflare/resources}/metrics.txt (100%) rename {metrics => src/alisolarflare/resources}/playerLogins.txt (100%) diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index e18f795..1df21ac 100644 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -1,4 +1,3 @@ eclipse.preferences.version=1 encoding/=UTF-8 -encoding/metrics=UTF-8 encoding/src=UTF-8 diff --git a/pom.xml b/pom.xml index 62a9e7d..b296628 100644 --- a/pom.xml +++ b/pom.xml @@ -21,9 +21,6 @@ *.yml - - metrics - diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index f283e7b..6db2501 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -13,6 +13,7 @@ import alisolarflare.components.flaircolouring.FlairColouringComponent; import alisolarflare.components.gpowers.GPowerComponent; import alisolarflare.components.insurance.InsuranceComponent; import alisolarflare.components.magic.MagicComponent; +import alisolarflare.components.spawn.SpawnComponent; public class AliPresents extends JavaPlugin{ public void onEnable(){ @@ -30,6 +31,7 @@ public class AliPresents extends JavaPlugin{ new InsuranceComponent().register(this); new MagicComponent().register(this); //new MetricsComponent().register(this); + new SpawnComponent().register(this); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); diff --git a/src/alisolarflare/components/creativeboundaries/CreativeBoundariesAPI.java b/src/alisolarflare/components/creativeboundaries/CreativeBoundariesAPI.java index 77b7996..7658e14 100644 --- a/src/alisolarflare/components/creativeboundaries/CreativeBoundariesAPI.java +++ b/src/alisolarflare/components/creativeboundaries/CreativeBoundariesAPI.java @@ -23,6 +23,11 @@ public class CreativeBoundariesAPI { cbCreatives.remove(player); } public static boolean toCreative(Player player){ + if (player.getWorld().getName().equalsIgnoreCase("World")){ + player.sendMessage("Creative Boundaries is disabled on the New Map!"); + return true; + } + TownBlock tb = TownyUniverse.getTownBlock(player.getLocation()); if (tb == null) { diff --git a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java index be65de6..ec16b12 100644 --- a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java +++ b/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java @@ -24,10 +24,12 @@ public class LetterDyeListener implements Listener{ try{ if((event.getAction() != Action.RIGHT_CLICK_AIR)) return; ItemStack item = event.getItem(); + if(item.getType() != Material.INK_SACK) return; - if(item.getItemMeta().hasEnchant(Enchantment.LUCK) && (item.getItemMeta().getEnchantLevel(Enchantment.LUCK) == 10)) return; + if(item.getItemMeta().hasEnchant(Enchantment.LUCK)) return; + if(item.getItemMeta().getEnchantLevel(Enchantment.LUCK) == 10) return; if(item.getItemMeta().getDisplayName() == "LetterDye") return; - + Dye dye = (Dye) event.getItem().getData(); User user = essentials.getUser(event.getPlayer()); user.setNickname(FlairColouringAPI.colourShiftRight(user._getNickname(), dye.getColor())); diff --git a/src/alisolarflare/components/metrics/MetricsComponent.java b/src/alisolarflare/components/metrics/MetricsComponent.java index 3bb855f..34bd000 100644 --- a/src/alisolarflare/components/metrics/MetricsComponent.java +++ b/src/alisolarflare/components/metrics/MetricsComponent.java @@ -11,7 +11,7 @@ import alisolarflare.components.metrics.files.MetricsFile; import alisolarflare.components.metrics.output.GetLoginMetrics; public class MetricsComponent extends Component{ - String defaultPath = "metrics"; + String defaultPath = "src/alisolarflare/resources"; String defaultFilePath = (defaultPath + "/metrics.txt"); String playerLoginsFilePath = (defaultPath + "/playerLogins.txt"); diff --git a/src/alisolarflare/components/metrics/files/MetricsFile.java b/src/alisolarflare/components/metrics/files/MetricsFile.java index 5fa2d98..baab52e 100644 --- a/src/alisolarflare/components/metrics/files/MetricsFile.java +++ b/src/alisolarflare/components/metrics/files/MetricsFile.java @@ -13,54 +13,28 @@ import java.util.List; import buttondevteam.lib.TBMCCoreAPI; public class MetricsFile { - private String fileName = "AliPresents/metrics/playerLogins.txt"; - public MetricsFile(String directory){ - this.fileName = directory; + private String fileName = "src/alisolarflare/resources/metrics/playerLogins.txt"; + public MetricsFile(String filePath){ + this.fileName = filePath; } public void AddLine(String string){ BufferedWriter inputStream = null; - String[] fileNames = { - "/AliPresents/metrics/playerLogins.txt", - "AliPresents/metrics/playerLogins.txt", - "/metrics/playerLogins.txt", - "metrics/playerLogins.txt", - "/playerLogins.txt", - "playerLogins.txt", - - - "/AliPresents/metrics/playerLogins", - "AliPresents/metrics/playerLogins", - "/metrics/playerLogins", - "metrics/playerLogins", - "/playerLogins", - "playerLogins", - - ".AliPresents.metrics.playerLogins.txt", - "AliPresents.metrics.playerLogins.txt", - ".metrics.playerLogins.txt", - "metrics.playerLogins.txt", - ".playerLogins.txt", - "playerLogins.txt", - - }; - for(String fileName: fileNames){ - try { - TBMCCoreAPI.sendDebugMessage("Trying to Open File: "+fileName+"..."); - File file = new File(fileName); - TBMCCoreAPI.sendDebugMessage("File Exists: " + file.exists()); - inputStream = new BufferedWriter(new FileWriter(fileName, true)); - TBMCCoreAPI.sendDebugMessage("Input Stream Created!"); - TBMCCoreAPI.sendDebugMessage("Trying to write to file..."); - inputStream.write(string); - TBMCCoreAPI.sendDebugMessage("Ending with newLine..."); - inputStream.newLine(); - TBMCCoreAPI.sendDebugMessage("Closing File..."); - inputStream.close(); - TBMCCoreAPI.sendDebugMessage("File Closed!"); - } catch (IOException e) { - TBMCCoreAPI.sendDebugMessage(fileName +" Input Stream could not be created! "); - TBMCCoreAPI.sendDebugMessage(e.toString()); - } + try { + TBMCCoreAPI.sendDebugMessage("Trying to Open File: "+fileName+"..."); + File file = new File(fileName); + TBMCCoreAPI.sendDebugMessage("File Exists: " + file.exists()); + inputStream = new BufferedWriter(new FileWriter(fileName, true)); + TBMCCoreAPI.sendDebugMessage("Input Stream Created!"); + TBMCCoreAPI.sendDebugMessage("Trying to write to file..."); + inputStream.write(string); + TBMCCoreAPI.sendDebugMessage("Ending with newLine..."); + inputStream.newLine(); + TBMCCoreAPI.sendDebugMessage("Closing File..."); + inputStream.close(); + TBMCCoreAPI.sendDebugMessage("File Closed!"); + } catch (IOException e) { + TBMCCoreAPI.sendDebugMessage(fileName +" Input Stream could not be created! "); + TBMCCoreAPI.sendDebugMessage(e.toString()); } } public List toArrayList(){ diff --git a/src/alisolarflare/components/spawn/SpawnComponent.java b/src/alisolarflare/components/spawn/SpawnComponent.java new file mode 100644 index 0000000..60bd317 --- /dev/null +++ b/src/alisolarflare/components/spawn/SpawnComponent.java @@ -0,0 +1,15 @@ +package alisolarflare.components.spawn; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.architecture.Component; +import alisolarflare.components.spawn.cows.CowSpawnLoop; + +public class SpawnComponent extends Component { + + @Override + public void register(JavaPlugin plugin) { + registerListener(plugin, new CowSpawnLoop(plugin)); + } + +} diff --git a/src/alisolarflare/components/spawn/cows/CowSpawnLoop.java b/src/alisolarflare/components/spawn/cows/CowSpawnLoop.java new file mode 100644 index 0000000..b7ded14 --- /dev/null +++ b/src/alisolarflare/components/spawn/cows/CowSpawnLoop.java @@ -0,0 +1,47 @@ +package alisolarflare.components.spawn.cows; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Cow; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitRunnable; +import org.bukkit.util.Vector; + +public class CowSpawnLoop extends BukkitRunnable implements Listener{ + + private JavaPlugin plugin; + + public CowSpawnLoop(JavaPlugin plugin) { + this.plugin = plugin; + this.runTaskTimer(plugin, 30200, 30200); + } + + @Override + public void run() { + boolean foodTrue; + for (Player player : plugin.getServer().getOnlinePlayers()){ + foodTrue = false; + for (Entity entity : player.getNearbyEntities(128, 128, 128)){ + if (entity instanceof Cow){ + foodTrue = true; + } + } + if (foodTrue){ + Location location = player.getLocation().add(new Vector(Math.random()*20, 0, Math.random()*20).normalize().multiply(30)); + Block attemptedCowSpawn = player.getWorld().getHighestBlockAt(location); + if (attemptedCowSpawn.getType().equals(Material.GRASS)){ + player.getWorld().spawnEntity(attemptedCowSpawn.getLocation().add(new Vector (0,1,0)), EntityType.COW); + player.getWorld().spawnEntity(attemptedCowSpawn.getLocation().add(new Vector (0,1,0)), EntityType.COW); + player.getWorld().spawnEntity(attemptedCowSpawn.getLocation().add(new Vector (0,1,0)), EntityType.COW); + } + } + } + + } + +} diff --git a/metrics/metrics.txt b/src/alisolarflare/resources/metrics.txt similarity index 100% rename from metrics/metrics.txt rename to src/alisolarflare/resources/metrics.txt diff --git a/metrics/playerLogins.txt b/src/alisolarflare/resources/playerLogins.txt similarity index 100% rename from metrics/playerLogins.txt rename to src/alisolarflare/resources/playerLogins.txt From 8bad0a97f410e99c9d9694af495f9c42a9ae0e54 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 8 Dec 2016 21:34:32 -0500 Subject: [PATCH 205/263] Made zombies drop $1 --- src/alisolarflare/AliPresents.java | 2 + .../components/cashmob/CashMobComponent.java | 18 ++++++++ .../components/cashmob/MobKillListener.java | 41 +++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 src/alisolarflare/components/cashmob/CashMobComponent.java create mode 100644 src/alisolarflare/components/cashmob/MobKillListener.java diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 6db2501..7d0716e 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -8,6 +8,7 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.alilinks.AliLinkComponent; import alisolarflare.components.bankchest.BankChestComponent; +import alisolarflare.components.cashmob.CashMobComponent; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; import alisolarflare.components.flaircolouring.FlairColouringComponent; import alisolarflare.components.gpowers.GPowerComponent; @@ -25,6 +26,7 @@ public class AliPresents extends JavaPlugin{ new AliLinkComponent().register(this); new BankChestComponent().register(this); + new CashMobComponent().register(this); new CreativeBoundariesComponent().register(this); new FlairColouringComponent().register(this); new GPowerComponent().register(this); diff --git a/src/alisolarflare/components/cashmob/CashMobComponent.java b/src/alisolarflare/components/cashmob/CashMobComponent.java new file mode 100644 index 0000000..dda2346 --- /dev/null +++ b/src/alisolarflare/components/cashmob/CashMobComponent.java @@ -0,0 +1,18 @@ +package alisolarflare.components.cashmob; + +import org.bukkit.Bukkit; +import org.bukkit.plugin.java.JavaPlugin; + +import com.earth2me.essentials.Essentials; + +import alisolarflare.architecture.Component; + +public class CashMobComponent extends Component{ + + @Override + public void register(JavaPlugin plugin) { + registerListener(plugin, new MobKillListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); + + } + +} diff --git a/src/alisolarflare/components/cashmob/MobKillListener.java b/src/alisolarflare/components/cashmob/MobKillListener.java new file mode 100644 index 0000000..2296a05 --- /dev/null +++ b/src/alisolarflare/components/cashmob/MobKillListener.java @@ -0,0 +1,41 @@ +package alisolarflare.components.cashmob; + +import java.math.BigDecimal; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityDeathEvent; + +import com.earth2me.essentials.Essentials; +import com.earth2me.essentials.User; + +import net.ess3.api.MaxMoneyException; + +public class MobKillListener implements Listener { + private Essentials essentials; + + public MobKillListener(Essentials essentials) { + this.essentials = essentials; + } + + @EventHandler + public void onMobKill(EntityDeathEvent event){ + Player killer; + if ((killer = event.getEntity().getKiller()) == null){ + return; + } + User user = essentials.getUser(killer); + switch(event.getEntity().getType()){ + case ZOMBIE: + try { + user.giveMoney(BigDecimal.ONE); + } catch (MaxMoneyException e) { + return; + } + default: + return; + } + + } +} From 3a23f4745affbe700038490911690a6a9f419f14 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 9 Dec 2016 20:27:58 -0500 Subject: [PATCH 206/263] Made Long Grass drop carrots and potatoes Temporary fix for the lack of carrots and potatoes in the server --- src/alisolarflare/AliPresents.java | 2 + .../components/fruit/FruitComponent.java | 15 +++++++ .../components/fruit/GrassBreakListener.java | 42 +++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 src/alisolarflare/components/fruit/FruitComponent.java create mode 100644 src/alisolarflare/components/fruit/GrassBreakListener.java diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 7d0716e..297bbcd 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -11,6 +11,7 @@ import alisolarflare.components.bankchest.BankChestComponent; import alisolarflare.components.cashmob.CashMobComponent; import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; import alisolarflare.components.flaircolouring.FlairColouringComponent; +import alisolarflare.components.fruit.FruitComponent; import alisolarflare.components.gpowers.GPowerComponent; import alisolarflare.components.insurance.InsuranceComponent; import alisolarflare.components.magic.MagicComponent; @@ -29,6 +30,7 @@ public class AliPresents extends JavaPlugin{ new CashMobComponent().register(this); new CreativeBoundariesComponent().register(this); new FlairColouringComponent().register(this); + new FruitComponent().register(this); new GPowerComponent().register(this); new InsuranceComponent().register(this); new MagicComponent().register(this); diff --git a/src/alisolarflare/components/fruit/FruitComponent.java b/src/alisolarflare/components/fruit/FruitComponent.java new file mode 100644 index 0000000..c4a99ed --- /dev/null +++ b/src/alisolarflare/components/fruit/FruitComponent.java @@ -0,0 +1,15 @@ +package alisolarflare.components.fruit; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.architecture.Component; + +public class FruitComponent extends Component{ + + @Override + public void register(JavaPlugin plugin) { + registerListener(plugin, new GrassBreakListener()); + + } + +} diff --git a/src/alisolarflare/components/fruit/GrassBreakListener.java b/src/alisolarflare/components/fruit/GrassBreakListener.java new file mode 100644 index 0000000..ee3659d --- /dev/null +++ b/src/alisolarflare/components/fruit/GrassBreakListener.java @@ -0,0 +1,42 @@ +package alisolarflare.components.fruit; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.inventory.ItemStack; + +public class GrassBreakListener implements Listener { + @EventHandler + public void onGrassBreak(BlockBreakEvent event){ + + + if (event.getBlock().getType().equals(Material.LONG_GRASS)){ + + Location location = event.getBlock().getLocation(); + World world = event.getBlock().getWorld(); + + switch((int) (Math.random()* 50)){ + case 1: // 2% chance + world.dropItem(location, new ItemStack(Material.CARROT)); + break; + case 2: // 2% chance + world.dropItem(location, new ItemStack(Material.BEETROOT_SEEDS)); + break; + case 3: // 2% chance + world.dropItem(location, new ItemStack(Material.POTATO)); + break; + case 4: // 2% chance + world.dropItem(location, new ItemStack(Material.FEATHER)); + break; + case 5: // 2% chance + world.dropItem(location, new ItemStack(Material.YELLOW_FLOWER)); + break; + default: + break; + } + } + } +} From bb305e94707d6ca8d430d7f84eb58e4b41182e51 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 9 Dec 2016 22:03:27 -0500 Subject: [PATCH 207/263] Made special items twice as rare --- src/alisolarflare/components/fruit/GrassBreakListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alisolarflare/components/fruit/GrassBreakListener.java b/src/alisolarflare/components/fruit/GrassBreakListener.java index ee3659d..098b31b 100644 --- a/src/alisolarflare/components/fruit/GrassBreakListener.java +++ b/src/alisolarflare/components/fruit/GrassBreakListener.java @@ -18,7 +18,7 @@ public class GrassBreakListener implements Listener { Location location = event.getBlock().getLocation(); World world = event.getBlock().getWorld(); - switch((int) (Math.random()* 50)){ + switch((int) (Math.random()* 100)){ case 1: // 2% chance world.dropItem(location, new ItemStack(Material.CARROT)); break; From 1253b6cc9f3b61547ea90089c1f87844eb9ac146 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 9 Dec 2016 22:30:45 -0500 Subject: [PATCH 208/263] Fixed Carrots and Potatoes not dropping --- .../components/fruit/GrassBreakListener.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/alisolarflare/components/fruit/GrassBreakListener.java b/src/alisolarflare/components/fruit/GrassBreakListener.java index 098b31b..4f03a95 100644 --- a/src/alisolarflare/components/fruit/GrassBreakListener.java +++ b/src/alisolarflare/components/fruit/GrassBreakListener.java @@ -3,6 +3,7 @@ package alisolarflare.components.fruit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; +import org.bukkit.block.Biome; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; @@ -18,20 +19,26 @@ public class GrassBreakListener implements Listener { Location location = event.getBlock().getLocation(); World world = event.getBlock().getWorld(); + /* + if (Math.random() > 0.05){ + switch(world.getBiome(location.getBlockX(), location.getBlockZ())){ + } + }*/ + switch((int) (Math.random()* 100)){ - case 1: // 2% chance - world.dropItem(location, new ItemStack(Material.CARROT)); + case 1: // 1% chance + world.dropItem(location, new ItemStack(Material.CARROT_ITEM)); break; - case 2: // 2% chance + case 2: // 1% chance world.dropItem(location, new ItemStack(Material.BEETROOT_SEEDS)); break; - case 3: // 2% chance - world.dropItem(location, new ItemStack(Material.POTATO)); + case 3: // 1% chance + world.dropItem(location, new ItemStack(Material.POTATO_ITEM)); break; - case 4: // 2% chance + case 4: // 1% chance world.dropItem(location, new ItemStack(Material.FEATHER)); break; - case 5: // 2% chance + case 5: // 1% chance world.dropItem(location, new ItemStack(Material.YELLOW_FLOWER)); break; default: From 61d5c82efc76541339a1487f2d8a1696dd6be6e0 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 9 Dec 2016 22:43:45 -0500 Subject: [PATCH 209/263] Reduced rarity a little --- src/alisolarflare/components/fruit/GrassBreakListener.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/alisolarflare/components/fruit/GrassBreakListener.java b/src/alisolarflare/components/fruit/GrassBreakListener.java index 4f03a95..6ae4836 100644 --- a/src/alisolarflare/components/fruit/GrassBreakListener.java +++ b/src/alisolarflare/components/fruit/GrassBreakListener.java @@ -19,13 +19,13 @@ public class GrassBreakListener implements Listener { Location location = event.getBlock().getLocation(); World world = event.getBlock().getWorld(); - /* + if (Math.random() > 0.05){ switch(world.getBiome(location.getBlockX(), location.getBlockZ())){ } - }*/ + } - switch((int) (Math.random()* 100)){ + switch((int) (Math.random()* 60)){ case 1: // 1% chance world.dropItem(location, new ItemStack(Material.CARROT_ITEM)); break; From 774b943f1c5d6a7504658a054d30e85b57badc9e Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 9 Dec 2016 22:45:16 -0500 Subject: [PATCH 210/263] Made carrots and potatoes twice as frequent --- .../components/fruit/GrassBreakListener.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/alisolarflare/components/fruit/GrassBreakListener.java b/src/alisolarflare/components/fruit/GrassBreakListener.java index 6ae4836..fb7f1c1 100644 --- a/src/alisolarflare/components/fruit/GrassBreakListener.java +++ b/src/alisolarflare/components/fruit/GrassBreakListener.java @@ -25,20 +25,22 @@ public class GrassBreakListener implements Listener { } } - switch((int) (Math.random()* 60)){ - case 1: // 1% chance + switch((int) (Math.random()* 70)){ + case 1: + case 2: world.dropItem(location, new ItemStack(Material.CARROT_ITEM)); break; - case 2: // 1% chance + case 3: // 1% chance world.dropItem(location, new ItemStack(Material.BEETROOT_SEEDS)); break; - case 3: // 1% chance + case 4: + case 7: world.dropItem(location, new ItemStack(Material.POTATO_ITEM)); break; - case 4: // 1% chance + case 5: // 1% chance world.dropItem(location, new ItemStack(Material.FEATHER)); break; - case 5: // 1% chance + case 6: // 1% chance world.dropItem(location, new ItemStack(Material.YELLOW_FLOWER)); break; default: From 7b9137513339443b89166d4a2c59d8d2a65fc43a Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 9 Dec 2016 22:50:21 -0500 Subject: [PATCH 211/263] Reset to default-ish --- .../components/fruit/GrassBreakListener.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/alisolarflare/components/fruit/GrassBreakListener.java b/src/alisolarflare/components/fruit/GrassBreakListener.java index fb7f1c1..3a33cfa 100644 --- a/src/alisolarflare/components/fruit/GrassBreakListener.java +++ b/src/alisolarflare/components/fruit/GrassBreakListener.java @@ -20,27 +20,21 @@ public class GrassBreakListener implements Listener { World world = event.getBlock().getWorld(); - if (Math.random() > 0.05){ - switch(world.getBiome(location.getBlockX(), location.getBlockZ())){ - } - } - switch((int) (Math.random()* 70)){ + switch((int) (Math.random()* 50)){ case 1: - case 2: world.dropItem(location, new ItemStack(Material.CARROT_ITEM)); break; - case 3: // 1% chance + case 2: world.dropItem(location, new ItemStack(Material.BEETROOT_SEEDS)); break; - case 4: - case 7: + case 3: world.dropItem(location, new ItemStack(Material.POTATO_ITEM)); break; - case 5: // 1% chance + case 4: world.dropItem(location, new ItemStack(Material.FEATHER)); break; - case 6: // 1% chance + case 5: world.dropItem(location, new ItemStack(Material.YELLOW_FLOWER)); break; default: From 205e27360efd6e74ea1ad235d61f913bfea15ebf Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 10 Dec 2016 15:15:11 -0500 Subject: [PATCH 212/263] Biomes are *hard* --- .../components/fruit/GrassBreakListener.java | 142 +++++++++++++++++- 1 file changed, 138 insertions(+), 4 deletions(-) diff --git a/src/alisolarflare/components/fruit/GrassBreakListener.java b/src/alisolarflare/components/fruit/GrassBreakListener.java index 3a33cfa..9bb54db 100644 --- a/src/alisolarflare/components/fruit/GrassBreakListener.java +++ b/src/alisolarflare/components/fruit/GrassBreakListener.java @@ -3,13 +3,21 @@ package alisolarflare.components.fruit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; -import org.bukkit.block.Biome; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.inventory.ItemStack; public class GrassBreakListener implements Listener { + /*public enum fruit { + Material.POTATO_ITEM, + Material.MELON_SEEDS, + Material.PUMPKIN_SEEDS, + Material.COCOA, + Material.BEETROOT_SEEDS, + Material.NETHER_WARTS, + Material.SEEDS + };*/ @EventHandler public void onGrassBreak(BlockBreakEvent event){ @@ -18,9 +26,135 @@ public class GrassBreakListener implements Listener { Location location = event.getBlock().getLocation(); World world = event.getBlock().getWorld(); - - - + /* + switch(world.getBiome(location.getBlockX(), location.getBlockZ())){ + + + + //JUNGLES + case JUNGLE: + case JUNGLE_EDGE: + case JUNGLE_HILLS: + case MUTATED_JUNGLE: + case MUTATED_JUNGLE_EDGE: + world.dropItem(location, new ItemStack(Material.COCOA)); + break; + + + //ROOFED FOREST + case ROOFED_FOREST: + case MUTATED_ROOFED_FOREST: + world.dropItem(location, new ItemStack(Material.CARROT_ITEM)); + break; + + + //GENERAL FOREST + case FOREST: + case FOREST_HILLS: + case MUTATED_FOREST: + case BIRCH_FOREST: + case BIRCH_FOREST_HILLS: + case MUTATED_BIRCH_FOREST: + case MUTATED_BIRCH_FOREST_HILLS: + world.dropItem(location, new ItemStack(Material.SEEDS)); + break; + case PLAINS: + case MUTATED_PLAINS: + world.dropItem(location, new ItemStack(Material.SEEDS)); + //DROP GRASS + break; + + + //SWAMPS + case SWAMPLAND: + case MUTATED_SWAMPLAND: + world.dropItem(location, new ItemStack(Material.POTATO)); + break; + + + //DESERT, DRY SHIT + case DESERT: + case DESERT_HILLS: + case MUTATED_DESERT: + case MESA: + case MESA_CLEAR_ROCK: + case MESA_ROCK: + case MUTATED_MESA: + case MUTATED_MESA_CLEAR_ROCK: + case MUTATED_MESA_ROCK: + case SAVANNA: + case SAVANNA_ROCK: + case MUTATED_SAVANNA: + case MUTATED_SAVANNA_ROCK: + world.dropItem(location, new ItemStack(Material.DEAD_BUSH)); + //DROP... dead shrub + break; + + + //Mountain Shit + case EXTREME_HILLS: + case EXTREME_HILLS_WITH_TREES: + case MUTATED_EXTREME_HILLS: + case MUTATED_EXTREME_HILLS_WITH_TREES: + case SMALLER_EXTREME_HILLS: + case STONE_BEACH: + //What the fuck grows in mountains? Rocks? + break; + + + //COLLLLLLLD FUCKERS + case TAIGA: + case TAIGA_COLD: + case TAIGA_COLD_HILLS: + case TAIGA_HILLS: + case COLD_BEACH: + case ICE_FLATS: + case ICE_MOUNTAINS: + case MUTATED_ICE_FLATS: + case FROZEN_OCEAN: + case FROZEN_RIVER: + case MUTATED_TAIGA: + case MUTATED_TAIGA_COLD: + case REDWOOD_TAIGA: + case REDWOOD_TAIGA_HILLS: + case MUTATED_REDWOOD_TAIGA: + case MUTATED_REDWOOD_TAIGA_HILLS: + world.dropItem(location, new ItemStack(Material.DIRT)); + break; + + + //OCEAN + case DEEP_OCEAN: + case OCEAN: + //DROP... why the fuck is there grass in deep ocean? + break; + + + //BEACHES + case BEACHES: + case RIVER: + //DROP A SEASHELL + break; + + + //MUSHROOM ISLANDS + case MUSHROOM_ISLAND: + case MUSHROOM_ISLAND_SHORE: + world.dropItem(location, new ItemStack(Material.BROWN_MUSHROOM)); + break; + + //WEIRD SHIT + case HELL: + case SKY: + case VOID: + break; + + + default: + break; + + }*/ + switch((int) (Math.random()* 50)){ case 1: world.dropItem(location, new ItemStack(Material.CARROT_ITEM)); From 7128804ef2ef504f4951cc83ba585a10c21389d5 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Tue, 13 Dec 2016 22:31:21 -0500 Subject: [PATCH 213/263] *probably* fixed essentials bug Copied a shit ton of code from @NorbiPeti --- pom.xml | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b296628..68e3c9f 100644 --- a/pom.xml +++ b/pom.xml @@ -31,6 +31,55 @@ 1.8 + + org.apache.maven.plugins + maven-shade-plugin + 2.4.2 + + + package + + shade + + + + + org.spigotmc:spigot-api + com.github.TBMCPlugins.ButtonCore:ButtonCore + net.ess3:Essentials + + + + + + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.0.1 + + + copy + compile + + copy-resources + + + target + + + resources + + + + + + @@ -80,7 +129,7 @@ net.ess3 Essentials - 2.13.1 + 2.14-SNAPSHOT net.citizensnpcs From 397bff70f2f4d68b54cb9df954ca9d35dcccfd8e Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Tue, 13 Dec 2016 22:31:43 -0500 Subject: [PATCH 214/263] attempted custom crafting recipies --- .../flaircolouring/FlairColouringComponent.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java b/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java index d9c28fa..10517a8 100644 --- a/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java +++ b/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java @@ -4,13 +4,17 @@ import java.util.ArrayList; import java.util.List; import org.bukkit.Bukkit; +import org.bukkit.Material; import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.ShapedRecipe; import org.bukkit.plugin.java.JavaPlugin; import com.earth2me.essentials.Essentials; import alisolarflare.architecture.Component; import alisolarflare.components.flaircolouring.letterdyes.GetLetterDye; +import alisolarflare.components.flaircolouring.letterdyes.LetterDye; import alisolarflare.components.flaircolouring.letterdyes.LetterDyeListener; import alisolarflare.components.flaircolouring.portals.FlairMe; import alisolarflare.components.flaircolouring.portals.PlayerProximityLoop; @@ -28,5 +32,16 @@ public class FlairColouringComponent extends Component { registerListener(plugin, new PortalListener(plugin, this)); registerListener(plugin, new PlayerProximityLoop(plugin, this)); registerListener(plugin, new LetterDyeListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); + + registerRecipies(plugin); + } + + public void registerRecipies(JavaPlugin plugin){ + ItemStack testItem = LetterDye.getLetterDye(); + ShapedRecipe testRecipie = new ShapedRecipe(testItem); + testRecipie.shape("***","*C*","***"); + + testRecipie.setIngredient('*', Material.INK_SACK); + } } From fe2a034429df3e127d7b8d36eec523ba49df92a7 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Tue, 13 Dec 2016 23:19:45 -0500 Subject: [PATCH 215/263] Renamed source package to prevent conflict With towny. (I FINALLY JOINED THE buttondevteam ARMADA) --- plugin.yml | 2 +- .../CreativeBoundariesComponent.java | 22 ------------------ .../components/gpowers/GPowerComponent.java | 23 ------------------- .../components/magic/MagicComponent.java | 20 ---------------- .../alipresents}/AliPresents.java | 22 +++++++++--------- .../alipresents}/architecture/Component.java | 2 +- .../architecture/commands/BaseCommand.java | 2 +- .../architecture/commands/ModCommand.java | 2 +- .../architecture/commands/PlayerCommand.java | 2 +- .../commands/subcommands/ModSubCommand.java | 2 +- .../subcommands/PlayerSubCommand.java | 2 +- .../commands/subcommands/SubCommand.java | 2 +- .../components/alilinks/AliLinkAPI.java | 4 ++-- .../components/alilinks/AliLinkComponent.java | 6 ++--- .../components/alilinks/commands/AliLink.java | 6 ++--- .../components/alilinks/entities/Link.java | 4 ++-- .../alilinks/tasks/UnpressTask.java | 2 +- .../bankchest/BankChestComponent.java | 4 ++-- .../bankchest/BankChestListener.java | 2 +- .../components/bankchest/CreateBankChest.java | 4 ++-- .../components/cashmob/CashMobComponent.java | 4 ++-- .../components/cashmob/MobKillListener.java | 2 +- .../CreativeBoundariesAPI.java | 2 +- .../CreativeBoundariesComponent.java | 22 ++++++++++++++++++ .../creativeboundaries/commands/Cbgm0.java | 6 ++--- .../creativeboundaries/commands/Cbgm1.java | 6 ++--- .../commands/SetForceBoundaries.java | 6 ++--- .../listeners/PlotChangeListener.java | 4 ++-- .../flaircolouring/FlairColouringAPI.java | 2 +- .../FlairColouringComponent.java | 18 +++++++-------- .../letterdyes/GetLetterDye.java | 4 ++-- .../flaircolouring/letterdyes/LetterDye.java | 2 +- .../letterdyes/LetterDyeListener.java | 4 ++-- .../flaircolouring/portals/FlairMe.java | 6 ++--- .../portals/PlayerProximityLoop.java | 4 ++-- .../portals/PortalListener.java | 6 ++--- .../portals/SetProximityLocation.java | 4 ++-- .../components/fruit/FruitComponent.java | 4 ++-- .../components/fruit/GrassBreakListener.java | 2 +- .../components/gpowers/GPowerComponent.java | 23 +++++++++++++++++++ .../components/gpowers/PoweredPlayer.java | 2 +- .../components/gpowers/api/GPowerAPI.java | 4 ++-- .../components/gpowers/commands/GPower.java | 6 ++--- .../gpowers/enchant/EnchantingLoop.java | 4 ++-- .../gpowers/powerstate/PowerAll.java | 6 ++--- .../gpowers/powerstate/PowerDown.java | 6 ++--- .../gpowers/powerstate/PowerUp.java | 6 ++--- .../components/insurance/Insurance.java | 2 +- .../insurance/InsuranceComponent.java | 4 ++-- .../components/insurance/getInsurance.java | 6 ++--- .../components/insurance/getInsuranceBar.java | 6 ++--- .../insurance/getInsuranceBlock.java | 6 ++--- .../insurance/getInsuranceNugget.java | 6 ++--- .../components/magic/MagicComponent.java | 20 ++++++++++++++++ .../magic/tricks/AliArrowListener.java | 2 +- .../components/magic/tricks/AliArrowTask.java | 2 +- .../magic/tricks/BoomBowDeathListener.java | 2 +- .../magic/tricks/BoomBowListener.java | 2 +- .../components/magic/tricks/BoomBowRule.java | 4 ++-- .../magic/tricks/BoomDecayTask.java | 2 +- .../magic/tricks/CannonBowListener.java | 2 +- .../components/metrics/MetricsComponent.java | 10 ++++---- .../collection/PlayerJoinListener.java | 6 ++--- .../components/metrics/files/MetricsFile.java | 2 +- .../metrics/output/GetLoginMetrics.java | 6 ++--- .../components/spawn/SpawnComponent.java | 6 ++--- .../components/spawn/cows/CowSpawnLoop.java | 2 +- .../graveyard/autouhc/UHCModule.java | 1 + .../autouhc/controller/SetMatchState.java | 1 + .../graveyard/autouhc/idle/AddToUHC.java | 1 + .../graveyard/autouhc/idle/JoinUHC.java | 1 + .../autouhc/intro/ConfigureMatch.java | 1 + .../autouhc/intro/IntroductionCutscene.java | 1 + .../autouhc/intro/ScheduleMatch.java | 1 + .../graveyard/autouhc/intro/StartMatch.java | 1 + .../listeners/MatchCyclingListener.java | 1 + .../autouhc/listeners/MatchMainLoop.java | 1 + .../graveyard/autouhc/memory/MatchState.java | 1 + .../graveyard/autouhc/memory/UHCMatch.java | 1 + .../graveyard/minigames/GameState.java | 1 + .../minigames/MinigameComponent.java | 1 + .../minigames/commands/JoinMinigame.java | 1 + .../minigames/commands/LeaveMinigame.java | 1 + .../minigames/commands/ListFighters.java | 1 + .../minigames/commands/SetColourSpawn.java | 1 + .../graveyard/minigames/data/SpawnSet.java | 1 + .../graveyard/shulker/AliShulkerModule.java | 6 ++--- .../graveyard/shulker/SetFlairDoorColour.java | 2 +- .../shulker/commands/AliShulker.java | 2 +- .../thebuttonrebirth/ButtonRebirthPlugin.java | 1 + .../thebuttonrebirth/admin/CreateShrine.java | 1 + .../thebuttonrebirth/commands/ShowBars.java | 1 + .../listeners/CyclicalDisplayListener.java | 1 + .../listeners/MidnightListener.java | 1 + .../listeners/StealChestListener.java | 1 + .../tasks/CheckChestTask.java | 1 + .../tasks/CyclicalDisplayTask.java | 1 + .../tasks/StealChestTask.java | 1 + .../alipresents}/resources/metrics.txt | 0 .../alipresents}/resources/playerLogins.txt | 0 100 files changed, 232 insertions(+), 204 deletions(-) delete mode 100644 src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java delete mode 100644 src/alisolarflare/components/gpowers/GPowerComponent.java delete mode 100644 src/alisolarflare/components/magic/MagicComponent.java rename src/{alisolarflare => buttondevteam/alipresents}/AliPresents.java (55%) rename src/{alisolarflare => buttondevteam/alipresents}/architecture/Component.java (95%) rename src/{alisolarflare => buttondevteam/alipresents}/architecture/commands/BaseCommand.java (65%) rename src/{alisolarflare => buttondevteam/alipresents}/architecture/commands/ModCommand.java (83%) rename src/{alisolarflare => buttondevteam/alipresents}/architecture/commands/PlayerCommand.java (93%) rename src/{alisolarflare => buttondevteam/alipresents}/architecture/commands/subcommands/ModSubCommand.java (78%) rename src/{alisolarflare => buttondevteam/alipresents}/architecture/commands/subcommands/PlayerSubCommand.java (79%) rename src/{alisolarflare => buttondevteam/alipresents}/architecture/commands/subcommands/SubCommand.java (80%) rename src/{alisolarflare => buttondevteam/alipresents}/components/alilinks/AliLinkAPI.java (94%) rename src/{alisolarflare => buttondevteam/alipresents}/components/alilinks/AliLinkComponent.java (50%) rename src/{alisolarflare => buttondevteam/alipresents}/components/alilinks/commands/AliLink.java (75%) rename src/{alisolarflare => buttondevteam/alipresents}/components/alilinks/entities/Link.java (90%) rename src/{alisolarflare => buttondevteam/alipresents}/components/alilinks/tasks/UnpressTask.java (84%) rename src/{alisolarflare => buttondevteam/alipresents}/components/bankchest/BankChestComponent.java (69%) rename src/{alisolarflare => buttondevteam/alipresents}/components/bankchest/BankChestListener.java (61%) rename src/{alisolarflare => buttondevteam/alipresents}/components/bankchest/CreateBankChest.java (65%) rename src/{alisolarflare => buttondevteam/alipresents}/components/cashmob/CashMobComponent.java (75%) rename src/{alisolarflare => buttondevteam/alipresents}/components/cashmob/MobKillListener.java (94%) rename src/{alisolarflare => buttondevteam/alipresents}/components/creativeboundaries/CreativeBoundariesAPI.java (97%) create mode 100644 src/buttondevteam/alipresents/components/creativeboundaries/CreativeBoundariesComponent.java rename src/{alisolarflare => buttondevteam/alipresents}/components/creativeboundaries/commands/Cbgm0.java (57%) rename src/{alisolarflare => buttondevteam/alipresents}/components/creativeboundaries/commands/Cbgm1.java (61%) rename src/{alisolarflare => buttondevteam/alipresents}/components/creativeboundaries/commands/SetForceBoundaries.java (60%) rename src/{alisolarflare => buttondevteam/alipresents}/components/creativeboundaries/listeners/PlotChangeListener.java (88%) rename src/{alisolarflare => buttondevteam/alipresents}/components/flaircolouring/FlairColouringAPI.java (97%) rename src/{alisolarflare => buttondevteam/alipresents}/components/flaircolouring/FlairColouringComponent.java (60%) rename src/{alisolarflare => buttondevteam/alipresents}/components/flaircolouring/letterdyes/GetLetterDye.java (63%) rename src/{alisolarflare => buttondevteam/alipresents}/components/flaircolouring/letterdyes/LetterDye.java (86%) rename src/{alisolarflare => buttondevteam/alipresents}/components/flaircolouring/letterdyes/LetterDyeListener.java (89%) rename src/{alisolarflare => buttondevteam/alipresents}/components/flaircolouring/portals/FlairMe.java (72%) rename src/{alisolarflare => buttondevteam/alipresents}/components/flaircolouring/portals/PlayerProximityLoop.java (93%) rename src/{alisolarflare => buttondevteam/alipresents}/components/flaircolouring/portals/PortalListener.java (87%) rename src/{alisolarflare => buttondevteam/alipresents}/components/flaircolouring/portals/SetProximityLocation.java (87%) rename src/{alisolarflare => buttondevteam/alipresents}/components/fruit/FruitComponent.java (65%) rename src/{alisolarflare => buttondevteam/alipresents}/components/fruit/GrassBreakListener.java (98%) create mode 100644 src/buttondevteam/alipresents/components/gpowers/GPowerComponent.java rename src/{alisolarflare => buttondevteam/alipresents}/components/gpowers/PoweredPlayer.java (88%) rename src/{alisolarflare => buttondevteam/alipresents}/components/gpowers/api/GPowerAPI.java (94%) rename src/{alisolarflare => buttondevteam/alipresents}/components/gpowers/commands/GPower.java (84%) rename src/{alisolarflare => buttondevteam/alipresents}/components/gpowers/enchant/EnchantingLoop.java (79%) rename src/{alisolarflare => buttondevteam/alipresents}/components/gpowers/powerstate/PowerAll.java (64%) rename src/{alisolarflare => buttondevteam/alipresents}/components/gpowers/powerstate/PowerDown.java (61%) rename src/{alisolarflare => buttondevteam/alipresents}/components/gpowers/powerstate/PowerUp.java (62%) rename src/{alisolarflare => buttondevteam/alipresents}/components/insurance/Insurance.java (94%) rename src/{alisolarflare => buttondevteam/alipresents}/components/insurance/InsuranceComponent.java (76%) rename src/{alisolarflare => buttondevteam/alipresents}/components/insurance/getInsurance.java (87%) rename src/{alisolarflare => buttondevteam/alipresents}/components/insurance/getInsuranceBar.java (70%) rename src/{alisolarflare => buttondevteam/alipresents}/components/insurance/getInsuranceBlock.java (71%) rename src/{alisolarflare => buttondevteam/alipresents}/components/insurance/getInsuranceNugget.java (71%) create mode 100644 src/buttondevteam/alipresents/components/magic/MagicComponent.java rename src/{alisolarflare => buttondevteam/alipresents}/components/magic/tricks/AliArrowListener.java (91%) rename src/{alisolarflare => buttondevteam/alipresents}/components/magic/tricks/AliArrowTask.java (90%) rename src/{alisolarflare => buttondevteam/alipresents}/components/magic/tricks/BoomBowDeathListener.java (86%) rename src/{alisolarflare => buttondevteam/alipresents}/components/magic/tricks/BoomBowListener.java (95%) rename src/{alisolarflare => buttondevteam/alipresents}/components/magic/tricks/BoomBowRule.java (89%) rename src/{alisolarflare => buttondevteam/alipresents}/components/magic/tricks/BoomDecayTask.java (85%) rename src/{alisolarflare => buttondevteam/alipresents}/components/magic/tricks/CannonBowListener.java (97%) rename src/{alisolarflare => buttondevteam/alipresents}/components/metrics/MetricsComponent.java (67%) rename src/{alisolarflare => buttondevteam/alipresents}/components/metrics/collection/PlayerJoinListener.java (76%) rename src/{alisolarflare => buttondevteam/alipresents}/components/metrics/files/MetricsFile.java (97%) rename src/{alisolarflare => buttondevteam/alipresents}/components/metrics/output/GetLoginMetrics.java (89%) rename src/{alisolarflare => buttondevteam/alipresents}/components/spawn/SpawnComponent.java (53%) rename src/{alisolarflare => buttondevteam/alipresents}/components/spawn/cows/CowSpawnLoop.java (96%) rename src/{ => buttondevteam/alipresents}/graveyard/autouhc/UHCModule.java (91%) rename src/{ => buttondevteam/alipresents}/graveyard/autouhc/controller/SetMatchState.java (96%) rename src/{ => buttondevteam/alipresents}/graveyard/autouhc/idle/AddToUHC.java (93%) rename src/{ => buttondevteam/alipresents}/graveyard/autouhc/idle/JoinUHC.java (92%) rename src/{ => buttondevteam/alipresents}/graveyard/autouhc/intro/ConfigureMatch.java (86%) rename src/{ => buttondevteam/alipresents}/graveyard/autouhc/intro/IntroductionCutscene.java (70%) rename src/{ => buttondevteam/alipresents}/graveyard/autouhc/intro/ScheduleMatch.java (86%) rename src/{ => buttondevteam/alipresents}/graveyard/autouhc/intro/StartMatch.java (92%) rename src/{ => buttondevteam/alipresents}/graveyard/autouhc/listeners/MatchCyclingListener.java (87%) rename src/{ => buttondevteam/alipresents}/graveyard/autouhc/listeners/MatchMainLoop.java (73%) rename src/{ => buttondevteam/alipresents}/graveyard/autouhc/memory/MatchState.java (85%) rename src/{ => buttondevteam/alipresents}/graveyard/autouhc/memory/UHCMatch.java (91%) rename src/{ => buttondevteam/alipresents}/graveyard/minigames/GameState.java (57%) rename src/{ => buttondevteam/alipresents}/graveyard/minigames/MinigameComponent.java (91%) rename src/{ => buttondevteam/alipresents}/graveyard/minigames/commands/JoinMinigame.java (89%) rename src/{ => buttondevteam/alipresents}/graveyard/minigames/commands/LeaveMinigame.java (90%) rename src/{ => buttondevteam/alipresents}/graveyard/minigames/commands/ListFighters.java (87%) rename src/{ => buttondevteam/alipresents}/graveyard/minigames/commands/SetColourSpawn.java (92%) rename src/{ => buttondevteam/alipresents}/graveyard/minigames/data/SpawnSet.java (76%) rename src/{ => buttondevteam/alipresents}/graveyard/shulker/AliShulkerModule.java (52%) rename src/{ => buttondevteam/alipresents}/graveyard/shulker/SetFlairDoorColour.java (94%) rename src/{ => buttondevteam/alipresents}/graveyard/shulker/commands/AliShulker.java (93%) rename src/{ => buttondevteam/alipresents}/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java (94%) rename src/{ => buttondevteam/alipresents}/graveyard/thebuttonrebirth/admin/CreateShrine.java (95%) rename src/{ => buttondevteam/alipresents}/graveyard/thebuttonrebirth/commands/ShowBars.java (87%) rename src/{ => buttondevteam/alipresents}/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java (87%) rename src/{ => buttondevteam/alipresents}/graveyard/thebuttonrebirth/listeners/MidnightListener.java (85%) rename src/{ => buttondevteam/alipresents}/graveyard/thebuttonrebirth/listeners/StealChestListener.java (85%) rename src/{ => buttondevteam/alipresents}/graveyard/thebuttonrebirth/tasks/CheckChestTask.java (96%) rename src/{ => buttondevteam/alipresents}/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java (95%) rename src/{ => buttondevteam/alipresents}/graveyard/thebuttonrebirth/tasks/StealChestTask.java (96%) rename src/{alisolarflare => buttondevteam/alipresents}/resources/metrics.txt (100%) rename src/{alisolarflare => buttondevteam/alipresents}/resources/playerLogins.txt (100%) diff --git a/plugin.yml b/plugin.yml index a57eb89..34fe825 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,4 +1,4 @@ -main: alisolarflare.AliPresents +main: buttondevteam.AliPresents name: AliPresents version: 2.0.2 diff --git a/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java b/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java deleted file mode 100644 index 4c96ef3..0000000 --- a/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java +++ /dev/null @@ -1,22 +0,0 @@ -package alisolarflare.components.creativeboundaries; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.architecture.Component; -import alisolarflare.components.creativeboundaries.commands.Cbgm0; -import alisolarflare.components.creativeboundaries.commands.Cbgm1; -import alisolarflare.components.creativeboundaries.commands.SetForceBoundaries; -import alisolarflare.components.creativeboundaries.listeners.PlotChangeListener; - - -public class CreativeBoundariesComponent extends Component{ - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new Cbgm1()); - registerCommand(plugin, new Cbgm0()); - registerCommand(plugin, new SetForceBoundaries()); - registerListener(plugin, new PlotChangeListener()); - //registerListener(plugin, new ItemRestrictionListener(this)); - } - -} diff --git a/src/alisolarflare/components/gpowers/GPowerComponent.java b/src/alisolarflare/components/gpowers/GPowerComponent.java deleted file mode 100644 index 64d33cc..0000000 --- a/src/alisolarflare/components/gpowers/GPowerComponent.java +++ /dev/null @@ -1,23 +0,0 @@ -package alisolarflare.components.gpowers; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.architecture.Component; -import alisolarflare.components.gpowers.commands.GPower; -import alisolarflare.components.gpowers.enchant.EnchantingLoop; -import alisolarflare.components.gpowers.powerstate.PowerDown; -import alisolarflare.components.gpowers.powerstate.PowerUp; - -public class GPowerComponent extends Component { - - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new GPower()); - registerCommand(plugin, new PowerUp()); - registerCommand(plugin, new PowerDown()); - - registerListener(plugin, new EnchantingLoop(plugin)); - - } - -} diff --git a/src/alisolarflare/components/magic/MagicComponent.java b/src/alisolarflare/components/magic/MagicComponent.java deleted file mode 100644 index d49f08b..0000000 --- a/src/alisolarflare/components/magic/MagicComponent.java +++ /dev/null @@ -1,20 +0,0 @@ -package alisolarflare.components.magic; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.architecture.Component; -import alisolarflare.components.magic.tricks.AliArrowListener; -import alisolarflare.components.magic.tricks.BoomBowDeathListener; -import alisolarflare.components.magic.tricks.BoomBowListener; -import alisolarflare.components.magic.tricks.CannonBowListener; - -public class MagicComponent extends Component{ - - @Override - public void register(JavaPlugin plugin) { - registerListener(plugin, new AliArrowListener(plugin)); - registerListener(plugin, new BoomBowDeathListener()); - registerListener(plugin, new BoomBowListener(plugin)); - registerListener(plugin, new CannonBowListener(plugin)); - } -} diff --git a/src/alisolarflare/AliPresents.java b/src/buttondevteam/alipresents/AliPresents.java similarity index 55% rename from src/alisolarflare/AliPresents.java rename to src/buttondevteam/alipresents/AliPresents.java index 297bbcd..a7a7820 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/buttondevteam/alipresents/AliPresents.java @@ -1,4 +1,4 @@ -package alisolarflare; +package buttondevteam.alipresents; import java.util.logging.Logger; @@ -6,16 +6,16 @@ import org.bukkit.plugin.PluginDescriptionFile; //import alisolarflare.links.AliLinkSubPlug; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.alilinks.AliLinkComponent; -import alisolarflare.components.bankchest.BankChestComponent; -import alisolarflare.components.cashmob.CashMobComponent; -import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; -import alisolarflare.components.flaircolouring.FlairColouringComponent; -import alisolarflare.components.fruit.FruitComponent; -import alisolarflare.components.gpowers.GPowerComponent; -import alisolarflare.components.insurance.InsuranceComponent; -import alisolarflare.components.magic.MagicComponent; -import alisolarflare.components.spawn.SpawnComponent; +import buttondevteam.alipresents.components.alilinks.AliLinkComponent; +import buttondevteam.alipresents.components.bankchest.BankChestComponent; +import buttondevteam.alipresents.components.cashmob.CashMobComponent; +import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesComponent; +import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; +import buttondevteam.alipresents.components.fruit.FruitComponent; +import buttondevteam.alipresents.components.gpowers.GPowerComponent; +import buttondevteam.alipresents.components.insurance.InsuranceComponent; +import buttondevteam.alipresents.components.magic.MagicComponent; +import buttondevteam.alipresents.components.spawn.SpawnComponent; public class AliPresents extends JavaPlugin{ public void onEnable(){ diff --git a/src/alisolarflare/architecture/Component.java b/src/buttondevteam/alipresents/architecture/Component.java similarity index 95% rename from src/alisolarflare/architecture/Component.java rename to src/buttondevteam/alipresents/architecture/Component.java index e2c4cd2..81b2f35 100644 --- a/src/alisolarflare/architecture/Component.java +++ b/src/buttondevteam/alipresents/architecture/Component.java @@ -1,4 +1,4 @@ -package alisolarflare.architecture; +package buttondevteam.alipresents.architecture; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.event.Listener; diff --git a/src/alisolarflare/architecture/commands/BaseCommand.java b/src/buttondevteam/alipresents/architecture/commands/BaseCommand.java similarity index 65% rename from src/alisolarflare/architecture/commands/BaseCommand.java rename to src/buttondevteam/alipresents/architecture/commands/BaseCommand.java index bece01e..0f8e89a 100644 --- a/src/alisolarflare/architecture/commands/BaseCommand.java +++ b/src/buttondevteam/alipresents/architecture/commands/BaseCommand.java @@ -1,4 +1,4 @@ -package alisolarflare.architecture.commands; +package buttondevteam.alipresents.architecture.commands; import buttondevteam.lib.chat.TBMCCommandBase; diff --git a/src/alisolarflare/architecture/commands/ModCommand.java b/src/buttondevteam/alipresents/architecture/commands/ModCommand.java similarity index 83% rename from src/alisolarflare/architecture/commands/ModCommand.java rename to src/buttondevteam/alipresents/architecture/commands/ModCommand.java index 3c13446..d0e4f03 100644 --- a/src/alisolarflare/architecture/commands/ModCommand.java +++ b/src/buttondevteam/alipresents/architecture/commands/ModCommand.java @@ -1,4 +1,4 @@ -package alisolarflare.architecture.commands; +package buttondevteam.alipresents.architecture.commands; public abstract class ModCommand extends PlayerCommand{ diff --git a/src/alisolarflare/architecture/commands/PlayerCommand.java b/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java similarity index 93% rename from src/alisolarflare/architecture/commands/PlayerCommand.java rename to src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java index 8d85fbf..3812448 100644 --- a/src/alisolarflare/architecture/commands/PlayerCommand.java +++ b/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java @@ -1,4 +1,4 @@ -package alisolarflare.architecture.commands; +package buttondevteam.alipresents.architecture.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/alisolarflare/architecture/commands/subcommands/ModSubCommand.java b/src/buttondevteam/alipresents/architecture/commands/subcommands/ModSubCommand.java similarity index 78% rename from src/alisolarflare/architecture/commands/subcommands/ModSubCommand.java rename to src/buttondevteam/alipresents/architecture/commands/subcommands/ModSubCommand.java index ec3ee25..24ba0ee 100644 --- a/src/alisolarflare/architecture/commands/subcommands/ModSubCommand.java +++ b/src/buttondevteam/alipresents/architecture/commands/subcommands/ModSubCommand.java @@ -1,4 +1,4 @@ -package alisolarflare.architecture.commands.subcommands; +package buttondevteam.alipresents.architecture.commands.subcommands; public abstract class ModSubCommand extends SubCommand{ @Override diff --git a/src/alisolarflare/architecture/commands/subcommands/PlayerSubCommand.java b/src/buttondevteam/alipresents/architecture/commands/subcommands/PlayerSubCommand.java similarity index 79% rename from src/alisolarflare/architecture/commands/subcommands/PlayerSubCommand.java rename to src/buttondevteam/alipresents/architecture/commands/subcommands/PlayerSubCommand.java index c71665e..aa7a631 100644 --- a/src/alisolarflare/architecture/commands/subcommands/PlayerSubCommand.java +++ b/src/buttondevteam/alipresents/architecture/commands/subcommands/PlayerSubCommand.java @@ -1,4 +1,4 @@ -package alisolarflare.architecture.commands.subcommands; +package buttondevteam.alipresents.architecture.commands.subcommands; public abstract class PlayerSubCommand extends SubCommand{ @Override diff --git a/src/alisolarflare/architecture/commands/subcommands/SubCommand.java b/src/buttondevteam/alipresents/architecture/commands/subcommands/SubCommand.java similarity index 80% rename from src/alisolarflare/architecture/commands/subcommands/SubCommand.java rename to src/buttondevteam/alipresents/architecture/commands/subcommands/SubCommand.java index 119fb70..8a6a93d 100644 --- a/src/alisolarflare/architecture/commands/subcommands/SubCommand.java +++ b/src/buttondevteam/alipresents/architecture/commands/subcommands/SubCommand.java @@ -1,4 +1,4 @@ -package alisolarflare.architecture.commands.subcommands; +package buttondevteam.alipresents.architecture.commands.subcommands; import org.bukkit.entity.Player; diff --git a/src/alisolarflare/components/alilinks/AliLinkAPI.java b/src/buttondevteam/alipresents/components/alilinks/AliLinkAPI.java similarity index 94% rename from src/alisolarflare/components/alilinks/AliLinkAPI.java rename to src/buttondevteam/alipresents/components/alilinks/AliLinkAPI.java index b4d9ea2..8115268 100644 --- a/src/alisolarflare/components/alilinks/AliLinkAPI.java +++ b/src/buttondevteam/alipresents/components/alilinks/AliLinkAPI.java @@ -1,4 +1,4 @@ -package alisolarflare.components.alilinks; +package buttondevteam.alipresents.components.alilinks; import java.util.ArrayList; import java.util.Arrays; @@ -12,7 +12,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.alilinks.entities.Link; +import buttondevteam.alipresents.components.alilinks.entities.Link; public class AliLinkAPI { private static List linkList; diff --git a/src/alisolarflare/components/alilinks/AliLinkComponent.java b/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java similarity index 50% rename from src/alisolarflare/components/alilinks/AliLinkComponent.java rename to src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java index 5a14d08..508e894 100644 --- a/src/alisolarflare/components/alilinks/AliLinkComponent.java +++ b/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java @@ -1,9 +1,9 @@ -package alisolarflare.components.alilinks; +package buttondevteam.alipresents.components.alilinks; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.architecture.Component; -import alisolarflare.components.alilinks.commands.AliLink; +import buttondevteam.alipresents.architecture.Component; +import buttondevteam.alipresents.components.alilinks.commands.AliLink; public class AliLinkComponent extends Component { @Override diff --git a/src/alisolarflare/components/alilinks/commands/AliLink.java b/src/buttondevteam/alipresents/components/alilinks/commands/AliLink.java similarity index 75% rename from src/alisolarflare/components/alilinks/commands/AliLink.java rename to src/buttondevteam/alipresents/components/alilinks/commands/AliLink.java index 20884db..e5f9286 100644 --- a/src/alisolarflare/components/alilinks/commands/AliLink.java +++ b/src/buttondevteam/alipresents/components/alilinks/commands/AliLink.java @@ -1,10 +1,10 @@ -package alisolarflare.components.alilinks.commands; +package buttondevteam.alipresents.components.alilinks.commands; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.alilinks.AliLinkAPI; +import buttondevteam.alipresents.architecture.commands.PlayerCommand; +import buttondevteam.alipresents.components.alilinks.AliLinkAPI; public class AliLink extends PlayerCommand{ private JavaPlugin plugin; diff --git a/src/alisolarflare/components/alilinks/entities/Link.java b/src/buttondevteam/alipresents/components/alilinks/entities/Link.java similarity index 90% rename from src/alisolarflare/components/alilinks/entities/Link.java rename to src/buttondevteam/alipresents/components/alilinks/entities/Link.java index 7fe08cf..2e73f13 100644 --- a/src/alisolarflare/components/alilinks/entities/Link.java +++ b/src/buttondevteam/alipresents/components/alilinks/entities/Link.java @@ -1,4 +1,4 @@ -package alisolarflare.components.alilinks.entities; +package buttondevteam.alipresents.components.alilinks.entities; import java.util.HashMap; import java.util.Map; @@ -9,7 +9,7 @@ import org.bukkit.Server; import org.bukkit.World; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.alilinks.tasks.UnpressTask; +import buttondevteam.alipresents.components.alilinks.tasks.UnpressTask; public class Link{ diff --git a/src/alisolarflare/components/alilinks/tasks/UnpressTask.java b/src/buttondevteam/alipresents/components/alilinks/tasks/UnpressTask.java similarity index 84% rename from src/alisolarflare/components/alilinks/tasks/UnpressTask.java rename to src/buttondevteam/alipresents/components/alilinks/tasks/UnpressTask.java index 38a06b0..c89c318 100644 --- a/src/alisolarflare/components/alilinks/tasks/UnpressTask.java +++ b/src/buttondevteam/alipresents/components/alilinks/tasks/UnpressTask.java @@ -1,4 +1,4 @@ -package alisolarflare.components.alilinks.tasks; +package buttondevteam.alipresents.components.alilinks.tasks; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/alisolarflare/components/bankchest/BankChestComponent.java b/src/buttondevteam/alipresents/components/bankchest/BankChestComponent.java similarity index 69% rename from src/alisolarflare/components/bankchest/BankChestComponent.java rename to src/buttondevteam/alipresents/components/bankchest/BankChestComponent.java index e331e28..a0fe761 100644 --- a/src/alisolarflare/components/bankchest/BankChestComponent.java +++ b/src/buttondevteam/alipresents/components/bankchest/BankChestComponent.java @@ -1,8 +1,8 @@ -package alisolarflare.components.bankchest; +package buttondevteam.alipresents.components.bankchest; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.architecture.Component; +import buttondevteam.alipresents.architecture.Component; public class BankChestComponent extends Component { diff --git a/src/alisolarflare/components/bankchest/BankChestListener.java b/src/buttondevteam/alipresents/components/bankchest/BankChestListener.java similarity index 61% rename from src/alisolarflare/components/bankchest/BankChestListener.java rename to src/buttondevteam/alipresents/components/bankchest/BankChestListener.java index d413bad..b13dbba 100644 --- a/src/alisolarflare/components/bankchest/BankChestListener.java +++ b/src/buttondevteam/alipresents/components/bankchest/BankChestListener.java @@ -1,4 +1,4 @@ -package alisolarflare.components.bankchest; +package buttondevteam.alipresents.components.bankchest; import org.bukkit.event.Listener; diff --git a/src/alisolarflare/components/bankchest/CreateBankChest.java b/src/buttondevteam/alipresents/components/bankchest/CreateBankChest.java similarity index 65% rename from src/alisolarflare/components/bankchest/CreateBankChest.java rename to src/buttondevteam/alipresents/components/bankchest/CreateBankChest.java index e73a27f..6af2665 100644 --- a/src/alisolarflare/components/bankchest/CreateBankChest.java +++ b/src/buttondevteam/alipresents/components/bankchest/CreateBankChest.java @@ -1,8 +1,8 @@ -package alisolarflare.components.bankchest; +package buttondevteam.alipresents.components.bankchest; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.ModCommand; +import buttondevteam.alipresents.architecture.commands.ModCommand; public class CreateBankChest extends ModCommand { diff --git a/src/alisolarflare/components/cashmob/CashMobComponent.java b/src/buttondevteam/alipresents/components/cashmob/CashMobComponent.java similarity index 75% rename from src/alisolarflare/components/cashmob/CashMobComponent.java rename to src/buttondevteam/alipresents/components/cashmob/CashMobComponent.java index dda2346..b4a427f 100644 --- a/src/alisolarflare/components/cashmob/CashMobComponent.java +++ b/src/buttondevteam/alipresents/components/cashmob/CashMobComponent.java @@ -1,11 +1,11 @@ -package alisolarflare.components.cashmob; +package buttondevteam.alipresents.components.cashmob; import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; import com.earth2me.essentials.Essentials; -import alisolarflare.architecture.Component; +import buttondevteam.alipresents.architecture.Component; public class CashMobComponent extends Component{ diff --git a/src/alisolarflare/components/cashmob/MobKillListener.java b/src/buttondevteam/alipresents/components/cashmob/MobKillListener.java similarity index 94% rename from src/alisolarflare/components/cashmob/MobKillListener.java rename to src/buttondevteam/alipresents/components/cashmob/MobKillListener.java index 2296a05..c1a4791 100644 --- a/src/alisolarflare/components/cashmob/MobKillListener.java +++ b/src/buttondevteam/alipresents/components/cashmob/MobKillListener.java @@ -1,4 +1,4 @@ -package alisolarflare.components.cashmob; +package buttondevteam.alipresents.components.cashmob; import java.math.BigDecimal; diff --git a/src/alisolarflare/components/creativeboundaries/CreativeBoundariesAPI.java b/src/buttondevteam/alipresents/components/creativeboundaries/CreativeBoundariesAPI.java similarity index 97% rename from src/alisolarflare/components/creativeboundaries/CreativeBoundariesAPI.java rename to src/buttondevteam/alipresents/components/creativeboundaries/CreativeBoundariesAPI.java index 7658e14..4c6adea 100644 --- a/src/alisolarflare/components/creativeboundaries/CreativeBoundariesAPI.java +++ b/src/buttondevteam/alipresents/components/creativeboundaries/CreativeBoundariesAPI.java @@ -1,4 +1,4 @@ -package alisolarflare.components.creativeboundaries; +package buttondevteam.alipresents.components.creativeboundaries; import java.util.ArrayList; import java.util.List; diff --git a/src/buttondevteam/alipresents/components/creativeboundaries/CreativeBoundariesComponent.java b/src/buttondevteam/alipresents/components/creativeboundaries/CreativeBoundariesComponent.java new file mode 100644 index 0000000..1435c91 --- /dev/null +++ b/src/buttondevteam/alipresents/components/creativeboundaries/CreativeBoundariesComponent.java @@ -0,0 +1,22 @@ +package buttondevteam.alipresents.components.creativeboundaries; + +import org.bukkit.plugin.java.JavaPlugin; + +import buttondevteam.alipresents.architecture.Component; +import buttondevteam.alipresents.components.creativeboundaries.commands.Cbgm0; +import buttondevteam.alipresents.components.creativeboundaries.commands.Cbgm1; +import buttondevteam.alipresents.components.creativeboundaries.commands.SetForceBoundaries; +import buttondevteam.alipresents.components.creativeboundaries.listeners.PlotChangeListener; + + +public class CreativeBoundariesComponent extends Component{ + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new Cbgm1()); + registerCommand(plugin, new Cbgm0()); + registerCommand(plugin, new SetForceBoundaries()); + registerListener(plugin, new PlotChangeListener()); + //registerListener(plugin, new ItemRestrictionListener(this)); + } + +} diff --git a/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm0.java similarity index 57% rename from src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java rename to src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm0.java index 106f1d6..17d6dda 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java +++ b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm0.java @@ -1,9 +1,9 @@ -package alisolarflare.components.creativeboundaries.commands; +package buttondevteam.alipresents.components.creativeboundaries.commands; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.creativeboundaries.CreativeBoundariesAPI; +import buttondevteam.alipresents.architecture.commands.PlayerCommand; +import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesAPI; public class Cbgm0 extends PlayerCommand{ @Override diff --git a/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm1.java similarity index 61% rename from src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java rename to src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm1.java index b4602ff..9266a52 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java +++ b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm1.java @@ -1,9 +1,9 @@ -package alisolarflare.components.creativeboundaries.commands; +package buttondevteam.alipresents.components.creativeboundaries.commands; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.creativeboundaries.CreativeBoundariesAPI; +import buttondevteam.alipresents.architecture.commands.PlayerCommand; +import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesAPI; public class Cbgm1 extends PlayerCommand { @Override diff --git a/src/alisolarflare/components/creativeboundaries/commands/SetForceBoundaries.java b/src/buttondevteam/alipresents/components/creativeboundaries/commands/SetForceBoundaries.java similarity index 60% rename from src/alisolarflare/components/creativeboundaries/commands/SetForceBoundaries.java rename to src/buttondevteam/alipresents/components/creativeboundaries/commands/SetForceBoundaries.java index 55c67cf..22d2c98 100644 --- a/src/alisolarflare/components/creativeboundaries/commands/SetForceBoundaries.java +++ b/src/buttondevteam/alipresents/components/creativeboundaries/commands/SetForceBoundaries.java @@ -1,9 +1,9 @@ -package alisolarflare.components.creativeboundaries.commands; +package buttondevteam.alipresents.components.creativeboundaries.commands; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.creativeboundaries.CreativeBoundariesAPI; +import buttondevteam.alipresents.architecture.commands.ModCommand; +import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesAPI; public class SetForceBoundaries extends ModCommand{ @Override diff --git a/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java b/src/buttondevteam/alipresents/components/creativeboundaries/listeners/PlotChangeListener.java similarity index 88% rename from src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java rename to src/buttondevteam/alipresents/components/creativeboundaries/listeners/PlotChangeListener.java index aa575e9..2d29e5c 100644 --- a/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java +++ b/src/buttondevteam/alipresents/components/creativeboundaries/listeners/PlotChangeListener.java @@ -1,4 +1,4 @@ -package alisolarflare.components.creativeboundaries.listeners; +package buttondevteam.alipresents.components.creativeboundaries.listeners; import org.bukkit.GameMode; import org.bukkit.entity.Player; @@ -12,7 +12,7 @@ import com.palmergames.bukkit.towny.object.Town; import com.palmergames.bukkit.towny.object.TownBlock; import com.palmergames.bukkit.towny.object.TownyUniverse; -import alisolarflare.components.creativeboundaries.CreativeBoundariesAPI; +import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesAPI; public class PlotChangeListener implements Listener{ @EventHandler diff --git a/src/alisolarflare/components/flaircolouring/FlairColouringAPI.java b/src/buttondevteam/alipresents/components/flaircolouring/FlairColouringAPI.java similarity index 97% rename from src/alisolarflare/components/flaircolouring/FlairColouringAPI.java rename to src/buttondevteam/alipresents/components/flaircolouring/FlairColouringAPI.java index 293da95..91a2bba 100644 --- a/src/alisolarflare/components/flaircolouring/FlairColouringAPI.java +++ b/src/buttondevteam/alipresents/components/flaircolouring/FlairColouringAPI.java @@ -1,4 +1,4 @@ -package alisolarflare.components.flaircolouring; +package buttondevteam.alipresents.components.flaircolouring; import org.bukkit.DyeColor; diff --git a/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java b/src/buttondevteam/alipresents/components/flaircolouring/FlairColouringComponent.java similarity index 60% rename from src/alisolarflare/components/flaircolouring/FlairColouringComponent.java rename to src/buttondevteam/alipresents/components/flaircolouring/FlairColouringComponent.java index 10517a8..04b6575 100644 --- a/src/alisolarflare/components/flaircolouring/FlairColouringComponent.java +++ b/src/buttondevteam/alipresents/components/flaircolouring/FlairColouringComponent.java @@ -1,4 +1,4 @@ -package alisolarflare.components.flaircolouring; +package buttondevteam.alipresents.components.flaircolouring; import java.util.ArrayList; import java.util.List; @@ -12,14 +12,14 @@ import org.bukkit.plugin.java.JavaPlugin; import com.earth2me.essentials.Essentials; -import alisolarflare.architecture.Component; -import alisolarflare.components.flaircolouring.letterdyes.GetLetterDye; -import alisolarflare.components.flaircolouring.letterdyes.LetterDye; -import alisolarflare.components.flaircolouring.letterdyes.LetterDyeListener; -import alisolarflare.components.flaircolouring.portals.FlairMe; -import alisolarflare.components.flaircolouring.portals.PlayerProximityLoop; -import alisolarflare.components.flaircolouring.portals.PortalListener; -import alisolarflare.components.flaircolouring.portals.SetProximityLocation; +import buttondevteam.alipresents.architecture.Component; +import buttondevteam.alipresents.components.flaircolouring.letterdyes.GetLetterDye; +import buttondevteam.alipresents.components.flaircolouring.letterdyes.LetterDye; +import buttondevteam.alipresents.components.flaircolouring.letterdyes.LetterDyeListener; +import buttondevteam.alipresents.components.flaircolouring.portals.FlairMe; +import buttondevteam.alipresents.components.flaircolouring.portals.PlayerProximityLoop; +import buttondevteam.alipresents.components.flaircolouring.portals.PortalListener; +import buttondevteam.alipresents.components.flaircolouring.portals.SetProximityLocation; public class FlairColouringComponent extends Component { public List playersToBeFlaired = new ArrayList(); diff --git a/src/alisolarflare/components/flaircolouring/letterdyes/GetLetterDye.java b/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/GetLetterDye.java similarity index 63% rename from src/alisolarflare/components/flaircolouring/letterdyes/GetLetterDye.java rename to src/buttondevteam/alipresents/components/flaircolouring/letterdyes/GetLetterDye.java index aaf7e0a..efe7fa5 100644 --- a/src/alisolarflare/components/flaircolouring/letterdyes/GetLetterDye.java +++ b/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/GetLetterDye.java @@ -1,8 +1,8 @@ -package alisolarflare.components.flaircolouring.letterdyes; +package buttondevteam.alipresents.components.flaircolouring.letterdyes; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.PlayerCommand; +import buttondevteam.alipresents.architecture.commands.PlayerCommand; public class GetLetterDye extends PlayerCommand{ @Override diff --git a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java b/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDye.java similarity index 86% rename from src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java rename to src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDye.java index 9c9e5df..0c3cf0d 100644 --- a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDye.java +++ b/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDye.java @@ -1,4 +1,4 @@ -package alisolarflare.components.flaircolouring.letterdyes; +package buttondevteam.alipresents.components.flaircolouring.letterdyes; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; diff --git a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java b/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDyeListener.java similarity index 89% rename from src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java rename to src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDyeListener.java index ec16b12..0e20ba9 100644 --- a/src/alisolarflare/components/flaircolouring/letterdyes/LetterDyeListener.java +++ b/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDyeListener.java @@ -1,4 +1,4 @@ -package alisolarflare.components.flaircolouring.letterdyes; +package buttondevteam.alipresents.components.flaircolouring.letterdyes; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; @@ -12,7 +12,7 @@ import org.bukkit.material.Dye; import com.earth2me.essentials.Essentials; import com.earth2me.essentials.User; -import alisolarflare.components.flaircolouring.FlairColouringAPI; +import buttondevteam.alipresents.components.flaircolouring.FlairColouringAPI; public class LetterDyeListener implements Listener{ private Essentials essentials; diff --git a/src/alisolarflare/components/flaircolouring/portals/FlairMe.java b/src/buttondevteam/alipresents/components/flaircolouring/portals/FlairMe.java similarity index 72% rename from src/alisolarflare/components/flaircolouring/portals/FlairMe.java rename to src/buttondevteam/alipresents/components/flaircolouring/portals/FlairMe.java index 5d428cc..6595949 100644 --- a/src/alisolarflare/components/flaircolouring/portals/FlairMe.java +++ b/src/buttondevteam/alipresents/components/flaircolouring/portals/FlairMe.java @@ -1,9 +1,9 @@ -package alisolarflare.components.flaircolouring.portals; +package buttondevteam.alipresents.components.flaircolouring.portals; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.flaircolouring.FlairColouringComponent; +import buttondevteam.alipresents.architecture.commands.PlayerCommand; +import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; public class FlairMe extends PlayerCommand { diff --git a/src/alisolarflare/components/flaircolouring/portals/PlayerProximityLoop.java b/src/buttondevteam/alipresents/components/flaircolouring/portals/PlayerProximityLoop.java similarity index 93% rename from src/alisolarflare/components/flaircolouring/portals/PlayerProximityLoop.java rename to src/buttondevteam/alipresents/components/flaircolouring/portals/PlayerProximityLoop.java index fbbe1f8..d038db5 100644 --- a/src/alisolarflare/components/flaircolouring/portals/PlayerProximityLoop.java +++ b/src/buttondevteam/alipresents/components/flaircolouring/portals/PlayerProximityLoop.java @@ -1,4 +1,4 @@ -package alisolarflare.components.flaircolouring.portals; +package buttondevteam.alipresents.components.flaircolouring.portals; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -6,7 +6,7 @@ import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; -import alisolarflare.components.flaircolouring.FlairColouringComponent; +import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; public class PlayerProximityLoop extends BukkitRunnable implements Listener{ private static JavaPlugin plugin; diff --git a/src/alisolarflare/components/flaircolouring/portals/PortalListener.java b/src/buttondevteam/alipresents/components/flaircolouring/portals/PortalListener.java similarity index 87% rename from src/alisolarflare/components/flaircolouring/portals/PortalListener.java rename to src/buttondevteam/alipresents/components/flaircolouring/portals/PortalListener.java index 8286e47..89151c9 100644 --- a/src/alisolarflare/components/flaircolouring/portals/PortalListener.java +++ b/src/buttondevteam/alipresents/components/flaircolouring/portals/PortalListener.java @@ -1,4 +1,4 @@ -package alisolarflare.components.flaircolouring.portals; +package buttondevteam.alipresents.components.flaircolouring.portals; import org.bukkit.Bukkit; import org.bukkit.DyeColor; @@ -13,8 +13,8 @@ import org.bukkit.plugin.java.JavaPlugin; import com.earth2me.essentials.Essentials; -import alisolarflare.components.flaircolouring.FlairColouringAPI; -import alisolarflare.components.flaircolouring.FlairColouringComponent; +import buttondevteam.alipresents.components.flaircolouring.FlairColouringAPI; +import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; public class PortalListener implements Listener{ public JavaPlugin plugin; diff --git a/src/alisolarflare/components/flaircolouring/portals/SetProximityLocation.java b/src/buttondevteam/alipresents/components/flaircolouring/portals/SetProximityLocation.java similarity index 87% rename from src/alisolarflare/components/flaircolouring/portals/SetProximityLocation.java rename to src/buttondevteam/alipresents/components/flaircolouring/portals/SetProximityLocation.java index f60b8e9..51fb0bc 100644 --- a/src/alisolarflare/components/flaircolouring/portals/SetProximityLocation.java +++ b/src/buttondevteam/alipresents/components/flaircolouring/portals/SetProximityLocation.java @@ -1,8 +1,8 @@ -package alisolarflare.components.flaircolouring.portals; +package buttondevteam.alipresents.components.flaircolouring.portals; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.ModCommand; +import buttondevteam.alipresents.architecture.commands.ModCommand; public class SetProximityLocation extends ModCommand{ diff --git a/src/alisolarflare/components/fruit/FruitComponent.java b/src/buttondevteam/alipresents/components/fruit/FruitComponent.java similarity index 65% rename from src/alisolarflare/components/fruit/FruitComponent.java rename to src/buttondevteam/alipresents/components/fruit/FruitComponent.java index c4a99ed..910f75f 100644 --- a/src/alisolarflare/components/fruit/FruitComponent.java +++ b/src/buttondevteam/alipresents/components/fruit/FruitComponent.java @@ -1,8 +1,8 @@ -package alisolarflare.components.fruit; +package buttondevteam.alipresents.components.fruit; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.architecture.Component; +import buttondevteam.alipresents.architecture.Component; public class FruitComponent extends Component{ diff --git a/src/alisolarflare/components/fruit/GrassBreakListener.java b/src/buttondevteam/alipresents/components/fruit/GrassBreakListener.java similarity index 98% rename from src/alisolarflare/components/fruit/GrassBreakListener.java rename to src/buttondevteam/alipresents/components/fruit/GrassBreakListener.java index 9bb54db..8279aa4 100644 --- a/src/alisolarflare/components/fruit/GrassBreakListener.java +++ b/src/buttondevteam/alipresents/components/fruit/GrassBreakListener.java @@ -1,4 +1,4 @@ -package alisolarflare.components.fruit; +package buttondevteam.alipresents.components.fruit; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/buttondevteam/alipresents/components/gpowers/GPowerComponent.java b/src/buttondevteam/alipresents/components/gpowers/GPowerComponent.java new file mode 100644 index 0000000..9e9ce33 --- /dev/null +++ b/src/buttondevteam/alipresents/components/gpowers/GPowerComponent.java @@ -0,0 +1,23 @@ +package buttondevteam.alipresents.components.gpowers; + +import org.bukkit.plugin.java.JavaPlugin; + +import buttondevteam.alipresents.architecture.Component; +import buttondevteam.alipresents.components.gpowers.commands.GPower; +import buttondevteam.alipresents.components.gpowers.enchant.EnchantingLoop; +import buttondevteam.alipresents.components.gpowers.powerstate.PowerDown; +import buttondevteam.alipresents.components.gpowers.powerstate.PowerUp; + +public class GPowerComponent extends Component { + + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new GPower()); + registerCommand(plugin, new PowerUp()); + registerCommand(plugin, new PowerDown()); + + registerListener(plugin, new EnchantingLoop(plugin)); + + } + +} diff --git a/src/alisolarflare/components/gpowers/PoweredPlayer.java b/src/buttondevteam/alipresents/components/gpowers/PoweredPlayer.java similarity index 88% rename from src/alisolarflare/components/gpowers/PoweredPlayer.java rename to src/buttondevteam/alipresents/components/gpowers/PoweredPlayer.java index 27b0116..7e33220 100644 --- a/src/alisolarflare/components/gpowers/PoweredPlayer.java +++ b/src/buttondevteam/alipresents/components/gpowers/PoweredPlayer.java @@ -1,4 +1,4 @@ -package alisolarflare.components.gpowers; +package buttondevteam.alipresents.components.gpowers; import java.util.UUID; diff --git a/src/alisolarflare/components/gpowers/api/GPowerAPI.java b/src/buttondevteam/alipresents/components/gpowers/api/GPowerAPI.java similarity index 94% rename from src/alisolarflare/components/gpowers/api/GPowerAPI.java rename to src/buttondevteam/alipresents/components/gpowers/api/GPowerAPI.java index f4c242e..76ccfa9 100644 --- a/src/alisolarflare/components/gpowers/api/GPowerAPI.java +++ b/src/buttondevteam/alipresents/components/gpowers/api/GPowerAPI.java @@ -1,4 +1,4 @@ -package alisolarflare.components.gpowers.api; +package buttondevteam.alipresents.components.gpowers.api; import java.util.HashMap; import java.util.Map; @@ -9,7 +9,7 @@ import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -import alisolarflare.components.gpowers.PoweredPlayer; +import buttondevteam.alipresents.components.gpowers.PoweredPlayer; public class GPowerAPI{ public static final int defaultPowerLength = 300; diff --git a/src/alisolarflare/components/gpowers/commands/GPower.java b/src/buttondevteam/alipresents/components/gpowers/commands/GPower.java similarity index 84% rename from src/alisolarflare/components/gpowers/commands/GPower.java rename to src/buttondevteam/alipresents/components/gpowers/commands/GPower.java index 2b7c31f..8b9abac 100644 --- a/src/alisolarflare/components/gpowers/commands/GPower.java +++ b/src/buttondevteam/alipresents/components/gpowers/commands/GPower.java @@ -1,9 +1,9 @@ -package alisolarflare.components.gpowers.commands; +package buttondevteam.alipresents.components.gpowers.commands; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.gpowers.api.GPowerAPI; +import buttondevteam.alipresents.architecture.commands.PlayerCommand; +import buttondevteam.alipresents.components.gpowers.api.GPowerAPI; public class GPower extends PlayerCommand { @Override diff --git a/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java b/src/buttondevteam/alipresents/components/gpowers/enchant/EnchantingLoop.java similarity index 79% rename from src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java rename to src/buttondevteam/alipresents/components/gpowers/enchant/EnchantingLoop.java index 98d55c6..5cb224e 100644 --- a/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java +++ b/src/buttondevteam/alipresents/components/gpowers/enchant/EnchantingLoop.java @@ -1,4 +1,4 @@ -package alisolarflare.components.gpowers.enchant; +package buttondevteam.alipresents.components.gpowers.enchant; import org.bukkit.Server; import org.bukkit.entity.Player; @@ -6,7 +6,7 @@ import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; -import alisolarflare.components.gpowers.api.GPowerAPI; +import buttondevteam.alipresents.components.gpowers.api.GPowerAPI; public class EnchantingLoop extends BukkitRunnable implements Listener{ private Server server; diff --git a/src/alisolarflare/components/gpowers/powerstate/PowerAll.java b/src/buttondevteam/alipresents/components/gpowers/powerstate/PowerAll.java similarity index 64% rename from src/alisolarflare/components/gpowers/powerstate/PowerAll.java rename to src/buttondevteam/alipresents/components/gpowers/powerstate/PowerAll.java index 4873422..525a728 100644 --- a/src/alisolarflare/components/gpowers/powerstate/PowerAll.java +++ b/src/buttondevteam/alipresents/components/gpowers/powerstate/PowerAll.java @@ -1,9 +1,9 @@ -package alisolarflare.components.gpowers.powerstate; +package buttondevteam.alipresents.components.gpowers.powerstate; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.gpowers.api.GPowerAPI; +import buttondevteam.alipresents.architecture.commands.ModCommand; +import buttondevteam.alipresents.components.gpowers.api.GPowerAPI; public class PowerAll extends ModCommand{ @Override diff --git a/src/alisolarflare/components/gpowers/powerstate/PowerDown.java b/src/buttondevteam/alipresents/components/gpowers/powerstate/PowerDown.java similarity index 61% rename from src/alisolarflare/components/gpowers/powerstate/PowerDown.java rename to src/buttondevteam/alipresents/components/gpowers/powerstate/PowerDown.java index a2ab7b9..4217219 100644 --- a/src/alisolarflare/components/gpowers/powerstate/PowerDown.java +++ b/src/buttondevteam/alipresents/components/gpowers/powerstate/PowerDown.java @@ -1,9 +1,9 @@ -package alisolarflare.components.gpowers.powerstate; +package buttondevteam.alipresents.components.gpowers.powerstate; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.gpowers.api.GPowerAPI; +import buttondevteam.alipresents.architecture.commands.PlayerCommand; +import buttondevteam.alipresents.components.gpowers.api.GPowerAPI; public class PowerDown extends PlayerCommand { @Override diff --git a/src/alisolarflare/components/gpowers/powerstate/PowerUp.java b/src/buttondevteam/alipresents/components/gpowers/powerstate/PowerUp.java similarity index 62% rename from src/alisolarflare/components/gpowers/powerstate/PowerUp.java rename to src/buttondevteam/alipresents/components/gpowers/powerstate/PowerUp.java index 6f7bc03..050f08f 100644 --- a/src/alisolarflare/components/gpowers/powerstate/PowerUp.java +++ b/src/buttondevteam/alipresents/components/gpowers/powerstate/PowerUp.java @@ -1,9 +1,9 @@ -package alisolarflare.components.gpowers.powerstate; +package buttondevteam.alipresents.components.gpowers.powerstate; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.PlayerCommand; -import alisolarflare.components.gpowers.api.GPowerAPI; +import buttondevteam.alipresents.architecture.commands.PlayerCommand; +import buttondevteam.alipresents.components.gpowers.api.GPowerAPI; public class PowerUp extends PlayerCommand { @Override diff --git a/src/alisolarflare/components/insurance/Insurance.java b/src/buttondevteam/alipresents/components/insurance/Insurance.java similarity index 94% rename from src/alisolarflare/components/insurance/Insurance.java rename to src/buttondevteam/alipresents/components/insurance/Insurance.java index afa8856..15a012a 100644 --- a/src/alisolarflare/components/insurance/Insurance.java +++ b/src/buttondevteam/alipresents/components/insurance/Insurance.java @@ -1,4 +1,4 @@ -package alisolarflare.components.insurance; +package buttondevteam.alipresents.components.insurance; import java.util.Arrays; import java.util.List; diff --git a/src/alisolarflare/components/insurance/InsuranceComponent.java b/src/buttondevteam/alipresents/components/insurance/InsuranceComponent.java similarity index 76% rename from src/alisolarflare/components/insurance/InsuranceComponent.java rename to src/buttondevteam/alipresents/components/insurance/InsuranceComponent.java index 14f8d5d..1099605 100644 --- a/src/alisolarflare/components/insurance/InsuranceComponent.java +++ b/src/buttondevteam/alipresents/components/insurance/InsuranceComponent.java @@ -1,8 +1,8 @@ -package alisolarflare.components.insurance; +package buttondevteam.alipresents.components.insurance; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.architecture.Component; +import buttondevteam.alipresents.architecture.Component; public class InsuranceComponent extends Component { diff --git a/src/alisolarflare/components/insurance/getInsurance.java b/src/buttondevteam/alipresents/components/insurance/getInsurance.java similarity index 87% rename from src/alisolarflare/components/insurance/getInsurance.java rename to src/buttondevteam/alipresents/components/insurance/getInsurance.java index 13bf55d..c760f5d 100644 --- a/src/alisolarflare/components/insurance/getInsurance.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsurance.java @@ -1,10 +1,10 @@ -package alisolarflare.components.insurance; +package buttondevteam.alipresents.components.insurance; import org.apache.commons.lang.StringUtils; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.insurance.Insurance.InsuranceType; +import buttondevteam.alipresents.architecture.commands.ModCommand; +import buttondevteam.alipresents.components.insurance.Insurance.InsuranceType; public class getInsurance extends ModCommand { private final int defaultAmount = 1; diff --git a/src/alisolarflare/components/insurance/getInsuranceBar.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceBar.java similarity index 70% rename from src/alisolarflare/components/insurance/getInsuranceBar.java rename to src/buttondevteam/alipresents/components/insurance/getInsuranceBar.java index 47bc004..af00805 100644 --- a/src/alisolarflare/components/insurance/getInsuranceBar.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceBar.java @@ -1,10 +1,10 @@ -package alisolarflare.components.insurance; +package buttondevteam.alipresents.components.insurance; import org.apache.commons.lang3.StringUtils; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.insurance.Insurance.InsuranceType; +import buttondevteam.alipresents.architecture.commands.ModCommand; +import buttondevteam.alipresents.components.insurance.Insurance.InsuranceType; public class getInsuranceBar extends ModCommand { diff --git a/src/alisolarflare/components/insurance/getInsuranceBlock.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java similarity index 71% rename from src/alisolarflare/components/insurance/getInsuranceBlock.java rename to src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java index 60c76b3..37b4173 100644 --- a/src/alisolarflare/components/insurance/getInsuranceBlock.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java @@ -1,10 +1,10 @@ -package alisolarflare.components.insurance; +package buttondevteam.alipresents.components.insurance; import org.apache.commons.lang3.StringUtils; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.insurance.Insurance.InsuranceType; +import buttondevteam.alipresents.architecture.commands.ModCommand; +import buttondevteam.alipresents.components.insurance.Insurance.InsuranceType; public class getInsuranceBlock extends ModCommand { diff --git a/src/alisolarflare/components/insurance/getInsuranceNugget.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java similarity index 71% rename from src/alisolarflare/components/insurance/getInsuranceNugget.java rename to src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java index 24f1694..8363916 100644 --- a/src/alisolarflare/components/insurance/getInsuranceNugget.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java @@ -1,10 +1,10 @@ -package alisolarflare.components.insurance; +package buttondevteam.alipresents.components.insurance; import org.apache.commons.lang3.StringUtils; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.insurance.Insurance.InsuranceType; +import buttondevteam.alipresents.architecture.commands.ModCommand; +import buttondevteam.alipresents.components.insurance.Insurance.InsuranceType; public class getInsuranceNugget extends ModCommand { diff --git a/src/buttondevteam/alipresents/components/magic/MagicComponent.java b/src/buttondevteam/alipresents/components/magic/MagicComponent.java new file mode 100644 index 0000000..4dd2389 --- /dev/null +++ b/src/buttondevteam/alipresents/components/magic/MagicComponent.java @@ -0,0 +1,20 @@ +package buttondevteam.alipresents.components.magic; + +import org.bukkit.plugin.java.JavaPlugin; + +import buttondevteam.alipresents.architecture.Component; +import buttondevteam.alipresents.components.magic.tricks.AliArrowListener; +import buttondevteam.alipresents.components.magic.tricks.BoomBowDeathListener; +import buttondevteam.alipresents.components.magic.tricks.BoomBowListener; +import buttondevteam.alipresents.components.magic.tricks.CannonBowListener; + +public class MagicComponent extends Component{ + + @Override + public void register(JavaPlugin plugin) { + registerListener(plugin, new AliArrowListener(plugin)); + registerListener(plugin, new BoomBowDeathListener()); + registerListener(plugin, new BoomBowListener(plugin)); + registerListener(plugin, new CannonBowListener(plugin)); + } +} diff --git a/src/alisolarflare/components/magic/tricks/AliArrowListener.java b/src/buttondevteam/alipresents/components/magic/tricks/AliArrowListener.java similarity index 91% rename from src/alisolarflare/components/magic/tricks/AliArrowListener.java rename to src/buttondevteam/alipresents/components/magic/tricks/AliArrowListener.java index 694e8a8..1159074 100644 --- a/src/alisolarflare/components/magic/tricks/AliArrowListener.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/AliArrowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.components.magic.tricks; +package buttondevteam.alipresents.components.magic.tricks; import org.bukkit.entity.Arrow; import org.bukkit.entity.EntityType; diff --git a/src/alisolarflare/components/magic/tricks/AliArrowTask.java b/src/buttondevteam/alipresents/components/magic/tricks/AliArrowTask.java similarity index 90% rename from src/alisolarflare/components/magic/tricks/AliArrowTask.java rename to src/buttondevteam/alipresents/components/magic/tricks/AliArrowTask.java index 6aa6665..cd4dd0b 100644 --- a/src/alisolarflare/components/magic/tricks/AliArrowTask.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/AliArrowTask.java @@ -1,4 +1,4 @@ -package alisolarflare.components.magic.tricks; +package buttondevteam.alipresents.components.magic.tricks; import org.bukkit.Particle; import org.bukkit.entity.Arrow; diff --git a/src/alisolarflare/components/magic/tricks/BoomBowDeathListener.java b/src/buttondevteam/alipresents/components/magic/tricks/BoomBowDeathListener.java similarity index 86% rename from src/alisolarflare/components/magic/tricks/BoomBowDeathListener.java rename to src/buttondevteam/alipresents/components/magic/tricks/BoomBowDeathListener.java index 3d60143..6b5feba 100644 --- a/src/alisolarflare/components/magic/tricks/BoomBowDeathListener.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/BoomBowDeathListener.java @@ -1,4 +1,4 @@ -package alisolarflare.components.magic.tricks; +package buttondevteam.alipresents.components.magic.tricks; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; diff --git a/src/alisolarflare/components/magic/tricks/BoomBowListener.java b/src/buttondevteam/alipresents/components/magic/tricks/BoomBowListener.java similarity index 95% rename from src/alisolarflare/components/magic/tricks/BoomBowListener.java rename to src/buttondevteam/alipresents/components/magic/tricks/BoomBowListener.java index bdb5b02..40caa46 100644 --- a/src/alisolarflare/components/magic/tricks/BoomBowListener.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/BoomBowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.components.magic.tricks; +package buttondevteam.alipresents.components.magic.tricks; import org.bukkit.GameMode; import org.bukkit.Location; diff --git a/src/alisolarflare/components/magic/tricks/BoomBowRule.java b/src/buttondevteam/alipresents/components/magic/tricks/BoomBowRule.java similarity index 89% rename from src/alisolarflare/components/magic/tricks/BoomBowRule.java rename to src/buttondevteam/alipresents/components/magic/tricks/BoomBowRule.java index 40cac59..ee52cdf 100644 --- a/src/alisolarflare/components/magic/tricks/BoomBowRule.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/BoomBowRule.java @@ -1,8 +1,8 @@ -package alisolarflare.components.magic.tricks; +package buttondevteam.alipresents.components.magic.tricks; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.ModCommand; +import buttondevteam.alipresents.architecture.commands.ModCommand; //HEHEHHEHEH EAASSSTER EGGS public class BoomBowRule extends ModCommand{ public static boolean boomDecay; diff --git a/src/alisolarflare/components/magic/tricks/BoomDecayTask.java b/src/buttondevteam/alipresents/components/magic/tricks/BoomDecayTask.java similarity index 85% rename from src/alisolarflare/components/magic/tricks/BoomDecayTask.java rename to src/buttondevteam/alipresents/components/magic/tricks/BoomDecayTask.java index 15a5474..df6e085 100644 --- a/src/alisolarflare/components/magic/tricks/BoomDecayTask.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/BoomDecayTask.java @@ -1,4 +1,4 @@ -package alisolarflare.components.magic.tricks; +package buttondevteam.alipresents.components.magic.tricks; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/alisolarflare/components/magic/tricks/CannonBowListener.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java similarity index 97% rename from src/alisolarflare/components/magic/tricks/CannonBowListener.java rename to src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java index e2aaa84..83eebb2 100644 --- a/src/alisolarflare/components/magic/tricks/CannonBowListener.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.components.magic.tricks; +package buttondevteam.alipresents.components.magic.tricks; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/alisolarflare/components/metrics/MetricsComponent.java b/src/buttondevteam/alipresents/components/metrics/MetricsComponent.java similarity index 67% rename from src/alisolarflare/components/metrics/MetricsComponent.java rename to src/buttondevteam/alipresents/components/metrics/MetricsComponent.java index 34bd000..ea57a09 100644 --- a/src/alisolarflare/components/metrics/MetricsComponent.java +++ b/src/buttondevteam/alipresents/components/metrics/MetricsComponent.java @@ -1,14 +1,14 @@ -package alisolarflare.components.metrics; +package buttondevteam.alipresents.components.metrics; import java.util.ArrayList; import java.util.List; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.architecture.Component; -import alisolarflare.components.metrics.collection.PlayerJoinListener; -import alisolarflare.components.metrics.files.MetricsFile; -import alisolarflare.components.metrics.output.GetLoginMetrics; +import buttondevteam.alipresents.architecture.Component; +import buttondevteam.alipresents.components.metrics.collection.PlayerJoinListener; +import buttondevteam.alipresents.components.metrics.files.MetricsFile; +import buttondevteam.alipresents.components.metrics.output.GetLoginMetrics; public class MetricsComponent extends Component{ String defaultPath = "src/alisolarflare/resources"; diff --git a/src/alisolarflare/components/metrics/collection/PlayerJoinListener.java b/src/buttondevteam/alipresents/components/metrics/collection/PlayerJoinListener.java similarity index 76% rename from src/alisolarflare/components/metrics/collection/PlayerJoinListener.java rename to src/buttondevteam/alipresents/components/metrics/collection/PlayerJoinListener.java index d997d32..fa1a9ef 100644 --- a/src/alisolarflare/components/metrics/collection/PlayerJoinListener.java +++ b/src/buttondevteam/alipresents/components/metrics/collection/PlayerJoinListener.java @@ -1,11 +1,11 @@ -package alisolarflare.components.metrics.collection; +package buttondevteam.alipresents.components.metrics.collection; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; -import alisolarflare.components.metrics.MetricsComponent; -import alisolarflare.components.metrics.files.MetricsFile; +import buttondevteam.alipresents.components.metrics.MetricsComponent; +import buttondevteam.alipresents.components.metrics.files.MetricsFile; public class PlayerJoinListener implements Listener{ diff --git a/src/alisolarflare/components/metrics/files/MetricsFile.java b/src/buttondevteam/alipresents/components/metrics/files/MetricsFile.java similarity index 97% rename from src/alisolarflare/components/metrics/files/MetricsFile.java rename to src/buttondevteam/alipresents/components/metrics/files/MetricsFile.java index baab52e..1290631 100644 --- a/src/alisolarflare/components/metrics/files/MetricsFile.java +++ b/src/buttondevteam/alipresents/components/metrics/files/MetricsFile.java @@ -1,4 +1,4 @@ -package alisolarflare.components.metrics.files; +package buttondevteam.alipresents.components.metrics.files; import java.io.BufferedReader; import java.io.BufferedWriter; diff --git a/src/alisolarflare/components/metrics/output/GetLoginMetrics.java b/src/buttondevteam/alipresents/components/metrics/output/GetLoginMetrics.java similarity index 89% rename from src/alisolarflare/components/metrics/output/GetLoginMetrics.java rename to src/buttondevteam/alipresents/components/metrics/output/GetLoginMetrics.java index ce6b76e..3778d0f 100644 --- a/src/alisolarflare/components/metrics/output/GetLoginMetrics.java +++ b/src/buttondevteam/alipresents/components/metrics/output/GetLoginMetrics.java @@ -1,4 +1,4 @@ -package alisolarflare.components.metrics.output; +package buttondevteam.alipresents.components.metrics.output; import java.io.BufferedReader; import java.io.FileNotFoundException; @@ -9,8 +9,8 @@ import java.util.List; import org.bukkit.entity.Player; -import alisolarflare.architecture.commands.ModCommand; -import alisolarflare.components.metrics.MetricsComponent; +import buttondevteam.alipresents.architecture.commands.ModCommand; +import buttondevteam.alipresents.components.metrics.MetricsComponent; import buttondevteam.lib.TBMCCoreAPI; public class GetLoginMetrics extends ModCommand{ diff --git a/src/alisolarflare/components/spawn/SpawnComponent.java b/src/buttondevteam/alipresents/components/spawn/SpawnComponent.java similarity index 53% rename from src/alisolarflare/components/spawn/SpawnComponent.java rename to src/buttondevteam/alipresents/components/spawn/SpawnComponent.java index 60bd317..189d844 100644 --- a/src/alisolarflare/components/spawn/SpawnComponent.java +++ b/src/buttondevteam/alipresents/components/spawn/SpawnComponent.java @@ -1,9 +1,9 @@ -package alisolarflare.components.spawn; +package buttondevteam.alipresents.components.spawn; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.architecture.Component; -import alisolarflare.components.spawn.cows.CowSpawnLoop; +import buttondevteam.alipresents.architecture.Component; +import buttondevteam.alipresents.components.spawn.cows.CowSpawnLoop; public class SpawnComponent extends Component { diff --git a/src/alisolarflare/components/spawn/cows/CowSpawnLoop.java b/src/buttondevteam/alipresents/components/spawn/cows/CowSpawnLoop.java similarity index 96% rename from src/alisolarflare/components/spawn/cows/CowSpawnLoop.java rename to src/buttondevteam/alipresents/components/spawn/cows/CowSpawnLoop.java index b7ded14..24ee650 100644 --- a/src/alisolarflare/components/spawn/cows/CowSpawnLoop.java +++ b/src/buttondevteam/alipresents/components/spawn/cows/CowSpawnLoop.java @@ -1,4 +1,4 @@ -package alisolarflare.components.spawn.cows; +package buttondevteam.alipresents.components.spawn.cows; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/graveyard/autouhc/UHCModule.java b/src/buttondevteam/alipresents/graveyard/autouhc/UHCModule.java similarity index 91% rename from src/graveyard/autouhc/UHCModule.java rename to src/buttondevteam/alipresents/graveyard/autouhc/UHCModule.java index b33ce22..2603269 100644 --- a/src/graveyard/autouhc/UHCModule.java +++ b/src/buttondevteam/alipresents/graveyard/autouhc/UHCModule.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.autouhc; //package graveyard.autouhc; //import org.bukkit.plugin.java.JavaPlugin; // diff --git a/src/graveyard/autouhc/controller/SetMatchState.java b/src/buttondevteam/alipresents/graveyard/autouhc/controller/SetMatchState.java similarity index 96% rename from src/graveyard/autouhc/controller/SetMatchState.java rename to src/buttondevteam/alipresents/graveyard/autouhc/controller/SetMatchState.java index 0f858f8..02f92e7 100644 --- a/src/graveyard/autouhc/controller/SetMatchState.java +++ b/src/buttondevteam/alipresents/graveyard/autouhc/controller/SetMatchState.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.autouhc.controller; //package graveyard.autouhc.controller; // //import org.bukkit.command.CommandSender; diff --git a/src/graveyard/autouhc/idle/AddToUHC.java b/src/buttondevteam/alipresents/graveyard/autouhc/idle/AddToUHC.java similarity index 93% rename from src/graveyard/autouhc/idle/AddToUHC.java rename to src/buttondevteam/alipresents/graveyard/autouhc/idle/AddToUHC.java index 9c4de01..4bfb2a5 100644 --- a/src/graveyard/autouhc/idle/AddToUHC.java +++ b/src/buttondevteam/alipresents/graveyard/autouhc/idle/AddToUHC.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.autouhc.idle; //package graveyard.autouhc.idle; // //import org.bukkit.command.CommandSender; diff --git a/src/graveyard/autouhc/idle/JoinUHC.java b/src/buttondevteam/alipresents/graveyard/autouhc/idle/JoinUHC.java similarity index 92% rename from src/graveyard/autouhc/idle/JoinUHC.java rename to src/buttondevteam/alipresents/graveyard/autouhc/idle/JoinUHC.java index 1236cd9..70e5206 100644 --- a/src/graveyard/autouhc/idle/JoinUHC.java +++ b/src/buttondevteam/alipresents/graveyard/autouhc/idle/JoinUHC.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.autouhc.idle; //package graveyard.autouhc.idle; // //import org.bukkit.command.CommandSender; diff --git a/src/graveyard/autouhc/intro/ConfigureMatch.java b/src/buttondevteam/alipresents/graveyard/autouhc/intro/ConfigureMatch.java similarity index 86% rename from src/graveyard/autouhc/intro/ConfigureMatch.java rename to src/buttondevteam/alipresents/graveyard/autouhc/intro/ConfigureMatch.java index be784c8..467fef1 100644 --- a/src/graveyard/autouhc/intro/ConfigureMatch.java +++ b/src/buttondevteam/alipresents/graveyard/autouhc/intro/ConfigureMatch.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.autouhc.intro; //package graveyard.autouhc.intro; // //import org.bukkit.command.CommandSender; diff --git a/src/graveyard/autouhc/intro/IntroductionCutscene.java b/src/buttondevteam/alipresents/graveyard/autouhc/intro/IntroductionCutscene.java similarity index 70% rename from src/graveyard/autouhc/intro/IntroductionCutscene.java rename to src/buttondevteam/alipresents/graveyard/autouhc/intro/IntroductionCutscene.java index 376c3d5..459a665 100644 --- a/src/graveyard/autouhc/intro/IntroductionCutscene.java +++ b/src/buttondevteam/alipresents/graveyard/autouhc/intro/IntroductionCutscene.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.autouhc.intro; //package graveyard.autouhc.intro; ///**@deprecated*/ //public class IntroductionCutscene { diff --git a/src/graveyard/autouhc/intro/ScheduleMatch.java b/src/buttondevteam/alipresents/graveyard/autouhc/intro/ScheduleMatch.java similarity index 86% rename from src/graveyard/autouhc/intro/ScheduleMatch.java rename to src/buttondevteam/alipresents/graveyard/autouhc/intro/ScheduleMatch.java index b887e1c..3c17e5a 100644 --- a/src/graveyard/autouhc/intro/ScheduleMatch.java +++ b/src/buttondevteam/alipresents/graveyard/autouhc/intro/ScheduleMatch.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.autouhc.intro; //package graveyard.autouhc.intro; // //import org.bukkit.command.CommandSender; diff --git a/src/graveyard/autouhc/intro/StartMatch.java b/src/buttondevteam/alipresents/graveyard/autouhc/intro/StartMatch.java similarity index 92% rename from src/graveyard/autouhc/intro/StartMatch.java rename to src/buttondevteam/alipresents/graveyard/autouhc/intro/StartMatch.java index 5ba3fae..dc8911f 100644 --- a/src/graveyard/autouhc/intro/StartMatch.java +++ b/src/buttondevteam/alipresents/graveyard/autouhc/intro/StartMatch.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.autouhc.intro; //package graveyard.autouhc.intro; // //import org.bukkit.command.CommandSender; diff --git a/src/graveyard/autouhc/listeners/MatchCyclingListener.java b/src/buttondevteam/alipresents/graveyard/autouhc/listeners/MatchCyclingListener.java similarity index 87% rename from src/graveyard/autouhc/listeners/MatchCyclingListener.java rename to src/buttondevteam/alipresents/graveyard/autouhc/listeners/MatchCyclingListener.java index 5ee5bfc..f5d74c4 100644 --- a/src/graveyard/autouhc/listeners/MatchCyclingListener.java +++ b/src/buttondevteam/alipresents/graveyard/autouhc/listeners/MatchCyclingListener.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.autouhc.listeners; //package graveyard.autouhc.listeners; // //import org.bukkit.event.Listener; diff --git a/src/graveyard/autouhc/listeners/MatchMainLoop.java b/src/buttondevteam/alipresents/graveyard/autouhc/listeners/MatchMainLoop.java similarity index 73% rename from src/graveyard/autouhc/listeners/MatchMainLoop.java rename to src/buttondevteam/alipresents/graveyard/autouhc/listeners/MatchMainLoop.java index 6b10fb6..4f210d5 100644 --- a/src/graveyard/autouhc/listeners/MatchMainLoop.java +++ b/src/buttondevteam/alipresents/graveyard/autouhc/listeners/MatchMainLoop.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.autouhc.listeners; //package graveyard.autouhc.listeners; // //import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/graveyard/autouhc/memory/MatchState.java b/src/buttondevteam/alipresents/graveyard/autouhc/memory/MatchState.java similarity index 85% rename from src/graveyard/autouhc/memory/MatchState.java rename to src/buttondevteam/alipresents/graveyard/autouhc/memory/MatchState.java index f309e8b..d4f38d9 100644 --- a/src/graveyard/autouhc/memory/MatchState.java +++ b/src/buttondevteam/alipresents/graveyard/autouhc/memory/MatchState.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.autouhc.memory; //package graveyard.autouhc.memory; ///**@deprecated*/ //public enum MatchState { diff --git a/src/graveyard/autouhc/memory/UHCMatch.java b/src/buttondevteam/alipresents/graveyard/autouhc/memory/UHCMatch.java similarity index 91% rename from src/graveyard/autouhc/memory/UHCMatch.java rename to src/buttondevteam/alipresents/graveyard/autouhc/memory/UHCMatch.java index bf43e13..e372502 100644 --- a/src/graveyard/autouhc/memory/UHCMatch.java +++ b/src/buttondevteam/alipresents/graveyard/autouhc/memory/UHCMatch.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.autouhc.memory; //package graveyard.autouhc.memory; // //import java.util.ArrayList; diff --git a/src/graveyard/minigames/GameState.java b/src/buttondevteam/alipresents/graveyard/minigames/GameState.java similarity index 57% rename from src/graveyard/minigames/GameState.java rename to src/buttondevteam/alipresents/graveyard/minigames/GameState.java index 36ad955..a01eafe 100644 --- a/src/graveyard/minigames/GameState.java +++ b/src/buttondevteam/alipresents/graveyard/minigames/GameState.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.minigames; /*package graveyard.minigames; public enum GameState { diff --git a/src/graveyard/minigames/MinigameComponent.java b/src/buttondevteam/alipresents/graveyard/minigames/MinigameComponent.java similarity index 91% rename from src/graveyard/minigames/MinigameComponent.java rename to src/buttondevteam/alipresents/graveyard/minigames/MinigameComponent.java index 29f375d..b056353 100644 --- a/src/graveyard/minigames/MinigameComponent.java +++ b/src/buttondevteam/alipresents/graveyard/minigames/MinigameComponent.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.minigames; /*package graveyard.minigames; import java.util.List; diff --git a/src/graveyard/minigames/commands/JoinMinigame.java b/src/buttondevteam/alipresents/graveyard/minigames/commands/JoinMinigame.java similarity index 89% rename from src/graveyard/minigames/commands/JoinMinigame.java rename to src/buttondevteam/alipresents/graveyard/minigames/commands/JoinMinigame.java index f0a960b..07f024d 100644 --- a/src/graveyard/minigames/commands/JoinMinigame.java +++ b/src/buttondevteam/alipresents/graveyard/minigames/commands/JoinMinigame.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.minigames.commands; /*package graveyard.minigames.commands; import java.util.List; diff --git a/src/graveyard/minigames/commands/LeaveMinigame.java b/src/buttondevteam/alipresents/graveyard/minigames/commands/LeaveMinigame.java similarity index 90% rename from src/graveyard/minigames/commands/LeaveMinigame.java rename to src/buttondevteam/alipresents/graveyard/minigames/commands/LeaveMinigame.java index 5a05279..e49b6fe 100644 --- a/src/graveyard/minigames/commands/LeaveMinigame.java +++ b/src/buttondevteam/alipresents/graveyard/minigames/commands/LeaveMinigame.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.minigames.commands; /*package graveyard.minigames.commands; import java.util.List; diff --git a/src/graveyard/minigames/commands/ListFighters.java b/src/buttondevteam/alipresents/graveyard/minigames/commands/ListFighters.java similarity index 87% rename from src/graveyard/minigames/commands/ListFighters.java rename to src/buttondevteam/alipresents/graveyard/minigames/commands/ListFighters.java index 73b5d80..ddf3ede 100644 --- a/src/graveyard/minigames/commands/ListFighters.java +++ b/src/buttondevteam/alipresents/graveyard/minigames/commands/ListFighters.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.minigames.commands; /*package graveyard.minigames.commands; import org.bukkit.entity.Player; diff --git a/src/graveyard/minigames/commands/SetColourSpawn.java b/src/buttondevteam/alipresents/graveyard/minigames/commands/SetColourSpawn.java similarity index 92% rename from src/graveyard/minigames/commands/SetColourSpawn.java rename to src/buttondevteam/alipresents/graveyard/minigames/commands/SetColourSpawn.java index 302ba1e..8863c2f 100644 --- a/src/graveyard/minigames/commands/SetColourSpawn.java +++ b/src/buttondevteam/alipresents/graveyard/minigames/commands/SetColourSpawn.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.minigames.commands; /*package graveyard.minigames.commands; import org.bukkit.entity.Player; diff --git a/src/graveyard/minigames/data/SpawnSet.java b/src/buttondevteam/alipresents/graveyard/minigames/data/SpawnSet.java similarity index 76% rename from src/graveyard/minigames/data/SpawnSet.java rename to src/buttondevteam/alipresents/graveyard/minigames/data/SpawnSet.java index 1878177..180e3f0 100644 --- a/src/graveyard/minigames/data/SpawnSet.java +++ b/src/buttondevteam/alipresents/graveyard/minigames/data/SpawnSet.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.minigames.data; /*package graveyard.minigames.data; import org.bukkit.Location; diff --git a/src/graveyard/shulker/AliShulkerModule.java b/src/buttondevteam/alipresents/graveyard/shulker/AliShulkerModule.java similarity index 52% rename from src/graveyard/shulker/AliShulkerModule.java rename to src/buttondevteam/alipresents/graveyard/shulker/AliShulkerModule.java index 8ffde1e..83b006a 100644 --- a/src/graveyard/shulker/AliShulkerModule.java +++ b/src/buttondevteam/alipresents/graveyard/shulker/AliShulkerModule.java @@ -1,9 +1,9 @@ -package graveyard.shulker; +package buttondevteam.alipresents.graveyard.shulker; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.architecture.Component; -import graveyard.shulker.commands.AliShulker; +import buttondevteam.alipresents.architecture.Component; +import buttondevteam.alipresents.graveyard.shulker.commands.AliShulker; /**@deprecated*/ public class AliShulkerModule extends Component { diff --git a/src/graveyard/shulker/SetFlairDoorColour.java b/src/buttondevteam/alipresents/graveyard/shulker/SetFlairDoorColour.java similarity index 94% rename from src/graveyard/shulker/SetFlairDoorColour.java rename to src/buttondevteam/alipresents/graveyard/shulker/SetFlairDoorColour.java index 83eceff..24a28b5 100644 --- a/src/graveyard/shulker/SetFlairDoorColour.java +++ b/src/buttondevteam/alipresents/graveyard/shulker/SetFlairDoorColour.java @@ -1,4 +1,4 @@ -package graveyard.shulker; +package buttondevteam.alipresents.graveyard.shulker; import java.util.Arrays; import java.util.List; diff --git a/src/graveyard/shulker/commands/AliShulker.java b/src/buttondevteam/alipresents/graveyard/shulker/commands/AliShulker.java similarity index 93% rename from src/graveyard/shulker/commands/AliShulker.java rename to src/buttondevteam/alipresents/graveyard/shulker/commands/AliShulker.java index abf44f3..c42d3e4 100644 --- a/src/graveyard/shulker/commands/AliShulker.java +++ b/src/buttondevteam/alipresents/graveyard/shulker/commands/AliShulker.java @@ -1,4 +1,4 @@ -package graveyard.shulker.commands; +package buttondevteam.alipresents.graveyard.shulker.commands; import org.bukkit.Location; import org.bukkit.command.CommandSender; diff --git a/src/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java similarity index 94% rename from src/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java rename to src/buttondevteam/alipresents/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java index 35c07e6..a129c1e 100644 --- a/src/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java +++ b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/ButtonRebirthPlugin.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.thebuttonrebirth; /*package graveyard.thebuttonrebirth; import java.util.ArrayList; diff --git a/src/graveyard/thebuttonrebirth/admin/CreateShrine.java b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/admin/CreateShrine.java similarity index 95% rename from src/graveyard/thebuttonrebirth/admin/CreateShrine.java rename to src/buttondevteam/alipresents/graveyard/thebuttonrebirth/admin/CreateShrine.java index 7df84c0..1444219 100644 --- a/src/graveyard/thebuttonrebirth/admin/CreateShrine.java +++ b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/admin/CreateShrine.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.thebuttonrebirth.admin; /*package graveyard.thebuttonrebirth.admin; import org.bukkit.Material; diff --git a/src/graveyard/thebuttonrebirth/commands/ShowBars.java b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/commands/ShowBars.java similarity index 87% rename from src/graveyard/thebuttonrebirth/commands/ShowBars.java rename to src/buttondevteam/alipresents/graveyard/thebuttonrebirth/commands/ShowBars.java index fd52cb7..8d47c51 100644 --- a/src/graveyard/thebuttonrebirth/commands/ShowBars.java +++ b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/commands/ShowBars.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.thebuttonrebirth.commands; /*package graveyard.thebuttonrebirth.commands; import org.bukkit.command.Command; diff --git a/src/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java similarity index 87% rename from src/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java rename to src/buttondevteam/alipresents/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java index 11f1355..f3acc5c 100644 --- a/src/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java +++ b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/listeners/CyclicalDisplayListener.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.thebuttonrebirth.listeners; /*package graveyard.thebuttonrebirth.listeners; import org.bukkit.event.Listener; diff --git a/src/graveyard/thebuttonrebirth/listeners/MidnightListener.java b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/listeners/MidnightListener.java similarity index 85% rename from src/graveyard/thebuttonrebirth/listeners/MidnightListener.java rename to src/buttondevteam/alipresents/graveyard/thebuttonrebirth/listeners/MidnightListener.java index d8cfa04..64e1a88 100644 --- a/src/graveyard/thebuttonrebirth/listeners/MidnightListener.java +++ b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/listeners/MidnightListener.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.thebuttonrebirth.listeners; /*package graveyard.thebuttonrebirth.listeners; import org.bukkit.event.Listener; diff --git a/src/graveyard/thebuttonrebirth/listeners/StealChestListener.java b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/listeners/StealChestListener.java similarity index 85% rename from src/graveyard/thebuttonrebirth/listeners/StealChestListener.java rename to src/buttondevteam/alipresents/graveyard/thebuttonrebirth/listeners/StealChestListener.java index 1c6bd4d..a3ff35f 100644 --- a/src/graveyard/thebuttonrebirth/listeners/StealChestListener.java +++ b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/listeners/StealChestListener.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.thebuttonrebirth.listeners; /*package graveyard.thebuttonrebirth.listeners; import org.bukkit.event.Listener; diff --git a/src/graveyard/thebuttonrebirth/tasks/CheckChestTask.java b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/tasks/CheckChestTask.java similarity index 96% rename from src/graveyard/thebuttonrebirth/tasks/CheckChestTask.java rename to src/buttondevteam/alipresents/graveyard/thebuttonrebirth/tasks/CheckChestTask.java index 71b653c..1b905aa 100644 --- a/src/graveyard/thebuttonrebirth/tasks/CheckChestTask.java +++ b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/tasks/CheckChestTask.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.thebuttonrebirth.tasks; //package graveyard.thebuttonrebirth.tasks; // //import java.time.Clock; diff --git a/src/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java similarity index 95% rename from src/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java rename to src/buttondevteam/alipresents/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java index 4c80a6f..68d039a 100644 --- a/src/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java +++ b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/tasks/CyclicalDisplayTask.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.thebuttonrebirth.tasks; /*package graveyard.thebuttonrebirth.tasks; import java.time.Clock; diff --git a/src/graveyard/thebuttonrebirth/tasks/StealChestTask.java b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/tasks/StealChestTask.java similarity index 96% rename from src/graveyard/thebuttonrebirth/tasks/StealChestTask.java rename to src/buttondevteam/alipresents/graveyard/thebuttonrebirth/tasks/StealChestTask.java index ef1079e..e1f7990 100644 --- a/src/graveyard/thebuttonrebirth/tasks/StealChestTask.java +++ b/src/buttondevteam/alipresents/graveyard/thebuttonrebirth/tasks/StealChestTask.java @@ -1,3 +1,4 @@ +package buttondevteam.alipresents.graveyard.thebuttonrebirth.tasks; /*package graveyard.thebuttonrebirth.tasks; import java.time.Clock; diff --git a/src/alisolarflare/resources/metrics.txt b/src/buttondevteam/alipresents/resources/metrics.txt similarity index 100% rename from src/alisolarflare/resources/metrics.txt rename to src/buttondevteam/alipresents/resources/metrics.txt diff --git a/src/alisolarflare/resources/playerLogins.txt b/src/buttondevteam/alipresents/resources/playerLogins.txt similarity index 100% rename from src/alisolarflare/resources/playerLogins.txt rename to src/buttondevteam/alipresents/resources/playerLogins.txt From 02803a86e28b949fd8f8a8a47b73a81ae702790b Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 15 Dec 2016 18:37:16 -0500 Subject: [PATCH 216/263] Adjusted Commands --- plugin.yml | 2 +- pom.xml | 27 ------------------- .../alipresents/architecture/Component.java | 5 ++-- .../architecture/commands/BaseCommand.java | 4 ++- .../architecture/commands/PlayerCommand.java | 7 +++++ .../graveyard/shulker/AliShulkerModule.java | 3 +-- 6 files changed, 15 insertions(+), 33 deletions(-) diff --git a/plugin.yml b/plugin.yml index 34fe825..f2f172d 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,4 +1,4 @@ -main: buttondevteam.AliPresents +main: buttondevteam.alipresents.AliPresents name: AliPresents version: 2.0.2 diff --git a/pom.xml b/pom.xml index 68e3c9f..d4c8311 100644 --- a/pom.xml +++ b/pom.xml @@ -31,33 +31,6 @@ 1.8 - - org.apache.maven.plugins - maven-shade-plugin - 2.4.2 - - - package - - shade - - - - - org.spigotmc:spigot-api - com.github.TBMCPlugins.ButtonCore:ButtonCore - net.ess3:Essentials - - - - - - - - - - - org.apache.maven.plugins maven-resources-plugin diff --git a/src/buttondevteam/alipresents/architecture/Component.java b/src/buttondevteam/alipresents/architecture/Component.java index 81b2f35..a08bee6 100644 --- a/src/buttondevteam/alipresents/architecture/Component.java +++ b/src/buttondevteam/alipresents/architecture/Component.java @@ -4,9 +4,9 @@ import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; +import buttondevteam.alipresents.architecture.commands.BaseCommand; import buttondevteam.lib.TBMCCoreAPI; import buttondevteam.lib.chat.TBMCChatAPI; -import buttondevteam.lib.chat.TBMCCommandBase; /** * A Module class allows the compacting of projects into one single package. @@ -35,8 +35,9 @@ public abstract class Component{ * @param label Name of the command in plugin.yml * @param commandExecutor Custom coded CommandExecutor class */ - protected void registerCommand(JavaPlugin plugin, TBMCCommandBase commandBase){ + protected void registerCommand(JavaPlugin plugin, BaseCommand commandBase){ TBMCChatAPI.AddCommand(plugin, commandBase); + //plugin.getCommand(commandBase.getClass().getSimpleName().toString()).setExecutor(commandBase); } /** * Registers a Listener to this plugin diff --git a/src/buttondevteam/alipresents/architecture/commands/BaseCommand.java b/src/buttondevteam/alipresents/architecture/commands/BaseCommand.java index 0f8e89a..6233d3a 100644 --- a/src/buttondevteam/alipresents/architecture/commands/BaseCommand.java +++ b/src/buttondevteam/alipresents/architecture/commands/BaseCommand.java @@ -1,6 +1,8 @@ package buttondevteam.alipresents.architecture.commands; +import org.bukkit.command.CommandExecutor; + import buttondevteam.lib.chat.TBMCCommandBase; -public abstract class BaseCommand extends TBMCCommandBase{ +public abstract class BaseCommand extends TBMCCommandBase implements CommandExecutor{ } diff --git a/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java b/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java index 3812448..35d81bd 100644 --- a/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java +++ b/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java @@ -1,9 +1,16 @@ package buttondevteam.alipresents.architecture.commands; +import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public abstract class PlayerCommand extends BaseCommand{ + /**replaces CommandExecutor functionality*/ + @Override + public boolean onCommand(CommandSender commandSender, Command command, String string, String[] args){ + return OnCommand(commandSender, string, args); + } + /**replaces TBMCCommandBase functionality*/ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args){ return OnCommand((Player) sender, alias, args); diff --git a/src/buttondevteam/alipresents/graveyard/shulker/AliShulkerModule.java b/src/buttondevteam/alipresents/graveyard/shulker/AliShulkerModule.java index 83b006a..0241e32 100644 --- a/src/buttondevteam/alipresents/graveyard/shulker/AliShulkerModule.java +++ b/src/buttondevteam/alipresents/graveyard/shulker/AliShulkerModule.java @@ -3,14 +3,13 @@ package buttondevteam.alipresents.graveyard.shulker; import org.bukkit.plugin.java.JavaPlugin; import buttondevteam.alipresents.architecture.Component; -import buttondevteam.alipresents.graveyard.shulker.commands.AliShulker; /**@deprecated*/ public class AliShulkerModule extends Component { @Override public void register(JavaPlugin plugin) { - registerCommand(plugin, new AliShulker()); + //registerCommand(plugin, new AliShulker()); } } From e2f2c6635211dbdd48ae6430375628d17a37a953 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 16 Dec 2016 12:51:46 -0500 Subject: [PATCH 217/263] Started work on sub-commands --- pom.xml | 32 +++++++++---------- .../commands/subcommands/SubCommand.java | 12 ++++++- .../components/alilinks/commands/Press.java | 32 +++++++++++++++++++ .../components/alilinks/commands/Set.java | 14 ++++++++ 4 files changed, 73 insertions(+), 17 deletions(-) create mode 100644 src/buttondevteam/alipresents/components/alilinks/commands/Press.java create mode 100644 src/buttondevteam/alipresents/components/alilinks/commands/Set.java diff --git a/pom.xml b/pom.xml index d4c8311..8a031d8 100644 --- a/pom.xml +++ b/pom.xml @@ -73,13 +73,13 @@ https://jitpack.io - ess-repo - http://repo.ess3.net/content/groups/essentials - - - citizensnpcs - http://repo.citizensnpcs.co/ - + ess-repo + http://repo.ess3.net/content/groups/essentials + + + citizensnpcs + http://repo.citizensnpcs.co/ + @@ -100,14 +100,14 @@ master-SNAPSHOT - net.ess3 - Essentials - 2.14-SNAPSHOT - - - net.citizensnpcs - citizens-v1_11_R1 - 2.0.21-SNAPSHOT - + net.ess3 + Essentials + 2.14-SNAPSHOT + + + net.citizensnpcs + citizens-v1_11_R1 + 2.0.21-SNAPSHOT + diff --git a/src/buttondevteam/alipresents/architecture/commands/subcommands/SubCommand.java b/src/buttondevteam/alipresents/architecture/commands/subcommands/SubCommand.java index 8a6a93d..9501bef 100644 --- a/src/buttondevteam/alipresents/architecture/commands/subcommands/SubCommand.java +++ b/src/buttondevteam/alipresents/architecture/commands/subcommands/SubCommand.java @@ -1,9 +1,19 @@ package buttondevteam.alipresents.architecture.commands.subcommands; +import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public abstract class SubCommand { - public abstract boolean run(Player player, String label, String[] args); + public boolean run(CommandSender sender, String label, String[] args){ + if (getPlayerOnly() && (sender instanceof Player)) + return false; + + if (getModOnly() && (sender.hasPermission("Moderator"))) + return false; + + return onCommand((Player) sender, label, args); + } + protected abstract boolean onCommand(Player player, String label, String[] args); public abstract boolean getPlayerOnly(); public abstract boolean getModOnly(); public abstract String[] GetHelpText(String alias); diff --git a/src/buttondevteam/alipresents/components/alilinks/commands/Press.java b/src/buttondevteam/alipresents/components/alilinks/commands/Press.java new file mode 100644 index 0000000..a1ad580 --- /dev/null +++ b/src/buttondevteam/alipresents/components/alilinks/commands/Press.java @@ -0,0 +1,32 @@ +package buttondevteam.alipresents.components.alilinks.commands; + +import org.bukkit.entity.Player; + +import buttondevteam.alipresents.architecture.commands.subcommands.SubCommand; + +public class Press extends SubCommand{ + + @Override + protected boolean onCommand(Player player, String label, String[] args) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean getPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean getModOnly() { + // TODO Auto-generated method stub + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } +} diff --git a/src/buttondevteam/alipresents/components/alilinks/commands/Set.java b/src/buttondevteam/alipresents/components/alilinks/commands/Set.java new file mode 100644 index 0000000..38fdc99 --- /dev/null +++ b/src/buttondevteam/alipresents/components/alilinks/commands/Set.java @@ -0,0 +1,14 @@ +package buttondevteam.alipresents.components.alilinks.commands; + +import org.bukkit.entity.Player; + +import buttondevteam.alipresents.architecture.commands.ModCommand; + +public class Set extends ModCommand{ + @Override + public boolean OnCommand(Player player, String alias, String[] args) { + // TODO Auto-generated method stub + return false; + } + +} From 7af3544c6162ec3e29094434b9e8d8e2cba8e4bb Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 16 Dec 2016 13:39:26 -0500 Subject: [PATCH 218/263] Broke AliLink --- .../commands/subcommands/ModSubCommand.java | 15 ---------- .../subcommands/PlayerSubCommand.java | 16 ---------- .../commands/subcommands/SubCommand.java | 20 ------------- .../components/alilinks/commands/AliLink.java | 30 ++++++++++++++++--- .../components/alilinks/commands/Press.java | 24 ++------------- 5 files changed, 29 insertions(+), 76 deletions(-) delete mode 100644 src/buttondevteam/alipresents/architecture/commands/subcommands/ModSubCommand.java delete mode 100644 src/buttondevteam/alipresents/architecture/commands/subcommands/PlayerSubCommand.java delete mode 100644 src/buttondevteam/alipresents/architecture/commands/subcommands/SubCommand.java diff --git a/src/buttondevteam/alipresents/architecture/commands/subcommands/ModSubCommand.java b/src/buttondevteam/alipresents/architecture/commands/subcommands/ModSubCommand.java deleted file mode 100644 index 24ba0ee..0000000 --- a/src/buttondevteam/alipresents/architecture/commands/subcommands/ModSubCommand.java +++ /dev/null @@ -1,15 +0,0 @@ -package buttondevteam.alipresents.architecture.commands.subcommands; - -public abstract class ModSubCommand extends SubCommand{ - @Override - public boolean getPlayerOnly() { - // TODO Auto-generated method stub - return true; - } - - @Override - public boolean getModOnly() { - // TODO Auto-generated method stub - return true; - } -} diff --git a/src/buttondevteam/alipresents/architecture/commands/subcommands/PlayerSubCommand.java b/src/buttondevteam/alipresents/architecture/commands/subcommands/PlayerSubCommand.java deleted file mode 100644 index aa7a631..0000000 --- a/src/buttondevteam/alipresents/architecture/commands/subcommands/PlayerSubCommand.java +++ /dev/null @@ -1,16 +0,0 @@ -package buttondevteam.alipresents.architecture.commands.subcommands; - -public abstract class PlayerSubCommand extends SubCommand{ - @Override - public boolean getModOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean getPlayerOnly() { - // TODO Auto-generated method stub - return true; - } - -} diff --git a/src/buttondevteam/alipresents/architecture/commands/subcommands/SubCommand.java b/src/buttondevteam/alipresents/architecture/commands/subcommands/SubCommand.java deleted file mode 100644 index 9501bef..0000000 --- a/src/buttondevteam/alipresents/architecture/commands/subcommands/SubCommand.java +++ /dev/null @@ -1,20 +0,0 @@ -package buttondevteam.alipresents.architecture.commands.subcommands; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -public abstract class SubCommand { - public boolean run(CommandSender sender, String label, String[] args){ - if (getPlayerOnly() && (sender instanceof Player)) - return false; - - if (getModOnly() && (sender.hasPermission("Moderator"))) - return false; - - return onCommand((Player) sender, label, args); - } - protected abstract boolean onCommand(Player player, String label, String[] args); - public abstract boolean getPlayerOnly(); - public abstract boolean getModOnly(); - public abstract String[] GetHelpText(String alias); -} diff --git a/src/buttondevteam/alipresents/components/alilinks/commands/AliLink.java b/src/buttondevteam/alipresents/components/alilinks/commands/AliLink.java index e5f9286..1886985 100644 --- a/src/buttondevteam/alipresents/components/alilinks/commands/AliLink.java +++ b/src/buttondevteam/alipresents/components/alilinks/commands/AliLink.java @@ -1,19 +1,21 @@ package buttondevteam.alipresents.components.alilinks.commands; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import buttondevteam.alipresents.architecture.commands.PlayerCommand; +import buttondevteam.alipresents.architecture.commands.BaseCommand; import buttondevteam.alipresents.components.alilinks.AliLinkAPI; -public class AliLink extends PlayerCommand{ +public class AliLink extends BaseCommand{ private JavaPlugin plugin; public AliLink(JavaPlugin plugin) { this.plugin = plugin; } @Override - public boolean OnCommand(Player player, String alias, String[] inputFrequencies) { + public boolean OnCommand(CommandSender player, String alias, String[] inputFrequencies) { if(inputFrequencies.length < 1) return false; @@ -21,12 +23,32 @@ public class AliLink extends PlayerCommand{ case "press": return AliLinkAPI.sendPressEvent(player, inputFrequencies, plugin); case "set": - return AliLinkAPI.createAliLink(player, inputFrequencies); + return AliLinkAPI.createAliLink((Player) player, inputFrequencies); default: return false; } } + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + // TODO Auto-generated method stub + return false; + } + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } diff --git a/src/buttondevteam/alipresents/components/alilinks/commands/Press.java b/src/buttondevteam/alipresents/components/alilinks/commands/Press.java index a1ad580..4b01942 100644 --- a/src/buttondevteam/alipresents/components/alilinks/commands/Press.java +++ b/src/buttondevteam/alipresents/components/alilinks/commands/Press.java @@ -2,31 +2,13 @@ package buttondevteam.alipresents.components.alilinks.commands; import org.bukkit.entity.Player; -import buttondevteam.alipresents.architecture.commands.subcommands.SubCommand; +import buttondevteam.alipresents.architecture.commands.PlayerCommand; -public class Press extends SubCommand{ +public class Press extends PlayerCommand{ @Override - protected boolean onCommand(Player player, String label, String[] args) { + public boolean OnCommand(Player player, String alias, String[] args) { // TODO Auto-generated method stub return false; } - - @Override - public boolean getPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean getModOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } } From ee2c29e1524c1ad00ff16f2011627519c7923742 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 16 Dec 2016 20:23:15 +0100 Subject: [PATCH 219/263] Fixed /alilink --- .../architecture/commands/ModCommand.java | 1 - .../architecture/commands/PlayerCommand.java | 2 - .../components/alilinks/AliLinkComponent.java | 12 +++- .../components/alilinks/commands/AliLink.java | 56 ------------------- .../components/alilinks/commands/Press.java | 13 ++++- .../components/alilinks/commands/Set.java | 14 +++-- 6 files changed, 30 insertions(+), 68 deletions(-) delete mode 100644 src/buttondevteam/alipresents/components/alilinks/commands/AliLink.java diff --git a/src/buttondevteam/alipresents/architecture/commands/ModCommand.java b/src/buttondevteam/alipresents/architecture/commands/ModCommand.java index d0e4f03..c9d5d03 100644 --- a/src/buttondevteam/alipresents/architecture/commands/ModCommand.java +++ b/src/buttondevteam/alipresents/architecture/commands/ModCommand.java @@ -12,7 +12,6 @@ public abstract class ModCommand extends PlayerCommand{ @Override public boolean GetModOnly() { - // TODO Auto-generated method stub return true; } } diff --git a/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java b/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java index 35d81bd..fa0282d 100644 --- a/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java +++ b/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java @@ -18,13 +18,11 @@ public abstract class PlayerCommand extends BaseCommand{ public abstract boolean OnCommand(Player player, String alias, String[] args); @Override public boolean GetPlayerOnly() { - // TODO Auto-generated method stub return true; } @Override public boolean GetModOnly() { - // TODO Auto-generated method stub return false; } @Override diff --git a/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java b/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java index 508e894..9d91954 100644 --- a/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java +++ b/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java @@ -3,11 +3,19 @@ package buttondevteam.alipresents.components.alilinks; import org.bukkit.plugin.java.JavaPlugin; import buttondevteam.alipresents.architecture.Component; -import buttondevteam.alipresents.components.alilinks.commands.AliLink; +import buttondevteam.alipresents.components.alilinks.commands.Press; +import buttondevteam.alipresents.components.alilinks.commands.Set; public class AliLinkComponent extends Component { + private static JavaPlugin p; + + public static JavaPlugin getPlugin() { + return p; + } + @Override public void register(JavaPlugin plugin) { - registerCommand(plugin, new AliLink(plugin)); + registerCommand(p = plugin, new Press()); + registerCommand(plugin, new Set()); } } diff --git a/src/buttondevteam/alipresents/components/alilinks/commands/AliLink.java b/src/buttondevteam/alipresents/components/alilinks/commands/AliLink.java deleted file mode 100644 index 1886985..0000000 --- a/src/buttondevteam/alipresents/components/alilinks/commands/AliLink.java +++ /dev/null @@ -1,56 +0,0 @@ -package buttondevteam.alipresents.components.alilinks.commands; - -import org.bukkit.command.Command; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import buttondevteam.alipresents.architecture.commands.BaseCommand; -import buttondevteam.alipresents.components.alilinks.AliLinkAPI; - -public class AliLink extends BaseCommand{ - private JavaPlugin plugin; - - public AliLink(JavaPlugin plugin) { - this.plugin = plugin; - } - @Override - public boolean OnCommand(CommandSender player, String alias, String[] inputFrequencies) { - if(inputFrequencies.length < 1) - return false; - - switch (inputFrequencies[0].toLowerCase()){ - case "press": - return AliLinkAPI.sendPressEvent(player, inputFrequencies, plugin); - case "set": - return AliLinkAPI.createAliLink((Player) player, inputFrequencies); - default: - return false; - } - - } - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - // TODO Auto-generated method stub - return false; - } - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } - @Override - public boolean GetPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - @Override - public boolean GetModOnly() { - // TODO Auto-generated method stub - return false; - } - - - - -} diff --git a/src/buttondevteam/alipresents/components/alilinks/commands/Press.java b/src/buttondevteam/alipresents/components/alilinks/commands/Press.java index 4b01942..4b531ed 100644 --- a/src/buttondevteam/alipresents/components/alilinks/commands/Press.java +++ b/src/buttondevteam/alipresents/components/alilinks/commands/Press.java @@ -3,12 +3,19 @@ package buttondevteam.alipresents.components.alilinks.commands; import org.bukkit.entity.Player; import buttondevteam.alipresents.architecture.commands.PlayerCommand; +import buttondevteam.alipresents.components.alilinks.AliLinkAPI; +import buttondevteam.alipresents.components.alilinks.AliLinkComponent; -public class Press extends PlayerCommand{ +public class Press extends PlayerCommand { + @Override + public String GetCommandPath() { + return "alilink press"; + } @Override public boolean OnCommand(Player player, String alias, String[] args) { - // TODO Auto-generated method stub - return false; + if (args.length < 1) + return false; + return AliLinkAPI.sendPressEvent(player, args, AliLinkComponent.getPlugin()); } } diff --git a/src/buttondevteam/alipresents/components/alilinks/commands/Set.java b/src/buttondevteam/alipresents/components/alilinks/commands/Set.java index 38fdc99..23385a6 100644 --- a/src/buttondevteam/alipresents/components/alilinks/commands/Set.java +++ b/src/buttondevteam/alipresents/components/alilinks/commands/Set.java @@ -3,12 +3,18 @@ package buttondevteam.alipresents.components.alilinks.commands; import org.bukkit.entity.Player; import buttondevteam.alipresents.architecture.commands.ModCommand; +import buttondevteam.alipresents.components.alilinks.AliLinkAPI; -public class Set extends ModCommand{ +public class Set extends ModCommand { @Override - public boolean OnCommand(Player player, String alias, String[] args) { - // TODO Auto-generated method stub - return false; + public String GetCommandPath() { + return "alilink set"; } + @Override + public boolean OnCommand(Player player, String alias, String[] args) { + if (args.length < 1) + return false; + return AliLinkAPI.createAliLink(player, args); + } } From 83ecead8878347d6075e2a58d0f936d8f0116105 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 16 Dec 2016 14:25:31 -0500 Subject: [PATCH 220/263] pls --- .../alipresents/components/alilinks/AliLinkComponent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java b/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java index 9d91954..c36f5cc 100644 --- a/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java +++ b/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java @@ -15,7 +15,8 @@ public class AliLinkComponent extends Component { @Override public void register(JavaPlugin plugin) { - registerCommand(p = plugin, new Press()); + p = plugin; + registerCommand(plugin, new Press()); registerCommand(plugin, new Set()); } } From 872e1c8ac7fcb8b338fc19891dfa680f2865e7d6 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Dec 2016 00:14:52 -0500 Subject: [PATCH 221/263] Adjusted commands to reduce plugin.yml --- plugin.yml | 86 ++++--------------- .../alipresents/AliPresents.java | 4 +- .../bankchest/BankChestComponent.java | 15 ---- .../bankchest/BankChestListener.java | 6 -- .../components/bankchest/CreateBankChest.java | 15 ---- .../creativeboundaries/commands/Cbgm0.java | 4 + .../creativeboundaries/commands/Cbgm1.java | 4 + .../commands/SetForceBoundaries.java | 5 ++ .../letterdyes/GetLetterDye.java | 4 + .../flaircolouring/portals/FlairMe.java | 4 + .../{gpowers => gpower}/GPowerComponent.java | 10 +-- .../{gpowers => gpower}/PoweredPlayer.java | 2 +- .../{gpowers => gpower}/api/GPowerAPI.java | 4 +- .../{gpowers => gpower}/commands/GPower.java | 13 ++- .../enchant/EnchantingLoop.java | 4 +- .../powerstate/PowerAll.java | 4 +- .../powerstate/PowerDown.java | 4 +- .../powerstate/PowerUp.java | 4 +- .../components/insurance/getInsurance.java | 5 ++ .../components/insurance/getInsuranceBar.java | 5 ++ .../insurance/getInsuranceBlock.java | 4 + .../insurance/getInsuranceNugget.java | 4 + .../metrics/output/GetLoginMetrics.java | 5 ++ 23 files changed, 86 insertions(+), 129 deletions(-) delete mode 100644 src/buttondevteam/alipresents/components/bankchest/BankChestComponent.java delete mode 100644 src/buttondevteam/alipresents/components/bankchest/BankChestListener.java delete mode 100644 src/buttondevteam/alipresents/components/bankchest/CreateBankChest.java rename src/buttondevteam/alipresents/components/{gpowers => gpower}/GPowerComponent.java (53%) rename src/buttondevteam/alipresents/components/{gpowers => gpower}/PoweredPlayer.java (88%) rename src/buttondevteam/alipresents/components/{gpowers => gpower}/api/GPowerAPI.java (94%) rename src/buttondevteam/alipresents/components/{gpowers => gpower}/commands/GPower.java (88%) rename src/buttondevteam/alipresents/components/{gpowers => gpower}/enchant/EnchantingLoop.java (79%) rename src/buttondevteam/alipresents/components/{gpowers => gpower}/powerstate/PowerAll.java (76%) rename src/buttondevteam/alipresents/components/{gpowers => gpower}/powerstate/PowerDown.java (73%) rename src/buttondevteam/alipresents/components/{gpowers => gpower}/powerstate/PowerUp.java (74%) diff --git a/plugin.yml b/plugin.yml index f2f172d..33b77f6 100644 --- a/plugin.yml +++ b/plugin.yml @@ -3,71 +3,23 @@ name: AliPresents version: 2.0.2 commands: - flairme: - description: Activates the Flair Me Command. Ask Ali - she was tired when writing this description - gpower: - description: Testing command for ghostie powers - powerup: - description: Official g-power command that activates the ghostie powerups - powerdown: - description: Offical g-power command that deactivates the ghostie powerups alilink: - description: Arguments - press or set - cbgm0: - description: Creative Boundaries Gamemode 0 - allows players to return to survival - cbgm1: - description: Creative Boundaries Gamemode 1 - allows players to access creative within their towns. Creative is removed outside of towns so be careful - setforceboundaries: - description: Should players automatically return to creative when outside town borders? Dickmode says yes. - joinminigame: - description: Join a Button Minigame - leaveminigame: - description: Leave a button minigame - listfighters: - description: List all fighters currently in a button minigame - setcolourspawn: - description: sets the spawn points for each colour in a button minigame - setmatchstate: - description: sets the current state of the ultrahardcore game. - addtouhc: - description: Adds a player to the UltraHardcore match - joinuhc: - description: This command allows you to join an UltraHardcore match - configurematch: - description: Configures an UltraHardcore match - schedulematch: - description: Schedules an UltraHardcore match - startmatch: - description: Starts an UltraHardcore match - spreadplayers: - description: Admin command that spreads players around an ultrahardcore match - teleporttouhc: - description: Teleports you to the ultrahardcore match - setuhclobby: - description: Sets the area where a uhc will take place - activatepowers: - description: Admin command that activates gpowers on a uhc - setworldborders: - description: sets the worldborders to a uhc match - startuhc: - description: starts an ultrahardcore match - starttimer: - description: starts an ultrahardcore timer - powerall: - description: activate every player's power - setproximitylocation: - description: sets one of two proximity blocks to create a space that players can change their flairs with using flairportals. Ask ali XD - getloginmetrics: - description: Gets metrics - getinsurance: - description: Gets insurance - getinsurancenugget: - description: Gets insurance nugget - getinsurancebar: - description: Gets insurance bar - getinsuranceblock: - description: Gets insurance block - createbankchest: - description: Creates a Bank Chest - getletterdye: - description: Creates Letter Dye \ No newline at end of file + description: creates wireless redstone + cashmob: + description: creates mobs + cb: + description: creates creative boundaries + debug: + description: debug commands + flaircolouring: + description: flaaairs + fruit: + description: fruits + gpower: + description: powerssss + insurance: + description: item block insurance + magic: + description: magic + metrics: + description: metrics system \ No newline at end of file diff --git a/src/buttondevteam/alipresents/AliPresents.java b/src/buttondevteam/alipresents/AliPresents.java index a7a7820..6092cf5 100644 --- a/src/buttondevteam/alipresents/AliPresents.java +++ b/src/buttondevteam/alipresents/AliPresents.java @@ -7,12 +7,11 @@ import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; import buttondevteam.alipresents.components.alilinks.AliLinkComponent; -import buttondevteam.alipresents.components.bankchest.BankChestComponent; import buttondevteam.alipresents.components.cashmob.CashMobComponent; import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesComponent; import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; import buttondevteam.alipresents.components.fruit.FruitComponent; -import buttondevteam.alipresents.components.gpowers.GPowerComponent; +import buttondevteam.alipresents.components.gpower.GPowerComponent; import buttondevteam.alipresents.components.insurance.InsuranceComponent; import buttondevteam.alipresents.components.magic.MagicComponent; import buttondevteam.alipresents.components.spawn.SpawnComponent; @@ -26,7 +25,6 @@ public class AliPresents extends JavaPlugin{ new AliLinkComponent().register(this); - new BankChestComponent().register(this); new CashMobComponent().register(this); new CreativeBoundariesComponent().register(this); new FlairColouringComponent().register(this); diff --git a/src/buttondevteam/alipresents/components/bankchest/BankChestComponent.java b/src/buttondevteam/alipresents/components/bankchest/BankChestComponent.java deleted file mode 100644 index a0fe761..0000000 --- a/src/buttondevteam/alipresents/components/bankchest/BankChestComponent.java +++ /dev/null @@ -1,15 +0,0 @@ -package buttondevteam.alipresents.components.bankchest; - -import org.bukkit.plugin.java.JavaPlugin; - -import buttondevteam.alipresents.architecture.Component; - -public class BankChestComponent extends Component { - - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new CreateBankChest()); - registerListener(plugin, new BankChestListener()); - } - -} diff --git a/src/buttondevteam/alipresents/components/bankchest/BankChestListener.java b/src/buttondevteam/alipresents/components/bankchest/BankChestListener.java deleted file mode 100644 index b13dbba..0000000 --- a/src/buttondevteam/alipresents/components/bankchest/BankChestListener.java +++ /dev/null @@ -1,6 +0,0 @@ -package buttondevteam.alipresents.components.bankchest; - -import org.bukkit.event.Listener; - -public class BankChestListener implements Listener { -} diff --git a/src/buttondevteam/alipresents/components/bankchest/CreateBankChest.java b/src/buttondevteam/alipresents/components/bankchest/CreateBankChest.java deleted file mode 100644 index 6af2665..0000000 --- a/src/buttondevteam/alipresents/components/bankchest/CreateBankChest.java +++ /dev/null @@ -1,15 +0,0 @@ -package buttondevteam.alipresents.components.bankchest; - -import org.bukkit.entity.Player; - -import buttondevteam.alipresents.architecture.commands.ModCommand; - -public class CreateBankChest extends ModCommand { - - @Override - public boolean OnCommand(Player player, String alias, String[] args) { - // TODO Auto-generated method stub - return false; - } - -} diff --git a/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm0.java b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm0.java index 17d6dda..2d026df 100644 --- a/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm0.java +++ b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm0.java @@ -6,6 +6,10 @@ import buttondevteam.alipresents.architecture.commands.PlayerCommand; import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesAPI; public class Cbgm0 extends PlayerCommand{ + @Override + public String GetCommandPath() { + return "cb gm1"; + } @Override public boolean OnCommand(Player player, String arg2, String[] arg3) { CreativeBoundariesAPI.toSurvival(player); diff --git a/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm1.java b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm1.java index 9266a52..aa78055 100644 --- a/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm1.java +++ b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm1.java @@ -6,6 +6,10 @@ import buttondevteam.alipresents.architecture.commands.PlayerCommand; import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesAPI; public class Cbgm1 extends PlayerCommand { + @Override + public String GetCommandPath() { + return "cb gm0"; + } @Override public boolean OnCommand(Player player, String arg2, String[] arg3) { return CreativeBoundariesAPI.toCreative(player); diff --git a/src/buttondevteam/alipresents/components/creativeboundaries/commands/SetForceBoundaries.java b/src/buttondevteam/alipresents/components/creativeboundaries/commands/SetForceBoundaries.java index 22d2c98..ebc527f 100644 --- a/src/buttondevteam/alipresents/components/creativeboundaries/commands/SetForceBoundaries.java +++ b/src/buttondevteam/alipresents/components/creativeboundaries/commands/SetForceBoundaries.java @@ -6,6 +6,11 @@ import buttondevteam.alipresents.architecture.commands.ModCommand; import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesAPI; public class SetForceBoundaries extends ModCommand{ + + @Override + public String GetCommandPath() { + return "cb set forceboundaries"; + } @Override public boolean OnCommand(Player player, String label, String[] args) { return (CreativeBoundariesAPI.setForceBoundaries(player, args)); diff --git a/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/GetLetterDye.java b/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/GetLetterDye.java index efe7fa5..e88153b 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/GetLetterDye.java +++ b/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/GetLetterDye.java @@ -5,6 +5,10 @@ import org.bukkit.entity.Player; import buttondevteam.alipresents.architecture.commands.PlayerCommand; public class GetLetterDye extends PlayerCommand{ + @Override + public String GetCommandPath() { + return "flaircolour getletterdye"; + } @Override public boolean OnCommand(Player player, String alias, String[] args) { player.getInventory().addItem(LetterDye.getLetterDye()); diff --git a/src/buttondevteam/alipresents/components/flaircolouring/portals/FlairMe.java b/src/buttondevteam/alipresents/components/flaircolouring/portals/FlairMe.java index 6595949..e14ddb8 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/portals/FlairMe.java +++ b/src/buttondevteam/alipresents/components/flaircolouring/portals/FlairMe.java @@ -6,6 +6,10 @@ import buttondevteam.alipresents.architecture.commands.PlayerCommand; import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; public class FlairMe extends PlayerCommand { + @Override + public String GetCommandPath() { + return "flaircolouring flairme"; + } private FlairColouringComponent component; public FlairMe(FlairColouringComponent flairDoorComponent) { diff --git a/src/buttondevteam/alipresents/components/gpowers/GPowerComponent.java b/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java similarity index 53% rename from src/buttondevteam/alipresents/components/gpowers/GPowerComponent.java rename to src/buttondevteam/alipresents/components/gpower/GPowerComponent.java index 9e9ce33..295cc6b 100644 --- a/src/buttondevteam/alipresents/components/gpowers/GPowerComponent.java +++ b/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java @@ -1,12 +1,12 @@ -package buttondevteam.alipresents.components.gpowers; +package buttondevteam.alipresents.components.gpower; import org.bukkit.plugin.java.JavaPlugin; import buttondevteam.alipresents.architecture.Component; -import buttondevteam.alipresents.components.gpowers.commands.GPower; -import buttondevteam.alipresents.components.gpowers.enchant.EnchantingLoop; -import buttondevteam.alipresents.components.gpowers.powerstate.PowerDown; -import buttondevteam.alipresents.components.gpowers.powerstate.PowerUp; +import buttondevteam.alipresents.components.gpower.commands.GPower; +import buttondevteam.alipresents.components.gpower.enchant.EnchantingLoop; +import buttondevteam.alipresents.components.gpower.powerstate.PowerDown; +import buttondevteam.alipresents.components.gpower.powerstate.PowerUp; public class GPowerComponent extends Component { diff --git a/src/buttondevteam/alipresents/components/gpowers/PoweredPlayer.java b/src/buttondevteam/alipresents/components/gpower/PoweredPlayer.java similarity index 88% rename from src/buttondevteam/alipresents/components/gpowers/PoweredPlayer.java rename to src/buttondevteam/alipresents/components/gpower/PoweredPlayer.java index 7e33220..8915b13 100644 --- a/src/buttondevteam/alipresents/components/gpowers/PoweredPlayer.java +++ b/src/buttondevteam/alipresents/components/gpower/PoweredPlayer.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.gpowers; +package buttondevteam.alipresents.components.gpower; import java.util.UUID; diff --git a/src/buttondevteam/alipresents/components/gpowers/api/GPowerAPI.java b/src/buttondevteam/alipresents/components/gpower/api/GPowerAPI.java similarity index 94% rename from src/buttondevteam/alipresents/components/gpowers/api/GPowerAPI.java rename to src/buttondevteam/alipresents/components/gpower/api/GPowerAPI.java index 76ccfa9..3596613 100644 --- a/src/buttondevteam/alipresents/components/gpowers/api/GPowerAPI.java +++ b/src/buttondevteam/alipresents/components/gpower/api/GPowerAPI.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.gpowers.api; +package buttondevteam.alipresents.components.gpower.api; import java.util.HashMap; import java.util.Map; @@ -9,7 +9,7 @@ import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -import buttondevteam.alipresents.components.gpowers.PoweredPlayer; +import buttondevteam.alipresents.components.gpower.PoweredPlayer; public class GPowerAPI{ public static final int defaultPowerLength = 300; diff --git a/src/buttondevteam/alipresents/components/gpowers/commands/GPower.java b/src/buttondevteam/alipresents/components/gpower/commands/GPower.java similarity index 88% rename from src/buttondevteam/alipresents/components/gpowers/commands/GPower.java rename to src/buttondevteam/alipresents/components/gpower/commands/GPower.java index 8b9abac..9c95f31 100644 --- a/src/buttondevteam/alipresents/components/gpowers/commands/GPower.java +++ b/src/buttondevteam/alipresents/components/gpower/commands/GPower.java @@ -1,11 +1,15 @@ -package buttondevteam.alipresents.components.gpowers.commands; +package buttondevteam.alipresents.components.gpower.commands; import org.bukkit.entity.Player; import buttondevteam.alipresents.architecture.commands.PlayerCommand; -import buttondevteam.alipresents.components.gpowers.api.GPowerAPI; +import buttondevteam.alipresents.components.gpower.api.GPowerAPI; public class GPower extends PlayerCommand { + @Override + public String GetCommandPath() { + return "gpower"; + } @Override public boolean OnCommand(Player player, String label, String[] args) { if (args.length < 2) { @@ -36,11 +40,6 @@ public class GPower extends PlayerCommand { return true; } - - @Override - public String GetCommandPath() { - return "gpower"; - } public String[] GetHelpText(String alias){ return new String[]{ "Usage: /gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]" diff --git a/src/buttondevteam/alipresents/components/gpowers/enchant/EnchantingLoop.java b/src/buttondevteam/alipresents/components/gpower/enchant/EnchantingLoop.java similarity index 79% rename from src/buttondevteam/alipresents/components/gpowers/enchant/EnchantingLoop.java rename to src/buttondevteam/alipresents/components/gpower/enchant/EnchantingLoop.java index 5cb224e..0cc205b 100644 --- a/src/buttondevteam/alipresents/components/gpowers/enchant/EnchantingLoop.java +++ b/src/buttondevteam/alipresents/components/gpower/enchant/EnchantingLoop.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.gpowers.enchant; +package buttondevteam.alipresents.components.gpower.enchant; import org.bukkit.Server; import org.bukkit.entity.Player; @@ -6,7 +6,7 @@ import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; -import buttondevteam.alipresents.components.gpowers.api.GPowerAPI; +import buttondevteam.alipresents.components.gpower.api.GPowerAPI; public class EnchantingLoop extends BukkitRunnable implements Listener{ private Server server; diff --git a/src/buttondevteam/alipresents/components/gpowers/powerstate/PowerAll.java b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerAll.java similarity index 76% rename from src/buttondevteam/alipresents/components/gpowers/powerstate/PowerAll.java rename to src/buttondevteam/alipresents/components/gpower/powerstate/PowerAll.java index 525a728..2da86db 100644 --- a/src/buttondevteam/alipresents/components/gpowers/powerstate/PowerAll.java +++ b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerAll.java @@ -1,9 +1,9 @@ -package buttondevteam.alipresents.components.gpowers.powerstate; +package buttondevteam.alipresents.components.gpower.powerstate; import org.bukkit.entity.Player; import buttondevteam.alipresents.architecture.commands.ModCommand; -import buttondevteam.alipresents.components.gpowers.api.GPowerAPI; +import buttondevteam.alipresents.components.gpower.api.GPowerAPI; public class PowerAll extends ModCommand{ @Override diff --git a/src/buttondevteam/alipresents/components/gpowers/powerstate/PowerDown.java b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerDown.java similarity index 73% rename from src/buttondevteam/alipresents/components/gpowers/powerstate/PowerDown.java rename to src/buttondevteam/alipresents/components/gpower/powerstate/PowerDown.java index 4217219..4f60034 100644 --- a/src/buttondevteam/alipresents/components/gpowers/powerstate/PowerDown.java +++ b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerDown.java @@ -1,9 +1,9 @@ -package buttondevteam.alipresents.components.gpowers.powerstate; +package buttondevteam.alipresents.components.gpower.powerstate; import org.bukkit.entity.Player; import buttondevteam.alipresents.architecture.commands.PlayerCommand; -import buttondevteam.alipresents.components.gpowers.api.GPowerAPI; +import buttondevteam.alipresents.components.gpower.api.GPowerAPI; public class PowerDown extends PlayerCommand { @Override diff --git a/src/buttondevteam/alipresents/components/gpowers/powerstate/PowerUp.java b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerUp.java similarity index 74% rename from src/buttondevteam/alipresents/components/gpowers/powerstate/PowerUp.java rename to src/buttondevteam/alipresents/components/gpower/powerstate/PowerUp.java index 050f08f..b3d7f96 100644 --- a/src/buttondevteam/alipresents/components/gpowers/powerstate/PowerUp.java +++ b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerUp.java @@ -1,9 +1,9 @@ -package buttondevteam.alipresents.components.gpowers.powerstate; +package buttondevteam.alipresents.components.gpower.powerstate; import org.bukkit.entity.Player; import buttondevteam.alipresents.architecture.commands.PlayerCommand; -import buttondevteam.alipresents.components.gpowers.api.GPowerAPI; +import buttondevteam.alipresents.components.gpower.api.GPowerAPI; public class PowerUp extends PlayerCommand { @Override diff --git a/src/buttondevteam/alipresents/components/insurance/getInsurance.java b/src/buttondevteam/alipresents/components/insurance/getInsurance.java index c760f5d..6a687ea 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsurance.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsurance.java @@ -51,4 +51,9 @@ public class getInsurance extends ModCommand { }; } + @Override + public String GetCommandPath() { + return "insurance get"; + } + } diff --git a/src/buttondevteam/alipresents/components/insurance/getInsuranceBar.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceBar.java index af00805..13f3339 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsuranceBar.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceBar.java @@ -17,4 +17,9 @@ public class getInsuranceBar extends ModCommand { } return true; } + + @Override + public String GetCommandPath() { + return "insurance getBar"; + } } diff --git a/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java index 37b4173..f671c12 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java @@ -18,4 +18,8 @@ public class getInsuranceBlock extends ModCommand { return false; } + @Override + public String GetCommandPath() { + return "insurance getblock"; + } } diff --git a/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java index 8363916..5ccaa03 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java @@ -17,5 +17,9 @@ public class getInsuranceNugget extends ModCommand { } return false; } + @Override + public String GetCommandPath() { + return "insurance getnugget"; + } } diff --git a/src/buttondevteam/alipresents/components/metrics/output/GetLoginMetrics.java b/src/buttondevteam/alipresents/components/metrics/output/GetLoginMetrics.java index 3778d0f..628b847 100644 --- a/src/buttondevteam/alipresents/components/metrics/output/GetLoginMetrics.java +++ b/src/buttondevteam/alipresents/components/metrics/output/GetLoginMetrics.java @@ -65,4 +65,9 @@ public class GetLoginMetrics extends ModCommand{ } return true; } + + @Override + public String GetCommandPath() { + return "metrics get logins"; + } } From 27f73ae61f100c34ceb2dc4e98e4a115e30782c5 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Dec 2016 02:40:25 -0500 Subject: [PATCH 222/263] Subcommanded all the commands --- plugin.yml | 2 +- src/buttondevteam/alipresents/AliPresents.java | 4 ++-- .../architecture/commands/PlayerCommand.java | 6 ++++-- .../FlairColourAPI.java} | 4 ++-- .../FlairColourComponent.java} | 18 +++++++++--------- .../letterdyes/GetLetterDye.java | 2 +- .../letterdyes/LetterDye.java | 2 +- .../letterdyes/LetterDyeListener.java | 6 +++--- .../portals/FlairMe.java | 10 +++++----- .../portals/PlayerProximityLoop.java | 8 ++++---- .../portals/PortalListener.java | 14 +++++++------- .../portals/SetProximityLocation.java | 7 ++++++- .../components/gpower/powerstate/PowerAll.java | 4 ++++ .../gpower/powerstate/PowerDown.java | 5 +++++ .../components/gpower/powerstate/PowerUp.java | 4 ++++ 15 files changed, 58 insertions(+), 38 deletions(-) rename src/buttondevteam/alipresents/components/{flaircolouring/FlairColouringAPI.java => flaircolour/FlairColourAPI.java} (96%) rename src/buttondevteam/alipresents/components/{flaircolouring/FlairColouringComponent.java => flaircolour/FlairColourComponent.java} (60%) rename src/buttondevteam/alipresents/components/{flaircolouring => flaircolour}/letterdyes/GetLetterDye.java (84%) rename src/buttondevteam/alipresents/components/{flaircolouring => flaircolour}/letterdyes/LetterDye.java (86%) rename src/buttondevteam/alipresents/components/{flaircolouring => flaircolour}/letterdyes/LetterDyeListener.java (83%) rename src/buttondevteam/alipresents/components/{flaircolouring => flaircolour}/portals/FlairMe.java (67%) rename src/buttondevteam/alipresents/components/{flaircolouring => flaircolour}/portals/PlayerProximityLoop.java (87%) rename src/buttondevteam/alipresents/components/{flaircolouring => flaircolour}/portals/PortalListener.java (76%) rename src/buttondevteam/alipresents/components/{flaircolouring => flaircolour}/portals/SetProximityLocation.java (86%) diff --git a/plugin.yml b/plugin.yml index 33b77f6..3e396be 100644 --- a/plugin.yml +++ b/plugin.yml @@ -11,7 +11,7 @@ commands: description: creates creative boundaries debug: description: debug commands - flaircolouring: + flaircolour: description: flaaairs fruit: description: fruits diff --git a/src/buttondevteam/alipresents/AliPresents.java b/src/buttondevteam/alipresents/AliPresents.java index 6092cf5..dcc752c 100644 --- a/src/buttondevteam/alipresents/AliPresents.java +++ b/src/buttondevteam/alipresents/AliPresents.java @@ -9,7 +9,7 @@ import org.bukkit.plugin.java.JavaPlugin; import buttondevteam.alipresents.components.alilinks.AliLinkComponent; import buttondevteam.alipresents.components.cashmob.CashMobComponent; import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesComponent; -import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; +import buttondevteam.alipresents.components.flaircolour.FlairColourComponent; import buttondevteam.alipresents.components.fruit.FruitComponent; import buttondevteam.alipresents.components.gpower.GPowerComponent; import buttondevteam.alipresents.components.insurance.InsuranceComponent; @@ -27,7 +27,7 @@ public class AliPresents extends JavaPlugin{ new AliLinkComponent().register(this); new CashMobComponent().register(this); new CreativeBoundariesComponent().register(this); - new FlairColouringComponent().register(this); + new FlairColourComponent().register(this); new FruitComponent().register(this); new GPowerComponent().register(this); new InsuranceComponent().register(this); diff --git a/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java b/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java index fa0282d..df0b997 100644 --- a/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java +++ b/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java @@ -7,12 +7,14 @@ import org.bukkit.entity.Player; public abstract class PlayerCommand extends BaseCommand{ /**replaces CommandExecutor functionality*/ @Override - public boolean onCommand(CommandSender commandSender, Command command, String string, String[] args){ - return OnCommand(commandSender, string, args); + public boolean onCommand(CommandSender sender, Command command, String string, String[] args){ + sender.sendMessage("activating" + string.toString()); + return OnCommand(sender, string, args); } /**replaces TBMCCommandBase functionality*/ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args){ + sender.sendMessage("activating" + alias.toString()); return OnCommand((Player) sender, alias, args); } public abstract boolean OnCommand(Player player, String alias, String[] args); diff --git a/src/buttondevteam/alipresents/components/flaircolouring/FlairColouringAPI.java b/src/buttondevteam/alipresents/components/flaircolour/FlairColourAPI.java similarity index 96% rename from src/buttondevteam/alipresents/components/flaircolouring/FlairColouringAPI.java rename to src/buttondevteam/alipresents/components/flaircolour/FlairColourAPI.java index 91a2bba..24dcd6f 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/FlairColouringAPI.java +++ b/src/buttondevteam/alipresents/components/flaircolour/FlairColourAPI.java @@ -1,10 +1,10 @@ -package buttondevteam.alipresents.components.flaircolouring; +package buttondevteam.alipresents.components.flaircolour; import org.bukkit.DyeColor; import com.earth2me.essentials.User; -public class FlairColouringAPI { +public class FlairColourAPI { public static void recolourPlayer(User user, DyeColor dyecolour){ String name = user._getNickname(); String sanitizedName = ""; diff --git a/src/buttondevteam/alipresents/components/flaircolouring/FlairColouringComponent.java b/src/buttondevteam/alipresents/components/flaircolour/FlairColourComponent.java similarity index 60% rename from src/buttondevteam/alipresents/components/flaircolouring/FlairColouringComponent.java rename to src/buttondevteam/alipresents/components/flaircolour/FlairColourComponent.java index 04b6575..d8f0485 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/FlairColouringComponent.java +++ b/src/buttondevteam/alipresents/components/flaircolour/FlairColourComponent.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.flaircolouring; +package buttondevteam.alipresents.components.flaircolour; import java.util.ArrayList; import java.util.List; @@ -13,15 +13,15 @@ import org.bukkit.plugin.java.JavaPlugin; import com.earth2me.essentials.Essentials; import buttondevteam.alipresents.architecture.Component; -import buttondevteam.alipresents.components.flaircolouring.letterdyes.GetLetterDye; -import buttondevteam.alipresents.components.flaircolouring.letterdyes.LetterDye; -import buttondevteam.alipresents.components.flaircolouring.letterdyes.LetterDyeListener; -import buttondevteam.alipresents.components.flaircolouring.portals.FlairMe; -import buttondevteam.alipresents.components.flaircolouring.portals.PlayerProximityLoop; -import buttondevteam.alipresents.components.flaircolouring.portals.PortalListener; -import buttondevteam.alipresents.components.flaircolouring.portals.SetProximityLocation; +import buttondevteam.alipresents.components.flaircolour.letterdyes.GetLetterDye; +import buttondevteam.alipresents.components.flaircolour.letterdyes.LetterDye; +import buttondevteam.alipresents.components.flaircolour.letterdyes.LetterDyeListener; +import buttondevteam.alipresents.components.flaircolour.portals.FlairMe; +import buttondevteam.alipresents.components.flaircolour.portals.PlayerProximityLoop; +import buttondevteam.alipresents.components.flaircolour.portals.PortalListener; +import buttondevteam.alipresents.components.flaircolour.portals.SetProximityLocation; -public class FlairColouringComponent extends Component { +public class FlairColourComponent extends Component { public List playersToBeFlaired = new ArrayList(); @Override public void register(JavaPlugin plugin) { diff --git a/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/GetLetterDye.java b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/GetLetterDye.java similarity index 84% rename from src/buttondevteam/alipresents/components/flaircolouring/letterdyes/GetLetterDye.java rename to src/buttondevteam/alipresents/components/flaircolour/letterdyes/GetLetterDye.java index e88153b..95597ff 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/GetLetterDye.java +++ b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/GetLetterDye.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.flaircolouring.letterdyes; +package buttondevteam.alipresents.components.flaircolour.letterdyes; import org.bukkit.entity.Player; diff --git a/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDye.java b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/LetterDye.java similarity index 86% rename from src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDye.java rename to src/buttondevteam/alipresents/components/flaircolour/letterdyes/LetterDye.java index 0c3cf0d..fa29f60 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDye.java +++ b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/LetterDye.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.flaircolouring.letterdyes; +package buttondevteam.alipresents.components.flaircolour.letterdyes; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; diff --git a/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDyeListener.java b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/LetterDyeListener.java similarity index 83% rename from src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDyeListener.java rename to src/buttondevteam/alipresents/components/flaircolour/letterdyes/LetterDyeListener.java index 0e20ba9..7668acb 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/letterdyes/LetterDyeListener.java +++ b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/LetterDyeListener.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.flaircolouring.letterdyes; +package buttondevteam.alipresents.components.flaircolour.letterdyes; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; @@ -12,7 +12,7 @@ import org.bukkit.material.Dye; import com.earth2me.essentials.Essentials; import com.earth2me.essentials.User; -import buttondevteam.alipresents.components.flaircolouring.FlairColouringAPI; +import buttondevteam.alipresents.components.flaircolour.FlairColourAPI; public class LetterDyeListener implements Listener{ private Essentials essentials; @@ -32,7 +32,7 @@ public class LetterDyeListener implements Listener{ Dye dye = (Dye) event.getItem().getData(); User user = essentials.getUser(event.getPlayer()); - user.setNickname(FlairColouringAPI.colourShiftRight(user._getNickname(), dye.getColor())); + user.setNickname(FlairColourAPI.colourShiftRight(user._getNickname(), dye.getColor())); }catch(Exception e){ event.getPlayer().sendMessage(e.getStackTrace().toString()); } diff --git a/src/buttondevteam/alipresents/components/flaircolouring/portals/FlairMe.java b/src/buttondevteam/alipresents/components/flaircolour/portals/FlairMe.java similarity index 67% rename from src/buttondevteam/alipresents/components/flaircolouring/portals/FlairMe.java rename to src/buttondevteam/alipresents/components/flaircolour/portals/FlairMe.java index e14ddb8..b72ff55 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/portals/FlairMe.java +++ b/src/buttondevteam/alipresents/components/flaircolour/portals/FlairMe.java @@ -1,18 +1,18 @@ -package buttondevteam.alipresents.components.flaircolouring.portals; +package buttondevteam.alipresents.components.flaircolour.portals; import org.bukkit.entity.Player; import buttondevteam.alipresents.architecture.commands.PlayerCommand; -import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; +import buttondevteam.alipresents.components.flaircolour.FlairColourComponent; public class FlairMe extends PlayerCommand { @Override public String GetCommandPath() { - return "flaircolouring flairme"; + return "flaircolour flairme"; } - private FlairColouringComponent component; - public FlairMe(FlairColouringComponent flairDoorComponent) { + private FlairColourComponent component; + public FlairMe(FlairColourComponent flairDoorComponent) { this.component = flairDoorComponent; } @Override diff --git a/src/buttondevteam/alipresents/components/flaircolouring/portals/PlayerProximityLoop.java b/src/buttondevteam/alipresents/components/flaircolour/portals/PlayerProximityLoop.java similarity index 87% rename from src/buttondevteam/alipresents/components/flaircolouring/portals/PlayerProximityLoop.java rename to src/buttondevteam/alipresents/components/flaircolour/portals/PlayerProximityLoop.java index d038db5..f21ffe9 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/portals/PlayerProximityLoop.java +++ b/src/buttondevteam/alipresents/components/flaircolour/portals/PlayerProximityLoop.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.flaircolouring.portals; +package buttondevteam.alipresents.components.flaircolour.portals; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -6,11 +6,11 @@ import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; -import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; +import buttondevteam.alipresents.components.flaircolour.FlairColourComponent; public class PlayerProximityLoop extends BukkitRunnable implements Listener{ private static JavaPlugin plugin; - private static FlairColouringComponent component; + private static FlairColourComponent component; private static Location startLocation; private static Location endLocation; @@ -21,7 +21,7 @@ public class PlayerProximityLoop extends BukkitRunnable implements Listener{ private static int eY; private static int eZ; - public PlayerProximityLoop(JavaPlugin plugin, FlairColouringComponent component) { + public PlayerProximityLoop(JavaPlugin plugin, FlairColourComponent component) { PlayerProximityLoop.plugin = plugin; PlayerProximityLoop.component = component; this.runTaskTimer(plugin, 0, 20); diff --git a/src/buttondevteam/alipresents/components/flaircolouring/portals/PortalListener.java b/src/buttondevteam/alipresents/components/flaircolour/portals/PortalListener.java similarity index 76% rename from src/buttondevteam/alipresents/components/flaircolouring/portals/PortalListener.java rename to src/buttondevteam/alipresents/components/flaircolour/portals/PortalListener.java index 89151c9..0e5b2c1 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/portals/PortalListener.java +++ b/src/buttondevteam/alipresents/components/flaircolour/portals/PortalListener.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.flaircolouring.portals; +package buttondevteam.alipresents.components.flaircolour.portals; import org.bukkit.Bukkit; import org.bukkit.DyeColor; @@ -13,17 +13,17 @@ import org.bukkit.plugin.java.JavaPlugin; import com.earth2me.essentials.Essentials; -import buttondevteam.alipresents.components.flaircolouring.FlairColouringAPI; -import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; +import buttondevteam.alipresents.components.flaircolour.FlairColourAPI; +import buttondevteam.alipresents.components.flaircolour.FlairColourComponent; public class PortalListener implements Listener{ public JavaPlugin plugin; Essentials essentials; - private FlairColouringComponent component; + private FlairColourComponent component; - public PortalListener(JavaPlugin plugin, FlairColouringComponent component) { + public PortalListener(JavaPlugin plugin, FlairColourComponent component) { this.plugin = plugin; this.component = component; this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials")); @@ -51,7 +51,7 @@ public class PortalListener implements Listener{ Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); //Block under middle block if(HigherBlock.getType() == Material.STONE){ - FlairColouringAPI.recolourPlayer(essentials.getUser(player), DyeColor.GRAY); + FlairColourAPI.recolourPlayer(essentials.getUser(player), DyeColor.GRAY); component.playersToBeFlaired.remove(player.getName()); return; } @@ -67,7 +67,7 @@ public class PortalListener implements Listener{ return; } - FlairColouringAPI.recolourPlayer(essentials.getUser(player), woolColour); + FlairColourAPI.recolourPlayer(essentials.getUser(player), woolColour); component.playersToBeFlaired.remove(player.getName()); } diff --git a/src/buttondevteam/alipresents/components/flaircolouring/portals/SetProximityLocation.java b/src/buttondevteam/alipresents/components/flaircolour/portals/SetProximityLocation.java similarity index 86% rename from src/buttondevteam/alipresents/components/flaircolouring/portals/SetProximityLocation.java rename to src/buttondevteam/alipresents/components/flaircolour/portals/SetProximityLocation.java index 51fb0bc..2f6b910 100644 --- a/src/buttondevteam/alipresents/components/flaircolouring/portals/SetProximityLocation.java +++ b/src/buttondevteam/alipresents/components/flaircolour/portals/SetProximityLocation.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.flaircolouring.portals; +package buttondevteam.alipresents.components.flaircolour.portals; import org.bukkit.entity.Player; @@ -36,4 +36,9 @@ public class SetProximityLocation extends ModCommand{ "change their colour state." }; } + @Override + public String GetCommandPath() { + return "flaircolour setproximitylocation"; + } + } diff --git a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerAll.java b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerAll.java index 2da86db..f1093ab 100644 --- a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerAll.java +++ b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerAll.java @@ -16,4 +16,8 @@ public class PowerAll extends ModCommand{ "Usage: Type /PowerAll to activate all powers for all players with gpowers" }; } + @Override + public String GetCommandPath() { + return "gpower powerall"; + } } diff --git a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerDown.java b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerDown.java index 4f60034..a1404f5 100644 --- a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerDown.java +++ b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerDown.java @@ -17,4 +17,9 @@ public class PowerDown extends PlayerCommand { "Usage: Type /PowerDown to disable your g-power" }; } + + @Override + public String GetCommandPath() { + return "gpower powerdown"; + } } diff --git a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerUp.java b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerUp.java index b3d7f96..46baa89 100644 --- a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerUp.java +++ b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerUp.java @@ -17,4 +17,8 @@ public class PowerUp extends PlayerCommand { "Usage: Type /PowerUp to activate your registered G-Power" }; } + @Override + public String GetCommandPath() { + return "gpower powerup"; + } } From baf804ddc0f665b7d1a433618f0772a7baa53bec Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Dec 2016 03:31:17 -0500 Subject: [PATCH 223/263] #27 fixed gm swap --- .../components/creativeboundaries/commands/Cbgm0.java | 2 +- .../components/creativeboundaries/commands/Cbgm1.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm0.java b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm0.java index 2d026df..d5dd890 100644 --- a/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm0.java +++ b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm0.java @@ -8,7 +8,7 @@ import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundarie public class Cbgm0 extends PlayerCommand{ @Override public String GetCommandPath() { - return "cb gm1"; + return "cb gm0"; } @Override public boolean OnCommand(Player player, String arg2, String[] arg3) { diff --git a/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm1.java b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm1.java index aa78055..b0ea0e2 100644 --- a/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm1.java +++ b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm1.java @@ -8,7 +8,7 @@ import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundarie public class Cbgm1 extends PlayerCommand { @Override public String GetCommandPath() { - return "cb gm0"; + return "cb gm1"; } @Override public boolean OnCommand(Player player, String arg2, String[] arg3) { From 248f54e3ec6e8b64b4d653612ad80d5969b21185 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Dec 2016 03:59:22 -0500 Subject: [PATCH 224/263] Fixed all bugs except implementation --- .../components/insurance/InsuranceComponent.java | 2 +- .../components/insurance/getInsurance.java | 14 +++++++++++--- .../components/insurance/getInsuranceBlock.java | 11 ++++++++++- ...getInsuranceBar.java => getInsuranceIngot.java} | 12 ++++++++++-- .../components/insurance/getInsuranceNugget.java | 10 +++++++++- 5 files changed, 41 insertions(+), 8 deletions(-) rename src/buttondevteam/alipresents/components/insurance/{getInsuranceBar.java => getInsuranceIngot.java} (69%) diff --git a/src/buttondevteam/alipresents/components/insurance/InsuranceComponent.java b/src/buttondevteam/alipresents/components/insurance/InsuranceComponent.java index 1099605..ee053f6 100644 --- a/src/buttondevteam/alipresents/components/insurance/InsuranceComponent.java +++ b/src/buttondevteam/alipresents/components/insurance/InsuranceComponent.java @@ -10,7 +10,7 @@ public class InsuranceComponent extends Component { public void register(JavaPlugin plugin) { registerCommand(plugin, new getInsurance()); registerCommand(plugin, new getInsuranceNugget()); - registerCommand(plugin, new getInsuranceBar()); + registerCommand(plugin, new getInsuranceIngot()); registerCommand(plugin, new getInsuranceBlock()); } diff --git a/src/buttondevteam/alipresents/components/insurance/getInsurance.java b/src/buttondevteam/alipresents/components/insurance/getInsurance.java index 6a687ea..aba87bb 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsurance.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsurance.java @@ -15,9 +15,9 @@ public class getInsurance extends ModCommand { InsuranceType insuranceType = defaultInsuranceType; switch(args.length){ - case 0: + case 0: // no arguments break; - case 1: + case 1: // or argument if (StringUtils.isNumeric(args[0])){ amount = Integer.parseInt(args[0]); break; @@ -25,14 +25,22 @@ public class getInsurance extends ModCommand { insuranceType = InsuranceType.valueOf(args[0]); break; }else{ + player.sendMessage("Invalid Argument " + args[0]); + player.sendMessage("Enter a type of insurance or a number as an argument"); + player.sendMessage(Insurance.InsuranceType.values().toString()); return false; } - default: + default: + // argument if (StringUtils.isNumeric(args[0]) && Insurance.isInsuranceType(args[1])){ amount = Integer.parseInt(args[0]); insuranceType = InsuranceType.valueOf(args[0]); break; }else{ + player.sendMessage("Invalid Argument " + args[0] + "|" + args[1]); + player.sendMessage("Usage /" + this.GetCommandPath() + + " " + + " <" + Insurance.InsuranceType.values().toString() + ">"); return false; } } diff --git a/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java index f671c12..cfbc15d 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java @@ -15,11 +15,20 @@ public class getInsuranceBlock extends ModCommand { }else{ player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block)); } - return false; + return true; } @Override public String GetCommandPath() { return "insurance getblock"; } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: /insurance getblock [amount]", + "This command returns an insurance block, which on death,", + "splits into 9 insurance ingot which each saves 1 row of", + "inventory per ingot" + }; + } } diff --git a/src/buttondevteam/alipresents/components/insurance/getInsuranceBar.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceIngot.java similarity index 69% rename from src/buttondevteam/alipresents/components/insurance/getInsuranceBar.java rename to src/buttondevteam/alipresents/components/insurance/getInsuranceIngot.java index 13f3339..bfd71dc 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsuranceBar.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceIngot.java @@ -6,7 +6,7 @@ import org.bukkit.entity.Player; import buttondevteam.alipresents.architecture.commands.ModCommand; import buttondevteam.alipresents.components.insurance.Insurance.InsuranceType; -public class getInsuranceBar extends ModCommand { +public class getInsuranceIngot extends ModCommand { @Override public boolean OnCommand(Player player, String alias, String[] args) { @@ -20,6 +20,14 @@ public class getInsuranceBar extends ModCommand { @Override public String GetCommandPath() { - return "insurance getBar"; + return "insurance getingot"; + } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: /insurance getingot [amount]", + "This command returns an insurance ingot, which on death,", + "saves one row of inventory" + }; } } diff --git a/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java index 5ccaa03..42e2c62 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java @@ -15,11 +15,19 @@ public class getInsuranceNugget extends ModCommand { }else{ player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Nugget)); } - return false; + return true; } @Override public String GetCommandPath() { return "insurance getnugget"; } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: /insurance getnugget [amount]", + "This command returns an insurance nugget, which on death,", + "saves one itemslot in the inventory" + }; + } } From 812dd89ee0f2e2cb335d81ee6301f8c5d4694e7e Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Dec 2016 04:23:57 -0500 Subject: [PATCH 225/263] #27 Actually fixed the thing --- .../alipresents/architecture/Component.java | 1 - .../components/gpower/GPowerComponent.java | 4 +- .../commands/{GPower.java => Test.java} | 99 ++++++++++--------- 3 files changed, 53 insertions(+), 51 deletions(-) rename src/buttondevteam/alipresents/components/gpower/commands/{GPower.java => Test.java} (78%) diff --git a/src/buttondevteam/alipresents/architecture/Component.java b/src/buttondevteam/alipresents/architecture/Component.java index a08bee6..af43424 100644 --- a/src/buttondevteam/alipresents/architecture/Component.java +++ b/src/buttondevteam/alipresents/architecture/Component.java @@ -21,7 +21,6 @@ import buttondevteam.lib.chat.TBMCChatAPI; * */ public abstract class Component{ - /** * Registers the module, when called by the JavaPlugin class. Call * registerCommand() and registerListener() within this method. diff --git a/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java b/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java index 295cc6b..1d85e84 100644 --- a/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java +++ b/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java @@ -3,7 +3,7 @@ package buttondevteam.alipresents.components.gpower; import org.bukkit.plugin.java.JavaPlugin; import buttondevteam.alipresents.architecture.Component; -import buttondevteam.alipresents.components.gpower.commands.GPower; +import buttondevteam.alipresents.components.gpower.commands.Test; import buttondevteam.alipresents.components.gpower.enchant.EnchantingLoop; import buttondevteam.alipresents.components.gpower.powerstate.PowerDown; import buttondevteam.alipresents.components.gpower.powerstate.PowerUp; @@ -12,7 +12,7 @@ public class GPowerComponent extends Component { @Override public void register(JavaPlugin plugin) { - registerCommand(plugin, new GPower()); + registerCommand(plugin, new Test()); registerCommand(plugin, new PowerUp()); registerCommand(plugin, new PowerDown()); diff --git a/src/buttondevteam/alipresents/components/gpower/commands/GPower.java b/src/buttondevteam/alipresents/components/gpower/commands/Test.java similarity index 78% rename from src/buttondevteam/alipresents/components/gpower/commands/GPower.java rename to src/buttondevteam/alipresents/components/gpower/commands/Test.java index 9c95f31..07dc669 100644 --- a/src/buttondevteam/alipresents/components/gpower/commands/GPower.java +++ b/src/buttondevteam/alipresents/components/gpower/commands/Test.java @@ -1,48 +1,51 @@ -package buttondevteam.alipresents.components.gpower.commands; - -import org.bukkit.entity.Player; - -import buttondevteam.alipresents.architecture.commands.PlayerCommand; -import buttondevteam.alipresents.components.gpower.api.GPowerAPI; - -public class GPower extends PlayerCommand { - @Override - public String GetCommandPath() { - return "gpower"; - } - @Override - public boolean OnCommand(Player player, String label, String[] args) { - if (args.length < 2) { - player.sendMessage("Proper Usage to test G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); - return false; - } - String colour; - if (args[0].startsWith("r") || args[0].startsWith("o") || args[0].startsWith("y") || args[0].startsWith("g") - || args[0].startsWith("b") || args[0].startsWith("p")) { - colour = args[0]; - } else { - player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); - return false; - } - boolean isActive; - if (args[1].startsWith("t")) { - isActive = true; - } else if (args[1].startsWith("f")) { - isActive = false; - } else { - player.sendMessage("error: active. Proper Usage to configure G-Powers:"); - return false; - } - player.sendMessage("Terms Vaild!"); - player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); - GPowerAPI.addPlayer(player, colour, isActive); - - return true; - } - public String[] GetHelpText(String alias){ - return new String[]{ - "Usage: /gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]" - }; - } -} +package buttondevteam.alipresents.components.gpower.commands; + +import org.bukkit.entity.Player; + +import buttondevteam.alipresents.architecture.commands.ModCommand; +import buttondevteam.alipresents.components.gpower.api.GPowerAPI; + +public class Test extends ModCommand{ + + @Override + public boolean OnCommand(Player player, String alias, String[] args) { + if (args.length < 2) { + player.sendMessage("Proper Usage to test G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + String colour; + if (args[0].startsWith("r") || args[0].startsWith("o") || args[0].startsWith("y") || args[0].startsWith("g") + || args[0].startsWith("b") || args[0].startsWith("p")) { + colour = args[0]; + } else { + player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); + return false; + } + boolean isActive; + if (args[1].startsWith("t")) { + isActive = true; + } else if (args[1].startsWith("f")) { + isActive = false; + } else { + player.sendMessage("error: active. Proper Usage to configure G-Powers:"); + return false; + } + player.sendMessage("Terms Vaild!"); + player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); + GPowerAPI.addPlayer(player, colour, isActive); + + return true; + } + @Override + public String GetCommandPath() { + return "gpower test"; + } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: /gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]" + }; + } + +} From 5801eaaddd648c92caa767f35c1507f738abb65a Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Dec 2016 07:22:56 -0500 Subject: [PATCH 226/263] Probably fixed Insurance IllegalArgumentException --- .../alipresents/components/insurance/Insurance.java | 10 +++++----- .../alipresents/components/insurance/getInsurance.java | 2 +- .../components/insurance/getInsuranceBlock.java | 4 ++-- .../components/insurance/getInsuranceIngot.java | 4 ++-- .../components/insurance/getInsuranceNugget.java | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/buttondevteam/alipresents/components/insurance/Insurance.java b/src/buttondevteam/alipresents/components/insurance/Insurance.java index 15a012a..86a1535 100644 --- a/src/buttondevteam/alipresents/components/insurance/Insurance.java +++ b/src/buttondevteam/alipresents/components/insurance/Insurance.java @@ -12,13 +12,13 @@ import buttondevteam.lib.DebugPotato; public abstract class Insurance { public static enum InsuranceType{ - Nugget, Ingot, Block + nugget, ingot, block }; public static ItemStack getInsurance(InsuranceType insuranceType){ ItemStack insuranceItem; List lore; switch(insuranceType){ - case Nugget: + case nugget: insuranceItem = new ItemStack(Material.GOLD_NUGGET); lore = Arrays.asList( "This insurance nugget will protect ", @@ -28,7 +28,7 @@ public abstract class Insurance { "one nugget." ); break; - case Ingot: + case ingot: insuranceItem = new ItemStack(Material.GOLD_INGOT); lore = Arrays.asList( "This insurance ingot will protect ", @@ -38,7 +38,7 @@ public abstract class Insurance { "row costing one ingot." ); break; - case Block: + case block: insuranceItem = new ItemStack(Material.GOLD_BLOCK); lore = Arrays.asList( "This insurance block will give your ", @@ -74,7 +74,7 @@ public abstract class Insurance { } public static boolean isInsuranceType(String string){ for (InsuranceType insuranceType : Insurance.InsuranceType.values()){ - if (string.equalsIgnoreCase(insuranceType.toString())){ + if (string.equals(insuranceType.toString())){ return true; } } diff --git a/src/buttondevteam/alipresents/components/insurance/getInsurance.java b/src/buttondevteam/alipresents/components/insurance/getInsurance.java index aba87bb..4ad5af7 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsurance.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsurance.java @@ -8,7 +8,7 @@ import buttondevteam.alipresents.components.insurance.Insurance.InsuranceType; public class getInsurance extends ModCommand { private final int defaultAmount = 1; - private final InsuranceType defaultInsuranceType = InsuranceType.Block; + private final InsuranceType defaultInsuranceType = InsuranceType.block; @Override public boolean OnCommand(Player player, String alias, String[] args) { int amount = defaultAmount; diff --git a/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java index cfbc15d..b59f73a 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java @@ -11,9 +11,9 @@ public class getInsuranceBlock extends ModCommand { @Override public boolean OnCommand(Player player, String alias, String[] args) { if (args.length > 0 && StringUtils.isNumeric(args[0])){ - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block, Integer.parseInt(args[0]))); + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.block, Integer.parseInt(args[0]))); }else{ - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block)); + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.block)); } return true; } diff --git a/src/buttondevteam/alipresents/components/insurance/getInsuranceIngot.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceIngot.java index bfd71dc..e3fdae6 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsuranceIngot.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceIngot.java @@ -11,9 +11,9 @@ public class getInsuranceIngot extends ModCommand { @Override public boolean OnCommand(Player player, String alias, String[] args) { if (args.length > 0 && StringUtils.isNumeric(args[0])){ - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot, Integer.parseInt(args[0]))); + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.ingot, Integer.parseInt(args[0]))); }else{ - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot)); + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.ingot)); } return true; } diff --git a/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java index 42e2c62..616ee78 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java @@ -11,9 +11,9 @@ public class getInsuranceNugget extends ModCommand { @Override public boolean OnCommand(Player player, String alias, String[] args) { if (args.length > 0 && StringUtils.isNumeric(args[0])){ - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Nugget, Integer.parseInt(args[0]))); + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.nugget, Integer.parseInt(args[0]))); }else{ - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Nugget)); + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.nugget)); } return true; } From 7def561103865c412e222fd190e82292b8dd5aca Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Dec 2016 07:24:42 -0500 Subject: [PATCH 227/263] Towny'd up --- pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index 8a031d8..fe6a070 100644 --- a/pom.xml +++ b/pom.xml @@ -109,5 +109,10 @@ citizens-v1_11_R1 2.0.21-SNAPSHOT + + com.github.TBMCPlugins.ButtonCore + Towny + master-SNAPSHOT + From 4ee38f92cf2d028d9f3a16a9558eedea65060317 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Dec 2016 07:36:00 -0500 Subject: [PATCH 228/263] Fixed #29 and its friends --- .../alipresents/components/insurance/getInsurance.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/buttondevteam/alipresents/components/insurance/getInsurance.java b/src/buttondevteam/alipresents/components/insurance/getInsurance.java index 4ad5af7..d8aa925 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsurance.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsurance.java @@ -34,6 +34,10 @@ public class getInsurance extends ModCommand { // argument if (StringUtils.isNumeric(args[0]) && Insurance.isInsuranceType(args[1])){ amount = Integer.parseInt(args[0]); + insuranceType = InsuranceType.valueOf(args[1]); + break; + }else if (StringUtils.isNumeric(args[1]) && Insurance.isInsuranceType(args[0])){ + amount = Integer.parseInt(args[1]); insuranceType = InsuranceType.valueOf(args[0]); break; }else{ From ba528112d5ec78b533bd53f619e89720e980d966 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Dec 2016 08:06:57 -0500 Subject: [PATCH 229/263] Fixed NPE at #26 after /flairme --- .../components/flaircolour/FlairColourAPI.java | 5 ++++- .../components/flaircolour/portals/PortalListener.java | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/buttondevteam/alipresents/components/flaircolour/FlairColourAPI.java b/src/buttondevteam/alipresents/components/flaircolour/FlairColourAPI.java index 24dcd6f..c216136 100644 --- a/src/buttondevteam/alipresents/components/flaircolour/FlairColourAPI.java +++ b/src/buttondevteam/alipresents/components/flaircolour/FlairColourAPI.java @@ -6,7 +6,10 @@ import com.earth2me.essentials.User; public class FlairColourAPI { public static void recolourPlayer(User user, DyeColor dyecolour){ - String name = user._getNickname(); + String name = ""; + if ((name = user._getNickname()) == null && (name = user.getDisplayName()) == null){ + name = user.getName(); + } String sanitizedName = ""; for(int i = 0; i < name.length(); i++){ if (name.charAt(i) == '§'){ diff --git a/src/buttondevteam/alipresents/components/flaircolour/portals/PortalListener.java b/src/buttondevteam/alipresents/components/flaircolour/portals/PortalListener.java index 0e5b2c1..7163daa 100644 --- a/src/buttondevteam/alipresents/components/flaircolour/portals/PortalListener.java +++ b/src/buttondevteam/alipresents/components/flaircolour/portals/PortalListener.java @@ -66,6 +66,14 @@ public class PortalListener implements Listener{ }else{ return; } + if (essentials.getUser(player) == null){ + player.sendMessage("Error! essentials.getUser() returns null!"); + throw new NullPointerException(); + } + if (woolColour == null){ + player.sendMessage("Error! Wool colour returns null!"); + throw new NullPointerException(); + } FlairColourAPI.recolourPlayer(essentials.getUser(player), woolColour); component.playersToBeFlaired.remove(player.getName()); From 4bc40f6aebaeae81b95f19d5d03e9c027c78b7d0 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Dec 2016 08:16:57 -0500 Subject: [PATCH 230/263] Fixed and future-proofed help texts #26 yo --- .../alipresents/components/alilinks/commands/Press.java | 7 +++++++ .../alipresents/components/alilinks/commands/Set.java | 7 +++++++ .../creativeboundaries/CreativeBoundariesComponent.java | 1 + .../components/creativeboundaries/commands/Cbgm0.java | 2 +- .../components/creativeboundaries/commands/Cbgm1.java | 2 +- .../creativeboundaries/commands/SetForceBoundaries.java | 2 +- .../components/flaircolour/letterdyes/GetLetterDye.java | 6 ++++++ .../components/flaircolour/portals/FlairMe.java | 2 +- .../flaircolour/portals/SetProximityLocation.java | 2 +- .../alipresents/components/gpower/commands/Test.java | 3 ++- .../components/gpower/powerstate/PowerDown.java | 2 +- .../alipresents/components/gpower/powerstate/PowerUp.java | 2 +- .../alipresents/components/insurance/getInsurance.java | 2 +- .../components/insurance/getInsuranceBlock.java | 2 +- .../components/insurance/getInsuranceIngot.java | 2 +- .../components/insurance/getInsuranceNugget.java | 2 +- 16 files changed, 34 insertions(+), 12 deletions(-) diff --git a/src/buttondevteam/alipresents/components/alilinks/commands/Press.java b/src/buttondevteam/alipresents/components/alilinks/commands/Press.java index 4b531ed..ac8d642 100644 --- a/src/buttondevteam/alipresents/components/alilinks/commands/Press.java +++ b/src/buttondevteam/alipresents/components/alilinks/commands/Press.java @@ -18,4 +18,11 @@ public class Press extends PlayerCommand { return false; return AliLinkAPI.sendPressEvent(player, args, AliLinkComponent.getPlugin()); } + @Override + public String[] GetHelpText(String alias){ + return new String[] { + "Usage: type /"+this.GetCommandPath()+" activate a wireless redstone block listening", + "to your frequency of choice" + }; + } } diff --git a/src/buttondevteam/alipresents/components/alilinks/commands/Set.java b/src/buttondevteam/alipresents/components/alilinks/commands/Set.java index 23385a6..80f650a 100644 --- a/src/buttondevteam/alipresents/components/alilinks/commands/Set.java +++ b/src/buttondevteam/alipresents/components/alilinks/commands/Set.java @@ -17,4 +17,11 @@ public class Set extends ModCommand { return false; return AliLinkAPI.createAliLink(player, args); } + @Override + public String[] GetHelpText(String alias){ + return new String[] { + "Usage: type /"+this.GetCommandPath()+" set a wireless redstone block that listens", + "for signals from the players pressing the frequency of your choice" + }; + } } diff --git a/src/buttondevteam/alipresents/components/creativeboundaries/CreativeBoundariesComponent.java b/src/buttondevteam/alipresents/components/creativeboundaries/CreativeBoundariesComponent.java index 1435c91..182f5b7 100644 --- a/src/buttondevteam/alipresents/components/creativeboundaries/CreativeBoundariesComponent.java +++ b/src/buttondevteam/alipresents/components/creativeboundaries/CreativeBoundariesComponent.java @@ -15,6 +15,7 @@ public class CreativeBoundariesComponent extends Component{ registerCommand(plugin, new Cbgm1()); registerCommand(plugin, new Cbgm0()); registerCommand(plugin, new SetForceBoundaries()); + registerListener(plugin, new PlotChangeListener()); //registerListener(plugin, new ItemRestrictionListener(this)); } diff --git a/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm0.java b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm0.java index d5dd890..9e8e2b7 100644 --- a/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm0.java +++ b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm0.java @@ -16,6 +16,6 @@ public class Cbgm0 extends PlayerCommand{ return true; } public String[] GetHelpText(String alias){ - return new String[]{"Creative Boundaries Usage: /cbgm0"}; + return new String[]{"Creative Boundaries Usage: /"+this.GetCommandPath()+""}; } } diff --git a/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm1.java b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm1.java index b0ea0e2..1f3769d 100644 --- a/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm1.java +++ b/src/buttondevteam/alipresents/components/creativeboundaries/commands/Cbgm1.java @@ -17,7 +17,7 @@ public class Cbgm1 extends PlayerCommand { @Override public String[] GetHelpText(String alias){ return new String[] { - "Usage: When in a town that you either own or are a resident of, type /cbgm1 to gain creative" + "Usage: When in a town that you either own or are a resident of, type /"+this.GetCommandPath()+" to gain creative" }; } } diff --git a/src/buttondevteam/alipresents/components/creativeboundaries/commands/SetForceBoundaries.java b/src/buttondevteam/alipresents/components/creativeboundaries/commands/SetForceBoundaries.java index ebc527f..1df8cc0 100644 --- a/src/buttondevteam/alipresents/components/creativeboundaries/commands/SetForceBoundaries.java +++ b/src/buttondevteam/alipresents/components/creativeboundaries/commands/SetForceBoundaries.java @@ -17,6 +17,6 @@ public class SetForceBoundaries extends ModCommand{ } @Override public String[] GetHelpText(String alias){ - return new String[]{"Usage: /SetForceBoundaries "}; + return new String[]{"Usage: /"+this.GetCommandPath()+" "}; } } diff --git a/src/buttondevteam/alipresents/components/flaircolour/letterdyes/GetLetterDye.java b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/GetLetterDye.java index 95597ff..08db228 100644 --- a/src/buttondevteam/alipresents/components/flaircolour/letterdyes/GetLetterDye.java +++ b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/GetLetterDye.java @@ -14,4 +14,10 @@ public class GetLetterDye extends PlayerCommand{ player.getInventory().addItem(LetterDye.getLetterDye()); return false; } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: Type /"+this.GetCommandPath()+" to get letter dyes that can change your username!" + }; + } } diff --git a/src/buttondevteam/alipresents/components/flaircolour/portals/FlairMe.java b/src/buttondevteam/alipresents/components/flaircolour/portals/FlairMe.java index b72ff55..373fcbf 100644 --- a/src/buttondevteam/alipresents/components/flaircolour/portals/FlairMe.java +++ b/src/buttondevteam/alipresents/components/flaircolour/portals/FlairMe.java @@ -24,7 +24,7 @@ public class FlairMe extends PlayerCommand { @Override public String[] GetHelpText(String alias){ return new String[]{ - "Usage: Type /flairme and enter a portal with coloured", + "Usage: Type /"+this.GetCommandPath()+" and enter a portal with coloured", "wool underneath to change your flair" }; } diff --git a/src/buttondevteam/alipresents/components/flaircolour/portals/SetProximityLocation.java b/src/buttondevteam/alipresents/components/flaircolour/portals/SetProximityLocation.java index 2f6b910..9a68574 100644 --- a/src/buttondevteam/alipresents/components/flaircolour/portals/SetProximityLocation.java +++ b/src/buttondevteam/alipresents/components/flaircolour/portals/SetProximityLocation.java @@ -30,7 +30,7 @@ public class SetProximityLocation extends ModCommand{ } public String[] GetHelpText(String alias){ return new String[] { - "Usage: /SetProximityLocation ", + "Usage: /"+this.GetCommandPath()+" ", "Use this command to set a proximity space: all players", "within this space will become flair-able, and portals will", "change their colour state." diff --git a/src/buttondevteam/alipresents/components/gpower/commands/Test.java b/src/buttondevteam/alipresents/components/gpower/commands/Test.java index 07dc669..f529833 100644 --- a/src/buttondevteam/alipresents/components/gpower/commands/Test.java +++ b/src/buttondevteam/alipresents/components/gpower/commands/Test.java @@ -44,8 +44,9 @@ public class Test extends ModCommand{ @Override public String[] GetHelpText(String alias){ return new String[]{ - "Usage: /gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]" + "Usage: /"+this.GetCommandPath()+" [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]" }; } + } diff --git a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerDown.java b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerDown.java index a1404f5..da402e6 100644 --- a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerDown.java +++ b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerDown.java @@ -14,7 +14,7 @@ public class PowerDown extends PlayerCommand { @Override public String[] GetHelpText(String alias){ return new String[]{ - "Usage: Type /PowerDown to disable your g-power" + "Usage: Type /"+this.GetCommandPath()+" to disable your g-power" }; } diff --git a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerUp.java b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerUp.java index 46baa89..1fec205 100644 --- a/src/buttondevteam/alipresents/components/gpower/powerstate/PowerUp.java +++ b/src/buttondevteam/alipresents/components/gpower/powerstate/PowerUp.java @@ -14,7 +14,7 @@ public class PowerUp extends PlayerCommand { @Override public String[] GetHelpText(String alias){ return new String[]{ - "Usage: Type /PowerUp to activate your registered G-Power" + "Usage: Type /"+this.GetCommandPath()+" to activate your registered G-Power" }; } @Override diff --git a/src/buttondevteam/alipresents/components/insurance/getInsurance.java b/src/buttondevteam/alipresents/components/insurance/getInsurance.java index d8aa925..b6cdc42 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsurance.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsurance.java @@ -55,7 +55,7 @@ public class getInsurance extends ModCommand { @Override public String[] GetHelpText(String alias){ return new String[]{ - "Usage: /getInsurance [amount] [type:nugget/bar/block/compound]", + "Usage: /"+this.GetCommandPath()+" [amount] [type:nugget/bar/block/compound]", "Use this command to get gold-standard inventory insurance, that saves ", "items in an inventory upon death. One nugget saves one ItemStack, a bar", "saves nine, a block saves 54. Compound converts amount (in nuggets) to a", diff --git a/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java index b59f73a..919d5ef 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java @@ -25,7 +25,7 @@ public class getInsuranceBlock extends ModCommand { @Override public String[] GetHelpText(String alias){ return new String[]{ - "Usage: /insurance getblock [amount]", + "Usage: /"+this.GetCommandPath()+" [amount]", "This command returns an insurance block, which on death,", "splits into 9 insurance ingot which each saves 1 row of", "inventory per ingot" diff --git a/src/buttondevteam/alipresents/components/insurance/getInsuranceIngot.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceIngot.java index e3fdae6..b161227 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsuranceIngot.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceIngot.java @@ -25,7 +25,7 @@ public class getInsuranceIngot extends ModCommand { @Override public String[] GetHelpText(String alias){ return new String[]{ - "Usage: /insurance getingot [amount]", + "Usage: /"+this.GetCommandPath()+" [amount]", "This command returns an insurance ingot, which on death,", "saves one row of inventory" }; diff --git a/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java index 616ee78..50978f7 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java @@ -24,7 +24,7 @@ public class getInsuranceNugget extends ModCommand { @Override public String[] GetHelpText(String alias){ return new String[]{ - "Usage: /insurance getnugget [amount]", + "Usage: /"+this.GetCommandPath()+" [amount]", "This command returns an insurance nugget, which on death,", "saves one itemslot in the inventory" }; From 8e805745b5306380a33bc5e16b0b02731a7a845d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Dec 2016 08:29:40 -0500 Subject: [PATCH 231/263] Fixed NPE for Setproximitylocation --- .../portals/PlayerProximityLoop.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/buttondevteam/alipresents/components/flaircolour/portals/PlayerProximityLoop.java b/src/buttondevteam/alipresents/components/flaircolour/portals/PlayerProximityLoop.java index f21ffe9..4a3db5b 100644 --- a/src/buttondevteam/alipresents/components/flaircolour/portals/PlayerProximityLoop.java +++ b/src/buttondevteam/alipresents/components/flaircolour/portals/PlayerProximityLoop.java @@ -13,14 +13,14 @@ public class PlayerProximityLoop extends BukkitRunnable implements Listener{ private static FlairColourComponent component; private static Location startLocation; private static Location endLocation; - + private static int sX; private static int sY; private static int sZ; private static int eX; private static int eY; private static int eZ; - + public PlayerProximityLoop(JavaPlugin plugin, FlairColourComponent component) { PlayerProximityLoop.plugin = plugin; PlayerProximityLoop.component = component; @@ -31,14 +31,21 @@ public class PlayerProximityLoop extends BukkitRunnable implements Listener{ PlayerProximityLoop.sY = location.getBlockY(); PlayerProximityLoop.sZ = location.getBlockZ(); PlayerProximityLoop.startLocation = location; - PlayerProximityLoop.endLocation.setWorld(location.getWorld()); + + if (endLocation == null) + PlayerProximityLoop.endLocation = location; + else + PlayerProximityLoop.endLocation.setWorld(location.getWorld()); } public static void setEndLocation(Location location){ PlayerProximityLoop.eX = location.getBlockX(); PlayerProximityLoop.eY = location.getBlockY(); PlayerProximityLoop.eZ = location.getBlockZ(); PlayerProximityLoop.startLocation.setWorld(location.getWorld()); - PlayerProximityLoop.endLocation = location; + if (endLocation == null) + PlayerProximityLoop.endLocation = location; + else + PlayerProximityLoop.endLocation.setWorld(location.getWorld()); } @Override @@ -65,8 +72,8 @@ public class PlayerProximityLoop extends BukkitRunnable implements Listener{ if((playerZ < sZ && playerZ < eZ) || (playerZ > sZ && playerZ > eZ)) continue; component.playersToBeFlaired.add(player); - + } } - + } From 871d32027bc1db9874bb0b81255e1ff22d206f8d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Dec 2016 08:36:21 -0500 Subject: [PATCH 232/263] Fix'd --- .../components/flaircolour/letterdyes/GetLetterDye.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buttondevteam/alipresents/components/flaircolour/letterdyes/GetLetterDye.java b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/GetLetterDye.java index 08db228..bd30317 100644 --- a/src/buttondevteam/alipresents/components/flaircolour/letterdyes/GetLetterDye.java +++ b/src/buttondevteam/alipresents/components/flaircolour/letterdyes/GetLetterDye.java @@ -12,7 +12,7 @@ public class GetLetterDye extends PlayerCommand{ @Override public boolean OnCommand(Player player, String alias, String[] args) { player.getInventory().addItem(LetterDye.getLetterDye()); - return false; + return true; } @Override public String[] GetHelpText(String alias){ From 880d03fba93c2c64ace1f951199dbb441d3ddd19 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 18 Dec 2016 22:18:11 -0500 Subject: [PATCH 233/263] Links now work with command blocks --- .../architecture/commands/BaseCommand.java | 14 ++++++++++++ .../commands/CommandBlockCommand.java | 21 ++++++++++++++++++ .../components/alilinks/AliLinkAPI.java | 2 +- .../components/alilinks/AliLinkComponent.java | 2 ++ .../alilinks/commands/ListLinks.java | 22 +++++++++++++++++++ .../components/alilinks/commands/Press.java | 21 ++++++++++-------- 6 files changed, 72 insertions(+), 10 deletions(-) create mode 100644 src/buttondevteam/alipresents/architecture/commands/CommandBlockCommand.java create mode 100644 src/buttondevteam/alipresents/components/alilinks/commands/ListLinks.java diff --git a/src/buttondevteam/alipresents/architecture/commands/BaseCommand.java b/src/buttondevteam/alipresents/architecture/commands/BaseCommand.java index 6233d3a..16d6127 100644 --- a/src/buttondevteam/alipresents/architecture/commands/BaseCommand.java +++ b/src/buttondevteam/alipresents/architecture/commands/BaseCommand.java @@ -1,8 +1,22 @@ package buttondevteam.alipresents.architecture.commands; +import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; public abstract class BaseCommand extends TBMCCommandBase implements CommandExecutor{ + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + // TODO Auto-generated method stub + return OnCommand(sender, label, args); + } + @Override + public String[] GetHelpText(String alias){ + return new String[] { + "This command doesn't have help text ask a dev to write one", + "If you're a dev, write the help text you lazy bastard. -Ali" + }; + } } diff --git a/src/buttondevteam/alipresents/architecture/commands/CommandBlockCommand.java b/src/buttondevteam/alipresents/architecture/commands/CommandBlockCommand.java new file mode 100644 index 0000000..57775e4 --- /dev/null +++ b/src/buttondevteam/alipresents/architecture/commands/CommandBlockCommand.java @@ -0,0 +1,21 @@ +package buttondevteam.alipresents.architecture.commands; + +public abstract class CommandBlockCommand extends BaseCommand{ + @Override + public String[] GetHelpText(String alias){ + return new String[] { + "This command doesn't have help text. ", + }; + } + + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/src/buttondevteam/alipresents/components/alilinks/AliLinkAPI.java b/src/buttondevteam/alipresents/components/alilinks/AliLinkAPI.java index 8115268..919ec34 100644 --- a/src/buttondevteam/alipresents/components/alilinks/AliLinkAPI.java +++ b/src/buttondevteam/alipresents/components/alilinks/AliLinkAPI.java @@ -15,7 +15,7 @@ import org.bukkit.plugin.java.JavaPlugin; import buttondevteam.alipresents.components.alilinks.entities.Link; public class AliLinkAPI { - private static List linkList; + public static List linkList = new ArrayList(); /**"Usage: /pressalilink "*/ public static boolean sendPressEvent(CommandSender sender, String[] inputFrequencies, JavaPlugin plugin) { if (inputFrequencies.length == 0) { diff --git a/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java b/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java index c36f5cc..d1d59b6 100644 --- a/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java +++ b/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java @@ -3,6 +3,7 @@ package buttondevteam.alipresents.components.alilinks; import org.bukkit.plugin.java.JavaPlugin; import buttondevteam.alipresents.architecture.Component; +import buttondevteam.alipresents.components.alilinks.commands.ListLinks; import buttondevteam.alipresents.components.alilinks.commands.Press; import buttondevteam.alipresents.components.alilinks.commands.Set; @@ -18,5 +19,6 @@ public class AliLinkComponent extends Component { p = plugin; registerCommand(plugin, new Press()); registerCommand(plugin, new Set()); + registerCommand(plugin, new ListLinks()); } } diff --git a/src/buttondevteam/alipresents/components/alilinks/commands/ListLinks.java b/src/buttondevteam/alipresents/components/alilinks/commands/ListLinks.java new file mode 100644 index 0000000..1806166 --- /dev/null +++ b/src/buttondevteam/alipresents/components/alilinks/commands/ListLinks.java @@ -0,0 +1,22 @@ +package buttondevteam.alipresents.components.alilinks.commands; + +import org.bukkit.entity.Player; + +import buttondevteam.alipresents.architecture.commands.PlayerCommand; +import buttondevteam.alipresents.components.alilinks.AliLinkAPI; +import buttondevteam.alipresents.components.alilinks.entities.Link; + +public class ListLinks extends PlayerCommand { + @Override + public boolean OnCommand(Player player, String alias, String[] args) { + for (Link link : AliLinkAPI.linkList){ + player.sendMessage(link.toString()); + } + return false; + } + @Override + public String GetCommandPath() { + return "alilink listlinks"; + } + +} diff --git a/src/buttondevteam/alipresents/components/alilinks/commands/Press.java b/src/buttondevteam/alipresents/components/alilinks/commands/Press.java index ac8d642..44dc38e 100644 --- a/src/buttondevteam/alipresents/components/alilinks/commands/Press.java +++ b/src/buttondevteam/alipresents/components/alilinks/commands/Press.java @@ -1,23 +1,17 @@ package buttondevteam.alipresents.components.alilinks.commands; -import org.bukkit.entity.Player; +import org.bukkit.command.CommandSender; -import buttondevteam.alipresents.architecture.commands.PlayerCommand; +import buttondevteam.alipresents.architecture.commands.CommandBlockCommand; import buttondevteam.alipresents.components.alilinks.AliLinkAPI; import buttondevteam.alipresents.components.alilinks.AliLinkComponent; -public class Press extends PlayerCommand { +public class Press extends CommandBlockCommand { @Override public String GetCommandPath() { return "alilink press"; } - @Override - public boolean OnCommand(Player player, String alias, String[] args) { - if (args.length < 1) - return false; - return AliLinkAPI.sendPressEvent(player, args, AliLinkComponent.getPlugin()); - } @Override public String[] GetHelpText(String alias){ return new String[] { @@ -25,4 +19,13 @@ public class Press extends PlayerCommand { "to your frequency of choice" }; } + + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + if (args.length < 1) + return false; + return AliLinkAPI.sendPressEvent(sender, args, AliLinkComponent.getPlugin()); + } + + } From 2dc1497640e41309099f78402d970cedae179b16 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 18 Dec 2016 23:20:33 -0500 Subject: [PATCH 234/263] Removed debug messages --- .../alipresents/architecture/commands/PlayerCommand.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java b/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java index df0b997..169283c 100644 --- a/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java +++ b/src/buttondevteam/alipresents/architecture/commands/PlayerCommand.java @@ -8,13 +8,11 @@ public abstract class PlayerCommand extends BaseCommand{ /**replaces CommandExecutor functionality*/ @Override public boolean onCommand(CommandSender sender, Command command, String string, String[] args){ - sender.sendMessage("activating" + string.toString()); return OnCommand(sender, string, args); } /**replaces TBMCCommandBase functionality*/ @Override public boolean OnCommand(CommandSender sender, String alias, String[] args){ - sender.sendMessage("activating" + alias.toString()); return OnCommand((Player) sender, alias, args); } public abstract boolean OnCommand(Player player, String alias, String[] args); From 18e210785a49097df6cdf6305d3ec7933a27112a Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 19 Dec 2016 00:21:11 -0500 Subject: [PATCH 235/263] Hotfixed Nether Portals being active --- src/buttondevteam/alipresents/AliPresents.java | 2 ++ .../components/hotfix/HotfixComponent.java | 15 +++++++++++++++ .../components/hotfix/NetherDisableListener.java | 12 ++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java create mode 100644 src/buttondevteam/alipresents/components/hotfix/NetherDisableListener.java diff --git a/src/buttondevteam/alipresents/AliPresents.java b/src/buttondevteam/alipresents/AliPresents.java index dcc752c..9919a3f 100644 --- a/src/buttondevteam/alipresents/AliPresents.java +++ b/src/buttondevteam/alipresents/AliPresents.java @@ -12,6 +12,7 @@ import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundarie import buttondevteam.alipresents.components.flaircolour.FlairColourComponent; import buttondevteam.alipresents.components.fruit.FruitComponent; import buttondevteam.alipresents.components.gpower.GPowerComponent; +import buttondevteam.alipresents.components.hotfix.HotfixComponent; import buttondevteam.alipresents.components.insurance.InsuranceComponent; import buttondevteam.alipresents.components.magic.MagicComponent; import buttondevteam.alipresents.components.spawn.SpawnComponent; @@ -30,6 +31,7 @@ public class AliPresents extends JavaPlugin{ new FlairColourComponent().register(this); new FruitComponent().register(this); new GPowerComponent().register(this); + new HotfixComponent().register(this); new InsuranceComponent().register(this); new MagicComponent().register(this); //new MetricsComponent().register(this); diff --git a/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java new file mode 100644 index 0000000..f8e4e10 --- /dev/null +++ b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java @@ -0,0 +1,15 @@ +package buttondevteam.alipresents.components.hotfix; + +import org.bukkit.plugin.java.JavaPlugin; + +import buttondevteam.alipresents.architecture.Component; + +public class HotfixComponent extends Component { + + @Override + public void register(JavaPlugin plugin) { + registerListener(plugin, new NetherDisableListener()); + + } + +} diff --git a/src/buttondevteam/alipresents/components/hotfix/NetherDisableListener.java b/src/buttondevteam/alipresents/components/hotfix/NetherDisableListener.java new file mode 100644 index 0000000..788c698 --- /dev/null +++ b/src/buttondevteam/alipresents/components/hotfix/NetherDisableListener.java @@ -0,0 +1,12 @@ +package buttondevteam.alipresents.components.hotfix; + +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerPortalEvent; + +public class NetherDisableListener implements Listener{ + @EventHandler + public void onPortalEnter(PlayerPortalEvent event){ + event.setCancelled(true); + } +} From 341fb1be2ef21ff73edc38760d5982d3d3c8f219 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 19 Dec 2016 15:58:10 -0500 Subject: [PATCH 236/263] refactored hotfixes --- src/buttondevteam/alipresents/AliPresents.java | 6 ------ .../components/cashmob/CashMobComponent.java | 18 ------------------ .../components/fruit/FruitComponent.java | 15 --------------- .../components/hotfix/HotfixComponent.java | 10 ++++++++++ .../cows => hotfix/hotfixes}/CowSpawnLoop.java | 2 +- .../hotfixes}/GrassBreakListener.java | 2 +- .../hotfixes}/MobKillListener.java | 2 +- .../{ => hotfixes}/NetherDisableListener.java | 4 +++- .../components/spawn/SpawnComponent.java | 15 --------------- 9 files changed, 16 insertions(+), 58 deletions(-) delete mode 100644 src/buttondevteam/alipresents/components/cashmob/CashMobComponent.java delete mode 100644 src/buttondevteam/alipresents/components/fruit/FruitComponent.java rename src/buttondevteam/alipresents/components/{spawn/cows => hotfix/hotfixes}/CowSpawnLoop.java (95%) rename src/buttondevteam/alipresents/components/{fruit => hotfix/hotfixes}/GrassBreakListener.java (98%) rename src/buttondevteam/alipresents/components/{cashmob => hotfix/hotfixes}/MobKillListener.java (93%) rename src/buttondevteam/alipresents/components/hotfix/{ => hotfixes}/NetherDisableListener.java (55%) delete mode 100644 src/buttondevteam/alipresents/components/spawn/SpawnComponent.java diff --git a/src/buttondevteam/alipresents/AliPresents.java b/src/buttondevteam/alipresents/AliPresents.java index 9919a3f..d8ad8bc 100644 --- a/src/buttondevteam/alipresents/AliPresents.java +++ b/src/buttondevteam/alipresents/AliPresents.java @@ -7,15 +7,12 @@ import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; import buttondevteam.alipresents.components.alilinks.AliLinkComponent; -import buttondevteam.alipresents.components.cashmob.CashMobComponent; import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesComponent; import buttondevteam.alipresents.components.flaircolour.FlairColourComponent; -import buttondevteam.alipresents.components.fruit.FruitComponent; import buttondevteam.alipresents.components.gpower.GPowerComponent; import buttondevteam.alipresents.components.hotfix.HotfixComponent; import buttondevteam.alipresents.components.insurance.InsuranceComponent; import buttondevteam.alipresents.components.magic.MagicComponent; -import buttondevteam.alipresents.components.spawn.SpawnComponent; public class AliPresents extends JavaPlugin{ public void onEnable(){ @@ -26,16 +23,13 @@ public class AliPresents extends JavaPlugin{ new AliLinkComponent().register(this); - new CashMobComponent().register(this); new CreativeBoundariesComponent().register(this); new FlairColourComponent().register(this); - new FruitComponent().register(this); new GPowerComponent().register(this); new HotfixComponent().register(this); new InsuranceComponent().register(this); new MagicComponent().register(this); //new MetricsComponent().register(this); - new SpawnComponent().register(this); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); diff --git a/src/buttondevteam/alipresents/components/cashmob/CashMobComponent.java b/src/buttondevteam/alipresents/components/cashmob/CashMobComponent.java deleted file mode 100644 index b4a427f..0000000 --- a/src/buttondevteam/alipresents/components/cashmob/CashMobComponent.java +++ /dev/null @@ -1,18 +0,0 @@ -package buttondevteam.alipresents.components.cashmob; - -import org.bukkit.Bukkit; -import org.bukkit.plugin.java.JavaPlugin; - -import com.earth2me.essentials.Essentials; - -import buttondevteam.alipresents.architecture.Component; - -public class CashMobComponent extends Component{ - - @Override - public void register(JavaPlugin plugin) { - registerListener(plugin, new MobKillListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); - - } - -} diff --git a/src/buttondevteam/alipresents/components/fruit/FruitComponent.java b/src/buttondevteam/alipresents/components/fruit/FruitComponent.java deleted file mode 100644 index 910f75f..0000000 --- a/src/buttondevteam/alipresents/components/fruit/FruitComponent.java +++ /dev/null @@ -1,15 +0,0 @@ -package buttondevteam.alipresents.components.fruit; - -import org.bukkit.plugin.java.JavaPlugin; - -import buttondevteam.alipresents.architecture.Component; - -public class FruitComponent extends Component{ - - @Override - public void register(JavaPlugin plugin) { - registerListener(plugin, new GrassBreakListener()); - - } - -} diff --git a/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java index f8e4e10..45e6a2a 100644 --- a/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java +++ b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java @@ -1,14 +1,24 @@ package buttondevteam.alipresents.components.hotfix; +import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; +import com.earth2me.essentials.Essentials; + import buttondevteam.alipresents.architecture.Component; +import buttondevteam.alipresents.components.hotfix.hotfixes.CowSpawnLoop; +import buttondevteam.alipresents.components.hotfix.hotfixes.GrassBreakListener; +import buttondevteam.alipresents.components.hotfix.hotfixes.MobKillListener; +import buttondevteam.alipresents.components.hotfix.hotfixes.NetherDisableListener; public class HotfixComponent extends Component { @Override public void register(JavaPlugin plugin) { registerListener(plugin, new NetherDisableListener()); + registerListener(plugin, new CowSpawnLoop(plugin)); + registerListener(plugin, new MobKillListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); + registerListener(plugin, new GrassBreakListener()); } diff --git a/src/buttondevteam/alipresents/components/spawn/cows/CowSpawnLoop.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CowSpawnLoop.java similarity index 95% rename from src/buttondevteam/alipresents/components/spawn/cows/CowSpawnLoop.java rename to src/buttondevteam/alipresents/components/hotfix/hotfixes/CowSpawnLoop.java index 24ee650..8fb663f 100644 --- a/src/buttondevteam/alipresents/components/spawn/cows/CowSpawnLoop.java +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CowSpawnLoop.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.spawn.cows; +package buttondevteam.alipresents.components.hotfix.hotfixes; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/buttondevteam/alipresents/components/fruit/GrassBreakListener.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/GrassBreakListener.java similarity index 98% rename from src/buttondevteam/alipresents/components/fruit/GrassBreakListener.java rename to src/buttondevteam/alipresents/components/hotfix/hotfixes/GrassBreakListener.java index 8279aa4..7ce406f 100644 --- a/src/buttondevteam/alipresents/components/fruit/GrassBreakListener.java +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/GrassBreakListener.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.fruit; +package buttondevteam.alipresents.components.hotfix.hotfixes; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/buttondevteam/alipresents/components/cashmob/MobKillListener.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/MobKillListener.java similarity index 93% rename from src/buttondevteam/alipresents/components/cashmob/MobKillListener.java rename to src/buttondevteam/alipresents/components/hotfix/hotfixes/MobKillListener.java index c1a4791..f13aaee 100644 --- a/src/buttondevteam/alipresents/components/cashmob/MobKillListener.java +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/MobKillListener.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.cashmob; +package buttondevteam.alipresents.components.hotfix.hotfixes; import java.math.BigDecimal; diff --git a/src/buttondevteam/alipresents/components/hotfix/NetherDisableListener.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/NetherDisableListener.java similarity index 55% rename from src/buttondevteam/alipresents/components/hotfix/NetherDisableListener.java rename to src/buttondevteam/alipresents/components/hotfix/hotfixes/NetherDisableListener.java index 788c698..b276e44 100644 --- a/src/buttondevteam/alipresents/components/hotfix/NetherDisableListener.java +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/NetherDisableListener.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.hotfix; +package buttondevteam.alipresents.components.hotfix.hotfixes; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -7,6 +7,8 @@ import org.bukkit.event.player.PlayerPortalEvent; public class NetherDisableListener implements Listener{ @EventHandler public void onPortalEnter(PlayerPortalEvent event){ + event.getPlayer().sendMessage("[HOTFIX] This portal is disabled!"); + event.getPlayer().sendMessage("[HOTFIX] Going to the Nether is disabled on the server"); event.setCancelled(true); } } diff --git a/src/buttondevteam/alipresents/components/spawn/SpawnComponent.java b/src/buttondevteam/alipresents/components/spawn/SpawnComponent.java deleted file mode 100644 index 189d844..0000000 --- a/src/buttondevteam/alipresents/components/spawn/SpawnComponent.java +++ /dev/null @@ -1,15 +0,0 @@ -package buttondevteam.alipresents.components.spawn; - -import org.bukkit.plugin.java.JavaPlugin; - -import buttondevteam.alipresents.architecture.Component; -import buttondevteam.alipresents.components.spawn.cows.CowSpawnLoop; - -public class SpawnComponent extends Component { - - @Override - public void register(JavaPlugin plugin) { - registerListener(plugin, new CowSpawnLoop(plugin)); - } - -} From c2389eb74c7c2a2f1f21c4728d6b543b6f36dace Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Tue, 20 Dec 2016 05:22:14 -0500 Subject: [PATCH 237/263] Adjusted Cannon Bow Made Draw Distance smaller Made TNT launch depending on draw Have launch settings be adjustable --- plugin.yml | 4 -- pom.xml | 2 +- .../components/magic/MagicComponent.java | 3 ++ .../components/magic/tricks/AliArrowTask.java | 4 +- .../magic/tricks/CannonBowListener.java | 52 ++++++++++++------- .../magic/tricks/CannonBowSettings.java | 32 ++++++++++++ 6 files changed, 73 insertions(+), 24 deletions(-) create mode 100644 src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java diff --git a/plugin.yml b/plugin.yml index 3e396be..32b153e 100644 --- a/plugin.yml +++ b/plugin.yml @@ -5,16 +5,12 @@ version: 2.0.2 commands: alilink: description: creates wireless redstone - cashmob: - description: creates mobs cb: description: creates creative boundaries debug: description: debug commands flaircolour: description: flaaairs - fruit: - description: fruits gpower: description: powerssss insurance: diff --git a/pom.xml b/pom.xml index fe6a070..ab68ed4 100644 --- a/pom.xml +++ b/pom.xml @@ -92,7 +92,7 @@ org.apache.commons commons-lang3 - 3.4 + 3.5 com.github.TBMCPlugins.ButtonCore diff --git a/src/buttondevteam/alipresents/components/magic/MagicComponent.java b/src/buttondevteam/alipresents/components/magic/MagicComponent.java index 4dd2389..228d82b 100644 --- a/src/buttondevteam/alipresents/components/magic/MagicComponent.java +++ b/src/buttondevteam/alipresents/components/magic/MagicComponent.java @@ -7,11 +7,14 @@ import buttondevteam.alipresents.components.magic.tricks.AliArrowListener; import buttondevteam.alipresents.components.magic.tricks.BoomBowDeathListener; import buttondevteam.alipresents.components.magic.tricks.BoomBowListener; import buttondevteam.alipresents.components.magic.tricks.CannonBowListener; +import buttondevteam.alipresents.components.magic.tricks.CannonBowSettings; public class MagicComponent extends Component{ @Override public void register(JavaPlugin plugin) { + registerCommand(plugin, new CannonBowSettings()); + registerListener(plugin, new AliArrowListener(plugin)); registerListener(plugin, new BoomBowDeathListener()); registerListener(plugin, new BoomBowListener(plugin)); diff --git a/src/buttondevteam/alipresents/components/magic/tricks/AliArrowTask.java b/src/buttondevteam/alipresents/components/magic/tricks/AliArrowTask.java index cd4dd0b..f607210 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/AliArrowTask.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/AliArrowTask.java @@ -8,6 +8,7 @@ public class AliArrowTask extends BukkitRunnable { static String[] permittedUsers = {"alisolarflare", "Zanthr", "NorbiPeti"}; String name; Arrow arrow; + int count = 0; public AliArrowTask(Arrow arrow, String name) { this.name = name; @@ -16,7 +17,8 @@ public class AliArrowTask extends BukkitRunnable { @Override public void run() { - if (arrow.isOnGround() || arrow.isDead()) { + count++; + if (count > 400 ||arrow.isOnGround() || arrow.isDead()) { this.cancel(); } diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java index 83eebb2..719f3fd 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java @@ -12,11 +12,14 @@ import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityExplodeEvent; -import org.bukkit.event.entity.ProjectileLaunchEvent; +import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.util.Vector; public class CannonBowListener implements Listener { + public static double SpeedMultiplier = 1.5; + public static double minforce = 0.2; public final static String launchedTNTName = "CANNON BOW TNT:42170"; JavaPlugin plugin; public CannonBowListener(JavaPlugin plugin){ @@ -24,35 +27,48 @@ public class CannonBowListener implements Listener { } @EventHandler - public void onProjectileLaunch(ProjectileLaunchEvent event){ - //ENTITY SANITATION - if(event.getEntity().getType() != EntityType.ARROW)return; + public void onProjectileLaunch(EntityShootBowEvent event){ + //Entity Sanitation + if(event.getProjectile().getType() != EntityType.ARROW)return; - //ARROW SANITATION - Arrow arrow = (Arrow) event.getEntity(); - if (!(arrow.isCritical()) || !(arrow.getShooter() instanceof Player))return; + //Arrow Sanitation + Arrow arrow = (Arrow) event.getProjectile(); + if (!(arrow.getShooter() instanceof Player))return; - //PLAYER SANITATION + //Player Sanitation Player player = (Player) arrow.getShooter(); if (!player.getInventory().contains(Material.TNT))return; - //BOW SANITATION + //Bow Sanitation ItemStack bow; if (!((bow = player.getInventory().getItemInMainHand()).getType() == Material.BOW))return; if (!(bow.containsEnchantment(Enchantment.PROTECTION_EXPLOSIONS)))return; if (!(bow.getEnchantmentLevel(Enchantment.PROTECTION_EXPLOSIONS) == 10))return; if (!(bow.getItemMeta().getDisplayName().toUpperCase().contains("CANNON BOW")))return; + + //TNT Spawning + + Vector playerVector = player.getEyeLocation().getDirection().normalize(); + if (event.getForce() < minforce){ - TNTPrimed tnt = (TNTPrimed) arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.PRIMED_TNT); - tnt.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(1.0)); - tnt.setCustomName(launchedTNTName); - tnt.setFuseTicks(40); - - player.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(-1)); - player.getWorld().playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 2.0F, 0); - player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, player.getLocation(), 2); - + + + }else{ + TNTPrimed tnt = (TNTPrimed) arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.PRIMED_TNT); + + tnt.setVelocity(playerVector.multiply(SpeedMultiplier).multiply(event.getForce())); + tnt.setCustomName(launchedTNTName); + tnt.setFuseTicks(40); + + //Player Recoil + player.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(-1)); + player.getWorld().playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 2.0F, 0); + player.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, player.getLocation(), 2); + + } arrow.remove(); + + return; } diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java new file mode 100644 index 0000000..e657375 --- /dev/null +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java @@ -0,0 +1,32 @@ +package buttondevteam.alipresents.components.magic.tricks; + +import org.apache.commons.lang3.math.NumberUtils; +import org.bukkit.entity.Player; + +import buttondevteam.alipresents.architecture.commands.ModCommand; + +public class CannonBowSettings extends ModCommand { + + @Override + public boolean OnCommand(Player player, String alias, String[] args) { + switch(args[0].toLowerCase()){ + case "speedmultiplier": + CannonBowListener.SpeedMultiplier = NumberUtils.toDouble(args[1], CannonBowListener.SpeedMultiplier); + break; + case "minforce": + CannonBowListener.minforce = NumberUtils.toDouble(args[1], CannonBowListener.SpeedMultiplier); + break; + default: + player.sendMessage("That isn't a valid setting!"); + player.sendMessage("Valid Settings are: "); + return false; + } + return true; + } + + @Override + public String GetCommandPath(){ + return "magic cannonbow"; + } + +} From d48d1451112f2a80657be6bcff99eb63f4b0b060 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Tue, 20 Dec 2016 06:33:49 -0500 Subject: [PATCH 238/263] More work on the Cannon Bow #37 Settings now savable TNT is now owned by a player --- config.yml | 6 ++++- pom.xml | 2 +- .../components/magic/MagicComponent.java | 2 +- .../magic/tricks/CannonBowListener.java | 25 ++++++++++++++++--- .../magic/tricks/CannonBowSettings.java | 12 ++++++--- 5 files changed, 38 insertions(+), 9 deletions(-) diff --git a/config.yml b/config.yml index c3cfef7..9fd8419 100644 --- a/config.yml +++ b/config.yml @@ -1 +1,5 @@ -UHCMatchState: "IDLE" \ No newline at end of file +UHCMatchState: "IDLE" +magic: + cannonbow: + speedmultiplier: 1.5 + minforce: 0.2 \ No newline at end of file diff --git a/pom.xml b/pom.xml index ab68ed4..d21b76e 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ org.spigotmc - spigot-api + spigot 1.11-R0.1-SNAPSHOT diff --git a/src/buttondevteam/alipresents/components/magic/MagicComponent.java b/src/buttondevteam/alipresents/components/magic/MagicComponent.java index 228d82b..8aa4b27 100644 --- a/src/buttondevteam/alipresents/components/magic/MagicComponent.java +++ b/src/buttondevteam/alipresents/components/magic/MagicComponent.java @@ -10,7 +10,7 @@ import buttondevteam.alipresents.components.magic.tricks.CannonBowListener; import buttondevteam.alipresents.components.magic.tricks.CannonBowSettings; public class MagicComponent extends Component{ - + @Override public void register(JavaPlugin plugin) { registerCommand(plugin, new CannonBowSettings()); diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java index 719f3fd..163e9b9 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java @@ -1,9 +1,13 @@ package buttondevteam.alipresents.components.magic.tricks; +import java.lang.reflect.Field; + import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Particle; import org.bukkit.Sound; +import org.bukkit.craftbukkit.v1_11_R1.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.v1_11_R1.entity.CraftTNTPrimed; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Arrow; import org.bukkit.entity.EntityType; @@ -17,13 +21,16 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.Vector; +import net.minecraft.server.v1_11_R1.EntityLiving; +import net.minecraft.server.v1_11_R1.EntityTNTPrimed; + public class CannonBowListener implements Listener { public static double SpeedMultiplier = 1.5; public static double minforce = 0.2; public final static String launchedTNTName = "CANNON BOW TNT:42170"; - JavaPlugin plugin; public CannonBowListener(JavaPlugin plugin){ - this.plugin = plugin; + SpeedMultiplier = plugin.getConfig().getDouble("magic.cannonbow.speedmultiplier"); + minforce = plugin.getConfig().getDouble("magic.cannonbow.minforce"); } @EventHandler @@ -55,6 +62,18 @@ public class CannonBowListener implements Listener { }else{ TNTPrimed tnt = (TNTPrimed) arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.PRIMED_TNT); + + // Change via NMS the source of the TNT by the player + EntityLiving nmsPlayer = (EntityLiving) (((CraftLivingEntity) player).getHandle()); + EntityTNTPrimed nmsTNT = (EntityTNTPrimed) (((CraftTNTPrimed) tnt).getHandle()); + try { + Field sourceField = EntityTNTPrimed.class.getDeclaredField("source"); + sourceField.setAccessible(true); + sourceField.set(nmsTNT, nmsPlayer); + } catch (Exception ex) { + ex.printStackTrace(); + } + tnt.setVelocity(playerVector.multiply(SpeedMultiplier).multiply(event.getForce())); tnt.setCustomName(launchedTNTName); @@ -62,7 +81,7 @@ public class CannonBowListener implements Listener { //Player Recoil player.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(-1)); - player.getWorld().playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 2.0F, 0); + player.getWorld().playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 1.0F, 0); player.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, player.getLocation(), 2); } diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java index e657375..d081bd3 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java @@ -6,15 +6,21 @@ import org.bukkit.entity.Player; import buttondevteam.alipresents.architecture.commands.ModCommand; public class CannonBowSettings extends ModCommand { - + @Override public boolean OnCommand(Player player, String alias, String[] args) { switch(args[0].toLowerCase()){ case "speedmultiplier": - CannonBowListener.SpeedMultiplier = NumberUtils.toDouble(args[1], CannonBowListener.SpeedMultiplier); + double speedMultiplier = NumberUtils.toDouble(args[1], CannonBowListener.SpeedMultiplier); + CannonBowListener.SpeedMultiplier = speedMultiplier; + this.getPlugin().getConfig().set("magic.cannonbow.speedmultiplier", speedMultiplier); + this.getPlugin().saveConfig(); break; case "minforce": - CannonBowListener.minforce = NumberUtils.toDouble(args[1], CannonBowListener.SpeedMultiplier); + double minforce = NumberUtils.toDouble(args[1], CannonBowListener.minforce); + CannonBowListener.minforce = minforce; + this.getPlugin().getConfig().set("magic.cannonbow.minforce", minforce); + this.getPlugin().saveConfig(); break; default: player.sendMessage("That isn't a valid setting!"); From bde22562622827d2b3c3e7bb6baf9f9eb3181e2d Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 21 Dec 2016 18:51:47 -0500 Subject: [PATCH 239/263] Added smoke to failed cannonbow shot --- .../alipresents/components/magic/tricks/CannonBowListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java index 163e9b9..a266827 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java @@ -58,7 +58,8 @@ public class CannonBowListener implements Listener { Vector playerVector = player.getEyeLocation().getDirection().normalize(); if (event.getForce() < minforce){ - + arrow.getWorld().spawnParticle(Particle.SMOKE_NORMAL, player.getLocation(), 30); + arrow.getWorld().playSound(player.getLocation(), Sound.BLOCK_LADDER_BREAK, 1.0F, -14); }else{ TNTPrimed tnt = (TNTPrimed) arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.PRIMED_TNT); From 4cf65fefa10035c0c32e601768cf4b6d97840b17 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 21 Dec 2016 19:02:48 -0500 Subject: [PATCH 240/263] Fully disabled Creative in World --- .../components/hotfix/HotfixComponent.java | 2 ++ .../hotfix/hotfixes/CreativeKillLoop.java | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java diff --git a/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java index 45e6a2a..abd2393 100644 --- a/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java +++ b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java @@ -7,6 +7,7 @@ import com.earth2me.essentials.Essentials; import buttondevteam.alipresents.architecture.Component; import buttondevteam.alipresents.components.hotfix.hotfixes.CowSpawnLoop; +import buttondevteam.alipresents.components.hotfix.hotfixes.CreativeKillLoop; import buttondevteam.alipresents.components.hotfix.hotfixes.GrassBreakListener; import buttondevteam.alipresents.components.hotfix.hotfixes.MobKillListener; import buttondevteam.alipresents.components.hotfix.hotfixes.NetherDisableListener; @@ -19,6 +20,7 @@ public class HotfixComponent extends Component { registerListener(plugin, new CowSpawnLoop(plugin)); registerListener(plugin, new MobKillListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); registerListener(plugin, new GrassBreakListener()); + registerListener(plugin, new CreativeKillLoop(plugin)); } diff --git a/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java new file mode 100644 index 0000000..d127982 --- /dev/null +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java @@ -0,0 +1,28 @@ +package buttondevteam.alipresents.components.hotfix.hotfixes; + +import org.bukkit.GameMode; +import org.bukkit.Server; +import org.bukkit.entity.Player; +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitRunnable; + +public class CreativeKillLoop extends BukkitRunnable implements Listener { + private Server server; + + public CreativeKillLoop(JavaPlugin plugin){ + this.server = plugin.getServer(); + this.runTaskTimer(plugin, 40, 40); + } + + @Override + public void run() { + for (Player player : server.getOnlinePlayers()){ + if(player.getGameMode() != GameMode.SURVIVAL && player.getWorld().getName() == "World" && player.isOp() == false){ + player.sendMessage("[Hotfix] Every Gamemode other than survival is disabled in the new world!"); + player.setGameMode(GameMode.SURVIVAL); + } + } + } + +} From 52bb4658036ec9cb82ca2332f40c7922e85553fd Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 21 Dec 2016 21:14:38 -0500 Subject: [PATCH 241/263] #37 finished cannon bow adjustments --- .../magic/tricks/CannonBowListener.java | 16 ++++-- .../magic/tricks/CannonBowSettings.java | 50 ++++++++++++------- 2 files changed, 44 insertions(+), 22 deletions(-) diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java index a266827..6c04546 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java @@ -6,6 +6,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Particle; import org.bukkit.Sound; +import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.craftbukkit.v1_11_R1.entity.CraftLivingEntity; import org.bukkit.craftbukkit.v1_11_R1.entity.CraftTNTPrimed; import org.bukkit.enchantments.Enchantment; @@ -27,10 +28,19 @@ import net.minecraft.server.v1_11_R1.EntityTNTPrimed; public class CannonBowListener implements Listener { public static double SpeedMultiplier = 1.5; public static double minforce = 0.2; + public static int fuseticks = 40; public final static String launchedTNTName = "CANNON BOW TNT:42170"; public CannonBowListener(JavaPlugin plugin){ - SpeedMultiplier = plugin.getConfig().getDouble("magic.cannonbow.speedmultiplier"); - minforce = plugin.getConfig().getDouble("magic.cannonbow.minforce"); + FileConfiguration config = plugin.getConfig(); + + if (config.isDouble("magic.cannonbow.speedmultiplier")) + SpeedMultiplier = config.getDouble("magic.cannonbow.speedmultiplier"); + + if (config.isDouble("magic.cannonbow.minforce")) + minforce = config.getDouble("magic.cannonbow.minforce"); + + if (config.isInt("magic.cannonbow.fuseticks")) + fuseticks = config.getInt("magic.cannonbow.fuseticks"); } @EventHandler @@ -78,7 +88,7 @@ public class CannonBowListener implements Listener { tnt.setVelocity(playerVector.multiply(SpeedMultiplier).multiply(event.getForce())); tnt.setCustomName(launchedTNTName); - tnt.setFuseTicks(40); + tnt.setFuseTicks(fuseticks); //Player Recoil player.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(-1)); diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java index d081bd3..c34641d 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java @@ -9,30 +9,42 @@ public class CannonBowSettings extends ModCommand { @Override public boolean OnCommand(Player player, String alias, String[] args) { - switch(args[0].toLowerCase()){ - case "speedmultiplier": - double speedMultiplier = NumberUtils.toDouble(args[1], CannonBowListener.SpeedMultiplier); - CannonBowListener.SpeedMultiplier = speedMultiplier; - this.getPlugin().getConfig().set("magic.cannonbow.speedmultiplier", speedMultiplier); - this.getPlugin().saveConfig(); - break; - case "minforce": - double minforce = NumberUtils.toDouble(args[1], CannonBowListener.minforce); - CannonBowListener.minforce = minforce; - this.getPlugin().getConfig().set("magic.cannonbow.minforce", minforce); - this.getPlugin().saveConfig(); - break; - default: - player.sendMessage("That isn't a valid setting!"); - player.sendMessage("Valid Settings are: "); - return false; + if (args.length > 1){ + switch(args[0].toLowerCase()){ + case "speedmultiplier": + double speedMultiplier = NumberUtils.toDouble(args[1], CannonBowListener.SpeedMultiplier); + CannonBowListener.SpeedMultiplier = speedMultiplier; + this.getPlugin().getConfig().set("magic.cannonbow.speedmultiplier", speedMultiplier); + this.getPlugin().saveConfig(); + break; + case "minforce": + double minforce = NumberUtils.toDouble(args[1], CannonBowListener.minforce); + CannonBowListener.minforce = minforce; + this.getPlugin().getConfig().set("magic.cannonbow.minforce", minforce); + this.getPlugin().saveConfig(); + break; + case "fuseticks": + int fuseticks = NumberUtils.toInt(args[1], CannonBowListener.fuseticks); + CannonBowListener.fuseticks = fuseticks; + this.getPlugin().getConfig().set("magic.cannonbow.fuseticks", fuseticks); + this.getPlugin().saveConfig(); + break; + case "display": + player.sendMessage("Speed Multiplier: "+CannonBowListener.SpeedMultiplier); + player.sendMessage("Minimum Force : "+CannonBowListener.minforce); + break; + default: + player.sendMessage("That isn't a valid setting!"); + player.sendMessage("Valid Settings are: "); + return false; + } } return true; } - + @Override public String GetCommandPath(){ return "magic cannonbow"; } - + } From 81b830e8055882f58fb59e87fc630732d7785373 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 21 Dec 2016 23:12:04 -0500 Subject: [PATCH 242/263] Added Maximum and minimum settings (Also gave kayla an arrow trail :D) --- .../components/magic/tricks/AliArrowTask.java | 4 ++ .../magic/tricks/CannonBowListener.java | 71 +++++++++++++++---- .../magic/tricks/CannonBowSettings.java | 26 +++---- 3 files changed, 73 insertions(+), 28 deletions(-) diff --git a/src/buttondevteam/alipresents/components/magic/tricks/AliArrowTask.java b/src/buttondevteam/alipresents/components/magic/tricks/AliArrowTask.java index f607210..05c5611 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/AliArrowTask.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/AliArrowTask.java @@ -35,6 +35,10 @@ public class AliArrowTask extends BukkitRunnable { case "norbipeti": arrow.getWorld().spawnParticle(Particle.LAVA, arrow.getLocation(), 1); break; + + case "mayskam1995": + arrow.getWorld().spawnParticle(Particle.DRIP_WATER, arrow.getLocation(), 2); + break; } } diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java index 6c04546..1dc1017 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java @@ -26,21 +26,25 @@ import net.minecraft.server.v1_11_R1.EntityLiving; import net.minecraft.server.v1_11_R1.EntityTNTPrimed; public class CannonBowListener implements Listener { - public static double SpeedMultiplier = 1.5; - public static double minforce = 0.2; - public static int fuseticks = 40; + private static double SpeedMultiplier = 1.5; + private static double minforce = 0.2; + private static int fuseticks = 40; + private static double recoil = 1; public final static String launchedTNTName = "CANNON BOW TNT:42170"; public CannonBowListener(JavaPlugin plugin){ FileConfiguration config = plugin.getConfig(); if (config.isDouble("magic.cannonbow.speedmultiplier")) - SpeedMultiplier = config.getDouble("magic.cannonbow.speedmultiplier"); + setSpeedMultiplier(config.getDouble("magic.cannonbow.speedmultiplier")); if (config.isDouble("magic.cannonbow.minforce")) - minforce = config.getDouble("magic.cannonbow.minforce"); + setMinforce(config.getDouble("magic.cannonbow.minforce")); if (config.isInt("magic.cannonbow.fuseticks")) - fuseticks = config.getInt("magic.cannonbow.fuseticks"); + setFuseticks(config.getInt("magic.cannonbow.fuseticks")); + + if (config.isDouble("magic.cannonbow.recoil")) + setRecoil(config.getDouble("magic.cannonbow.recoil")); } @EventHandler @@ -64,14 +68,15 @@ public class CannonBowListener implements Listener { if (!(bow.getItemMeta().getDisplayName().toUpperCase().contains("CANNON BOW")))return; //TNT Spawning - Vector playerVector = player.getEyeLocation().getDirection().normalize(); - if (event.getForce() < minforce){ + if (event.getForce() < getMinforce()){ + //Smoke cloud if draw is too low arrow.getWorld().spawnParticle(Particle.SMOKE_NORMAL, player.getLocation(), 30); - arrow.getWorld().playSound(player.getLocation(), Sound.BLOCK_LADDER_BREAK, 1.0F, -14); + arrow.getWorld().playSound(player.getLocation(), Sound.BLOCK_LADDER_BREAK, 1.0F, -7); }else{ + //Spawn TNT TNTPrimed tnt = (TNTPrimed) arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.PRIMED_TNT); // Change via NMS the source of the TNT by the player @@ -85,13 +90,13 @@ public class CannonBowListener implements Listener { ex.printStackTrace(); } - - tnt.setVelocity(playerVector.multiply(SpeedMultiplier).multiply(event.getForce())); + // + tnt.setVelocity(playerVector.multiply(getSpeedMultiplier()).multiply(event.getForce())); tnt.setCustomName(launchedTNTName); - tnt.setFuseTicks(fuseticks); + tnt.setFuseTicks(getFuseticks()); //Player Recoil - player.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(-1)); + player.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(-1).multiply(getRecoil())); player.getWorld().playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 1.0F, 0); player.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, player.getLocation(), 2); @@ -114,4 +119,44 @@ public class CannonBowListener implements Listener { } + + public static double getSpeedMultiplier() { + return SpeedMultiplier; + } + + public static void setSpeedMultiplier(double speedMultiplier) { + if (speedMultiplier > 4) speedMultiplier = 4; + if (speedMultiplier < 0) speedMultiplier = 0; + SpeedMultiplier = speedMultiplier; + } + + public static double getMinforce() { + return minforce; + } + + public static void setMinforce(double minforce) { + if (minforce > 1) minforce = 1; + if (minforce < 0) minforce = 0; + CannonBowListener.minforce = minforce; + } + + public static int getFuseticks() { + return fuseticks; + } + + public static void setFuseticks(int fuseticks) { + if (fuseticks > 400) fuseticks = 400; + if (fuseticks < 0) fuseticks = 0; + CannonBowListener.fuseticks = fuseticks; + } + + public static double getRecoil() { + return recoil; + } + + public static void setRecoil(double recoil) { + if (recoil > 20) recoil = 20; + if (recoil < 0) recoil = 0; + CannonBowListener.recoil = recoil; + } } \ No newline at end of file diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java index c34641d..d781203 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java @@ -12,26 +12,22 @@ public class CannonBowSettings extends ModCommand { if (args.length > 1){ switch(args[0].toLowerCase()){ case "speedmultiplier": - double speedMultiplier = NumberUtils.toDouble(args[1], CannonBowListener.SpeedMultiplier); - CannonBowListener.SpeedMultiplier = speedMultiplier; - this.getPlugin().getConfig().set("magic.cannonbow.speedmultiplier", speedMultiplier); - this.getPlugin().saveConfig(); + CannonBowListener.setSpeedMultiplier(NumberUtils.toDouble(args[1], CannonBowListener.getSpeedMultiplier())); break; case "minforce": - double minforce = NumberUtils.toDouble(args[1], CannonBowListener.minforce); - CannonBowListener.minforce = minforce; - this.getPlugin().getConfig().set("magic.cannonbow.minforce", minforce); - this.getPlugin().saveConfig(); + CannonBowListener.setMinforce(NumberUtils.toDouble(args[1], CannonBowListener.getMinforce())); break; case "fuseticks": - int fuseticks = NumberUtils.toInt(args[1], CannonBowListener.fuseticks); - CannonBowListener.fuseticks = fuseticks; - this.getPlugin().getConfig().set("magic.cannonbow.fuseticks", fuseticks); - this.getPlugin().saveConfig(); + CannonBowListener.setFuseticks(NumberUtils.toInt(args[1], CannonBowListener.getFuseticks())); + break; + case "recoil": + CannonBowListener.setRecoil(NumberUtils.toDouble((args[1]), CannonBowListener.getRecoil())); break; case "display": - player.sendMessage("Speed Multiplier: "+CannonBowListener.SpeedMultiplier); - player.sendMessage("Minimum Force : "+CannonBowListener.minforce); + player.sendMessage("Speed Multiplier: "+CannonBowListener.getSpeedMultiplier()); + player.sendMessage("Minimum Force: "+CannonBowListener.getMinforce()); + player.sendMessage("Fuseticks: " + CannonBowListener.getFuseticks()); + player.sendMessage("Recoil: " + CannonBowListener.getRecoil()); break; default: player.sendMessage("That isn't a valid setting!"); @@ -44,7 +40,7 @@ public class CannonBowSettings extends ModCommand { @Override public String GetCommandPath(){ - return "magic cannonbow"; + return "magic cannonbow settings"; } } From 1f75e7cbf3fb5307698a5ca41248960043e6a823 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 21 Dec 2016 23:32:27 -0500 Subject: [PATCH 243/263] Adjustments --- .../components/hotfix/hotfixes/CreativeKillLoop.java | 7 +++---- .../components/magic/tricks/CannonBowSettings.java | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java index d127982..cd7e045 100644 --- a/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java @@ -1,23 +1,22 @@ package buttondevteam.alipresents.components.hotfix.hotfixes; import org.bukkit.GameMode; -import org.bukkit.Server; import org.bukkit.entity.Player; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; public class CreativeKillLoop extends BukkitRunnable implements Listener { - private Server server; + private JavaPlugin plugin; public CreativeKillLoop(JavaPlugin plugin){ - this.server = plugin.getServer(); + this.plugin = plugin; this.runTaskTimer(plugin, 40, 40); } @Override public void run() { - for (Player player : server.getOnlinePlayers()){ + for (Player player : plugin.getServer().getOnlinePlayers()){ if(player.getGameMode() != GameMode.SURVIVAL && player.getWorld().getName() == "World" && player.isOp() == false){ player.sendMessage("[Hotfix] Every Gamemode other than survival is disabled in the new world!"); player.setGameMode(GameMode.SURVIVAL); diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java index d781203..8aa8655 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java @@ -31,7 +31,8 @@ public class CannonBowSettings extends ModCommand { break; default: player.sendMessage("That isn't a valid setting!"); - player.sendMessage("Valid Settings are: "); + player.sendMessage("Valid Settings are: speedmultiplier, minforce, fuseticks, recoil"); + player.sendMessage("Use argument 'display' to disply current settings"); return false; } } From 8f8d1756098c2d2fe7c942a308b226a112bc4049 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 22 Dec 2016 04:37:36 -0500 Subject: [PATCH 244/263] Removed NMS because of build errors --- pom.xml | 2 +- .../components/magic/tricks/CannonBowListener.java | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index d21b76e..ab68ed4 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ org.spigotmc - spigot + spigot-api 1.11-R0.1-SNAPSHOT diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java index 1dc1017..3bf6f60 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java @@ -1,14 +1,10 @@ package buttondevteam.alipresents.components.magic.tricks; -import java.lang.reflect.Field; - import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Particle; import org.bukkit.Sound; import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.craftbukkit.v1_11_R1.entity.CraftLivingEntity; -import org.bukkit.craftbukkit.v1_11_R1.entity.CraftTNTPrimed; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Arrow; import org.bukkit.entity.EntityType; @@ -22,9 +18,6 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.Vector; -import net.minecraft.server.v1_11_R1.EntityLiving; -import net.minecraft.server.v1_11_R1.EntityTNTPrimed; - public class CannonBowListener implements Listener { private static double SpeedMultiplier = 1.5; private static double minforce = 0.2; @@ -78,7 +71,7 @@ public class CannonBowListener implements Listener { }else{ //Spawn TNT TNTPrimed tnt = (TNTPrimed) arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.PRIMED_TNT); - + /* // Change via NMS the source of the TNT by the player EntityLiving nmsPlayer = (EntityLiving) (((CraftLivingEntity) player).getHandle()); EntityTNTPrimed nmsTNT = (EntityTNTPrimed) (((CraftTNTPrimed) tnt).getHandle()); @@ -88,7 +81,7 @@ public class CannonBowListener implements Listener { sourceField.set(nmsTNT, nmsPlayer); } catch (Exception ex) { ex.printStackTrace(); - } + }*/ // tnt.setVelocity(playerVector.multiply(getSpeedMultiplier()).multiply(event.getForce())); From 01cc741e3361decc9b5c8e16dbf4660bc2f2eda8 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 22 Dec 2016 05:16:04 -0500 Subject: [PATCH 245/263] Added Debug Messages --- .../components/hotfix/hotfixes/CreativeKillLoop.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java index cd7e045..b83c626 100644 --- a/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java @@ -16,8 +16,13 @@ public class CreativeKillLoop extends BukkitRunnable implements Listener { @Override public void run() { + plugin.getServer().broadcastMessage("CreativeLoop"); for (Player player : plugin.getServer().getOnlinePlayers()){ - if(player.getGameMode() != GameMode.SURVIVAL && player.getWorld().getName() == "World" && player.isOp() == false){ + player.sendMessage("Player: " + player.getName()); + player.sendMessage("World: " + player.getWorld()); + player.sendMessage("Gamemode : " + player.getGameMode().toString()); + player.sendMessage("IsOP: " + player.isOp()); + if(player.getGameMode() != GameMode.SURVIVAL && player.getWorld().getName().equalsIgnoreCase("world") && player.isOp() == false){ player.sendMessage("[Hotfix] Every Gamemode other than survival is disabled in the new world!"); player.setGameMode(GameMode.SURVIVAL); } From f65cd9210c9c863f7e92f1bca527b931434a9b77 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 22 Dec 2016 05:22:04 -0500 Subject: [PATCH 246/263] Finally did the duty The guillotine has dropped. Contact Ali *directly* and *personally* if you have complaints or a valid reason to use non-survival inventory. (Written at 5:21 AM, I might have been salty as fuck when I made this decision) --- .../components/hotfix/hotfixes/CreativeKillLoop.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java index b83c626..e90ea0a 100644 --- a/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java @@ -16,12 +16,7 @@ public class CreativeKillLoop extends BukkitRunnable implements Listener { @Override public void run() { - plugin.getServer().broadcastMessage("CreativeLoop"); for (Player player : plugin.getServer().getOnlinePlayers()){ - player.sendMessage("Player: " + player.getName()); - player.sendMessage("World: " + player.getWorld()); - player.sendMessage("Gamemode : " + player.getGameMode().toString()); - player.sendMessage("IsOP: " + player.isOp()); if(player.getGameMode() != GameMode.SURVIVAL && player.getWorld().getName().equalsIgnoreCase("world") && player.isOp() == false){ player.sendMessage("[Hotfix] Every Gamemode other than survival is disabled in the new world!"); player.setGameMode(GameMode.SURVIVAL); From 4a4ee986d57bb8dd2df2be48e3a2bb80571a2e63 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 22 Dec 2016 09:33:31 -0500 Subject: [PATCH 247/263] Changed Filepaths --- .../components/metrics/MetricsComponent.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/buttondevteam/alipresents/components/metrics/MetricsComponent.java b/src/buttondevteam/alipresents/components/metrics/MetricsComponent.java index ea57a09..0e561a6 100644 --- a/src/buttondevteam/alipresents/components/metrics/MetricsComponent.java +++ b/src/buttondevteam/alipresents/components/metrics/MetricsComponent.java @@ -11,15 +11,20 @@ import buttondevteam.alipresents.components.metrics.files.MetricsFile; import buttondevteam.alipresents.components.metrics.output.GetLoginMetrics; public class MetricsComponent extends Component{ - String defaultPath = "src/alisolarflare/resources"; - String defaultFilePath = (defaultPath + "/metrics.txt"); - String playerLoginsFilePath = (defaultPath + "/playerLogins.txt"); + String defaultPath; + String defaultFilePath; + String playerLoginsFilePath; public MetricsFile playerLoginsFile; // DATA - STRING public List metricsList; @Override public void register(JavaPlugin plugin){ + + defaultPath = plugin.getDataFolder().getAbsolutePath(); + defaultFilePath = defaultPath + "/metrics.txt"; + playerLoginsFilePath = defaultPath + "/playerLogins.txt"; + playerLoginsFile = new MetricsFile(playerLoginsFilePath); registerCommand(plugin, new GetLoginMetrics(this)); registerListener(plugin, new PlayerJoinListener(this, playerLoginsFile)); From 67aab381686c2b3be911b0c56b4aa39787cfb580 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 22 Dec 2016 19:58:29 -0500 Subject: [PATCH 248/263] ok <@126012419792306177> --- src/buttondevteam/alipresents/AliPresents.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/buttondevteam/alipresents/AliPresents.java b/src/buttondevteam/alipresents/AliPresents.java index d8ad8bc..584d194 100644 --- a/src/buttondevteam/alipresents/AliPresents.java +++ b/src/buttondevteam/alipresents/AliPresents.java @@ -8,6 +8,7 @@ import org.bukkit.plugin.java.JavaPlugin; import buttondevteam.alipresents.components.alilinks.AliLinkComponent; import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesComponent; +import buttondevteam.alipresents.components.dungeons.DungeonComponent; import buttondevteam.alipresents.components.flaircolour.FlairColourComponent; import buttondevteam.alipresents.components.gpower.GPowerComponent; import buttondevteam.alipresents.components.hotfix.HotfixComponent; @@ -24,6 +25,7 @@ public class AliPresents extends JavaPlugin{ new AliLinkComponent().register(this); new CreativeBoundariesComponent().register(this); + new DungeonComponent().register(this); new FlairColourComponent().register(this); new GPowerComponent().register(this); new HotfixComponent().register(this); From d839fd9dd163a8a4a81efcb44af9acedfc381b26 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 22 Dec 2016 19:58:43 -0500 Subject: [PATCH 249/263] Started work on Dungeons --- .../components/dungeons/DungeonComponent.java | 20 +++++++++ .../components/dungeons/commands/Enter.java | 23 ++++++++++ .../components/dungeons/commands/Exit.java | 23 ++++++++++ .../components/dungeons/dungeons/Dungeon.java | 30 +++++++++++++ .../dungeons/dungeons/GenericDungeonA1.java | 45 +++++++++++++++++++ 5 files changed, 141 insertions(+) create mode 100644 src/buttondevteam/alipresents/components/dungeons/DungeonComponent.java create mode 100644 src/buttondevteam/alipresents/components/dungeons/commands/Enter.java create mode 100644 src/buttondevteam/alipresents/components/dungeons/commands/Exit.java create mode 100644 src/buttondevteam/alipresents/components/dungeons/dungeons/Dungeon.java create mode 100644 src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java diff --git a/src/buttondevteam/alipresents/components/dungeons/DungeonComponent.java b/src/buttondevteam/alipresents/components/dungeons/DungeonComponent.java new file mode 100644 index 0000000..439f60c --- /dev/null +++ b/src/buttondevteam/alipresents/components/dungeons/DungeonComponent.java @@ -0,0 +1,20 @@ +package buttondevteam.alipresents.components.dungeons; + +import org.bukkit.plugin.java.JavaPlugin; + +import buttondevteam.alipresents.architecture.Component; +import buttondevteam.alipresents.components.dungeons.commands.Enter; +import buttondevteam.alipresents.components.dungeons.commands.Exit; +import buttondevteam.alipresents.components.dungeons.dungeons.GenericDungeonA1; + +public class DungeonComponent extends Component { + public GenericDungeonA1 dungeonA1; + @Override + public void register(JavaPlugin plugin) { + dungeonA1 = new GenericDungeonA1(plugin); + registerCommand(plugin, new Enter(this)); + registerCommand(plugin, new Exit(this)); + + } + +} diff --git a/src/buttondevteam/alipresents/components/dungeons/commands/Enter.java b/src/buttondevteam/alipresents/components/dungeons/commands/Enter.java new file mode 100644 index 0000000..d93b8d7 --- /dev/null +++ b/src/buttondevteam/alipresents/components/dungeons/commands/Enter.java @@ -0,0 +1,23 @@ +package buttondevteam.alipresents.components.dungeons.commands; + +import org.bukkit.entity.Player; + +import buttondevteam.alipresents.architecture.commands.ModCommand; +import buttondevteam.alipresents.components.dungeons.DungeonComponent; + +public class Enter extends ModCommand{ + private DungeonComponent component; + public Enter(DungeonComponent component) { + this.component = component; + } + @Override + public boolean OnCommand(Player player, String alias, String[] args) { + component.dungeonA1.enterDungeon(player); + return false; + } + @Override + public String GetCommandPath(){ + return "dungeon enter"; + } + +} diff --git a/src/buttondevteam/alipresents/components/dungeons/commands/Exit.java b/src/buttondevteam/alipresents/components/dungeons/commands/Exit.java new file mode 100644 index 0000000..88b2f74 --- /dev/null +++ b/src/buttondevteam/alipresents/components/dungeons/commands/Exit.java @@ -0,0 +1,23 @@ +package buttondevteam.alipresents.components.dungeons.commands; + +import org.bukkit.entity.Player; + +import buttondevteam.alipresents.architecture.commands.PlayerCommand; +import buttondevteam.alipresents.components.dungeons.DungeonComponent; + +public class Exit extends PlayerCommand { + + private DungeonComponent component; + public Exit(DungeonComponent component) { + this.component = component; + } + @Override + public boolean OnCommand(Player player, String alias, String[] args) { + component.dungeonA1.exitDungeon(player); + return false; + } + public String getCommandPath(){ + return "dungeon exit"; + } + +} diff --git a/src/buttondevteam/alipresents/components/dungeons/dungeons/Dungeon.java b/src/buttondevteam/alipresents/components/dungeons/dungeons/Dungeon.java new file mode 100644 index 0000000..520c36a --- /dev/null +++ b/src/buttondevteam/alipresents/components/dungeons/dungeons/Dungeon.java @@ -0,0 +1,30 @@ +package buttondevteam.alipresents.components.dungeons.dungeons; + +import org.bukkit.GameMode; +import org.bukkit.Location; +import org.bukkit.entity.Player; + +/**Dungeon Object that represents a dungeon*/ +public abstract class Dungeon { + public abstract Location getDungeonEntrance(); + public abstract Location getDungeonExit(); + public boolean enterDungeon(Player player){ + + if (getDungeonEntrance() == null){ + player.sendMessage("There has been a collapse! You may not enter the dungeon now."); + return false; + } + player.teleport(getDungeonEntrance()); + player.setGameMode(GameMode.ADVENTURE); + return true; + } + public boolean exitDungeon(Player player){ + if (getDungeonExit() == null){ + player.sendMessage("Oh god, something went horribly wrong with exiting... Yell for help!"); + return false; + } + player.teleport(getDungeonExit()); + player.setGameMode(GameMode.SURVIVAL); + return true; + } +} diff --git a/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java b/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java new file mode 100644 index 0000000..d262f56 --- /dev/null +++ b/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java @@ -0,0 +1,45 @@ +package buttondevteam.alipresents.components.dungeons.dungeons; + +import org.bukkit.Location; +import org.bukkit.plugin.java.JavaPlugin; + +public class GenericDungeonA1 extends Dungeon{ + private Location dungeonEntrance; + private Location dungeonExit; + + public GenericDungeonA1(JavaPlugin plugin){ + if(!initDungeon(plugin)){ + plugin.getServer().broadcastMessage("DungeonA1 can't be initialized!"); + } + } + private boolean initDungeon(JavaPlugin plugin){ + if (plugin.getServer().getWorld("Dungeons") == null || plugin.getServer().getWorld("world") == null){ + plugin.getServer().broadcastMessage("GenericDungeonA1Error! One of the worlds is null!"); + plugin.getServer().broadcastMessage("Available Worlds... " + plugin.getServer().getWorlds().toString()); + return false; + } + + dungeonEntrance = new Location(plugin.getServer().getWorld("Dungeons"), -7.5, 138.0, -91.5); + dungeonExit = plugin.getServer().getWorld("world").getSpawnLocation().clone(); + + if (dungeonEntrance == null || dungeonExit == null){ + plugin.getServer().broadcastMessage("DungeonA1Error! Dungeon Entrance or Exit is null!"); + plugin.getServer().broadcastMessage("DungeonEnterance: " + dungeonEntrance.toString()); + plugin.getServer().broadcastMessage("Dungeon Exit: " + dungeonExit.toString()); + return false; + } + return true; + } + public void setDungeonEnterance(Location location){ + dungeonEntrance = location; + } + @Override + public Location getDungeonEntrance() { + return dungeonEntrance; + } + @Override + public Location getDungeonExit() { + return dungeonExit; + } + +} From c06f19d6e448e9f80ed5affbc4f0779a672c1f3e Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 22 Dec 2016 20:02:04 -0500 Subject: [PATCH 250/263] Corrected grammar <@126012419792306177> --- .../components/dungeons/dungeons/GenericDungeonA1.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java b/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java index d262f56..55ca9b6 100644 --- a/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java +++ b/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java @@ -9,7 +9,7 @@ public class GenericDungeonA1 extends Dungeon{ public GenericDungeonA1(JavaPlugin plugin){ if(!initDungeon(plugin)){ - plugin.getServer().broadcastMessage("DungeonA1 can't be initialized!"); + plugin.getServer().broadcastMessage("DungeonA1 cant be initialized!"); } } private boolean initDungeon(JavaPlugin plugin){ From 1d3471f09909a3e459df2090c4725b158a5503e9 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 22 Dec 2016 21:31:36 -0500 Subject: [PATCH 251/263] Got Dungeon teleporting set up and working --- config.yml | 5 ---- plugin.yml | 2 ++ .../components/dungeons/DungeonComponent.java | 8 ++++- .../dungeons/commands/DisplayDebug.java | 28 ++++++++++++++++++ .../components/dungeons/commands/Enter.java | 4 +-- .../components/dungeons/commands/Exit.java | 7 +++-- .../dungeons/commands/SetEntrance.java | 25 ++++++++++++++++ .../components/dungeons/commands/SetExit.java | 28 ++++++++++++++++++ .../components/dungeons/dungeons/Dungeon.java | 2 ++ .../dungeons/dungeons/GenericDungeonA1.java | 29 ++++++++++++------- 10 files changed, 116 insertions(+), 22 deletions(-) create mode 100644 src/buttondevteam/alipresents/components/dungeons/commands/DisplayDebug.java create mode 100644 src/buttondevteam/alipresents/components/dungeons/commands/SetEntrance.java create mode 100644 src/buttondevteam/alipresents/components/dungeons/commands/SetExit.java diff --git a/config.yml b/config.yml index 9fd8419..e69de29 100644 --- a/config.yml +++ b/config.yml @@ -1,5 +0,0 @@ -UHCMatchState: "IDLE" -magic: - cannonbow: - speedmultiplier: 1.5 - minforce: 0.2 \ No newline at end of file diff --git a/plugin.yml b/plugin.yml index 32b153e..4860aeb 100644 --- a/plugin.yml +++ b/plugin.yml @@ -7,6 +7,8 @@ commands: description: creates wireless redstone cb: description: creates creative boundaries + dungeons: + description: handles the resource dungeons scattered around the map debug: description: debug commands flaircolour: diff --git a/src/buttondevteam/alipresents/components/dungeons/DungeonComponent.java b/src/buttondevteam/alipresents/components/dungeons/DungeonComponent.java index 439f60c..d9e0b1d 100644 --- a/src/buttondevteam/alipresents/components/dungeons/DungeonComponent.java +++ b/src/buttondevteam/alipresents/components/dungeons/DungeonComponent.java @@ -3,8 +3,11 @@ package buttondevteam.alipresents.components.dungeons; import org.bukkit.plugin.java.JavaPlugin; import buttondevteam.alipresents.architecture.Component; +import buttondevteam.alipresents.components.dungeons.commands.DisplayDebug; import buttondevteam.alipresents.components.dungeons.commands.Enter; import buttondevteam.alipresents.components.dungeons.commands.Exit; +import buttondevteam.alipresents.components.dungeons.commands.SetEntrance; +import buttondevteam.alipresents.components.dungeons.commands.SetExit; import buttondevteam.alipresents.components.dungeons.dungeons.GenericDungeonA1; public class DungeonComponent extends Component { @@ -12,9 +15,12 @@ public class DungeonComponent extends Component { @Override public void register(JavaPlugin plugin) { dungeonA1 = new GenericDungeonA1(plugin); + + registerCommand(plugin, new DisplayDebug(this)); registerCommand(plugin, new Enter(this)); registerCommand(plugin, new Exit(this)); - + registerCommand(plugin, new SetEntrance(this)); + registerCommand(plugin, new SetExit(this)); } } diff --git a/src/buttondevteam/alipresents/components/dungeons/commands/DisplayDebug.java b/src/buttondevteam/alipresents/components/dungeons/commands/DisplayDebug.java new file mode 100644 index 0000000..88803c3 --- /dev/null +++ b/src/buttondevteam/alipresents/components/dungeons/commands/DisplayDebug.java @@ -0,0 +1,28 @@ +package buttondevteam.alipresents.components.dungeons.commands; + +import org.bukkit.entity.Player; + +import buttondevteam.alipresents.architecture.commands.ModCommand; +import buttondevteam.alipresents.components.dungeons.DungeonComponent; + +public class DisplayDebug extends ModCommand { + + private DungeonComponent component; + + public DisplayDebug(DungeonComponent component) { + this.component = component; + } + + @Override + public boolean OnCommand(Player player, String alias, String[] args) { + player.sendMessage("Entrance Location: "+component.dungeonA1.getDungeonEntrance().toString()); + player.sendMessage("Exit Location: "+component.dungeonA1.getDungeonExit().toString()); + return true; + } + + @Override + public String GetCommandPath(){ + return "dungeons display debug"; + } + +} diff --git a/src/buttondevteam/alipresents/components/dungeons/commands/Enter.java b/src/buttondevteam/alipresents/components/dungeons/commands/Enter.java index d93b8d7..45317f4 100644 --- a/src/buttondevteam/alipresents/components/dungeons/commands/Enter.java +++ b/src/buttondevteam/alipresents/components/dungeons/commands/Enter.java @@ -13,11 +13,11 @@ public class Enter extends ModCommand{ @Override public boolean OnCommand(Player player, String alias, String[] args) { component.dungeonA1.enterDungeon(player); - return false; + return true; } @Override public String GetCommandPath(){ - return "dungeon enter"; + return "dungeons enter"; } } diff --git a/src/buttondevteam/alipresents/components/dungeons/commands/Exit.java b/src/buttondevteam/alipresents/components/dungeons/commands/Exit.java index 88b2f74..17c5dd2 100644 --- a/src/buttondevteam/alipresents/components/dungeons/commands/Exit.java +++ b/src/buttondevteam/alipresents/components/dungeons/commands/Exit.java @@ -14,10 +14,11 @@ public class Exit extends PlayerCommand { @Override public boolean OnCommand(Player player, String alias, String[] args) { component.dungeonA1.exitDungeon(player); - return false; + return true; } - public String getCommandPath(){ - return "dungeon exit"; + @Override + public String GetCommandPath(){ + return "dungeons exit"; } } diff --git a/src/buttondevteam/alipresents/components/dungeons/commands/SetEntrance.java b/src/buttondevteam/alipresents/components/dungeons/commands/SetEntrance.java new file mode 100644 index 0000000..3d9a25b --- /dev/null +++ b/src/buttondevteam/alipresents/components/dungeons/commands/SetEntrance.java @@ -0,0 +1,25 @@ +package buttondevteam.alipresents.components.dungeons.commands; + +import org.bukkit.entity.Player; + +import buttondevteam.alipresents.architecture.commands.ModCommand; +import buttondevteam.alipresents.components.dungeons.DungeonComponent; + +public class SetEntrance extends ModCommand { + + private DungeonComponent component; + public SetEntrance(DungeonComponent component) { + this.component = component; + } + @Override + public boolean OnCommand(Player player, String alias, String[] args) { + player.sendMessage("Setting DungeonA1's Entrance!"); + component.dungeonA1.setEntrance(player.getLocation()); + player.sendMessage("Entrance Set!"); + return true; + } + public String GetCommandPath(){ + return "dungeons set entrance"; + } + +} diff --git a/src/buttondevteam/alipresents/components/dungeons/commands/SetExit.java b/src/buttondevteam/alipresents/components/dungeons/commands/SetExit.java new file mode 100644 index 0000000..b7d356d --- /dev/null +++ b/src/buttondevteam/alipresents/components/dungeons/commands/SetExit.java @@ -0,0 +1,28 @@ +package buttondevteam.alipresents.components.dungeons.commands; + +import org.bukkit.entity.Player; + +import buttondevteam.alipresents.architecture.commands.ModCommand; +import buttondevteam.alipresents.components.dungeons.DungeonComponent; + +public class SetExit extends ModCommand { + + private DungeonComponent component; + + public SetExit(DungeonComponent component) { + this.component = component; + } + + @Override + public boolean OnCommand(Player player, String alias, String[] args) { + player.sendMessage("Setting DungeonA1's Exit!"); + component.dungeonA1.setExit(player.getLocation()); + player.sendMessage("DungeonA1's Exit Set!"); + return true; + } + @Override + public String GetCommandPath(){ + return "dungeons set exit"; + } + +} diff --git a/src/buttondevteam/alipresents/components/dungeons/dungeons/Dungeon.java b/src/buttondevteam/alipresents/components/dungeons/dungeons/Dungeon.java index 520c36a..f2f9453 100644 --- a/src/buttondevteam/alipresents/components/dungeons/dungeons/Dungeon.java +++ b/src/buttondevteam/alipresents/components/dungeons/dungeons/Dungeon.java @@ -8,6 +8,8 @@ import org.bukkit.entity.Player; public abstract class Dungeon { public abstract Location getDungeonEntrance(); public abstract Location getDungeonExit(); + public abstract void setEntrance(Location location); + public abstract void setExit(Location location); public boolean enterDungeon(Player player){ if (getDungeonEntrance() == null){ diff --git a/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java b/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java index 55ca9b6..b4c13f5 100644 --- a/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java +++ b/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java @@ -4,13 +4,15 @@ import org.bukkit.Location; import org.bukkit.plugin.java.JavaPlugin; public class GenericDungeonA1 extends Dungeon{ - private Location dungeonEntrance; - private Location dungeonExit; + private Location entrance; + private Location exit; + private JavaPlugin plugin; public GenericDungeonA1(JavaPlugin plugin){ if(!initDungeon(plugin)){ plugin.getServer().broadcastMessage("DungeonA1 cant be initialized!"); } + this.plugin = plugin; } private boolean initDungeon(JavaPlugin plugin){ if (plugin.getServer().getWorld("Dungeons") == null || plugin.getServer().getWorld("world") == null){ @@ -19,27 +21,32 @@ public class GenericDungeonA1 extends Dungeon{ return false; } - dungeonEntrance = new Location(plugin.getServer().getWorld("Dungeons"), -7.5, 138.0, -91.5); - dungeonExit = plugin.getServer().getWorld("world").getSpawnLocation().clone(); + entrance = new Location(plugin.getServer().getWorld("Dungeons"), -7.5, 138.0, -91.5); + exit = plugin.getServer().getWorld("world").getSpawnLocation().clone(); - if (dungeonEntrance == null || dungeonExit == null){ + if (entrance == null || exit == null){ plugin.getServer().broadcastMessage("DungeonA1Error! Dungeon Entrance or Exit is null!"); - plugin.getServer().broadcastMessage("DungeonEnterance: " + dungeonEntrance.toString()); - plugin.getServer().broadcastMessage("Dungeon Exit: " + dungeonExit.toString()); + plugin.getServer().broadcastMessage("Dungeon Entrance: " + entrance.toString()); + plugin.getServer().broadcastMessage("Dungeon Exit: " + exit.toString()); return false; } return true; } - public void setDungeonEnterance(Location location){ - dungeonEntrance = location; + public void setEntrance(Location location){ + plugin.getConfig().set("dungeons.dungeona1.entrance", entrance); + plugin.saveConfig(); + entrance = location; + } + public void setExit(Location location){ + exit = location; } @Override public Location getDungeonEntrance() { - return dungeonEntrance; + return entrance; } @Override public Location getDungeonExit() { - return dungeonExit; + return exit; } } From 6aa87119a0fc951a6e86da2cc83c43ea2ee842cb Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 23 Dec 2016 01:30:31 -0500 Subject: [PATCH 252/263] Oh god this is the ugliest code I've written in a while --- .../dungeons/dungeons/GenericDungeonA1.java | 41 ++++++++++++++++--- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java b/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java index b4c13f5..4f70d62 100644 --- a/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java +++ b/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java @@ -1,6 +1,7 @@ package buttondevteam.alipresents.components.dungeons.dungeons; import org.bukkit.Location; +import org.bukkit.World; import org.bukkit.plugin.java.JavaPlugin; public class GenericDungeonA1 extends Dungeon{ @@ -15,14 +16,22 @@ public class GenericDungeonA1 extends Dungeon{ this.plugin = plugin; } private boolean initDungeon(JavaPlugin plugin){ + /* if (plugin.getServer().getWorld("Dungeons") == null || plugin.getServer().getWorld("world") == null){ plugin.getServer().broadcastMessage("GenericDungeonA1Error! One of the worlds is null!"); plugin.getServer().broadcastMessage("Available Worlds... " + plugin.getServer().getWorlds().toString()); return false; + }*/ + if ((entrance = loadLocation(plugin, "dungeons.dungeona1.enter")) == null){ + if(plugin.getServer().getWorld("Dungeons") != null){ + entrance = new Location(plugin.getServer().getWorld("Dungeons"), -7.5, 138.0, -91.5); + } + } + if ((exit = loadLocation(plugin, "dungeons.dungeona1.exit")) == null){ + if (plugin.getServer().getWorld("world") != null){ + exit = plugin.getServer().getWorld("world").getSpawnLocation().clone(); + } } - - entrance = new Location(plugin.getServer().getWorld("Dungeons"), -7.5, 138.0, -91.5); - exit = plugin.getServer().getWorld("world").getSpawnLocation().clone(); if (entrance == null || exit == null){ plugin.getServer().broadcastMessage("DungeonA1Error! Dungeon Entrance or Exit is null!"); @@ -32,12 +41,14 @@ public class GenericDungeonA1 extends Dungeon{ } return true; } + @Override public void setEntrance(Location location){ - plugin.getConfig().set("dungeons.dungeona1.entrance", entrance); - plugin.saveConfig(); + saveLocation(plugin, "dungeons.dungeona1.enter", location); entrance = location; } + @Override public void setExit(Location location){ + saveLocation(plugin, "dungeons.dungeona1.exit", location); exit = location; } @Override @@ -48,5 +59,23 @@ public class GenericDungeonA1 extends Dungeon{ public Location getDungeonExit() { return exit; } - + private void saveLocation(JavaPlugin plugin, String path, Location location){ + plugin.getConfig().set(path+".world", location.getWorld().getName()); + plugin.getConfig().set(path+".x", location.getX()); + plugin.getConfig().set(path+".y", location.getY()); + plugin.getConfig().set(path+".z", location.getZ()); + plugin.saveConfig(); + } + private Location loadLocation(JavaPlugin plugin, String path){ + try{ + World world = plugin.getServer().getWorld(plugin.getConfig().getString(path+".world")); + double x = plugin.getConfig().getDouble(path+".x"); + double y = plugin.getConfig().getDouble(path+".y"); + double z = plugin.getConfig().getDouble(path+".z"); + return new Location(world, x, y, z); + }catch(Exception e){ + e.printStackTrace(); + return null; + } + } } From b9219413f6247d50898f9cdbf9d2b29587176f8e Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 23 Dec 2016 22:50:49 -0500 Subject: [PATCH 253/263] Adjusted Dungeons --- .../dungeons/dungeons/GenericDungeonA1.java | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java b/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java index 4f70d62..b8ad2bd 100644 --- a/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java +++ b/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java @@ -22,15 +22,24 @@ public class GenericDungeonA1 extends Dungeon{ plugin.getServer().broadcastMessage("Available Worlds... " + plugin.getServer().getWorlds().toString()); return false; }*/ - if ((entrance = loadLocation(plugin, "dungeons.dungeona1.enter")) == null){ - if(plugin.getServer().getWorld("Dungeons") != null){ - entrance = new Location(plugin.getServer().getWorld("Dungeons"), -7.5, 138.0, -91.5); - } + Location temp; + if ((temp = loadLocation(plugin, "dungeons.dungeona1.enter")) != null){ + entrance = temp; + }else if(plugin.getServer().getWorld("Dungeons") != null){ + entrance = new Location(plugin.getServer().getWorld("Dungeons"), -7.5, 138.0, -91.5); + }else{ + plugin.getServer().broadcastMessage("There is no working default dungeon entrance for A1, setting to null"); + entrance = null; } - if ((exit = loadLocation(plugin, "dungeons.dungeona1.exit")) == null){ - if (plugin.getServer().getWorld("world") != null){ - exit = plugin.getServer().getWorld("world").getSpawnLocation().clone(); - } + + temp = null; + if ((temp = loadLocation(plugin, "dungeons.dungeona1.exit")) != null){ + exit = temp; + }else if (plugin.getServer().getWorld("world") != null){ + exit = plugin.getServer().getWorld("world").getSpawnLocation().clone(); + }else{ + plugin.getServer().broadcastMessage("There is no working default dungeon exit for A1, setting to null"); + exit = null; } if (entrance == null || exit == null){ @@ -72,6 +81,7 @@ public class GenericDungeonA1 extends Dungeon{ double x = plugin.getConfig().getDouble(path+".x"); double y = plugin.getConfig().getDouble(path+".y"); double z = plugin.getConfig().getDouble(path+".z"); + return new Location(world, x, y, z); }catch(Exception e){ e.printStackTrace(); From 7d012bb9ec1a8a746465fe18cda6d6ee5acfad7f Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 24 Dec 2016 02:15:02 -0500 Subject: [PATCH 254/263] Added isDestructive setting --- .../magic/tricks/CannonBowListener.java | 214 +++++++++++++----- .../magic/tricks/CannonBowSettings.java | 11 +- 2 files changed, 164 insertions(+), 61 deletions(-) diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java index 3bf6f60..85dbd81 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java @@ -4,6 +4,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Particle; import org.bukkit.Sound; +import org.bukkit.command.CommandSender; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Arrow; @@ -19,55 +20,87 @@ import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.Vector; public class CannonBowListener implements Listener { - private static double SpeedMultiplier = 1.5; - private static double minforce = 0.2; - private static int fuseticks = 40; - private static double recoil = 1; + + private static double maxSpeedMultiplier = 4; + private static double minSpeedMultiplier = 0; + private static double defaultSpeedMultiplier = 1; + private static String speedMultiplierPath = "magic.cannonbow.speedmultiplier"; + + private static int maxFuseTicks = 400; + private static int minFuseTicks = 0; + private static int defaultFuseTicks = 30; + private static String fuseTicksPath = "magic.cannonbow.fuseticks"; + + private static double maxMinForce = 1; + private static double minMinForce = 0; + private static double defaultMinForce = 0.2; + private static String minForcePath = "magic.cannonbow.minforce"; + + private static double maxRecoil = 20; + private static double minRecoil = -5; + private static double defaultRecoil = 1; + private static String recoilPath = "magic.cannonbow.recoil"; + + private static boolean defaultIsDestructive = false; + private static String isDestructivePath = "magic.cannonbow.isdestructive"; + + private static double speedMultiplier = defaultSpeedMultiplier; + private static double minForce = defaultMinForce; + private static int fuseTicks = defaultFuseTicks; + private static double recoil = defaultRecoil; + private static boolean isDestructive = defaultIsDestructive; + public final static String launchedTNTName = "CANNON BOW TNT:42170"; + + static FileConfiguration config; public CannonBowListener(JavaPlugin plugin){ - FileConfiguration config = plugin.getConfig(); - - if (config.isDouble("magic.cannonbow.speedmultiplier")) - setSpeedMultiplier(config.getDouble("magic.cannonbow.speedmultiplier")); - - if (config.isDouble("magic.cannonbow.minforce")) - setMinforce(config.getDouble("magic.cannonbow.minforce")); - - if (config.isInt("magic.cannonbow.fuseticks")) - setFuseticks(config.getInt("magic.cannonbow.fuseticks")); - - if (config.isDouble("magic.cannonbow.recoil")) - setRecoil(config.getDouble("magic.cannonbow.recoil")); + config = plugin.getConfig(); + + if (config.isDouble(speedMultiplierPath)) + setSpeedMultiplier(config.getDouble(speedMultiplierPath)); + + if (config.isDouble(minForcePath)) + setMinforce(config.getDouble(minForcePath)); + + if (config.isInt(fuseTicksPath)) + setFuseticks(config.getInt(fuseTicksPath)); + + if (config.isDouble(recoilPath)) + setRecoil(config.getDouble(recoilPath)); + + if (config.isBoolean(isDestructivePath)) + setIsDestructive(config.getBoolean(isDestructivePath)); } - + @EventHandler public void onProjectileLaunch(EntityShootBowEvent event){ //Entity Sanitation if(event.getProjectile().getType() != EntityType.ARROW)return; - + //Arrow Sanitation Arrow arrow = (Arrow) event.getProjectile(); if (!(arrow.getShooter() instanceof Player))return; - + //Player Sanitation Player player = (Player) arrow.getShooter(); if (!player.getInventory().contains(Material.TNT))return; - + //Bow Sanitation ItemStack bow; if (!((bow = player.getInventory().getItemInMainHand()).getType() == Material.BOW))return; if (!(bow.containsEnchantment(Enchantment.PROTECTION_EXPLOSIONS)))return; if (!(bow.getEnchantmentLevel(Enchantment.PROTECTION_EXPLOSIONS) == 10))return; if (!(bow.getItemMeta().getDisplayName().toUpperCase().contains("CANNON BOW")))return; - + //TNT Spawning Vector playerVector = player.getEyeLocation().getDirection().normalize(); + Location playerLocation = player.getLocation(); if (event.getForce() < getMinforce()){ - + //Smoke cloud if draw is too low - arrow.getWorld().spawnParticle(Particle.SMOKE_NORMAL, player.getLocation(), 30); - arrow.getWorld().playSound(player.getLocation(), Sound.BLOCK_LADDER_BREAK, 1.0F, -7); - + arrow.getWorld().spawnParticle(Particle.SMOKE_NORMAL, playerLocation, 30); + arrow.getWorld().playSound(playerLocation, Sound.BLOCK_LADDER_BREAK, 1.0F, -7); + }else{ //Spawn TNT TNTPrimed tnt = (TNTPrimed) arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.PRIMED_TNT); @@ -82,74 +115,135 @@ public class CannonBowListener implements Listener { } catch (Exception ex) { ex.printStackTrace(); }*/ - + // tnt.setVelocity(playerVector.multiply(getSpeedMultiplier()).multiply(event.getForce())); tnt.setCustomName(launchedTNTName); tnt.setFuseTicks(getFuseticks()); - + //Player Recoil - player.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(-1).multiply(getRecoil())); - player.getWorld().playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 1.0F, 0); - player.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, player.getLocation(), 2); - + player.setVelocity(playerVector.multiply(-1).multiply(getRecoil())); + player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 1.0F, 0); + player.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, playerLocation, 2); + } arrow.remove(); - - + + return; - + } @EventHandler public void onTnTExplode(EntityExplodeEvent event) { if (event.getEntityType() != EntityType.PRIMED_TNT) return; if (event.getEntity().getCustomName() != "CANNON BOW TNT:42170") return; - - Location loc = event.getEntity().getLocation(); - event.getEntity().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 3, false, false); - event.setCancelled(true); - - + + if (isDestructive == true){ + Location loc = event.getEntity().getLocation(); + event.getEntity().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 3, false, false); + event.setCancelled(true); + } + + } + public static double getSpeedMultiplier() { - return SpeedMultiplier; + return speedMultiplier; } - public static void setSpeedMultiplier(double speedMultiplier) { - if (speedMultiplier > 4) speedMultiplier = 4; - if (speedMultiplier < 0) speedMultiplier = 0; - SpeedMultiplier = speedMultiplier; + public static void setSpeedMultiplier(double multiplier, CommandSender sender){ + + if (multiplier > maxSpeedMultiplier) sender.sendMessage("SpeedMultiplier is too Large! Setting multiplier to "+ maxSpeedMultiplier); + if (multiplier < maxSpeedMultiplier) sender.sendMessage("SpeedMultiplier is too Small! Setting multiplier to "+ minSpeedMultiplier); + + setSpeedMultiplier(multiplier, sender); + sender.sendMessage("SpeedMultiplier set to " + getSpeedMultiplier()); } + public static void setSpeedMultiplier(double multiplier) { + + if (multiplier > maxSpeedMultiplier) multiplier = maxSpeedMultiplier; + if (multiplier < minSpeedMultiplier) multiplier = minSpeedMultiplier; + config.set(speedMultiplierPath, multiplier); + speedMultiplier = multiplier; + + } + + public static double getMinforce() { - return minforce; + return minForce; + } + public static void setMinForce(double minforce, CommandSender sender){ + + if (minforce > maxMinForce) sender.sendMessage("MinForce is too large! Setting it to " + maxMinForce); + if (minforce < minMinForce) sender.sendMessage("MinForce is too small! Setting it to " + minMinForce); + setMinforce(minforce); + sender.sendMessage("MinForce set to " + getMinforce()); + + } + public static void setMinforce(double minforce) { + + if (minforce > maxMinForce) minforce = maxMinForce; + if (minforce < minMinForce) minforce = minMinForce; + config.set(minForcePath, minforce); + CannonBowListener.minForce = minforce; } - public static void setMinforce(double minforce) { - if (minforce > 1) minforce = 1; - if (minforce < 0) minforce = 0; - CannonBowListener.minforce = minforce; - } public static int getFuseticks() { - return fuseticks; + return fuseTicks; + } + public static void setFuseticks(int fuseticks, CommandSender sender){ + + if (fuseticks > maxFuseTicks) sender.sendMessage("Fuseticks is too large! Setting it to " + maxFuseTicks); + if (fuseticks < minFuseTicks) sender.sendMessage("Fuseticks is too small! Setting it to " + minFuseTicks); + setFuseticks(fuseticks); + sender.sendMessage("FuseTicks set to " + getFuseticks()); + + } + public static void setFuseticks(int fuseticks) { + + if (fuseticks > maxFuseTicks) fuseticks = maxFuseTicks; + if (fuseticks < minFuseTicks) fuseticks = minFuseTicks; + config.set(fuseTicksPath, fuseticks); + CannonBowListener.fuseTicks = fuseticks; + } - public static void setFuseticks(int fuseticks) { - if (fuseticks > 400) fuseticks = 400; - if (fuseticks < 0) fuseticks = 0; - CannonBowListener.fuseticks = fuseticks; - } public static double getRecoil() { return recoil; } + public static void setRecoil(double recoil, CommandSender sender){ + if (recoil > maxRecoil) sender.sendMessage("Recoil is too large! Setting it to " + maxRecoil); + if (recoil < maxRecoil) sender.sendMessage("Recoil is too small! Setting it to " + minRecoil); + setRecoil(recoil); + sender.sendMessage("Recoil set to " + getRecoil()); + + } public static void setRecoil(double recoil) { - if (recoil > 20) recoil = 20; - if (recoil < 0) recoil = 0; + + if (recoil > maxRecoil) recoil = maxRecoil; + if (recoil < minRecoil) recoil = minRecoil; + config.set(recoilPath, recoil); CannonBowListener.recoil = recoil; + + } + + + public static boolean getIsDestructive(){ + return isDestructive; + } + public static void setIsDestructive(String input){ + if(input.startsWith("T") || input.startsWith("t")) setIsDestructive(true); + if(input.startsWith("F") || input.startsWith("f")) setIsDestructive(false); + + } + public static void setIsDestructive(boolean isDestructive){ + CannonBowListener.isDestructive = isDestructive; + config.set(speedMultiplierPath, isDestructive); } } \ No newline at end of file diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java index 8aa8655..cbd7df4 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowSettings.java @@ -9,25 +9,34 @@ public class CannonBowSettings extends ModCommand { @Override public boolean OnCommand(Player player, String alias, String[] args) { - if (args.length > 1){ + if (args.length > 1 && args[0] == "display"){ switch(args[0].toLowerCase()){ + case "force": case "speedmultiplier": CannonBowListener.setSpeedMultiplier(NumberUtils.toDouble(args[1], CannonBowListener.getSpeedMultiplier())); break; + case "minimumforce": case "minforce": + case "minimumdraw": + case "mindraw": CannonBowListener.setMinforce(NumberUtils.toDouble(args[1], CannonBowListener.getMinforce())); break; + case "fuse": + case "fusetick": case "fuseticks": CannonBowListener.setFuseticks(NumberUtils.toInt(args[1], CannonBowListener.getFuseticks())); break; case "recoil": CannonBowListener.setRecoil(NumberUtils.toDouble((args[1]), CannonBowListener.getRecoil())); break; + case "isDestructive": + CannonBowListener.setIsDestructive(args[1]); case "display": player.sendMessage("Speed Multiplier: "+CannonBowListener.getSpeedMultiplier()); player.sendMessage("Minimum Force: "+CannonBowListener.getMinforce()); player.sendMessage("Fuseticks: " + CannonBowListener.getFuseticks()); player.sendMessage("Recoil: " + CannonBowListener.getRecoil()); + player.sendMessage("isDestructive: " + CannonBowListener.getIsDestructive()); break; default: player.sendMessage("That isn't a valid setting!"); From 956fdf81fc2b8617116186823bd3f4f7b8cd93e9 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 24 Dec 2016 03:43:43 -0500 Subject: [PATCH 255/263] Made a default save path for the cannon bow --- .../components/magic/tricks/CannonBowListener.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java index 85dbd81..cee7da0 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java @@ -20,29 +20,30 @@ import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.Vector; public class CannonBowListener implements Listener { - + private static String savePath = "magic.cannonbow"; + private static double maxSpeedMultiplier = 4; private static double minSpeedMultiplier = 0; private static double defaultSpeedMultiplier = 1; - private static String speedMultiplierPath = "magic.cannonbow.speedmultiplier"; + private static String speedMultiplierPath = savePath + ".speedmultiplier"; private static int maxFuseTicks = 400; private static int minFuseTicks = 0; private static int defaultFuseTicks = 30; - private static String fuseTicksPath = "magic.cannonbow.fuseticks"; + private static String fuseTicksPath = savePath + ".fuseticks"; private static double maxMinForce = 1; private static double minMinForce = 0; private static double defaultMinForce = 0.2; - private static String minForcePath = "magic.cannonbow.minforce"; + private static String minForcePath = savePath + ".minforce"; private static double maxRecoil = 20; private static double minRecoil = -5; private static double defaultRecoil = 1; - private static String recoilPath = "magic.cannonbow.recoil"; + private static String recoilPath = savePath + ".recoil"; private static boolean defaultIsDestructive = false; - private static String isDestructivePath = "magic.cannonbow.isdestructive"; + private static String isDestructivePath = savePath + ".isdestructive"; private static double speedMultiplier = defaultSpeedMultiplier; private static double minForce = defaultMinForce; From dc57298c04fb319efa6c28f7422aec84f6d33b9f Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 26 Dec 2016 22:40:35 -0500 Subject: [PATCH 256/263] Disabled main world creative block --- .../components/hotfix/HotfixComponent.java | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java index abd2393..c0da11c 100644 --- a/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java +++ b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java @@ -1,27 +1,28 @@ -package buttondevteam.alipresents.components.hotfix; - -import org.bukkit.Bukkit; -import org.bukkit.plugin.java.JavaPlugin; - -import com.earth2me.essentials.Essentials; - -import buttondevteam.alipresents.architecture.Component; -import buttondevteam.alipresents.components.hotfix.hotfixes.CowSpawnLoop; -import buttondevteam.alipresents.components.hotfix.hotfixes.CreativeKillLoop; -import buttondevteam.alipresents.components.hotfix.hotfixes.GrassBreakListener; -import buttondevteam.alipresents.components.hotfix.hotfixes.MobKillListener; -import buttondevteam.alipresents.components.hotfix.hotfixes.NetherDisableListener; - -public class HotfixComponent extends Component { - - @Override - public void register(JavaPlugin plugin) { - registerListener(plugin, new NetherDisableListener()); - registerListener(plugin, new CowSpawnLoop(plugin)); - registerListener(plugin, new MobKillListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); - registerListener(plugin, new GrassBreakListener()); - registerListener(plugin, new CreativeKillLoop(plugin)); - - } - -} +package buttondevteam.alipresents.components.hotfix; + +import org.bukkit.Bukkit; +import org.bukkit.plugin.java.JavaPlugin; + +import com.earth2me.essentials.Essentials; + +import buttondevteam.alipresents.architecture.Component; +import buttondevteam.alipresents.components.hotfix.hotfixes.CowSpawnLoop; +import buttondevteam.alipresents.components.hotfix.hotfixes.ElytraFireworks; +import buttondevteam.alipresents.components.hotfix.hotfixes.GrassBreakListener; +import buttondevteam.alipresents.components.hotfix.hotfixes.MobKillListener; +import buttondevteam.alipresents.components.hotfix.hotfixes.NetherDisableListener; + +public class HotfixComponent extends Component { + + @Override + public void register(JavaPlugin plugin) { + registerListener(plugin, new NetherDisableListener()); + registerListener(plugin, new CowSpawnLoop(plugin)); + registerListener(plugin, new MobKillListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); + registerListener(plugin, new GrassBreakListener()); + //registerListener(plugin, new CreativeKillLoop(plugin)); + registerListener(plugin, new ElytraFireworks(plugin)); + + } + +} From 8ab502183444068af7ffe27bd27dbd870dca5276 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 26 Dec 2016 22:42:41 -0500 Subject: [PATCH 257/263] Adjusted fireworks and dungeon --- .../dungeons/dungeons/GenericDungeonA1.java | 186 +++++++++--------- .../hotfix/hotfixes/ElytraFireworks.java | 36 ++++ 2 files changed, 131 insertions(+), 91 deletions(-) create mode 100644 src/buttondevteam/alipresents/components/hotfix/hotfixes/ElytraFireworks.java diff --git a/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java b/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java index b8ad2bd..c04e93d 100644 --- a/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java +++ b/src/buttondevteam/alipresents/components/dungeons/dungeons/GenericDungeonA1.java @@ -1,91 +1,95 @@ -package buttondevteam.alipresents.components.dungeons.dungeons; - -import org.bukkit.Location; -import org.bukkit.World; -import org.bukkit.plugin.java.JavaPlugin; - -public class GenericDungeonA1 extends Dungeon{ - private Location entrance; - private Location exit; - private JavaPlugin plugin; - - public GenericDungeonA1(JavaPlugin plugin){ - if(!initDungeon(plugin)){ - plugin.getServer().broadcastMessage("DungeonA1 cant be initialized!"); - } - this.plugin = plugin; - } - private boolean initDungeon(JavaPlugin plugin){ - /* - if (plugin.getServer().getWorld("Dungeons") == null || plugin.getServer().getWorld("world") == null){ - plugin.getServer().broadcastMessage("GenericDungeonA1Error! One of the worlds is null!"); - plugin.getServer().broadcastMessage("Available Worlds... " + plugin.getServer().getWorlds().toString()); - return false; - }*/ - Location temp; - if ((temp = loadLocation(plugin, "dungeons.dungeona1.enter")) != null){ - entrance = temp; - }else if(plugin.getServer().getWorld("Dungeons") != null){ - entrance = new Location(plugin.getServer().getWorld("Dungeons"), -7.5, 138.0, -91.5); - }else{ - plugin.getServer().broadcastMessage("There is no working default dungeon entrance for A1, setting to null"); - entrance = null; - } - - temp = null; - if ((temp = loadLocation(plugin, "dungeons.dungeona1.exit")) != null){ - exit = temp; - }else if (plugin.getServer().getWorld("world") != null){ - exit = plugin.getServer().getWorld("world").getSpawnLocation().clone(); - }else{ - plugin.getServer().broadcastMessage("There is no working default dungeon exit for A1, setting to null"); - exit = null; - } - - if (entrance == null || exit == null){ - plugin.getServer().broadcastMessage("DungeonA1Error! Dungeon Entrance or Exit is null!"); - plugin.getServer().broadcastMessage("Dungeon Entrance: " + entrance.toString()); - plugin.getServer().broadcastMessage("Dungeon Exit: " + exit.toString()); - return false; - } - return true; - } - @Override - public void setEntrance(Location location){ - saveLocation(plugin, "dungeons.dungeona1.enter", location); - entrance = location; - } - @Override - public void setExit(Location location){ - saveLocation(plugin, "dungeons.dungeona1.exit", location); - exit = location; - } - @Override - public Location getDungeonEntrance() { - return entrance; - } - @Override - public Location getDungeonExit() { - return exit; - } - private void saveLocation(JavaPlugin plugin, String path, Location location){ - plugin.getConfig().set(path+".world", location.getWorld().getName()); - plugin.getConfig().set(path+".x", location.getX()); - plugin.getConfig().set(path+".y", location.getY()); - plugin.getConfig().set(path+".z", location.getZ()); - plugin.saveConfig(); - } - private Location loadLocation(JavaPlugin plugin, String path){ - try{ - World world = plugin.getServer().getWorld(plugin.getConfig().getString(path+".world")); - double x = plugin.getConfig().getDouble(path+".x"); - double y = plugin.getConfig().getDouble(path+".y"); - double z = plugin.getConfig().getDouble(path+".z"); - - return new Location(world, x, y, z); - }catch(Exception e){ - e.printStackTrace(); - return null; - } - } -} +package buttondevteam.alipresents.components.dungeons.dungeons; + +import org.bukkit.Location; +import org.bukkit.World; +import org.bukkit.plugin.java.JavaPlugin; + +public class GenericDungeonA1 extends Dungeon{ + private Location entrance; + private Location exit; + private JavaPlugin plugin; + + public GenericDungeonA1(JavaPlugin plugin){ + if(!initDungeon(plugin)){ + plugin.getServer().broadcastMessage("DungeonA1 cant be initialized!"); + } + this.plugin = plugin; + } + private boolean initDungeon(JavaPlugin plugin){ + /* + if (plugin.getServer().getWorld("Dungeons") == null || plugin.getServer().getWorld("world") == null){ + plugin.getServer().broadcastMessage("GenericDungeonA1Error! One of the worlds is null!"); + plugin.getServer().broadcastMessage("Available Worlds... " + plugin.getServer().getWorlds().toString()); + return false; + }*/ + Location temp; + if ((temp = loadLocation(plugin, "dungeons.dungeona1.enter")) != null){ + entrance = temp; + }else if(plugin.getServer().getWorld("Dungeons") != null){ + entrance = new Location(plugin.getServer().getWorld("Dungeons"), -7.5, 138.0, -91.5); + }else{ + plugin.getServer().broadcastMessage("There is no working default dungeon entrance for A1, setting to null"); + entrance = null; + } + + temp = null; + if ((temp = loadLocation(plugin, "dungeons.dungeona1.exit")) != null){ + exit = temp; + }else if (plugin.getServer().getWorld("world") != null){ + exit = plugin.getServer().getWorld("world").getSpawnLocation().clone(); + }else{ + plugin.getServer().broadcastMessage("There is no working default dungeon exit for A1, setting to null"); + exit = null; + } + + if (entrance == null || exit == null){ + plugin.getServer().broadcastMessage("DungeonA1Error! Dungeon Entrance or Exit is null!"); + plugin.getServer().broadcastMessage("Dungeon Entrance: " + entrance.toString()); + plugin.getServer().broadcastMessage("Dungeon Exit: " + exit.toString()); + return false; + } + return true; + } + @Override + public void setEntrance(Location location){ + saveLocation(plugin, "dungeons.dungeona1.enter", location); + entrance = location; + } + @Override + public void setExit(Location location){ + saveLocation(plugin, "dungeons.dungeona1.exit", location); + exit = location; + } + @Override + public Location getDungeonEntrance() { + return entrance; + } + @Override + public Location getDungeonExit() { + return exit; + } + private void saveLocation(JavaPlugin plugin, String path, Location location){ + plugin.getConfig().set(path+".world", location.getWorld().getName()); + plugin.getConfig().set(path+".x", location.getX()); + plugin.getConfig().set(path+".y", location.getY()); + plugin.getConfig().set(path+".z", location.getZ()); + plugin.saveConfig(); + } + private Location loadLocation(JavaPlugin plugin, String path){ + try{ + String worldname = plugin.getConfig().getString(path+".world"); + if(worldname == null) return null; + + World world = plugin.getServer().getWorld(worldname); + double x = plugin.getConfig().getDouble(path+".x"); + double y = plugin.getConfig().getDouble(path+".y"); + double z = plugin.getConfig().getDouble(path+".z"); + if (world == null) return null; + + return new Location(world, x, y, z); + }catch(Exception e){ + e.printStackTrace(); + return null; + } + } +} diff --git a/src/buttondevteam/alipresents/components/hotfix/hotfixes/ElytraFireworks.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/ElytraFireworks.java new file mode 100644 index 0000000..c7101a7 --- /dev/null +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/ElytraFireworks.java @@ -0,0 +1,36 @@ +package buttondevteam.alipresents.components.hotfix.hotfixes; + +import org.bukkit.FireworkEffect; +import org.bukkit.GameMode; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.FireworkMeta; +import org.bukkit.plugin.java.JavaPlugin; + +public class ElytraFireworks implements Listener { + JavaPlugin plugin; + public ElytraFireworks(JavaPlugin plugin) { + this.plugin = plugin; + } + public void onRightClick(PlayerInteractEvent event){ + //ACTION SANITATION + if(!(event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)) return; + if(!(event.getPlayer().isGliding())) return; + if(!(event.getMaterial() == Material.FIREWORK)) return; + + //BOW SANITATION + ItemStack firework = event.getItem(); + FireworkMeta fireworkMeta= (FireworkMeta) firework.getItemMeta(); + for (FireworkEffect effect : fireworkMeta.getEffects()){ + event.getPlayer().sendMessage(effect.toString()); + } + + //PLAYER SANITATION + Player player = event.getPlayer(); + if(player.getGameMode().equals(GameMode.SPECTATOR))return; + } +} From a026fc5e60edca5c949c4bb6de424514cb8e66a3 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 26 Dec 2016 22:46:02 -0500 Subject: [PATCH 258/263] Fixed error --- .../alipresents/components/hotfix/HotfixComponent.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java index c0da11c..c9ac0c2 100644 --- a/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java +++ b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java @@ -7,7 +7,6 @@ import com.earth2me.essentials.Essentials; import buttondevteam.alipresents.architecture.Component; import buttondevteam.alipresents.components.hotfix.hotfixes.CowSpawnLoop; -import buttondevteam.alipresents.components.hotfix.hotfixes.ElytraFireworks; import buttondevteam.alipresents.components.hotfix.hotfixes.GrassBreakListener; import buttondevteam.alipresents.components.hotfix.hotfixes.MobKillListener; import buttondevteam.alipresents.components.hotfix.hotfixes.NetherDisableListener; @@ -21,7 +20,6 @@ public class HotfixComponent extends Component { registerListener(plugin, new MobKillListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); registerListener(plugin, new GrassBreakListener()); //registerListener(plugin, new CreativeKillLoop(plugin)); - registerListener(plugin, new ElytraFireworks(plugin)); } From f665665fcd4f678bcc18629ddf1c0e93b0fe2c6f Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 26 Dec 2016 23:23:47 -0500 Subject: [PATCH 259/263] Creative kill applies outside spawn --- .../components/hotfix/HotfixComponent.java | 3 +- .../hotfix/hotfixes/CreativeKillLoop.java | 64 +++++++++++-------- 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java index c9ac0c2..708d127 100644 --- a/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java +++ b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java @@ -7,6 +7,7 @@ import com.earth2me.essentials.Essentials; import buttondevteam.alipresents.architecture.Component; import buttondevteam.alipresents.components.hotfix.hotfixes.CowSpawnLoop; +import buttondevteam.alipresents.components.hotfix.hotfixes.CreativeKillLoop; import buttondevteam.alipresents.components.hotfix.hotfixes.GrassBreakListener; import buttondevteam.alipresents.components.hotfix.hotfixes.MobKillListener; import buttondevteam.alipresents.components.hotfix.hotfixes.NetherDisableListener; @@ -19,7 +20,7 @@ public class HotfixComponent extends Component { registerListener(plugin, new CowSpawnLoop(plugin)); registerListener(plugin, new MobKillListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); registerListener(plugin, new GrassBreakListener()); - //registerListener(plugin, new CreativeKillLoop(plugin)); + registerListener(plugin, new CreativeKillLoop(plugin)); } diff --git a/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java index e90ea0a..7e759b2 100644 --- a/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java @@ -1,27 +1,37 @@ -package buttondevteam.alipresents.components.hotfix.hotfixes; - -import org.bukkit.GameMode; -import org.bukkit.entity.Player; -import org.bukkit.event.Listener; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.scheduler.BukkitRunnable; - -public class CreativeKillLoop extends BukkitRunnable implements Listener { - private JavaPlugin plugin; - - public CreativeKillLoop(JavaPlugin plugin){ - this.plugin = plugin; - this.runTaskTimer(plugin, 40, 40); - } - - @Override - public void run() { - for (Player player : plugin.getServer().getOnlinePlayers()){ - if(player.getGameMode() != GameMode.SURVIVAL && player.getWorld().getName().equalsIgnoreCase("world") && player.isOp() == false){ - player.sendMessage("[Hotfix] Every Gamemode other than survival is disabled in the new world!"); - player.setGameMode(GameMode.SURVIVAL); - } - } - } - -} +package buttondevteam.alipresents.components.hotfix.hotfixes; + +import org.bukkit.GameMode; +import org.bukkit.Location; +import org.bukkit.entity.Player; +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitRunnable; + +public class CreativeKillLoop extends BukkitRunnable implements Listener { + private JavaPlugin plugin; + + public CreativeKillLoop(JavaPlugin plugin){ + this.plugin = plugin; + this.runTaskTimer(plugin, 40, 40); + } + + @Override + public void run() { + Location location; + for (Player player : plugin.getServer().getOnlinePlayers()){ + if (player.getGameMode() == GameMode.SURVIVAL) continue; + if (player.getWorld().getName().equalsIgnoreCase("world")) continue; + if (player.isOp()) continue; + + location = player.getLocation(); + if (250 > location.getBlockX() && location.getBlockX() > -250) continue; + if (250 > location.getBlockZ() && location.getBlockZ() > -250) continue; + + player.sendMessage("[Hotfix] Every Gamemode other than survival is disabled in the new world!"); + player.setGameMode(GameMode.SURVIVAL); + + } + + } + +} From f843ea0380b8aeade755caf507d6c15e8d9302ef Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 26 Dec 2016 23:39:33 -0500 Subject: [PATCH 260/263] Testing in production --- .../components/hotfix/hotfixes/CreativeKillLoop.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java index 7e759b2..cc5a3aa 100644 --- a/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java @@ -20,12 +20,12 @@ public class CreativeKillLoop extends BukkitRunnable implements Listener { Location location; for (Player player : plugin.getServer().getOnlinePlayers()){ if (player.getGameMode() == GameMode.SURVIVAL) continue; - if (player.getWorld().getName().equalsIgnoreCase("world")) continue; + if (!player.getWorld().getName().equalsIgnoreCase("world")) continue; if (player.isOp()) continue; location = player.getLocation(); - if (250 > location.getBlockX() && location.getBlockX() > -250) continue; - if (250 > location.getBlockZ() && location.getBlockZ() > -250) continue; + if (location.getBlockX() < 250 && location.getBlockX() > -250) continue; + if (location.getBlockZ() < 250 && location.getBlockZ() > -250) continue; player.sendMessage("[Hotfix] Every Gamemode other than survival is disabled in the new world!"); player.setGameMode(GameMode.SURVIVAL); From 13fb77a27342fbecd00eec3f9b4c4c6db92ebdb7 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 26 Dec 2016 23:55:09 -0500 Subject: [PATCH 261/263] Added more informational dialouge --- .../components/hotfix/hotfixes/CreativeKillLoop.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java index cc5a3aa..e8f7680 100644 --- a/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CreativeKillLoop.java @@ -22,12 +22,15 @@ public class CreativeKillLoop extends BukkitRunnable implements Listener { if (player.getGameMode() == GameMode.SURVIVAL) continue; if (!player.getWorld().getName().equalsIgnoreCase("world")) continue; if (player.isOp()) continue; + + player.sendMessage("[Hotfix] Every Gamemode other than survival is disabled in the new world"); + player.setGameMode(GameMode.SURVIVAL); location = player.getLocation(); if (location.getBlockX() < 250 && location.getBlockX() > -250) continue; if (location.getBlockZ() < 250 && location.getBlockZ() > -250) continue; - player.sendMessage("[Hotfix] Every Gamemode other than survival is disabled in the new world!"); + player.sendMessage("[Hotfix] Unless you are in Spawn Island!"); player.setGameMode(GameMode.SURVIVAL); } From c517296a0a1d1b29325844fc8e1fa25c39a99249 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Wed, 28 Dec 2016 23:41:15 -0500 Subject: [PATCH 262/263] Started work on refactoring Gpowers --- .../components/gpower/ApplyPowerUp.java | 55 +++++++++++++++++++ .../components/gpower/GPowerComponent.java | 4 +- .../components/gpower/api/GPowerAPI.java | 8 ++- .../components/magic/MagicComponent.java | 8 ++- .../magic/tricks/CannonBowListener.java | 34 ++++++------ 5 files changed, 87 insertions(+), 22 deletions(-) create mode 100644 src/buttondevteam/alipresents/components/gpower/ApplyPowerUp.java diff --git a/src/buttondevteam/alipresents/components/gpower/ApplyPowerUp.java b/src/buttondevteam/alipresents/components/gpower/ApplyPowerUp.java new file mode 100644 index 0000000..52c6d93 --- /dev/null +++ b/src/buttondevteam/alipresents/components/gpower/ApplyPowerUp.java @@ -0,0 +1,55 @@ +package buttondevteam.alipresents.components.gpower; + +import org.bukkit.entity.Player; + +import buttondevteam.alipresents.architecture.commands.ModCommand; +import buttondevteam.alipresents.components.gpower.api.GPowerAPI; + +public class ApplyPowerUp extends ModCommand { + + @Override + public boolean OnCommand(Player player, String alias, String[] args) { + if (args.length > 1) //No one's online + return false; + + String playerArgument = args[0]; + + Player argPlayer = player.getServer().getPlayer(playerArgument); + + if (argPlayer == null) + { + + // Attempted player is not online + player.sendMessage(playerArgument + " is not online right now. Players online are: "); + player.sendMessage(player.getServer().getOnlinePlayers().toString()); + + if (args.length < 2){ + player.sendMessage("You may apply the effect " + args[1] + "to them"); + } + + } + if (args.length < 2){ + //recolour no colour + GPowerAPI.PowerUpPlayer(player); + return true; + }else{ + GPowerAPI.PowerUpPlayer(player); + //recolour with colour + return true; + } + + + } + @Override + public String[] GetHelpText(String string){ + return new String[]{ + "Usage: /"+GetCommandPath()+" ", + "Use this command to apply a gpower colour to players", + }; + } + @Override + public String GetCommandPath(){ + return "gpower applypowerup"; + } + +} diff --git a/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java b/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java index 1d85e84..7fda859 100644 --- a/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java +++ b/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java @@ -15,7 +15,9 @@ public class GPowerComponent extends Component { registerCommand(plugin, new Test()); registerCommand(plugin, new PowerUp()); registerCommand(plugin, new PowerDown()); - + + registerCommand(plugin, new ApplyPowerUp()); + registerCommand(plugin, new ApplyPowerDown()); registerListener(plugin, new EnchantingLoop(plugin)); } diff --git a/src/buttondevteam/alipresents/components/gpower/api/GPowerAPI.java b/src/buttondevteam/alipresents/components/gpower/api/GPowerAPI.java index 3596613..d497f69 100644 --- a/src/buttondevteam/alipresents/components/gpower/api/GPowerAPI.java +++ b/src/buttondevteam/alipresents/components/gpower/api/GPowerAPI.java @@ -18,6 +18,9 @@ public class GPowerAPI{ public static void addPlayer(Player player, String colour, boolean powerIsActive){ poweredPlayerList.put(player.getUniqueId(), new PoweredPlayer(player.getUniqueId(), colour, true)); } + public static void PowerUpPlayer(Player player, String colour){ + PowerUpPlayer(player); + } public static void PowerUpPlayer(Player player){ player.sendMessage("Powering up!"); if(poweredPlayerList.containsKey(player.getUniqueId())){ @@ -33,14 +36,15 @@ public class GPowerAPI{ } } - public static void PowerDownPlayer(Player player){ + public static boolean PowerDownPlayer(Player player){ player.sendMessage("Powering down!"); if (poweredPlayerList.containsKey(player.getUniqueId())){ player.sendMessage("Powered down!"); poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; + return true; }else{ player.sendMessage("P down!"); - return; + return false; } } diff --git a/src/buttondevteam/alipresents/components/magic/MagicComponent.java b/src/buttondevteam/alipresents/components/magic/MagicComponent.java index 8aa4b27..444cc74 100644 --- a/src/buttondevteam/alipresents/components/magic/MagicComponent.java +++ b/src/buttondevteam/alipresents/components/magic/MagicComponent.java @@ -7,17 +7,19 @@ import buttondevteam.alipresents.components.magic.tricks.AliArrowListener; import buttondevteam.alipresents.components.magic.tricks.BoomBowDeathListener; import buttondevteam.alipresents.components.magic.tricks.BoomBowListener; import buttondevteam.alipresents.components.magic.tricks.CannonBowListener; -import buttondevteam.alipresents.components.magic.tricks.CannonBowSettings; public class MagicComponent extends Component{ @Override public void register(JavaPlugin plugin) { - registerCommand(plugin, new CannonBowSettings()); + //registerCommand(plugin, new CannonBowSettings()); registerListener(plugin, new AliArrowListener(plugin)); registerListener(plugin, new BoomBowDeathListener()); registerListener(plugin, new BoomBowListener(plugin)); - registerListener(plugin, new CannonBowListener(plugin)); + + CannonBowListener cbl = new CannonBowListener(plugin); + //cbl.loadSettings(plugin.getConfig()); + registerListener(plugin, cbl); } } diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java index cee7da0..ef321f3 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java @@ -56,23 +56,8 @@ public class CannonBowListener implements Listener { static FileConfiguration config; public CannonBowListener(JavaPlugin plugin){ config = plugin.getConfig(); - - if (config.isDouble(speedMultiplierPath)) - setSpeedMultiplier(config.getDouble(speedMultiplierPath)); - - if (config.isDouble(minForcePath)) - setMinforce(config.getDouble(minForcePath)); - - if (config.isInt(fuseTicksPath)) - setFuseticks(config.getInt(fuseTicksPath)); - - if (config.isDouble(recoilPath)) - setRecoil(config.getDouble(recoilPath)); - - if (config.isBoolean(isDestructivePath)) - setIsDestructive(config.getBoolean(isDestructivePath)); } - + @EventHandler public void onProjectileLaunch(EntityShootBowEvent event){ //Entity Sanitation @@ -247,4 +232,21 @@ public class CannonBowListener implements Listener { CannonBowListener.isDestructive = isDestructive; config.set(speedMultiplierPath, isDestructive); } + + public void loadSettings(FileConfiguration config){ + if (config.isDouble(speedMultiplierPath)) + setSpeedMultiplier(config.getDouble(speedMultiplierPath)); + + if (config.isDouble(minForcePath)) + setMinforce(config.getDouble(minForcePath)); + + if (config.isInt(fuseTicksPath)) + setFuseticks(config.getInt(fuseTicksPath)); + + if (config.isDouble(recoilPath)) + setRecoil(config.getDouble(recoilPath)); + + if (config.isBoolean(isDestructivePath)) + setIsDestructive(config.getBoolean(isDestructivePath)); + } } \ No newline at end of file From 50f5ccf9c145fa8a702db73dd5e9e24c38c16529 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 29 Dec 2016 20:45:28 -0500 Subject: [PATCH 263/263] Revert "Started work on refactoring Gpowers" This reverts commit c517296a0a1d1b29325844fc8e1fa25c39a99249. --- .../components/gpower/ApplyPowerUp.java | 55 ------------------- .../components/gpower/GPowerComponent.java | 4 +- .../components/gpower/api/GPowerAPI.java | 8 +-- .../components/magic/MagicComponent.java | 8 +-- .../magic/tricks/CannonBowListener.java | 34 ++++++------ 5 files changed, 22 insertions(+), 87 deletions(-) delete mode 100644 src/buttondevteam/alipresents/components/gpower/ApplyPowerUp.java diff --git a/src/buttondevteam/alipresents/components/gpower/ApplyPowerUp.java b/src/buttondevteam/alipresents/components/gpower/ApplyPowerUp.java deleted file mode 100644 index 52c6d93..0000000 --- a/src/buttondevteam/alipresents/components/gpower/ApplyPowerUp.java +++ /dev/null @@ -1,55 +0,0 @@ -package buttondevteam.alipresents.components.gpower; - -import org.bukkit.entity.Player; - -import buttondevteam.alipresents.architecture.commands.ModCommand; -import buttondevteam.alipresents.components.gpower.api.GPowerAPI; - -public class ApplyPowerUp extends ModCommand { - - @Override - public boolean OnCommand(Player player, String alias, String[] args) { - if (args.length > 1) //No one's online - return false; - - String playerArgument = args[0]; - - Player argPlayer = player.getServer().getPlayer(playerArgument); - - if (argPlayer == null) - { - - // Attempted player is not online - player.sendMessage(playerArgument + " is not online right now. Players online are: "); - player.sendMessage(player.getServer().getOnlinePlayers().toString()); - - if (args.length < 2){ - player.sendMessage("You may apply the effect " + args[1] + "to them"); - } - - } - if (args.length < 2){ - //recolour no colour - GPowerAPI.PowerUpPlayer(player); - return true; - }else{ - GPowerAPI.PowerUpPlayer(player); - //recolour with colour - return true; - } - - - } - @Override - public String[] GetHelpText(String string){ - return new String[]{ - "Usage: /"+GetCommandPath()+" ", - "Use this command to apply a gpower colour to players", - }; - } - @Override - public String GetCommandPath(){ - return "gpower applypowerup"; - } - -} diff --git a/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java b/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java index 7fda859..1d85e84 100644 --- a/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java +++ b/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java @@ -15,9 +15,7 @@ public class GPowerComponent extends Component { registerCommand(plugin, new Test()); registerCommand(plugin, new PowerUp()); registerCommand(plugin, new PowerDown()); - - registerCommand(plugin, new ApplyPowerUp()); - registerCommand(plugin, new ApplyPowerDown()); + registerListener(plugin, new EnchantingLoop(plugin)); } diff --git a/src/buttondevteam/alipresents/components/gpower/api/GPowerAPI.java b/src/buttondevteam/alipresents/components/gpower/api/GPowerAPI.java index d497f69..3596613 100644 --- a/src/buttondevteam/alipresents/components/gpower/api/GPowerAPI.java +++ b/src/buttondevteam/alipresents/components/gpower/api/GPowerAPI.java @@ -18,9 +18,6 @@ public class GPowerAPI{ public static void addPlayer(Player player, String colour, boolean powerIsActive){ poweredPlayerList.put(player.getUniqueId(), new PoweredPlayer(player.getUniqueId(), colour, true)); } - public static void PowerUpPlayer(Player player, String colour){ - PowerUpPlayer(player); - } public static void PowerUpPlayer(Player player){ player.sendMessage("Powering up!"); if(poweredPlayerList.containsKey(player.getUniqueId())){ @@ -36,15 +33,14 @@ public class GPowerAPI{ } } - public static boolean PowerDownPlayer(Player player){ + public static void PowerDownPlayer(Player player){ player.sendMessage("Powering down!"); if (poweredPlayerList.containsKey(player.getUniqueId())){ player.sendMessage("Powered down!"); poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; - return true; }else{ player.sendMessage("P down!"); - return false; + return; } } diff --git a/src/buttondevteam/alipresents/components/magic/MagicComponent.java b/src/buttondevteam/alipresents/components/magic/MagicComponent.java index 444cc74..8aa4b27 100644 --- a/src/buttondevteam/alipresents/components/magic/MagicComponent.java +++ b/src/buttondevteam/alipresents/components/magic/MagicComponent.java @@ -7,19 +7,17 @@ import buttondevteam.alipresents.components.magic.tricks.AliArrowListener; import buttondevteam.alipresents.components.magic.tricks.BoomBowDeathListener; import buttondevteam.alipresents.components.magic.tricks.BoomBowListener; import buttondevteam.alipresents.components.magic.tricks.CannonBowListener; +import buttondevteam.alipresents.components.magic.tricks.CannonBowSettings; public class MagicComponent extends Component{ @Override public void register(JavaPlugin plugin) { - //registerCommand(plugin, new CannonBowSettings()); + registerCommand(plugin, new CannonBowSettings()); registerListener(plugin, new AliArrowListener(plugin)); registerListener(plugin, new BoomBowDeathListener()); registerListener(plugin, new BoomBowListener(plugin)); - - CannonBowListener cbl = new CannonBowListener(plugin); - //cbl.loadSettings(plugin.getConfig()); - registerListener(plugin, cbl); + registerListener(plugin, new CannonBowListener(plugin)); } } diff --git a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java index ef321f3..cee7da0 100644 --- a/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java +++ b/src/buttondevteam/alipresents/components/magic/tricks/CannonBowListener.java @@ -56,8 +56,23 @@ public class CannonBowListener implements Listener { static FileConfiguration config; public CannonBowListener(JavaPlugin plugin){ config = plugin.getConfig(); + + if (config.isDouble(speedMultiplierPath)) + setSpeedMultiplier(config.getDouble(speedMultiplierPath)); + + if (config.isDouble(minForcePath)) + setMinforce(config.getDouble(minForcePath)); + + if (config.isInt(fuseTicksPath)) + setFuseticks(config.getInt(fuseTicksPath)); + + if (config.isDouble(recoilPath)) + setRecoil(config.getDouble(recoilPath)); + + if (config.isBoolean(isDestructivePath)) + setIsDestructive(config.getBoolean(isDestructivePath)); } - + @EventHandler public void onProjectileLaunch(EntityShootBowEvent event){ //Entity Sanitation @@ -232,21 +247,4 @@ public class CannonBowListener implements Listener { CannonBowListener.isDestructive = isDestructive; config.set(speedMultiplierPath, isDestructive); } - - public void loadSettings(FileConfiguration config){ - if (config.isDouble(speedMultiplierPath)) - setSpeedMultiplier(config.getDouble(speedMultiplierPath)); - - if (config.isDouble(minForcePath)) - setMinforce(config.getDouble(minForcePath)); - - if (config.isInt(fuseTicksPath)) - setFuseticks(config.getInt(fuseTicksPath)); - - if (config.isDouble(recoilPath)) - setRecoil(config.getDouble(recoilPath)); - - if (config.isBoolean(isDestructivePath)) - setIsDestructive(config.getBoolean(isDestructivePath)); - } } \ No newline at end of file