diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index dfe0770..0000000
--- a/.gitattributes
+++ /dev/null
@@ -1,2 +0,0 @@
-# Auto detect text files and perform LF normalization
-* text=auto
diff --git a/.gitignore b/.gitignore
index 27d5dde..79e0c42 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,12 +1,8 @@
-# User-specific stuff
+# Folders
.idea/
-
-*.iml
-*.ipr
-*.iws
-
-# IntelliJ
-out/
+.gradle/
+build/
+target/
# Compiled class file
*.class
@@ -17,7 +13,11 @@ out/
# BlueJ files
*.ctxt
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
# Package Files #
+*.jar
*.war
*.nar
*.ear
@@ -27,86 +27,4 @@ out/
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
-
-*~
-
-# temporary files which can be created if a process still has a handle open of a deleted file
-.fuse_hidden*
-
-# KDE directory preferences
-.directory
-
-# Linux trash folder which might appear on any partition or disk
-.Trash-*
-
-# .nfs files are created when an open file is removed but is still being accessed
-.nfs*
-
-# General
-.DS_Store
-.AppleDouble
-.LSOverride
-
-# Icon must end with two \r
-Icon
-
-# Thumbnails
-._*
-
-# Files that might appear in the root of a volume
-.DocumentRevisions-V100
-.fseventsd
-.Spotlight-V100
-.TemporaryItems
-.Trashes
-.VolumeIcon.icns
-.com.apple.timemachine.donotpresent
-
-# Directories potentially created on remote AFP share
-.AppleDB
-.AppleDesktop
-Network Trash Folder
-Temporary Items
-.apdisk
-
-# Windows thumbnail cache files
-Thumbs.db
-Thumbs.db:encryptable
-ehthumbs.db
-ehthumbs_vista.db
-
-# Dump file
-*.stackdump
-
-# Folder config file
-[Dd]esktop.ini
-
-# Recycle Bin used on file shares
-$RECYCLE.BIN/
-
-# Windows Installer files
-*.cab
-*.msi
-*.msix
-*.msm
-*.msp
-
-# Windows shortcuts
-*.lnk
-
-target/
-
-pom.xml.tag
-pom.xml.releaseBackup
-pom.xml.versionsBackup
-pom.xml.next
-
-release.properties
-dependency-reduced-pom.xml
-buildNumber.properties
-.mvn/timing.properties
-.mvn/wrapper/maven-wrapper.jar
-.flattened-pom.xml
-
-# Common working directory
-run/
+replay_pid*
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index f288702..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,674 +0,0 @@
- 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.
-
-
- Copyright (C)
-
- 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:
-
- Copyright (C)
- 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
index 3c041e2..8e03c7f 100644
--- a/README.md
+++ b/README.md
@@ -14,26 +14,40 @@ https://polymart.org/resource/customcrops.2625
Execute gradle build in your IDLE and get the jar in /build/libs folder
-### API Usage
+### API Guide
+```access transformers
+public class YourClass {
+
+ private CustomCropsAPI api;
+
+ public YourClass() {
+ api = CustomCropsAPI.getInstance();
+ }
+
+ public yourMethod() {
+ api.xxx();
+ }
+}
+```
#### Events
-CropBreakEvent\
-CropInteractEvent\
-CropPlantEvent\
-FertilizerUseEvent\
-GreenhouseGlassBreakEvent\
-GreenhouseGlassPlaceEvent\
-PotBreakEvent\
-PotInfoEvent\
-PotInteractEvent\
-PotPlaceEvent\
-PotWaterEvent\
-ScarecrowBreakEvent\
-ScarecrowPlaceEvent\
-SprinklerFillEvent\
-SprinklerPlaceEvent\
-SprinklerInteractEvent\
+```
+CropBreakEvent
+CropInteractEvent
+CropPlantEvent
+FertilizerUseEvent
+GreenhouseGlassBreakEvent
+GreenhouseGlassPlaceEvent
+PotBreakEvent
+PotInfoEvent
+PotInteractEvent
+PotPlaceEvent
+PotWaterEvent
+ScarecrowBreakEvent
+ScarecrowPlaceEvent
+SprinklerFillEvent
+SprinklerPlaceEvent
+SprinklerInteractEvent
SprinklerBreakEvent
-
-#### Utils
-Use CustomCropsAPI.getInstance() to get the API instance
\ No newline at end of file
+SeasonChangeEvent
+```
diff --git a/api/.gitignore b/api/.gitignore
new file mode 100644
index 0000000..b63da45
--- /dev/null
+++ b/api/.gitignore
@@ -0,0 +1,42 @@
+.gradle
+build/
+!gradle/wrapper/gradle-wrapper.jar
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+out/
+!**/src/main/**/out/
+!**/src/test/**/out/
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+bin/
+!**/src/main/**/bin/
+!**/src/test/**/bin/
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store
\ No newline at end of file
diff --git a/api/build.gradle.kts b/api/build.gradle.kts
new file mode 100644
index 0000000..367c9bb
--- /dev/null
+++ b/api/build.gradle.kts
@@ -0,0 +1,3 @@
+dependencies {
+ compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
+}
\ No newline at end of file
diff --git a/api/src/main/java/net/momirealms/customcrops/api/CustomCropsAPI.java b/api/src/main/java/net/momirealms/customcrops/api/CustomCropsAPI.java
new file mode 100644
index 0000000..8e132af
--- /dev/null
+++ b/api/src/main/java/net/momirealms/customcrops/api/CustomCropsAPI.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) <2022>
+ *
+ * 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
+ * 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 .
+ */
+
+package net.momirealms.customcrops.api;
+
+import net.momirealms.customcrops.api.object.CCGrowingCrop;
+import net.momirealms.customcrops.api.object.CCPot;
+import net.momirealms.customcrops.api.object.CCSprinkler;
+import net.momirealms.customcrops.api.object.CCWorldSeason;
+import org.bukkit.Bukkit;
+import org.bukkit.Location;
+import org.bukkit.World;
+import org.bukkit.plugin.Plugin;
+
+import javax.annotation.Nullable;
+
+public interface CustomCropsAPI {
+
+ /**
+ * Get the pot instance at the specified location
+ * In order to reduce the memory usage, pot data would be removed
+ * if it has no water and no fertilizer
+ * But if "only-work-in-loaded-chunks" is true, pot data would not be removed
+ * @param location location
+ * @return pot
+ */
+ @Nullable
+ CCPot getPotAt(Location location);
+
+ /**
+ * Get the on growing crop at the specified location
+ * It would be null if the crop already comes to its final stage
+ * @param location location
+ * @return on growing crop
+ */
+ @Nullable
+ CCGrowingCrop getCropAt(Location location);
+
+ /**
+ * If the block is a greenhouse glass in data
+ * It would return false if your greenhouse glass lost due to server crash
+ * @param location location
+ * @return whether the block is greenhouse glass
+ */
+ boolean isGreenhouseGlass(Location location);
+
+ /**
+ * If the chunk has a scarecrow
+ * @param location location
+ * @return has scarecrow or not
+ */
+ boolean hasScarecrowInChunk(Location location);
+
+ /**
+ * Get the sprinkler at the specified location
+ * It would be null if the sprinkler run out of water
+ * @param location location
+ * @return sprinkler
+ */
+ @Nullable
+ CCSprinkler getSprinklerAt(Location location);
+
+ /**
+ * Set the world's season
+ * @param world world
+ * @param season season
+ */
+ void setSeason(String world, String season);
+
+ /**
+ * Set the world's date
+ * @param world world
+ * @param date date
+ */
+ void setDate(String world, int date);
+
+ /**
+ * Add a world's date
+ * @param world world
+ */
+ void addDate(String world);
+
+ /**
+ * Get a world's season
+ * @param world world
+ * @return season
+ */
+ @Nullable
+ CCWorldSeason getSeason(String world);
+
+ /**
+ * Force the crops to grow in specified seconds
+ * @param world world
+ * @param seconds time
+ */
+ void grow(World world, int seconds);
+
+ /**
+ * Force the sprinkler to work in specified seconds
+ * @param world world
+ * @param seconds time
+ */
+ void sprinklerWork(World world, int seconds);
+
+ /**
+ * Force the pots to reduce water and consume fertilizer in specified seconds
+ * @param world world
+ * @param seconds time
+ */
+ void consume(World world, int seconds);
+
+ /**
+ * Get the api instance
+ * It would be null if the plugin is not enabled
+ * @return api
+ */
+ @Nullable
+ static CustomCropsAPI getInstance() {
+ Plugin plugin = Bukkit.getPluginManager().getPlugin("CustomCrops");
+ if (plugin instanceof CustomCropsPlugin cc) {
+ return cc.getAPI();
+ }
+ return null;
+ }
+}
diff --git a/api/src/main/java/net/momirealms/customcrops/api/CustomCropsPlugin.java b/api/src/main/java/net/momirealms/customcrops/api/CustomCropsPlugin.java
new file mode 100644
index 0000000..c037609
--- /dev/null
+++ b/api/src/main/java/net/momirealms/customcrops/api/CustomCropsPlugin.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) <2022>
+ *
+ * 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
+ * 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 .
+ */
+
+package net.momirealms.customcrops.api;
+
+import org.bukkit.plugin.java.JavaPlugin;
+
+public class CustomCropsPlugin extends JavaPlugin {
+
+ protected CustomCropsAPI customCropsAPI;
+
+ public CustomCropsAPI getAPI() {
+ return customCropsAPI;
+ }
+}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/CropBreakEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/CropBreakEvent.java
similarity index 76%
rename from src/main/java/net/momirealms/customcrops/api/event/CropBreakEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/CropBreakEvent.java
index fa4e39a..623378b 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/CropBreakEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/CropBreakEvent.java
@@ -17,7 +17,6 @@
package net.momirealms.customcrops.api.event;
-import net.momirealms.customcrops.api.object.crop.CropConfig;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable;
@@ -26,23 +25,28 @@ import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+/**
+ * An event that triggered when breaking a crop
+ */
public class CropBreakEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
- private final CropConfig cropConfig;
private final String cropItemID;
+ private final String cropKey;
private final Location location;
private final Entity entity;
- /**
- * This event might be called when entity breaks the crop or player triggers the break action
- */
- public CropBreakEvent(@Nullable Entity entity, CropConfig cropConfig, String cropItemID, Location location) {
+ public CropBreakEvent(
+ @Nullable Entity entity,
+ @NotNull String cropItemID,
+ @NotNull String cropKey,
+ @NotNull Location location
+ ) {
this.entity = entity;
- this.cropConfig = cropConfig;
this.cropItemID = cropItemID;
this.location = location;
+ this.cropKey = cropKey;
}
@Override
@@ -66,24 +70,39 @@ public class CropBreakEvent extends Event implements Cancellable {
return getHandlerList();
}
- public CropConfig getCropConfig() {
- return cropConfig;
- }
-
/**
* Get the crop item id in IA/Oraxen
* @return item id
*/
+ @NotNull
public String getCropItemID() {
return cropItemID;
}
+ /**
+ * Get the crop location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
+ /**
+ * Would be null if the crop is not broken by an entity
+ * @return entity
+ */
@Nullable
public Entity getEntity() {
return entity;
}
+
+ /**
+ * Get the crop config key
+ * @return crop key
+ */
+ @NotNull
+ public String getCropKey() {
+ return cropKey;
+ }
}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/CropInteractEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/CropInteractEvent.java
similarity index 61%
rename from src/main/java/net/momirealms/customcrops/api/event/CropInteractEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/CropInteractEvent.java
index 682e8ab..f3441b4 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/CropInteractEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/CropInteractEvent.java
@@ -17,8 +17,6 @@
package net.momirealms.customcrops.api.event;
-import net.momirealms.customcrops.api.object.crop.CropConfig;
-import net.momirealms.customcrops.api.object.crop.StageConfig;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
@@ -27,21 +25,30 @@ import org.bukkit.event.player.PlayerEvent;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
+/**
+ * An event that triggered when a player interacts a crop
+ */
public class CropInteractEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private final Location location;
- private final StageConfig stageConfig;
- private final CropConfig cropConfig;
- private final ItemStack hand;
+ private final String cropItemID;
+ private final String cropKey;
+ private final ItemStack itemInHand;
- public CropInteractEvent(@NotNull Player who, ItemStack hand, Location location, CropConfig cropConfig, StageConfig stageConfig) {
+ public CropInteractEvent(
+ @NotNull Player who,
+ @NotNull ItemStack itemInHand,
+ @NotNull Location location,
+ @NotNull String cropItemID,
+ @NotNull String cropKey
+ ) {
super(who);
- this.stageConfig = stageConfig;
+ this.cropItemID = cropItemID;
this.location = location;
- this.cropConfig = cropConfig;
- this.hand = hand;
+ this.cropKey = cropKey;
+ this.itemInHand = itemInHand;
}
@Override
@@ -65,19 +72,40 @@ public class CropInteractEvent extends PlayerEvent implements Cancellable {
return getHandlerList();
}
+ /**
+ * Get the crop location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
- public StageConfig getStageConfig() {
- return stageConfig;
+ /**
+ * Get the item in player's hand
+ * If there's nothing in hand, it would return AIR
+ * @return item in hand
+ */
+ @NotNull
+ public ItemStack getItemInHand() {
+ return itemInHand;
}
- public CropConfig getCropConfig() {
- return cropConfig;
+ /**
+ * Get the crop model item id
+ * @return model item id
+ */
+ @NotNull
+ public String getCropItemID() {
+ return cropItemID;
}
- public ItemStack getHand() {
- return hand;
+ /**
+ * Get the crop config key
+ * @return crop key
+ */
+ @NotNull
+ public String getCropKey() {
+ return cropKey;
}
}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/CropPlantEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/CropPlantEvent.java
similarity index 59%
rename from src/main/java/net/momirealms/customcrops/api/event/CropPlantEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/CropPlantEvent.java
index 51e9c71..479e929 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/CropPlantEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/CropPlantEvent.java
@@ -25,26 +25,33 @@ import org.bukkit.event.player.PlayerEvent;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
+/**
+ * An event that triggered when planting a crop
+ */
public class CropPlantEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
- private final ItemStack hand;
- private final String crop;
+ private final ItemStack itemInHand;
+ private final String cropKey;
private final Location location;
private int point;
- private String crop_model;
+ private String cropItemID;
- /**
- * This event might be called when player plants the crop with a seed or triggers the replant action
- */
- public CropPlantEvent(@NotNull Player who, ItemStack hand, Location location, String crop, int point, String crop_model) {
+ public CropPlantEvent(
+ @NotNull Player who,
+ @NotNull ItemStack itemInHand,
+ @NotNull Location location,
+ @NotNull String cropKey,
+ int point,
+ @NotNull String cropItemID
+ ) {
super(who);
- this.hand = hand;
+ this.itemInHand = itemInHand;
this.location = location;
- this.crop = crop;
+ this.cropKey = cropKey;
this.point = point;
- this.crop_model = crop_model;
+ this.cropItemID = cropItemID;
}
@Override
@@ -57,8 +64,13 @@ public class CropPlantEvent extends PlayerEvent implements Cancellable {
this.cancelled = cancel;
}
- public ItemStack getHand() {
- return hand;
+ /**
+ * Get the seed item
+ * @return seed item
+ */
+ @NotNull
+ public ItemStack getItemInHand() {
+ return itemInHand;
}
@NotNull
@@ -72,31 +84,56 @@ public class CropPlantEvent extends PlayerEvent implements Cancellable {
return getHandlerList();
}
- public String getCrop() {
- return crop;
+ /**
+ * Get the crop config key
+ * @return crop key
+ */
+ @NotNull
+ public String getCropKey() {
+ return cropKey;
}
+ /**
+ * Get the crop location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
+ /**
+ * Get the initial point
+ * It would be 0 when planting
+ * but might be a value higher than 0 when replanting
+ * @return point
+ */
public int getPoint() {
return point;
}
+ /**
+ * Set the initial point
+ * @param point point
+ */
public void setPoint(int point) {
this.point = point;
}
/**
- * Get the crop stage model key
+ * Get the crop stage model item id
* @return crop model
*/
+ @NotNull
public String getCropModel() {
- return crop_model;
+ return cropItemID;
}
- public void setCropModel(String crop_model) {
- this.crop_model = crop_model;
+ /**
+ * Set the crop model item id
+ * @param cropItemID crop model item id
+ */
+ public void setCropModel(String cropItemID) {
+ this.cropItemID = cropItemID;
}
}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/FertilizerUseEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/FertilizerUseEvent.java
similarity index 67%
rename from src/main/java/net/momirealms/customcrops/api/event/FertilizerUseEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/FertilizerUseEvent.java
index 0d040f5..a53a2fc 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/FertilizerUseEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/FertilizerUseEvent.java
@@ -17,7 +17,6 @@
package net.momirealms.customcrops.api.event;
-import net.momirealms.customcrops.api.object.fertilizer.FertilizerConfig;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
@@ -26,18 +25,26 @@ import org.bukkit.event.player.PlayerEvent;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
+/**
+ * An event that triggered when player is using fertilizers
+ */
public class FertilizerUseEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
- private final ItemStack hand;
- private final FertilizerConfig fertilizerConfig;
+ private final ItemStack itemInHand;
+ private final String fertilizerKey;
private final Location location;
- public FertilizerUseEvent(@NotNull Player who, ItemStack hand, FertilizerConfig fertilizerConfig, Location location) {
+ public FertilizerUseEvent(
+ @NotNull Player who,
+ @NotNull ItemStack itemInHand,
+ @NotNull String fertilizerKey,
+ @NotNull Location location
+ ) {
super(who);
- this.hand = hand;
- this.fertilizerConfig = fertilizerConfig;
+ this.itemInHand = itemInHand;
+ this.fertilizerKey = fertilizerKey;
this.location = location;
}
@@ -51,14 +58,29 @@ public class FertilizerUseEvent extends PlayerEvent implements Cancellable {
this.cancelled = cancel;
}
- public ItemStack getHand() {
- return hand;
+ /**
+ * Get the fertilizer item in hand
+ * @return fertilizer itemStack
+ */
+ @NotNull
+ public ItemStack getItemInHand() {
+ return itemInHand;
}
- public FertilizerConfig getFertilizerConfig() {
- return fertilizerConfig;
+ /**
+ * Get the fertilizer config key
+ * @return fertilizer key
+ */
+ @NotNull
+ public String getFertilizerKey() {
+ return fertilizerKey;
}
+ /**
+ * Get the pot location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassBreakEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassBreakEvent.java
similarity index 86%
rename from src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassBreakEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassBreakEvent.java
index 14ff426..5a4254a 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassBreakEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassBreakEvent.java
@@ -24,13 +24,19 @@ import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import org.jetbrains.annotations.NotNull;
+/**
+ * An event that triggered when breaking greenhouse glass
+ */
public class GreenhouseGlassBreakEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private final Location location;
- public GreenhouseGlassBreakEvent(@NotNull Player who, Location location) {
+ public GreenhouseGlassBreakEvent(
+ @NotNull Player who,
+ @NotNull Location location
+ ) {
super(who);
this.location = location;
}
@@ -56,6 +62,11 @@ public class GreenhouseGlassBreakEvent extends PlayerEvent implements Cancellabl
return getHandlerList();
}
+ /**
+ * Get the glass location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassPlaceEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassPlaceEvent.java
similarity index 86%
rename from src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassPlaceEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassPlaceEvent.java
index 482729c..59cc4f6 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassPlaceEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassPlaceEvent.java
@@ -24,13 +24,19 @@ import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import org.jetbrains.annotations.NotNull;
+/**
+ * An event that triggered when placing greenhouse glass
+ */
public class GreenhouseGlassPlaceEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private final Location location;
- public GreenhouseGlassPlaceEvent(@NotNull Player who, Location location) {
+ public GreenhouseGlassPlaceEvent(
+ @NotNull Player who,
+ @NotNull Location location
+ ) {
super(who);
this.location = location;
}
@@ -56,6 +62,11 @@ public class GreenhouseGlassPlaceEvent extends PlayerEvent implements Cancellabl
return getHandlerList();
}
+ /**
+ * Get the glass location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/PotBreakEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/PotBreakEvent.java
similarity index 75%
rename from src/main/java/net/momirealms/customcrops/api/event/PotBreakEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/PotBreakEvent.java
index 6940594..4365834 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/PotBreakEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/PotBreakEvent.java
@@ -17,7 +17,6 @@
package net.momirealms.customcrops.api.event;
-import net.momirealms.customcrops.api.object.pot.PotConfig;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable;
@@ -26,18 +25,25 @@ import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+/**
+ * An event that triggered when breaking a pot
+ */
public class PotBreakEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private final Location location;
- private final PotConfig potConfig;
+ private final String potKey;
private final Entity entity;
- public PotBreakEvent(@Nullable Entity entity, Location location, PotConfig potConfig) {
+ public PotBreakEvent(
+ @Nullable Entity entity,
+ @NotNull Location location,
+ @NotNull String potKey
+ ) {
this.entity = entity;
this.location = location;
- this.potConfig = potConfig;
+ this.potKey = potKey;
}
@Override
@@ -61,14 +67,28 @@ public class PotBreakEvent extends Event implements Cancellable {
return getHandlerList();
}
+ /**
+ * Get the pot location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
- public PotConfig getPotConfig() {
- return potConfig;
+ /**
+ * Get the pot config key
+ * @return pot key
+ */
+ @NotNull
+ public String getPotKey() {
+ return potKey;
}
+ /**
+ * It would be null if the event is not triggered by an entity
+ * @return entity
+ */
@Nullable
public Entity getEntity() {
return entity;
diff --git a/src/main/java/net/momirealms/customcrops/api/event/PotInfoEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/PotInfoEvent.java
similarity index 57%
rename from src/main/java/net/momirealms/customcrops/api/event/PotInfoEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/PotInfoEvent.java
index 0ee75cb..e29983e 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/PotInfoEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/PotInfoEvent.java
@@ -17,9 +17,8 @@
package net.momirealms.customcrops.api.event;
-import net.momirealms.customcrops.api.object.crop.GrowingCrop;
-import net.momirealms.customcrops.api.object.fertilizer.Fertilizer;
-import net.momirealms.customcrops.api.object.pot.PotConfig;
+import net.momirealms.customcrops.api.object.CCFertilizer;
+import net.momirealms.customcrops.api.object.CCGrowingCrop;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
@@ -28,23 +27,33 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+/**
+ * This event is called after a player interacted a pot
+ * So the fertilizer/water would be updated
+ */
public class PotInfoEvent extends PlayerEvent {
private static final HandlerList handlers = new HandlerList();
- private final PotConfig potConfig;
- private final Fertilizer fertilizer;
+ private final CCFertilizer fertilizer;
private final int water;
- private final GrowingCrop growingCrop;
- private final ItemStack hand;
+ private final CCGrowingCrop growingCrop;
+ private final ItemStack itemInHand;
private final Location location;
- public PotInfoEvent(@NotNull Player who, Location location, ItemStack hand, PotConfig potConfig, @Nullable Fertilizer fertilizer, int water, GrowingCrop growingCrop) {
+
+ public PotInfoEvent(
+ @NotNull Player who,
+ @NotNull Location location,
+ @NotNull ItemStack itemInHand,
+ @Nullable CCFertilizer fertilizer,
+ int water,
+ @Nullable CCGrowingCrop growingCrop
+ ) {
super(who);
- this.potConfig = potConfig;
this.fertilizer = fertilizer;
this.water = water;
this.growingCrop = growingCrop;
- this.hand = hand;
+ this.itemInHand = itemInHand;
this.location = location;
}
@@ -59,28 +68,48 @@ public class PotInfoEvent extends PlayerEvent {
return getHandlerList();
}
- public PotConfig getPotConfig() {
- return potConfig;
- }
-
+ /**
+ * Get the fertilizer
+ * @return fertilizer
+ */
@Nullable
- public Fertilizer getFertilizer() {
+ public CCFertilizer getFertilizer() {
return fertilizer;
}
+ /**
+ * Get the water amount
+ * @return water amount
+ */
public int getWater() {
return water;
}
+ /**
+ * Get the on growing crop above the pot
+ * It would be null if there's no crop or the crop is already ripe
+ * @return crop
+ */
@Nullable
- public GrowingCrop getGrowingCrop() {
+ public CCGrowingCrop getGrowingCrop() {
return growingCrop;
}
- public ItemStack getHand() {
- return hand;
+ /**
+ * Get the item in player's hand
+ * If there's nothing in hand, it would return AIR
+ * @return item in hand
+ */
+ @NotNull
+ public ItemStack getItemInHand() {
+ return itemInHand;
}
+ /**
+ * Get the pot location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/PotInteractEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/PotInteractEvent.java
similarity index 64%
rename from src/main/java/net/momirealms/customcrops/api/event/PotInteractEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/PotInteractEvent.java
index ad4f61b..24f36ed 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/PotInteractEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/PotInteractEvent.java
@@ -17,7 +17,6 @@
package net.momirealms.customcrops.api.event;
-import net.momirealms.customcrops.api.object.pot.PotConfig;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
@@ -26,19 +25,27 @@ import org.bukkit.event.player.PlayerEvent;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
+/**
+ * This event is called when a player is interacting a pot
+ */
public class PotInteractEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
- private final ItemStack hand;
+ private final ItemStack itemInHand;
private final Location location;
- private final PotConfig potConfig;
+ private final String potKey;
- public PotInteractEvent(@NotNull Player who, ItemStack hand, Location location, PotConfig potConfig) {
+ public PotInteractEvent(
+ @NotNull Player who,
+ @NotNull ItemStack itemInHand,
+ @NotNull Location location,
+ @NotNull String potKey
+ ) {
super(who);
- this.hand = hand;
+ this.itemInHand = itemInHand;
this.location = location;
- this.potConfig = potConfig;
+ this.potKey = potKey;
}
@Override
@@ -46,6 +53,10 @@ public class PotInteractEvent extends PlayerEvent implements Cancellable {
return cancelled;
}
+ /**
+ * Cancelling this event would cancel PotInfoEvent too
+ * @param cancel true if you wish to cancel this event
+ */
@Override
public void setCancelled(boolean cancel) {
this.cancelled = cancel;
@@ -62,15 +73,31 @@ public class PotInteractEvent extends PlayerEvent implements Cancellable {
return getHandlerList();
}
- public ItemStack getHand() {
- return hand;
+ /**
+ * Get the item in player's hand
+ * If there's nothing in hand, it would return AIR
+ * @return item in hand
+ */
+ @NotNull
+ public ItemStack getItemInHand() {
+ return itemInHand;
}
+ /**
+ * Get the pot location
+ * @return pot location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
- public PotConfig getPotConfig() {
- return potConfig;
+ /**
+ * Get the pot's config key
+ * @return pot key
+ */
+ @NotNull
+ public String getPotKey() {
+ return potKey;
}
}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/PotPlaceEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/PotPlaceEvent.java
similarity index 77%
rename from src/main/java/net/momirealms/customcrops/api/event/PotPlaceEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/PotPlaceEvent.java
index 72852ef..47712ce 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/PotPlaceEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/PotPlaceEvent.java
@@ -17,7 +17,6 @@
package net.momirealms.customcrops.api.event;
-import net.momirealms.customcrops.api.object.pot.PotConfig;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
@@ -25,17 +24,24 @@ import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import org.jetbrains.annotations.NotNull;
+/**
+ * An event that triggered when placing a pot
+ */
public class PotPlaceEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private final Location location;
- private final PotConfig potConfig;
+ private final String potKey;
- public PotPlaceEvent(@NotNull Player who, Location location, PotConfig potConfig) {
+ public PotPlaceEvent(
+ @NotNull Player who,
+ @NotNull Location location,
+ @NotNull String potKey
+ ) {
super(who);
this.location = location;
- this.potConfig = potConfig;
+ this.potKey = potKey;
}
@Override
@@ -59,11 +65,21 @@ public class PotPlaceEvent extends PlayerEvent implements Cancellable {
return getHandlerList();
}
+ /**
+ * Get the pot location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
- public PotConfig getPotConfig() {
- return potConfig;
+ /**
+ * Get the placed pot config key
+ * @return pot key
+ */
+ @NotNull
+ public String getPotKey() {
+ return potKey;
}
}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/PotWaterEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/PotWaterEvent.java
similarity index 73%
rename from src/main/java/net/momirealms/customcrops/api/event/PotWaterEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/PotWaterEvent.java
index 3a10828..da6e191 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/PotWaterEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/PotWaterEvent.java
@@ -25,17 +25,24 @@ import org.bukkit.event.player.PlayerEvent;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
+/**
+ * An event that triggered when watering a pot
+ */
public class PotWaterEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
- private final ItemStack hand;
+ private final ItemStack itemInHand;
private int water;
private final Location location;
- public PotWaterEvent(@NotNull Player who, ItemStack hand, int water, Location location) {
+ public PotWaterEvent(
+ @NotNull Player who,
+ @NotNull ItemStack itemInHand,
+ int water,
+ @NotNull Location location) {
super(who);
- this.hand = hand;
+ this.itemInHand = itemInHand;
this.water = water;
this.location = location;
}
@@ -61,22 +68,36 @@ public class PotWaterEvent extends PlayerEvent implements Cancellable {
return getHandlerList();
}
+ /**
+ * Get the pot location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
- public ItemStack getHand() {
- return hand;
+ /**
+ * Get the item in player's hand
+ * @return item in hand
+ */
+ @NotNull
+ public ItemStack getItemInHand() {
+ return itemInHand;
}
/**
* Get the amount of water
- * @return the amount of water that adds to the pot
+ * @return the amount of water that added to the pot
*/
public int getWater() {
return water;
}
+ /**
+ * Set the amount of water that added to the pot
+ * @param water water
+ */
public void setWater(int water) {
this.water = water;
}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/ScarecrowBreakEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowBreakEvent.java
similarity index 86%
rename from src/main/java/net/momirealms/customcrops/api/event/ScarecrowBreakEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowBreakEvent.java
index 151b5cf..1e64a32 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/ScarecrowBreakEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowBreakEvent.java
@@ -24,13 +24,19 @@ import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import org.jetbrains.annotations.NotNull;
+/**
+ * An event that triggered when breaking a scarecrow
+ */
public class ScarecrowBreakEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private final Location location;
- public ScarecrowBreakEvent(@NotNull Player who, Location location) {
+ public ScarecrowBreakEvent(
+ @NotNull Player who,
+ @NotNull Location location
+ ) {
super(who);
this.location = location;
}
@@ -56,6 +62,11 @@ public class ScarecrowBreakEvent extends PlayerEvent implements Cancellable {
return getHandlerList();
}
+ /**
+ * Get the scarecrow location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/ScarecrowPlaceEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowPlaceEvent.java
similarity index 86%
rename from src/main/java/net/momirealms/customcrops/api/event/ScarecrowPlaceEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowPlaceEvent.java
index 03b17d8..b65a4bc 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/ScarecrowPlaceEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowPlaceEvent.java
@@ -24,13 +24,19 @@ import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import org.jetbrains.annotations.NotNull;
+/**
+ * An event that triggered when placing a scarecrow
+ */
public class ScarecrowPlaceEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private final Location location;
- public ScarecrowPlaceEvent(@NotNull Player who, Location location) {
+ public ScarecrowPlaceEvent(
+ @NotNull Player who,
+ @NotNull Location location
+ ) {
super(who);
this.location = location;
}
@@ -56,6 +62,11 @@ public class ScarecrowPlaceEvent extends PlayerEvent implements Cancellable {
return getHandlerList();
}
+ /**
+ * Get the scarecrow location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/SeasonChangeEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/SeasonChangeEvent.java
new file mode 100644
index 0000000..c421e1a
--- /dev/null
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/SeasonChangeEvent.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) <2022>
+ *
+ * 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
+ * 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 .
+ */
+
+package net.momirealms.customcrops.api.event;
+
+import net.momirealms.customcrops.api.object.CCWorldSeason;
+import org.bukkit.World;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.world.WorldEvent;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * An event that triggered when season changes
+ */
+public class SeasonChangeEvent extends WorldEvent {
+
+ private static final HandlerList handlers = new HandlerList();
+ private final CCWorldSeason season;
+
+ public SeasonChangeEvent(
+ @NotNull World world,
+ @NotNull CCWorldSeason season
+ ) {
+ super(world);
+ this.season = season;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return getHandlerList();
+ }
+
+ /**
+ * Get the new season
+ * @return season
+ */
+ @NotNull
+ public CCWorldSeason getSeason() {
+ return season;
+ }
+}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/SprinklerBreakEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerBreakEvent.java
similarity index 75%
rename from src/main/java/net/momirealms/customcrops/api/event/SprinklerBreakEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/SprinklerBreakEvent.java
index 39aed58..36c3a89 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/SprinklerBreakEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerBreakEvent.java
@@ -17,7 +17,6 @@
package net.momirealms.customcrops.api.event;
-import net.momirealms.customcrops.api.object.sprinkler.SprinklerConfig;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
@@ -25,17 +24,24 @@ import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import org.jetbrains.annotations.NotNull;
+/**
+ * An event that triggered when breaking a sprinkler
+ */
public class SprinklerBreakEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private final Location location;
- private final SprinklerConfig sprinklerConfig;
+ private final String sprinklerKey;
- public SprinklerBreakEvent(@NotNull Player who, Location location, SprinklerConfig sprinklerConfig) {
+ public SprinklerBreakEvent(
+ @NotNull Player who,
+ @NotNull Location location,
+ @NotNull String sprinklerKey
+ ) {
super(who);
this.location = location;
- this.sprinklerConfig = sprinklerConfig;
+ this.sprinklerKey = sprinklerKey;
}
@Override
@@ -59,11 +65,21 @@ public class SprinklerBreakEvent extends PlayerEvent implements Cancellable {
return getHandlerList();
}
+ /**
+ * Get the sprinkler location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
- public SprinklerConfig getSprinklerConfig() {
- return sprinklerConfig;
+ /**
+ * Get the sprinkler config key
+ * @return sprinkler key
+ */
+ @NotNull
+ public String getSprinklerKey() {
+ return sprinklerKey;
}
}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/SprinklerFillEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerFillEvent.java
similarity index 66%
rename from src/main/java/net/momirealms/customcrops/api/event/SprinklerFillEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/SprinklerFillEvent.java
index ad1f5e9..0474ce3 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/SprinklerFillEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerFillEvent.java
@@ -25,19 +25,29 @@ import org.bukkit.event.player.PlayerEvent;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
+/**
+ * An event that triggered when filling a sprinkler
+ */
public class SprinklerFillEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
- private final ItemStack hand;
+ private final ItemStack itemInHand;
private int water;
private final Location location;
+ private final String sprinklerKey;
- public SprinklerFillEvent(@NotNull Player who, ItemStack hand, int water, Location location) {
+ public SprinklerFillEvent(
+ @NotNull Player who,
+ @NotNull String sprinklerKey,
+ @NotNull ItemStack itemInHand,
+ int water,
+ @NotNull Location location) {
super(who);
- this.hand = hand;
+ this.itemInHand = itemInHand;
this.water = water;
this.location = location;
+ this.sprinklerKey = sprinklerKey;
}
@Override
@@ -61,23 +71,46 @@ public class SprinklerFillEvent extends PlayerEvent implements Cancellable {
return getHandlerList();
}
- public ItemStack getHand() {
- return hand;
+ /**
+ * Get the item in player's hand
+ * @return item in hand
+ */
+ @NotNull
+ public ItemStack getItemInHand() {
+ return itemInHand;
}
+ /**
+ * Get the sprinkler location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
/**
* Get the amount of water
- * @return the amount of water that adds to the sprinkler
+ * @return the amount of water that added to the sprinkler
*/
public int getWater() {
return water;
}
+ /**
+ * Set the water that added to the sprinkler
+ * @param water water
+ */
public void setWater(int water) {
this.water = water;
}
+
+ /**
+ * Get the sprinkler config key
+ * @return sprinkler key
+ */
+ @NotNull
+ public String getSprinklerKey() {
+ return sprinklerKey;
+ }
}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/SprinklerInteractEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerInteractEvent.java
similarity index 67%
rename from src/main/java/net/momirealms/customcrops/api/event/SprinklerInteractEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/SprinklerInteractEvent.java
index 14156b2..346a531 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/SprinklerInteractEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerInteractEvent.java
@@ -17,7 +17,6 @@
package net.momirealms.customcrops.api.event;
-import net.momirealms.customcrops.api.object.sprinkler.SprinklerConfig;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
@@ -26,19 +25,27 @@ import org.bukkit.event.player.PlayerEvent;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
+/**
+ * An event that triggered when interacting a sprinkler
+ */
public class SprinklerInteractEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private final Location location;
- private final SprinklerConfig sprinklerConfig;
- private final ItemStack hand;
+ private final String sprinklerKey;
+ private final ItemStack itemInHand;
- public SprinklerInteractEvent(@NotNull Player who, ItemStack hand, Location location, SprinklerConfig sprinklerConfig) {
+ public SprinklerInteractEvent(
+ @NotNull Player who,
+ @NotNull ItemStack itemInHand,
+ @NotNull Location location,
+ @NotNull String sprinklerKey
+ ) {
super(who);
this.location = location;
- this.sprinklerConfig = sprinklerConfig;
- this.hand = hand;
+ this.sprinklerKey = sprinklerKey;
+ this.itemInHand = itemInHand;
}
@Override
@@ -62,15 +69,30 @@ public class SprinklerInteractEvent extends PlayerEvent implements Cancellable {
return getHandlerList();
}
+ /**
+ * Get the sprinkler location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
- public SprinklerConfig getSprinklerConfig() {
- return sprinklerConfig;
+ /**
+ * Get the sprinkler config key
+ * @return sprinkler key
+ */
+ @NotNull
+ public String getSprinklerKey() {
+ return sprinklerKey;
}
- public ItemStack getHand() {
- return hand;
+ /**
+ * Get the item in player's hand
+ * @return item in hand
+ */
+ @NotNull
+ public ItemStack getItemInHand() {
+ return itemInHand;
}
}
diff --git a/src/main/java/net/momirealms/customcrops/api/event/SprinklerPlaceEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerPlaceEvent.java
similarity index 70%
rename from src/main/java/net/momirealms/customcrops/api/event/SprinklerPlaceEvent.java
rename to api/src/main/java/net/momirealms/customcrops/api/event/SprinklerPlaceEvent.java
index b4a4e7d..b50d252 100644
--- a/src/main/java/net/momirealms/customcrops/api/event/SprinklerPlaceEvent.java
+++ b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerPlaceEvent.java
@@ -17,7 +17,6 @@
package net.momirealms.customcrops.api.event;
-import net.momirealms.customcrops.api.object.sprinkler.SprinklerConfig;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
@@ -26,19 +25,22 @@ import org.bukkit.event.player.PlayerEvent;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
+/**
+ * An event that triggered when placing a sprinkler
+ */
public class SprinklerPlaceEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
- private final ItemStack hand;
+ private final ItemStack itemInHand;
private final Location location;
- private final SprinklerConfig sprinklerConfig;
+ private final String sprinklerKey;
- public SprinklerPlaceEvent(@NotNull Player who, ItemStack hand, Location location, SprinklerConfig sprinklerConfig) {
+ public SprinklerPlaceEvent(@NotNull Player who, ItemStack itemInHand, Location location, String sprinklerKey) {
super(who);
- this.hand = hand;
+ this.itemInHand = itemInHand;
this.location = location;
- this.sprinklerConfig = sprinklerConfig;
+ this.sprinklerKey = sprinklerKey;
}
@Override
@@ -62,15 +64,30 @@ public class SprinklerPlaceEvent extends PlayerEvent implements Cancellable {
return getHandlerList();
}
- public ItemStack getHand() {
- return hand;
+ /**
+ * Get the item in player's hand
+ * @return item in hand
+ */
+ @NotNull
+ public ItemStack getItemInHand() {
+ return itemInHand;
}
+ /**
+ * Get the sprinkler location
+ * @return location
+ */
+ @NotNull
public Location getLocation() {
return location;
}
- public SprinklerConfig getSprinklerConfig() {
- return sprinklerConfig;
+ /**
+ * Get the sprinkler config key
+ * @return sprinkler key
+ */
+ @NotNull
+ public String getSprinklerKey() {
+ return sprinklerKey;
}
}
diff --git a/api/src/main/java/net/momirealms/customcrops/api/object/CCFertilizer.java b/api/src/main/java/net/momirealms/customcrops/api/object/CCFertilizer.java
new file mode 100644
index 0000000..8889ddd
--- /dev/null
+++ b/api/src/main/java/net/momirealms/customcrops/api/object/CCFertilizer.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) <2022>
+ *
+ * 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
+ * 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 .
+ */
+
+package net.momirealms.customcrops.api.object;
+
+/**
+ * Fertilizer
+ */
+public interface CCFertilizer {
+
+ /**
+ * Reduce the fertilizer's usage times
+ * @return whether the fertilizer is used up
+ */
+ boolean reduceTimes();
+
+ /**
+ * Get the fertilizer key in config
+ * @return key
+ */
+ String getKey();
+
+ /**
+ * Get the remaining usage times
+ * @return times
+ */
+ int getLeftTimes();
+
+ /**
+ * Set remaining usage times
+ * @param times times
+ */
+ void setTimes(int times);
+}
diff --git a/api/src/main/java/net/momirealms/customcrops/api/object/CCGrowingCrop.java b/api/src/main/java/net/momirealms/customcrops/api/object/CCGrowingCrop.java
new file mode 100644
index 0000000..2f43ebd
--- /dev/null
+++ b/api/src/main/java/net/momirealms/customcrops/api/object/CCGrowingCrop.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) <2022>
+ *
+ * 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
+ * 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 .
+ */
+
+package net.momirealms.customcrops.api.object;
+
+/**
+ * Crops
+ */
+public interface CCGrowingCrop {
+
+ /**
+ * Get the crop growing point
+ * @return point
+ */
+ int getPoints();
+
+ /**
+ * Set the growing point
+ * @param points points
+ */
+ void setPoints(int points);
+
+ /**
+ * Get the crop config key
+ * @return crop key
+ */
+ String getKey();
+}
diff --git a/api/src/main/java/net/momirealms/customcrops/api/object/CCPot.java b/api/src/main/java/net/momirealms/customcrops/api/object/CCPot.java
new file mode 100644
index 0000000..bc5017f
--- /dev/null
+++ b/api/src/main/java/net/momirealms/customcrops/api/object/CCPot.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) <2022>
+ *
+ * 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
+ * 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 .
+ */
+
+package net.momirealms.customcrops.api.object;
+
+/**
+ * Pot
+ */
+public interface CCPot {
+
+ /**
+ * Get the pot config key
+ * @return key
+ */
+ String getKey();
+
+ /**
+ * Get the fertilizer inside the pot
+ * @return fertilizer
+ */
+ CCFertilizer getFertilizer();
+
+ /**
+ * Set the fertilizer to the pot
+ * @param fertilizer fertilizer
+ */
+ void setFertilizer(CCFertilizer fertilizer);
+
+ /**
+ * Get the water amount
+ * @return water amount
+ */
+ int getWater();
+
+ /**
+ * Whether the pot is wet
+ * @return wet or not
+ */
+ boolean isWet();
+
+ /**
+ * Add water to pot
+ * @param amount water amount
+ * @return whether the pot is previously dry
+ */
+ boolean addWater(int amount);
+
+ /**
+ * Set water amount
+ * @param amount amount
+ */
+ void setWater(int amount);
+}
diff --git a/api/src/main/java/net/momirealms/customcrops/api/object/CCSprinkler.java b/api/src/main/java/net/momirealms/customcrops/api/object/CCSprinkler.java
new file mode 100644
index 0000000..ea8b4b1
--- /dev/null
+++ b/api/src/main/java/net/momirealms/customcrops/api/object/CCSprinkler.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) <2022>
+ *
+ * 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
+ * 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 .
+ */
+
+package net.momirealms.customcrops.api.object;
+
+/**
+ * Sprinkler
+ */
+public interface CCSprinkler {
+
+ /**
+ * Get the remaining water
+ * @return water amount
+ */
+ int getWater();
+
+ /**
+ * Set the remaining water
+ * @param water water
+ */
+ void setWater(int water);
+
+ /**
+ * Get the sprinkler config key
+ * @return sprinkler key
+ */
+ String getKey();
+}
diff --git a/api/src/main/java/net/momirealms/customcrops/api/object/CCWorldSeason.java b/api/src/main/java/net/momirealms/customcrops/api/object/CCWorldSeason.java
new file mode 100644
index 0000000..041afc6
--- /dev/null
+++ b/api/src/main/java/net/momirealms/customcrops/api/object/CCWorldSeason.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) <2022>
+ *
+ * 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
+ * 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 .
+ */
+
+package net.momirealms.customcrops.api.object;
+
+/**
+ * Season
+ */
+public interface CCWorldSeason {
+
+ /**
+ * SPRING, SUMMER, AUTUMN, WINTER
+ * @return season
+ */
+ String getSeason();
+
+ /**
+ * Get the season display name
+ * @return display name
+ */
+ String getDisplay();
+}
diff --git a/build.gradle b/build.gradle
deleted file mode 100644
index 952b266..0000000
--- a/build.gradle
+++ /dev/null
@@ -1,75 +0,0 @@
-plugins {
- id 'java'
- id 'com.github.johnrengelman.shadow' version '7.1.2'
-}
-
-group = 'net.momirealms'
-version = '3.3.0.1'
-
-repositories {
- mavenCentral()
- maven {name = "enginehub repo"; url = "https://maven.enginehub.org/repo/"}
- maven {name = "aliyun repo"; url = "https://maven.aliyun.com/repository/public/"}
- maven {name = 'papermc repo'; url = 'https://papermc.io/repo/repository/maven-public/'}
- maven {name = 'sonatype'; url = 'https://oss.sonatype.org/content/groups/public/'}
- maven {name = "dmulloy2 repo"; url = "https://repo.dmulloy2.net/repository/public/"}
- maven {name = "clip repo"; url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'}
- maven {name = "codemc repo"; url = "https://repo.codemc.org/repository/maven-public/"}
- maven {name = "Lumine repo"; url = "https://mvn.lumine.io/repository/maven-public"}
- maven {name = "jitpack repo"; url = "https://jitpack.io"}
- maven {name = 'bg-software repo'; url = 'https://repo.bg-software.com/repository/api/'}
- maven {name = 'aswm repo'; url = 'https://repo.infernalsuite.com/repository/maven-snapshots/' }
- maven {name = 'aswm repo'; url = 'https://repo.rapture.pw/repository/maven-releases/' }
- maven {name = 'mmo-repo'; url = 'https://nexus.phoenixdevt.fr/repository/maven-public/'}
-}
-
-dependencies {
- compileOnly ('dev.dejvokep:boosted-yaml:1.3.1')
- compileOnly ('commons-io:commons-io:2.11.0')
- compileOnly ('io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT')
- compileOnly ('me.clip:placeholderapi:2.11.3')
- compileOnly ('com.github.LoneDev6:api-itemsadder:3.4.1e')
- compileOnly ('com.github.oraxen:oraxen:1.157.2')
- compileOnly ('io.lumine:Mythic-Dist:5.0.3-SNAPSHOT')
- compileOnly ('com.willfp:eco:6.60.0')
- compileOnly ('com.willfp:EcoJobs:3.13.0')
- compileOnly ('net.objecthunter:exp4j:0.4.8')
- compileOnly ('io.lumine:Mythic-Dist:5.2.1')
- compileOnly ('com.infernalsuite.aswm:api:1.19.4-R0.1-SNAPSHOT')
- compileOnly ('net.Indyuce:MMOItems-API:6.9.2-SNAPSHOT')
- compileOnly ('com.google.code.gson:gson:2.10.1')
- compileOnly fileTree (dir:'libs',includes:['*.jar'])
- implementation ('net.kyori:adventure-api:4.14.0')
- implementation ('net.kyori:adventure-platform-bukkit:4.3.0')
- implementation ('net.kyori:adventure-text-minimessage:4.14.0')
- implementation ("de.tr7zw:item-nbt-api:2.11.3")
- implementation ('org.bstats:bstats-bukkit:3.0.1')
- implementation fileTree (dir:'libs',includes:['BiomeAPI.jar','ProtectionLib.jar'])
-}
-
-processResources {
- def props = [version: version]
- inputs.properties props
- filteringCharset 'UTF-8'
- filesMatching(['paper-plugin.yml', 'plugin.yml']) {
- expand props
- }
-}
-
-tasks.withType(JavaCompile).configureEach {
- options.encoding = "UTF-8"
-}
-
-shadowJar {
- relocate ('de.tr7zw', 'net.momirealms.customcrops.libraries.tr7zw')
- relocate ('net.kyori', 'net.momirealms.customcrops.libraries.kyori')
- relocate ('org.bstats', 'net.momirealms.customcrops.libraries.bstats')
- relocate ('org.apache.commons.pool2', 'net.momirealms.customcrops.libraries.commons.pool2')
- relocate ('net.momirealms.biomeapi', 'net.momirealms.customcrops.libraries.biomeapi')
- relocate ('net.momirealms.protectionlib', 'net.momirealms.customcrops.libraries.protectionlib')
-}
-
-tasks.register("delete", Delete).get().delete("build/libs/"+project.name+"-"+project.version+".jar")
-tasks.named("build").get().dependsOn("shadowJar").finalizedBy("delete").doLast {
- println("Deleting: "+ "build/libs/"+project.name+"-"+project.version+".jar")
-}
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000..4cc9c19
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,82 @@
+plugins {
+ id("org.gradle.java")
+ id("application")
+ id("org.gradle.maven-publish")
+ id("com.github.johnrengelman.shadow") version "8.1.1"
+}
+
+allprojects {
+
+ project.group = "net.momirealms"
+ project.version = "3.3.1.0"
+
+ apply()
+ apply(plugin = "java")
+ apply(plugin = "application")
+ apply(plugin = "com.github.johnrengelman.shadow")
+ apply(plugin = "org.gradle.maven-publish")
+
+ application {
+ mainClass.set("")
+ }
+
+ repositories {
+ maven("https://maven.aliyun.com/repository/public/")
+ mavenCentral()
+ maven("https://betonquest.org/nexus/repository/betonquest/")
+ maven("https://maven.enginehub.org/repo/")
+ maven("https://oss.sonatype.org/content/groups/public/")
+ maven("https://repo.codemc.org/repository/maven-public/")
+ maven("https://jitpack.io")
+ maven("https://repo.papermc.io/repository/maven-public/")
+ maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
+ maven("https://repo.dmulloy2.net/repository/public/")
+ maven("https://mvn.lumine.io/repository/maven-public/")
+ maven("https://repo.bg-software.com/repository/api/")
+ maven("https://repo.infernalsuite.com/repository/maven-snapshots/")
+ maven("https://repo.rapture.pw/repository/maven-releases/")
+ maven("https://nexus.phoenixdevt.fr/repository/maven-public/")
+ maven("https://r.irepo.space/maven/")
+ maven("https://repo.auxilor.io/repository/maven-public/")
+ }
+
+ dependencies {
+ testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
+ testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.3")
+ testImplementation("org.junit.jupiter:junit-jupiter-engine:5.9.3")
+ }
+
+ tasks.processResources {
+ val props = mapOf("version" to version)
+ inputs.properties(props)
+ filteringCharset = "UTF-8"
+ filesMatching("plugin.yml") {
+ expand(props)
+ }
+ }
+}
+
+subprojects {
+
+ tasks.withType {
+ options.encoding = "UTF-8"
+ }
+
+ tasks.shadowJar {
+ destinationDirectory.set(file("$rootDir/target"))
+ archiveClassifier.set("")
+ archiveFileName.set("CustomCrops-" + project.name + "-" + project.version + ".jar")
+ }
+
+ tasks.javadoc.configure {
+ options.quiet()
+ }
+
+ if ("api" == project.name) {
+ java {
+ withSourcesJar()
+ withJavadocJar()
+ }
+ }
+}
+
diff --git a/gradle.properties b/gradle.properties
index e69de29..7b26f39 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -0,0 +1,8 @@
+systemProp.socks.proxyHost=127.0.0.1
+systemProp.socks.proxyPort=7890
+
+systemProp.http.proxyHost=127.0.0.1
+systemProp.http.proxyPort=7890
+
+systemProp.https.proxyHost=127.0.0.1
+systemProp.https.proxyPort=7890
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 2e6e589..fae0804 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index 3da45c1..744e882 100644
--- a/gradlew
+++ b/gradlew
@@ -1,7 +1,7 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
-# Copyright ? 2015-2021 the original authors.
+# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,101 +17,67 @@
#
##############################################################################
-#
-# Gradle start up script for POSIX generated by Gradle.
-#
-# Important for running:
-#
-# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
-# noncompliant, but you have some other compliant shell such as ksh or
-# bash, then to run this script, type that shell name before the whole
-# command line, like:
-#
-# ksh Gradle
-#
-# Busybox and similar reduced shells will NOT work, because this script
-# requires all of these POSIX shell features:
-# * functions;
-# * expansions ?$var?, ?${var}?, ?${var:-default}?, ?${var+SET}?,
-# ?${var#prefix}?, ?${var%suffix}?, and ?$( cmd )?;
-# * compound commands having a testable exit status, especially ?case?;
-# * various built-in commands including ?command?, ?set?, and ?ulimit?.
-#
-# Important for patching:
-#
-# (2) This script targets any POSIX shell, so it avoids extensions provided
-# by Bash, Ksh, etc; in particular arrays are avoided.
-#
-# The "traditional" practice of packing multiple parameters into a
-# space-separated string is a well documented source of bugs and security
-# problems, so this is (mostly) avoided, by progressively accumulating
-# options in "$@", and eventually passing that to Java.
-#
-# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
-# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
-# see the in-line comments for details.
-#
-# There are tweaks for specific operating systems such as AIX, CygWin,
-# Darwin, MinGW, and NonStop.
-#
-# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
-# within the Gradle project.
-#
-# You can find Gradle at https://github.com/gradle/gradle/.
-#
+##
+## Gradle start up script for UN*X
+##
##############################################################################
# Attempt to set APP_HOME
-
# Resolve links: $0 may be a link
-app_path=$0
-
-# Need this for daisy-chained symlinks.
-while
- APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
- [ -h "$app_path" ]
-do
- ls=$( ls -ld "$app_path" )
- link=${ls#*' -> '}
- case $link in #(
- /*) app_path=$link ;; #(
- *) app_path=$APP_HOME$link ;;
- esac
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
done
-
-APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
APP_NAME="Gradle"
-APP_BASE_NAME=${0##*/}
+APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD=maximum
+MAX_FD="maximum"
warn () {
echo "$*"
-} >&2
+}
die () {
echo
echo "$*"
echo
exit 1
-} >&2
+}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
-case "$( uname )" in #(
- CYGWIN* ) cygwin=true ;; #(
- Darwin* ) darwin=true ;; #(
- MSYS* | MINGW* ) msys=true ;; #(
- NONSTOP* ) nonstop=true ;;
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MSYS* | MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -121,9 +87,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
- JAVACMD=$JAVA_HOME/jre/sh/java
+ JAVACMD="$JAVA_HOME/jre/sh/java"
else
- JAVACMD=$JAVA_HOME/bin/java
+ JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -132,7 +98,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
- JAVACMD=java
+ JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
@@ -140,95 +106,80 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
-if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
- case $MAX_FD in #(
- max*)
- MAX_FD=$( ulimit -H -n ) ||
- warn "Could not query maximum file descriptor limit"
- esac
- case $MAX_FD in #(
- '' | soft) :;; #(
- *)
- ulimit -n "$MAX_FD" ||
- warn "Could not set maximum file descriptor limit to $MAX_FD"
- esac
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
fi
-# Collect all arguments for the java command, stacking in reverse order:
-# * args from the command line
-# * the main class name
-# * -classpath
-# * -D...appname settings
-# * --module-path (only if needed)
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
# For Cygwin or MSYS, switch paths to Windows format before running java
-if "$cygwin" || "$msys" ; then
- APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
- CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=$( cygpath --unix "$JAVACMD" )
+ JAVACMD=`cygpath --unix "$JAVACMD"`
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- for arg do
- if
- case $arg in #(
- -*) false ;; # don't mess with options #(
- /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
- [ -e "$t" ] ;; #(
- *) false ;;
- esac
- then
- arg=$( cygpath --path --ignore --mixed "$arg" )
- fi
- # Roll the args list around exactly as many times as the number of
- # args, so each arg winds up back in the position where it started, but
- # possibly modified.
- #
- # NB: a `for` loop captures its iteration list before it begins, so
- # changing the positional parameters here affects neither the number of
- # iterations, nor the values presented in `arg`.
- shift # remove old arg
- set -- "$@" "$arg" # push replacement arg
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
fi
-# Collect all arguments for the java command;
-# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
-# shell script including quotes and variable substitutions, so put them in
-# double quotes to make sure that they get re-expanded; and
-# * put everything else in single quotes, so that it's not re-expanded.
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
-set -- \
- "-Dorg.gradle.appname=$APP_BASE_NAME" \
- -classpath "$CLASSPATH" \
- org.gradle.wrapper.GradleWrapperMain \
- "$@"
-
-# Use "xargs" to parse quoted args.
-#
-# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
-#
-# In Bash we could simply go:
-#
-# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
-# set -- "${ARGS[@]}" "$@"
-#
-# but POSIX shell has neither arrays nor command substitution, so instead we
-# post-process each arg (as a line of input to sed) to backslash-escape any
-# character that might be a shell metacharacter, then use eval to reverse
-# that process (while maintaining the separation between arguments), and wrap
-# the whole thing up as a single "set" statement.
-#
-# This will of course break if any of these variables contains a newline or
-# an unmatched quote.
-#
-
-eval "set -- $(
- printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
- xargs -n1 |
- sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
- tr '\n' ' '
- )" '"$@"'
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"
diff --git a/libs/AureliumSkills-Beta1.3.6.jar b/libs/AureliumSkills-Beta1.3.6.jar
deleted file mode 100644
index ed284b9..0000000
Binary files a/libs/AureliumSkills-Beta1.3.6.jar and /dev/null differ
diff --git a/libs/BetonQuest1.12.9.jar b/libs/BetonQuest1.12.9.jar
deleted file mode 100644
index 6a0f73f..0000000
Binary files a/libs/BetonQuest1.12.9.jar and /dev/null differ
diff --git a/libs/BetonQuest2.0.0-dev-668.jar b/libs/BetonQuest2.0.0-dev-668.jar
deleted file mode 100644
index c8de2b8..0000000
Binary files a/libs/BetonQuest2.0.0-dev-668.jar and /dev/null differ
diff --git a/libs/BiomeAPI.jar b/libs/BiomeAPI.jar
deleted file mode 100644
index 00c0671..0000000
Binary files a/libs/BiomeAPI.jar and /dev/null differ
diff --git a/libs/ClueScrolls-api.jar b/libs/ClueScrolls-api.jar
deleted file mode 100644
index 38234c6..0000000
Binary files a/libs/ClueScrolls-api.jar and /dev/null differ
diff --git a/libs/EcoSkills v3.0.0-api.jar b/libs/EcoSkills v3.0.0-api.jar
deleted file mode 100644
index 0f648d8..0000000
Binary files a/libs/EcoSkills v3.0.0-api.jar and /dev/null differ
diff --git a/libs/Jobs5.1.2.2.jar b/libs/Jobs5.1.2.2.jar
deleted file mode 100644
index 3943f94..0000000
Binary files a/libs/Jobs5.1.2.2.jar and /dev/null differ
diff --git a/libs/MMOCore-1.11-api.jar b/libs/MMOCore-1.11-api.jar
deleted file mode 100644
index f7a424b..0000000
Binary files a/libs/MMOCore-1.11-api.jar and /dev/null differ
diff --git a/libs/MythicLib-1.5.2.jar b/libs/MythicLib-1.5.2.jar
deleted file mode 100644
index 9873944..0000000
Binary files a/libs/MythicLib-1.5.2.jar and /dev/null differ
diff --git a/libs/NeigeItems-1.14.15-api.jar b/libs/NeigeItems-1.14.15-api.jar
deleted file mode 100644
index 9539468..0000000
Binary files a/libs/NeigeItems-1.14.15-api.jar and /dev/null differ
diff --git a/libs/ProtectionLib.jar b/libs/ProtectionLib.jar
deleted file mode 100644
index a326400..0000000
Binary files a/libs/ProtectionLib.jar and /dev/null differ
diff --git a/libs/ProtocolLib.jar b/libs/ProtocolLib.jar
deleted file mode 100644
index 14cef05..0000000
Binary files a/libs/ProtocolLib.jar and /dev/null differ
diff --git a/libs/RealisticSeasons-api.jar b/libs/RealisticSeasons-api.jar
deleted file mode 100644
index 6777a7d..0000000
Binary files a/libs/RealisticSeasons-api.jar and /dev/null differ
diff --git a/libs/Vault.jar b/libs/Vault.jar
deleted file mode 100644
index 4bcaa89..0000000
Binary files a/libs/Vault.jar and /dev/null differ
diff --git a/libs/battle-pass-api.jar b/libs/battle-pass-api.jar
deleted file mode 100644
index 608df8c..0000000
Binary files a/libs/battle-pass-api.jar and /dev/null differ
diff --git a/libs/mcMMO-api.jar b/libs/mcMMO-api.jar
deleted file mode 100644
index a2ac22e..0000000
Binary files a/libs/mcMMO-api.jar and /dev/null differ
diff --git a/plugin/.gitignore b/plugin/.gitignore
new file mode 100644
index 0000000..b63da45
--- /dev/null
+++ b/plugin/.gitignore
@@ -0,0 +1,42 @@
+.gradle
+build/
+!gradle/wrapper/gradle-wrapper.jar
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+out/
+!**/src/main/**/out/
+!**/src/test/**/out/
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+bin/
+!**/src/main/**/bin/
+!**/src/test/**/bin/
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store
\ No newline at end of file
diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts
new file mode 100644
index 0000000..e11d7eb
--- /dev/null
+++ b/plugin/build.gradle.kts
@@ -0,0 +1,44 @@
+dependencies {
+ compileOnly(fileTree("libs"))
+ compileOnly("me.clip:placeholderapi:2.11.3")
+ compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
+ compileOnly("dev.dejvokep:boosted-yaml:1.3.1")
+ compileOnly("commons-io:commons-io:2.11.0")
+ compileOnly("com.google.code.gson:gson:2.10.1")
+ compileOnly("com.github.LoneDev6:api-itemsadder:3.4.1e")
+ compileOnly("com.github.oraxen:oraxen:1.157.2")
+ compileOnly("io.lumine:Mythic-Dist:5.2.1")
+ compileOnly("io.lumine:MythicLib-dist:1.5.2-SNAPSHOT")
+ compileOnly("com.willfp:eco:6.65.1")
+ compileOnly("com.willfp:EcoJobs:3.13.0")
+ compileOnly("net.objecthunter:exp4j:0.4.8")
+ compileOnly("com.infernalsuite.aswm:api:1.19.4-R0.1-SNAPSHOT")
+ compileOnly("net.Indyuce:MMOItems-API:6.9.2-SNAPSHOT")
+ compileOnly("pers.neige.neigeitems:NeigeItems:1.14.23")
+ compileOnly("com.github.Archy-X:AureliumSkills:Beta1.3.21")
+ compileOnly("com.willfp:EcoSkills:3.8.1")
+ compileOnly("com.github.Zrips:Jobs:4.17.2")
+ compileOnly("com.github.MilkBowl:VaultAPI:1.7")
+ compileOnly("com.comphenix.protocol:ProtocolLib:5.0.0")
+ compileOnly("pl.betoncraft:betonquest:1.12.10")
+
+ implementation(project(":api"))
+ implementation("net.kyori:adventure-api:4.14.0")
+ implementation("net.kyori:adventure-platform-bukkit:4.3.0")
+ implementation("net.kyori:adventure-text-minimessage:4.14.0")
+ implementation("net.kyori:adventure-text-serializer-legacy:4.14.0")
+ implementation("de.tr7zw:item-nbt-api:2.11.3")
+ implementation("org.bstats:bstats-bukkit:3.0.1")
+ implementation(files("libs/BiomeAPI.jar", "libs/ProtectionLib.jar"))
+}
+
+tasks {
+ shadowJar {
+ relocate ("de.tr7zw.changeme", "net.momirealms.customcrops.libraries")
+ relocate ("de.tr7zw.annotations", "net.momirealms.customcrops.libraries.annotations")
+ relocate ("net.kyori", "net.momirealms.customcrops.libraries")
+ relocate ("org.bstats", "net.momirealms.customcrops.libraries.bstats")
+ relocate ("net.momirealms.biomeapi", "net.momirealms.customcrops.libraries.biomeapi")
+ relocate ("net.momirealms.protectionlib", "net.momirealms.customcrops.libraries.protectionlib")
+ }
+}
diff --git a/src/main/java/net/momirealms/customcrops/CustomCrops.java b/plugin/src/main/java/net/momirealms/customcrops/CustomCrops.java
similarity index 93%
rename from src/main/java/net/momirealms/customcrops/CustomCrops.java
rename to plugin/src/main/java/net/momirealms/customcrops/CustomCrops.java
index d3ac22a..240b05e 100644
--- a/src/main/java/net/momirealms/customcrops/CustomCrops.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/CustomCrops.java
@@ -20,12 +20,8 @@ package net.momirealms.customcrops;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.ProtocolManager;
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
-import net.momirealms.customcrops.api.CustomCropsAPI;
-import net.momirealms.customcrops.api.customplugin.Platform;
-import net.momirealms.customcrops.api.customplugin.PlatformInterface;
-import net.momirealms.customcrops.api.customplugin.PlatformManager;
-import net.momirealms.customcrops.api.customplugin.itemsadder.ItemsAdderPluginImpl;
-import net.momirealms.customcrops.api.customplugin.oraxen.OraxenPluginImpl;
+import net.momirealms.customcrops.api.CustomCropsAPIImpl;
+import net.momirealms.customcrops.api.CustomCropsPlugin;
import net.momirealms.customcrops.api.object.basic.ConfigManager;
import net.momirealms.customcrops.api.object.basic.MessageManager;
import net.momirealms.customcrops.api.object.crop.CropManager;
@@ -37,22 +33,26 @@ import net.momirealms.customcrops.api.object.season.SeasonManager;
import net.momirealms.customcrops.api.object.sprinkler.SprinklerManager;
import net.momirealms.customcrops.api.object.wateringcan.WateringCanManager;
import net.momirealms.customcrops.api.object.world.WorldDataManager;
-import net.momirealms.customcrops.api.util.AdventureUtils;
import net.momirealms.customcrops.command.CustomCropsCommand;
+import net.momirealms.customcrops.customplugin.Platform;
+import net.momirealms.customcrops.customplugin.PlatformInterface;
+import net.momirealms.customcrops.customplugin.PlatformManager;
+import net.momirealms.customcrops.customplugin.itemsadder.ItemsAdderPluginImpl;
+import net.momirealms.customcrops.customplugin.oraxen.OraxenPluginImpl;
import net.momirealms.customcrops.helper.LibraryLoader;
import net.momirealms.customcrops.helper.VersionHelper;
import net.momirealms.customcrops.integration.IntegrationManager;
+import net.momirealms.customcrops.util.AdventureUtils;
import net.momirealms.protectionlib.ProtectionLib;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.PluginManager;
-import org.bukkit.plugin.java.JavaPlugin;
import java.util.TimeZone;
-public final class CustomCrops extends JavaPlugin {
+public final class CustomCrops extends CustomCropsPlugin {
private static BukkitAudiences adventure;
private static CustomCrops plugin;
@@ -72,7 +72,6 @@ public final class CustomCrops extends JavaPlugin {
private PlatformManager platformManager;
private HologramManager hologramManager;
private VersionHelper versionHelper;
- private CustomCropsAPI customCropsAPI;
private Scheduler scheduler;
@Override
@@ -115,7 +114,7 @@ public final class CustomCrops extends JavaPlugin {
this.potManager = new PotManager(this);
this.hologramManager = new HologramManager(this);
this.platformManager = new PlatformManager(this);
- this.customCropsAPI = new CustomCropsAPI(this);
+ super.customCropsAPI = new CustomCropsAPIImpl(this);
this.reload();
@@ -209,8 +208,7 @@ public final class CustomCrops extends JavaPlugin {
AdventureUtils.consoleMessage("==============================================================");
Bukkit.getPluginManager().disablePlugin(this);
return false;
- }
- else {
+ } else {
AdventureUtils.consoleMessage("[CustomCrops] Platform: " + platform.name());
return true;
}
@@ -288,10 +286,6 @@ public final class CustomCrops extends JavaPlugin {
return hologramManager;
}
- public CustomCropsAPI getAPI() {
- return customCropsAPI;
- }
-
public Scheduler getScheduler() {
return scheduler;
}
diff --git a/src/main/java/net/momirealms/customcrops/api/CustomCropsAPI.java b/plugin/src/main/java/net/momirealms/customcrops/api/CustomCropsAPIImpl.java
similarity index 81%
rename from src/main/java/net/momirealms/customcrops/api/CustomCropsAPI.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/CustomCropsAPIImpl.java
index 3e6d586..41ca4ee 100644
--- a/src/main/java/net/momirealms/customcrops/api/CustomCropsAPI.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/CustomCropsAPIImpl.java
@@ -18,38 +18,41 @@
package net.momirealms.customcrops.api;
import net.momirealms.customcrops.CustomCrops;
-import net.momirealms.customcrops.api.object.crop.GrowingCrop;
-import net.momirealms.customcrops.api.object.pot.Pot;
+import net.momirealms.customcrops.api.object.CCGrowingCrop;
+import net.momirealms.customcrops.api.object.CCPot;
+import net.momirealms.customcrops.api.object.CCSprinkler;
+import net.momirealms.customcrops.api.object.CCWorldSeason;
import net.momirealms.customcrops.api.object.season.CCSeason;
import net.momirealms.customcrops.api.object.season.SeasonData;
-import net.momirealms.customcrops.api.object.sprinkler.Sprinkler;
import net.momirealms.customcrops.api.object.world.CCWorld;
import net.momirealms.customcrops.api.object.world.SimpleLocation;
import org.bukkit.Location;
import org.bukkit.World;
import org.jetbrains.annotations.Nullable;
-public class CustomCropsAPI {
+import java.util.Locale;
- private static CustomCropsAPI instance;
+public class CustomCropsAPIImpl implements CustomCropsAPI {
+
+ private static CustomCropsAPIImpl instance;
private final CustomCrops plugin;
- public CustomCropsAPI(CustomCrops plugin) {
+ public CustomCropsAPIImpl(CustomCrops plugin) {
this.plugin = plugin;
instance = this;
}
- public static CustomCropsAPI getInstance() {
+ public static CustomCropsAPIImpl getInstance() {
return instance;
}
@Nullable
- public Pot getPotAt(Location location) {
+ public CCPot getPotAt(Location location) {
return plugin.getWorldDataManager().getPotData(SimpleLocation.getByBukkitLocation(location));
}
@Nullable
- public GrowingCrop getCropAt(Location location) {
+ public CCGrowingCrop getCropAt(Location location) {
return plugin.getWorldDataManager().getCropData(SimpleLocation.getByBukkitLocation(location));
}
@@ -61,14 +64,14 @@ public class CustomCropsAPI {
return plugin.getWorldDataManager().hasScarecrow(SimpleLocation.getByBukkitLocation(location));
}
- public Sprinkler getSprinklerAt(Location location) {
+ public CCSprinkler getSprinklerAt(Location location) {
return plugin.getWorldDataManager().getSprinklerData(SimpleLocation.getByBukkitLocation(location));
}
- public void setSeason(String world, CCSeason season) {
+ public void setSeason(String world, String season) {
SeasonData seasonData = plugin.getSeasonManager().getSeasonData(world);
if (seasonData != null) {
- seasonData.changeSeason(season);
+ seasonData.changeSeason(CCSeason.valueOf(season.toUpperCase(Locale.ENGLISH)));
}
}
@@ -87,7 +90,7 @@ public class CustomCropsAPI {
}
@Nullable
- public CCSeason getSeason(String world) {
+ public CCWorldSeason getSeason(String world) {
SeasonData seasonData = plugin.getSeasonManager().getSeasonData(world);
if (seasonData != null) {
return seasonData.getSeason();
diff --git a/src/main/java/net/momirealms/customcrops/api/object/BoneMeal.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/BoneMeal.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/BoneMeal.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/BoneMeal.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/CrowTask.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/CrowTask.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/api/object/CrowTask.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/CrowTask.java
index 9d593b4..f898329 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/CrowTask.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/CrowTask.java
@@ -18,7 +18,7 @@
package net.momirealms.customcrops.api.object;
import net.momirealms.customcrops.CustomCrops;
-import net.momirealms.customcrops.api.util.FakeEntityUtils;
+import net.momirealms.customcrops.util.FakeEntityUtils;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/Function.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/Function.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/Function.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/Function.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/InteractCrop.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/InteractCrop.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/InteractCrop.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/InteractCrop.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/ItemMode.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/ItemMode.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/ItemMode.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/ItemMode.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/ItemType.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/ItemType.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/ItemType.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/ItemType.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/OfflineReplaceTask.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/OfflineReplaceTask.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/OfflineReplaceTask.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/OfflineReplaceTask.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/Pair.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/Pair.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/Pair.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/Pair.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/Tuple.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/Tuple.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/Tuple.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/Tuple.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/Action.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/Action.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/action/Action.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/Action.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/BreakImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/BreakImpl.java
similarity index 93%
rename from src/main/java/net/momirealms/customcrops/api/object/action/BreakImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/BreakImpl.java
index 7f34a28..49099a5 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/action/BreakImpl.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/BreakImpl.java
@@ -35,21 +35,21 @@ import java.util.concurrent.CompletableFuture;
public class BreakImpl implements Action {
private final boolean triggerAction;
- private final String stage_id;
+ private final String stageID;
- public BreakImpl(boolean triggerAction, @Nullable String stage_id) {
+ public BreakImpl(boolean triggerAction, @Nullable String stageID) {
this.triggerAction = triggerAction;
- this.stage_id = stage_id;
+ this.stageID = stageID;
}
@Override
public void doOn(@Nullable Player player, @Nullable SimpleLocation cropLoc, ItemMode itemMode) {
- if (cropLoc == null || stage_id == null) return;
- CropConfig cropConfig = CustomCrops.getInstance().getCropManager().getCropConfigByStage(stage_id);
+ if (cropLoc == null || stageID == null) return;
+ CropConfig cropConfig = CustomCrops.getInstance().getCropManager().getCropConfigByStage(stageID);
Location bLoc = cropLoc.getBukkitLocation();
- if (bLoc == null) return;
+ if (bLoc == null || cropConfig == null) return;
if (player != null) {
- CropBreakEvent cropBreakEvent = new CropBreakEvent(player, cropConfig, stage_id, bLoc);
+ CropBreakEvent cropBreakEvent = new CropBreakEvent(player, cropConfig.getKey(), stageID, bLoc);
Bukkit.getPluginManager().callEvent(cropBreakEvent);
if (cropBreakEvent.isCancelled()) {
return;
@@ -85,7 +85,7 @@ public class BreakImpl implements Action {
private void doTriggerActions(@Nullable Player player, @NotNull SimpleLocation crop_loc, ItemMode itemMode) {
if (triggerAction) {
- StageConfig stageConfig = CustomCrops.getInstance().getCropManager().getStageConfig(stage_id);
+ StageConfig stageConfig = CustomCrops.getInstance().getCropManager().getStageConfig(stageID);
if (stageConfig != null) {
Action[] actions = stageConfig.getBreakActions();
if (actions != null) {
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/ChainImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/ChainImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/action/ChainImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/ChainImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/CommandActionImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/CommandActionImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/action/CommandActionImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/CommandActionImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/DropItemImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/DropItemImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/action/DropItemImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/DropItemImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/GiveMoneyImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/GiveMoneyImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/action/GiveMoneyImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/GiveMoneyImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/JobXPImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/JobXPImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/action/JobXPImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/JobXPImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/MessageActionImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/MessageActionImpl.java
similarity index 96%
rename from src/main/java/net/momirealms/customcrops/api/object/action/MessageActionImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/MessageActionImpl.java
index b5e06e6..75c4a56 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/action/MessageActionImpl.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/MessageActionImpl.java
@@ -19,7 +19,7 @@ package net.momirealms.customcrops.api.object.action;
import net.momirealms.customcrops.api.object.ItemMode;
import net.momirealms.customcrops.api.object.world.SimpleLocation;
-import net.momirealms.customcrops.api.util.AdventureUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Nullable;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/ParticleImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/ParticleImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/action/ParticleImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/ParticleImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/PotionEffectImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/PotionEffectImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/action/PotionEffectImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/PotionEffectImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/ReplantImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/ReplantImpl.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/api/object/action/ReplantImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/ReplantImpl.java
index 3f076f4..1177c9b 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/action/ReplantImpl.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/ReplantImpl.java
@@ -25,7 +25,7 @@ import net.momirealms.customcrops.api.object.basic.MessageManager;
import net.momirealms.customcrops.api.object.crop.CropConfig;
import net.momirealms.customcrops.api.object.crop.GrowingCrop;
import net.momirealms.customcrops.api.object.world.SimpleLocation;
-import net.momirealms.customcrops.api.util.AdventureUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Location;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/SkillXPImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/SkillXPImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/action/SkillXPImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/SkillXPImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/SoundActionImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/SoundActionImpl.java
similarity index 96%
rename from src/main/java/net/momirealms/customcrops/api/object/action/SoundActionImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/SoundActionImpl.java
index e44b76e..49fafd6 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/action/SoundActionImpl.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/SoundActionImpl.java
@@ -21,7 +21,7 @@ import net.kyori.adventure.key.Key;
import net.kyori.adventure.sound.Sound;
import net.momirealms.customcrops.api.object.ItemMode;
import net.momirealms.customcrops.api.object.world.SimpleLocation;
-import net.momirealms.customcrops.api.util.AdventureUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Nullable;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/SwingHandImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/SwingHandImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/action/SwingHandImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/SwingHandImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/VanillaXPImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/VanillaXPImpl.java
similarity index 96%
rename from src/main/java/net/momirealms/customcrops/api/object/action/VanillaXPImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/VanillaXPImpl.java
index da008f7..0200651 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/action/VanillaXPImpl.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/VanillaXPImpl.java
@@ -21,7 +21,7 @@ import net.kyori.adventure.key.Key;
import net.kyori.adventure.sound.Sound;
import net.momirealms.customcrops.api.object.ItemMode;
import net.momirealms.customcrops.api.object.world.SimpleLocation;
-import net.momirealms.customcrops.api.util.AdventureUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Nullable;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/action/VariationImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/VariationImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/action/VariationImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/action/VariationImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/basic/ConfigManager.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/basic/ConfigManager.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/api/object/basic/ConfigManager.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/basic/ConfigManager.java
index fb8bead..2a3ab5e 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/basic/ConfigManager.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/basic/ConfigManager.java
@@ -19,8 +19,8 @@ package net.momirealms.customcrops.api.object.basic;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.Function;
-import net.momirealms.customcrops.api.util.AdventureUtils;
-import net.momirealms.customcrops.api.util.ConfigUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
+import net.momirealms.customcrops.util.ConfigUtils;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/basic/MessageManager.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/basic/MessageManager.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/api/object/basic/MessageManager.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/basic/MessageManager.java
index 171cca0..ea36924 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/basic/MessageManager.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/basic/MessageManager.java
@@ -19,7 +19,7 @@ package net.momirealms.customcrops.api.object.basic;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.Function;
-import net.momirealms.customcrops.api.util.ConfigUtils;
+import net.momirealms.customcrops.util.ConfigUtils;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/condition/AndCondition.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/condition/AndCondition.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/condition/AndCondition.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/condition/AndCondition.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/condition/Condition.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/condition/Condition.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/condition/Condition.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/condition/Condition.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/condition/CrowAttack.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/condition/CrowAttack.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/condition/CrowAttack.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/condition/CrowAttack.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/condition/DeathCondition.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/condition/DeathCondition.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/condition/DeathCondition.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/condition/DeathCondition.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/condition/OrCondition.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/condition/OrCondition.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/condition/OrCondition.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/condition/OrCondition.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/condition/Random.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/condition/Random.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/condition/Random.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/condition/Random.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/condition/RightSeason.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/condition/RightSeason.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/condition/RightSeason.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/condition/RightSeason.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/condition/WaterLessThan.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/condition/WaterLessThan.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/condition/WaterLessThan.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/condition/WaterLessThan.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/condition/WaterMoreThan.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/condition/WaterMoreThan.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/condition/WaterMoreThan.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/condition/WaterMoreThan.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/condition/Weather.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/condition/Weather.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/condition/Weather.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/condition/Weather.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/condition/WrongSeason.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/condition/WrongSeason.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/condition/WrongSeason.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/condition/WrongSeason.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/crop/CropConfig.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/crop/CropConfig.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/crop/CropConfig.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/crop/CropConfig.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/crop/CropManager.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/crop/CropManager.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/api/object/crop/CropManager.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/crop/CropManager.java
index a84a39a..d5a1e2b 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/crop/CropManager.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/crop/CropManager.java
@@ -18,15 +18,15 @@
package net.momirealms.customcrops.api.object.crop;
import net.momirealms.customcrops.CustomCrops;
-import net.momirealms.customcrops.api.customplugin.Platform;
import net.momirealms.customcrops.api.object.Function;
import net.momirealms.customcrops.api.object.InteractCrop;
import net.momirealms.customcrops.api.object.ItemMode;
import net.momirealms.customcrops.api.object.condition.Condition;
import net.momirealms.customcrops.api.object.condition.DeathCondition;
import net.momirealms.customcrops.api.object.requirement.Requirement;
-import net.momirealms.customcrops.api.util.AdventureUtils;
-import net.momirealms.customcrops.api.util.ConfigUtils;
+import net.momirealms.customcrops.customplugin.Platform;
+import net.momirealms.customcrops.util.AdventureUtils;
+import net.momirealms.customcrops.util.ConfigUtils;
import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/crop/GrowingCrop.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/crop/GrowingCrop.java
similarity index 89%
rename from src/main/java/net/momirealms/customcrops/api/object/crop/GrowingCrop.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/crop/GrowingCrop.java
index 03de0f0..0e00018 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/crop/GrowingCrop.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/crop/GrowingCrop.java
@@ -18,11 +18,12 @@
package net.momirealms.customcrops.api.object.crop;
import net.momirealms.customcrops.CustomCrops;
+import net.momirealms.customcrops.api.object.CCGrowingCrop;
import java.io.Serial;
import java.io.Serializable;
-public class GrowingCrop implements Serializable {
+public class GrowingCrop implements Serializable, CCGrowingCrop {
@Serial
private static final long serialVersionUID = 2828962866548871991L;
@@ -43,7 +44,7 @@ public class GrowingCrop implements Serializable {
this.points = points;
}
- public String getCropKey() {
+ public String getKey() {
return crop;
}
diff --git a/src/main/java/net/momirealms/customcrops/api/object/crop/StageConfig.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/crop/StageConfig.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/crop/StageConfig.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/crop/StageConfig.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/crop/VariationCrop.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/crop/VariationCrop.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/crop/VariationCrop.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/crop/VariationCrop.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/fertilizer/Fertilizer.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/Fertilizer.java
similarity index 92%
rename from src/main/java/net/momirealms/customcrops/api/object/fertilizer/Fertilizer.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/Fertilizer.java
index e1a22e7..9a9293b 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/fertilizer/Fertilizer.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/Fertilizer.java
@@ -18,10 +18,11 @@
package net.momirealms.customcrops.api.object.fertilizer;
import net.momirealms.customcrops.CustomCrops;
+import net.momirealms.customcrops.api.object.CCFertilizer;
import java.io.Serializable;
-public class Fertilizer implements Serializable {
+public class Fertilizer implements Serializable, CCFertilizer {
private final String key;
private int times;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/fertilizer/FertilizerConfig.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/FertilizerConfig.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/fertilizer/FertilizerConfig.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/FertilizerConfig.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/fertilizer/FertilizerManager.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/FertilizerManager.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/api/object/fertilizer/FertilizerManager.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/FertilizerManager.java
index c196319..b3da0cc 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/fertilizer/FertilizerManager.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/FertilizerManager.java
@@ -23,8 +23,8 @@ import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.Function;
import net.momirealms.customcrops.api.object.Pair;
import net.momirealms.customcrops.api.object.requirement.Requirement;
-import net.momirealms.customcrops.api.util.AdventureUtils;
-import net.momirealms.customcrops.api.util.ConfigUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
+import net.momirealms.customcrops.util.ConfigUtils;
import org.bukkit.Particle;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/fertilizer/FertilizerType.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/FertilizerType.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/fertilizer/FertilizerType.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/FertilizerType.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/fertilizer/Quality.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/Quality.java
similarity index 97%
rename from src/main/java/net/momirealms/customcrops/api/object/fertilizer/Quality.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/Quality.java
index 610082e..3ab9740 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/fertilizer/Quality.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/Quality.java
@@ -20,7 +20,7 @@ package net.momirealms.customcrops.api.object.fertilizer;
import net.kyori.adventure.sound.Sound;
import net.momirealms.customcrops.api.object.basic.ConfigManager;
import net.momirealms.customcrops.api.object.requirement.Requirement;
-import net.momirealms.customcrops.api.util.AdventureUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.Particle;
import org.jetbrains.annotations.Nullable;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/fertilizer/SoilRetain.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/SoilRetain.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/fertilizer/SoilRetain.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/SoilRetain.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/fertilizer/SpeedGrow.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/SpeedGrow.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/fertilizer/SpeedGrow.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/SpeedGrow.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/fertilizer/Variation.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/Variation.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/fertilizer/Variation.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/Variation.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/fertilizer/YieldIncrease.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/YieldIncrease.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/fertilizer/YieldIncrease.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/fertilizer/YieldIncrease.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/fill/AbstractFillMethod.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/fill/AbstractFillMethod.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/fill/AbstractFillMethod.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/fill/AbstractFillMethod.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/fill/PassiveFillMethod.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/fill/PassiveFillMethod.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/fill/PassiveFillMethod.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/fill/PassiveFillMethod.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/fill/PositiveFillMethod.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/fill/PositiveFillMethod.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/fill/PositiveFillMethod.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/fill/PositiveFillMethod.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/hologram/AbstractHologram.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/hologram/AbstractHologram.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/hologram/AbstractHologram.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/hologram/AbstractHologram.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/hologram/FertilizerHologram.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/hologram/FertilizerHologram.java
similarity index 89%
rename from src/main/java/net/momirealms/customcrops/api/object/hologram/FertilizerHologram.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/hologram/FertilizerHologram.java
index ad00245..7a884ea 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/hologram/FertilizerHologram.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/hologram/FertilizerHologram.java
@@ -18,6 +18,7 @@
package net.momirealms.customcrops.api.object.hologram;
+import net.momirealms.customcrops.api.object.CCFertilizer;
import net.momirealms.customcrops.api.object.fertilizer.Fertilizer;
import net.momirealms.customcrops.api.object.fertilizer.FertilizerConfig;
import org.jetbrains.annotations.NotNull;
@@ -28,7 +29,8 @@ public class FertilizerHologram extends AbstractHologram {
super(content, offset, mode, duration, textDisplayMeta);
}
- public String getContent(Fertilizer fertilizer) {
+ public String getContent(CCFertilizer CCFertilizer) {
+ Fertilizer fertilizer = (Fertilizer) CCFertilizer;
FertilizerConfig fertilizerConfig = fertilizer.getConfig();
return content.replace("{icon}", String.valueOf(fertilizerConfig.getIcon()))
.replace("{left_times}", String.valueOf(fertilizer.getLeftTimes()))
diff --git a/src/main/java/net/momirealms/customcrops/api/object/hologram/HologramManager.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/hologram/HologramManager.java
similarity index 99%
rename from src/main/java/net/momirealms/customcrops/api/object/hologram/HologramManager.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/hologram/HologramManager.java
index a54cab3..4f18263 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/hologram/HologramManager.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/hologram/HologramManager.java
@@ -21,7 +21,7 @@ import net.kyori.adventure.text.Component;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.Function;
import net.momirealms.customcrops.api.object.Tuple;
-import net.momirealms.customcrops.api.util.FakeEntityUtils;
+import net.momirealms.customcrops.util.FakeEntityUtils;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/hologram/TextDisplayMeta.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/hologram/TextDisplayMeta.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/hologram/TextDisplayMeta.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/hologram/TextDisplayMeta.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/hologram/WaterAmountHologram.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/hologram/WaterAmountHologram.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/hologram/WaterAmountHologram.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/hologram/WaterAmountHologram.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/loot/Loot.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/loot/Loot.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/loot/Loot.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/loot/Loot.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/loot/OtherLoot.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/loot/OtherLoot.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/loot/OtherLoot.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/loot/OtherLoot.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/loot/QualityLoot.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/loot/QualityLoot.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/api/object/loot/QualityLoot.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/loot/QualityLoot.java
index 352fca1..e3807e4 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/loot/QualityLoot.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/loot/QualityLoot.java
@@ -24,7 +24,6 @@ import net.momirealms.customcrops.api.object.fertilizer.Quality;
import net.momirealms.customcrops.api.object.fertilizer.YieldIncrease;
import net.momirealms.customcrops.api.object.pot.Pot;
import net.momirealms.customcrops.api.object.world.SimpleLocation;
-import net.momirealms.customcrops.api.util.AdventureUtils;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/migrate/MigrateWorld.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/migrate/MigrateWorld.java
similarity index 99%
rename from src/main/java/net/momirealms/customcrops/api/object/migrate/MigrateWorld.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/migrate/MigrateWorld.java
index a845870..ea1e35b 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/migrate/MigrateWorld.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/migrate/MigrateWorld.java
@@ -25,7 +25,7 @@ import net.momirealms.customcrops.api.object.sprinkler.Sprinkler;
import net.momirealms.customcrops.api.object.world.CCChunk;
import net.momirealms.customcrops.api.object.world.ChunkCoordinate;
import net.momirealms.customcrops.api.object.world.SimpleLocation;
-import net.momirealms.customcrops.api.util.ConfigUtils;
+import net.momirealms.customcrops.util.ConfigUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/pot/Pot.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/pot/Pot.java
similarity index 89%
rename from src/main/java/net/momirealms/customcrops/api/object/pot/Pot.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/pot/Pot.java
index 5935e4c..7753e87 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/pot/Pot.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/pot/Pot.java
@@ -18,13 +18,15 @@
package net.momirealms.customcrops.api.object.pot;
import net.momirealms.customcrops.CustomCrops;
+import net.momirealms.customcrops.api.object.CCFertilizer;
+import net.momirealms.customcrops.api.object.CCPot;
import net.momirealms.customcrops.api.object.fertilizer.Fertilizer;
import org.jetbrains.annotations.NotNull;
import java.io.Serial;
import java.io.Serializable;
-public class Pot implements Serializable {
+public class Pot implements Serializable, CCPot {
@Serial
private static final long serialVersionUID = -6598493908660891824L;
@@ -43,6 +45,11 @@ public class Pot implements Serializable {
return fertilizer;
}
+ @Override
+ public void setFertilizer(CCFertilizer fertilizer) {
+ setFertilizer((Fertilizer) fertilizer);
+ }
+
public void setFertilizer(Fertilizer fertilizer) {
this.fertilizer = fertilizer;
}
@@ -94,7 +101,7 @@ public class Pot implements Serializable {
}
@NotNull
- public String getPotKey() {
+ public String getKey() {
return key;
}
diff --git a/src/main/java/net/momirealms/customcrops/api/object/pot/PotConfig.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/pot/PotConfig.java
similarity index 91%
rename from src/main/java/net/momirealms/customcrops/api/object/pot/PotConfig.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/pot/PotConfig.java
index 85b05b6..3b13ba1 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/pot/PotConfig.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/pot/PotConfig.java
@@ -17,6 +17,7 @@
package net.momirealms.customcrops.api.object.pot;
+import net.momirealms.customcrops.api.object.CCFertilizer;
import net.momirealms.customcrops.api.object.Pair;
import net.momirealms.customcrops.api.object.fertilizer.Fertilizer;
import net.momirealms.customcrops.api.object.fertilizer.FertilizerConfig;
@@ -61,8 +62,8 @@ public class PotConfig {
fertilizerConvertMap.put(fertilizerType, Pair.of(dry_pot, wet_pot));
}
- public String getWetPot(@Nullable Fertilizer fertilizer) {
- if (fertilizer == null || !enableFertilized) return pot.right();
+ public String getWetPot(@Nullable CCFertilizer CCFertilizer) {
+ if (!enableFertilized || !(CCFertilizer instanceof Fertilizer fertilizer)) return pot.right();
FertilizerConfig fertilizerConfig = fertilizer.getConfig();
if (fertilizerConfig == null) return pot.right();
FertilizerType fertilizerType = fertilizerConfig.getFertilizerType();
@@ -71,8 +72,8 @@ public class PotConfig {
else return pair.right();
}
- public String getDryPot(@Nullable Fertilizer fertilizer) {
- if (fertilizer == null || !enableFertilized) return pot.left();
+ public String getDryPot(@Nullable CCFertilizer CCFertilizer) {
+ if (!enableFertilized || !(CCFertilizer instanceof Fertilizer fertilizer)) return pot.left();
FertilizerConfig fertilizerConfig = fertilizer.getConfig();
if (fertilizerConfig == null) return pot.left();
FertilizerType fertilizerType = fertilizerConfig.getFertilizerType();
diff --git a/src/main/java/net/momirealms/customcrops/api/object/pot/PotManager.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/pot/PotManager.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/api/object/pot/PotManager.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/pot/PotManager.java
index 5031a6b..ae38e61 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/pot/PotManager.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/pot/PotManager.java
@@ -25,8 +25,8 @@ import net.momirealms.customcrops.api.object.hologram.FertilizerHologram;
import net.momirealms.customcrops.api.object.hologram.HologramManager;
import net.momirealms.customcrops.api.object.hologram.TextDisplayMeta;
import net.momirealms.customcrops.api.object.hologram.WaterAmountHologram;
-import net.momirealms.customcrops.api.util.AdventureUtils;
-import net.momirealms.customcrops.api.util.ConfigUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
+import net.momirealms.customcrops.util.ConfigUtils;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import org.jetbrains.annotations.Nullable;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/AbstractRequirement.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/AbstractRequirement.java
similarity index 96%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/AbstractRequirement.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/AbstractRequirement.java
index 9aaa5f0..f297ede 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/requirement/AbstractRequirement.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/AbstractRequirement.java
@@ -19,7 +19,7 @@ package net.momirealms.customcrops.api.object.requirement;
import net.momirealms.customcrops.api.object.action.Action;
import net.momirealms.customcrops.api.object.world.SimpleLocation;
-import net.momirealms.customcrops.api.util.AdventureUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Nullable;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/BiomeImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/BiomeImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/BiomeImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/BiomeImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/CurrentState.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/CurrentState.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/CurrentState.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/CurrentState.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/CustomPapi.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/CustomPapi.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/CustomPapi.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/CustomPapi.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/DateImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/DateImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/DateImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/DateImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/EntityAmountInChunkImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/EntityAmountInChunkImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/EntityAmountInChunkImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/EntityAmountInChunkImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/JobLevelImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/JobLevelImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/JobLevelImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/JobLevelImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/PermissionImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/PermissionImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/PermissionImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/PermissionImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/Requirement.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/Requirement.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/Requirement.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/Requirement.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/SeasonImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/SeasonImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/SeasonImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/SeasonImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/SkillLevelImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/SkillLevelImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/SkillLevelImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/SkillLevelImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/TimeImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/TimeImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/TimeImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/TimeImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/WeatherImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/WeatherImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/WeatherImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/WeatherImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/WorldImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/WorldImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/WorldImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/WorldImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/YPosImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/YPosImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/YPosImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/YPosImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/ExpressionAnd.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/ExpressionAnd.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/papi/ExpressionAnd.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/ExpressionAnd.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/ExpressionOr.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/ExpressionOr.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/papi/ExpressionOr.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/ExpressionOr.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiEquals.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiEquals.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiEquals.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiEquals.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiGreater.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiGreater.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiGreater.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiGreater.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiNoLarger.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiNoLarger.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiNoLarger.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiNoLarger.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiNoLess.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiNoLess.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiNoLess.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiNoLess.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiNotEquals.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiNotEquals.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiNotEquals.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiNotEquals.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiRequirement.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiRequirement.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiRequirement.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiRequirement.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiSmaller.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiSmaller.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiSmaller.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/papi/PapiSmaller.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/scheduler/BukkitSchedulerImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/scheduler/BukkitSchedulerImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/scheduler/BukkitSchedulerImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/scheduler/BukkitSchedulerImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/scheduler/FoliaSchedulerImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/scheduler/FoliaSchedulerImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/scheduler/FoliaSchedulerImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/scheduler/FoliaSchedulerImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/scheduler/Scheduler.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/scheduler/Scheduler.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/scheduler/Scheduler.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/scheduler/Scheduler.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/scheduler/SchedulerPlatform.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/scheduler/SchedulerPlatform.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/scheduler/SchedulerPlatform.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/scheduler/SchedulerPlatform.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/season/CCSeason.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/season/CCSeason.java
similarity index 86%
rename from src/main/java/net/momirealms/customcrops/api/object/season/CCSeason.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/season/CCSeason.java
index 91a92cd..b323561 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/season/CCSeason.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/season/CCSeason.java
@@ -17,9 +17,10 @@
package net.momirealms.customcrops.api.object.season;
+import net.momirealms.customcrops.api.object.CCWorldSeason;
import net.momirealms.customcrops.api.object.basic.MessageManager;
-public enum CCSeason {
+public enum CCSeason implements CCWorldSeason {
SPRING(MessageManager.spring),
SUMMER(MessageManager.summer),
@@ -36,4 +37,8 @@ public enum CCSeason {
public String getDisplay() {
return display;
}
+
+ public String getSeason() {
+ return this.name();
+ }
}
diff --git a/src/main/java/net/momirealms/customcrops/api/object/season/SeasonData.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/season/SeasonData.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/season/SeasonData.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/season/SeasonData.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/season/SeasonManager.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/season/SeasonManager.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/season/SeasonManager.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/season/SeasonManager.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/sprinkler/Sprinkler.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/sprinkler/Sprinkler.java
similarity index 92%
rename from src/main/java/net/momirealms/customcrops/api/object/sprinkler/Sprinkler.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/sprinkler/Sprinkler.java
index 6b30a3f..9015a79 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/sprinkler/Sprinkler.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/sprinkler/Sprinkler.java
@@ -18,12 +18,13 @@
package net.momirealms.customcrops.api.object.sprinkler;
import net.momirealms.customcrops.CustomCrops;
+import net.momirealms.customcrops.api.object.CCSprinkler;
import org.jetbrains.annotations.Nullable;
import java.io.Serial;
import java.io.Serializable;
-public class Sprinkler implements Serializable {
+public class Sprinkler implements Serializable, CCSprinkler {
@Serial
private static final long serialVersionUID = -1994328062935821245L;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/sprinkler/SprinklerAnimation.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/sprinkler/SprinklerAnimation.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/sprinkler/SprinklerAnimation.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/sprinkler/SprinklerAnimation.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/sprinkler/SprinklerConfig.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/sprinkler/SprinklerConfig.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/sprinkler/SprinklerConfig.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/sprinkler/SprinklerConfig.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/sprinkler/SprinklerManager.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/sprinkler/SprinklerManager.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/api/object/sprinkler/SprinklerManager.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/sprinkler/SprinklerManager.java
index 5a9c50d..9ec00f0 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/sprinkler/SprinklerManager.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/sprinkler/SprinklerManager.java
@@ -26,8 +26,8 @@ import net.momirealms.customcrops.api.object.fill.PassiveFillMethod;
import net.momirealms.customcrops.api.object.hologram.HologramManager;
import net.momirealms.customcrops.api.object.hologram.TextDisplayMeta;
import net.momirealms.customcrops.api.object.hologram.WaterAmountHologram;
-import net.momirealms.customcrops.api.util.AdventureUtils;
-import net.momirealms.customcrops.api.util.ConfigUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
+import net.momirealms.customcrops.util.ConfigUtils;
import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/wateringcan/WateringCanConfig.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/wateringcan/WateringCanConfig.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/wateringcan/WateringCanConfig.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/wateringcan/WateringCanConfig.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/wateringcan/WateringCanManager.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/wateringcan/WateringCanManager.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/api/object/wateringcan/WateringCanManager.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/wateringcan/WateringCanManager.java
index e5c615f..7d29270 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/wateringcan/WateringCanManager.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/wateringcan/WateringCanManager.java
@@ -24,8 +24,8 @@ import net.kyori.adventure.sound.Sound;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.Function;
import net.momirealms.customcrops.api.object.fill.PositiveFillMethod;
-import net.momirealms.customcrops.api.util.AdventureUtils;
-import net.momirealms.customcrops.api.util.ConfigUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
+import net.momirealms.customcrops.util.ConfigUtils;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.configuration.ConfigurationSection;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/world/CCChunk.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/world/CCChunk.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/api/object/world/CCChunk.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/world/CCChunk.java
index d863cd3..4a81d98 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/world/CCChunk.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/world/CCChunk.java
@@ -18,14 +18,14 @@
package net.momirealms.customcrops.api.object.world;
import net.momirealms.customcrops.CustomCrops;
-import net.momirealms.customcrops.api.customplugin.PlatformInterface;
import net.momirealms.customcrops.api.object.OfflineReplaceTask;
import net.momirealms.customcrops.api.object.basic.ConfigManager;
import net.momirealms.customcrops.api.object.crop.GrowingCrop;
import net.momirealms.customcrops.api.object.fertilizer.Fertilizer;
import net.momirealms.customcrops.api.object.pot.Pot;
import net.momirealms.customcrops.api.object.sprinkler.Sprinkler;
-import net.momirealms.customcrops.api.util.ConfigUtils;
+import net.momirealms.customcrops.customplugin.PlatformInterface;
+import net.momirealms.customcrops.util.ConfigUtils;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/world/CCWorld.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/world/CCWorld.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/api/object/world/CCWorld.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/world/CCWorld.java
index 69a91b6..399535d 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/world/CCWorld.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/world/CCWorld.java
@@ -41,11 +41,11 @@ import net.momirealms.customcrops.api.object.season.SeasonData;
import net.momirealms.customcrops.api.object.sprinkler.Sprinkler;
import net.momirealms.customcrops.api.object.sprinkler.SprinklerAnimation;
import net.momirealms.customcrops.api.object.sprinkler.SprinklerConfig;
-import net.momirealms.customcrops.api.util.AdventureUtils;
-import net.momirealms.customcrops.api.util.ConfigUtils;
-import net.momirealms.customcrops.api.util.FakeEntityUtils;
-import net.momirealms.customcrops.api.util.RotationUtils;
import net.momirealms.customcrops.helper.Log;
+import net.momirealms.customcrops.util.AdventureUtils;
+import net.momirealms.customcrops.util.ConfigUtils;
+import net.momirealms.customcrops.util.FakeEntityUtils;
+import net.momirealms.customcrops.util.RotationUtils;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.block.data.type.Farmland;
@@ -454,7 +454,7 @@ public class CCWorld extends Function {
}
if (ConfigManager.updateDuringLoading) {
- addOfflineReplaceTask(simpleLocation, new OfflineReplaceTask(pot.getPotKey(), ItemType.POT, ItemMode.NOTE_BLOCK));
+ addOfflineReplaceTask(simpleLocation, new OfflineReplaceTask(pot.getKey(), ItemType.POT, ItemMode.NOTE_BLOCK));
return;
}
@@ -483,7 +483,7 @@ public class CCWorld extends Function {
String replacer = pot.isWet() ? potConfig.getWetPot(pot.getFertilizer()) : potConfig.getDryPot(pot.getFertilizer());
String id = plugin.getPlatformInterface().getBlockID(block);
if (ConfigManager.enableCorruptionFixer && id.equals("NOTE_BLOCK")) {
- corruptedPot.put(simpleLocation, pot.getPotKey());
+ corruptedPot.put(simpleLocation, pot.getKey());
if (ConfigManager.debugCorruption) AdventureUtils.consoleMessage("[CustomCrops] Corrupted pot found at: " + simpleLocation);
return;
}
@@ -492,7 +492,7 @@ public class CCWorld extends Function {
removePotData(simpleLocation);
return;
}
- if (!potKey.equals(pot.getPotKey())) {
+ if (!potKey.equals(pot.getKey())) {
return;
}
if (ConfigUtils.isVanillaItem(replacer)) {
@@ -609,7 +609,7 @@ public class CCWorld extends Function {
} else if (ConfigManager.enableCorruptionFixer && blockID.equals("NOTE_BLOCK")) {
Pot pot = getPotData(simpleLocation);
if (pot != null) {
- potKey = pot.getPotKey();
+ potKey = pot.getKey();
if (whitelist == null) {
pot.addWater(amount);
} else {
diff --git a/src/main/java/net/momirealms/customcrops/api/object/world/ChunkCoordinate.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/world/ChunkCoordinate.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/world/ChunkCoordinate.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/world/ChunkCoordinate.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/world/SimpleLocation.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/world/SimpleLocation.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/world/SimpleLocation.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/world/SimpleLocation.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/world/SlimeWorldListener.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/world/SlimeWorldListener.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/world/SlimeWorldListener.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/world/SlimeWorldListener.java
diff --git a/src/main/java/net/momirealms/customcrops/api/object/world/WorldDataManager.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/world/WorldDataManager.java
similarity index 99%
rename from src/main/java/net/momirealms/customcrops/api/object/world/WorldDataManager.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/world/WorldDataManager.java
index 9897305..7678b51 100644
--- a/src/main/java/net/momirealms/customcrops/api/object/world/WorldDataManager.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/world/WorldDataManager.java
@@ -26,7 +26,7 @@ import net.momirealms.customcrops.api.object.fertilizer.Fertilizer;
import net.momirealms.customcrops.api.object.pot.Pot;
import net.momirealms.customcrops.api.object.sprinkler.Sprinkler;
import net.momirealms.customcrops.api.object.sprinkler.SprinklerConfig;
-import net.momirealms.customcrops.api.util.AdventureUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.World;
diff --git a/src/main/java/net/momirealms/customcrops/api/object/world/WorldListener.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/world/WorldListener.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/object/world/WorldListener.java
rename to plugin/src/main/java/net/momirealms/customcrops/api/object/world/WorldListener.java
diff --git a/src/main/java/net/momirealms/customcrops/command/AbstractMainCommand.java b/plugin/src/main/java/net/momirealms/customcrops/command/AbstractMainCommand.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/command/AbstractMainCommand.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/AbstractMainCommand.java
index 4f8c7fb..4aa8a4e 100644
--- a/src/main/java/net/momirealms/customcrops/command/AbstractMainCommand.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/command/AbstractMainCommand.java
@@ -18,7 +18,7 @@
package net.momirealms.customcrops.command;
import net.momirealms.customcrops.api.object.basic.MessageManager;
-import net.momirealms.customcrops.api.util.AdventureUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
diff --git a/src/main/java/net/momirealms/customcrops/command/AbstractSubCommand.java b/plugin/src/main/java/net/momirealms/customcrops/command/AbstractSubCommand.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/command/AbstractSubCommand.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/AbstractSubCommand.java
index eeb029f..b8760ba 100644
--- a/src/main/java/net/momirealms/customcrops/command/AbstractSubCommand.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/command/AbstractSubCommand.java
@@ -18,7 +18,7 @@
package net.momirealms.customcrops.command;
import net.momirealms.customcrops.api.object.basic.MessageManager;
-import net.momirealms.customcrops.api.util.AdventureUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
diff --git a/src/main/java/net/momirealms/customcrops/command/CustomCropsCommand.java b/plugin/src/main/java/net/momirealms/customcrops/command/CustomCropsCommand.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/command/CustomCropsCommand.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/CustomCropsCommand.java
diff --git a/src/main/java/net/momirealms/customcrops/command/subcmd/AboutCommand.java b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/AboutCommand.java
similarity index 97%
rename from src/main/java/net/momirealms/customcrops/command/subcmd/AboutCommand.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/subcmd/AboutCommand.java
index 2565dec..f57d234 100644
--- a/src/main/java/net/momirealms/customcrops/command/subcmd/AboutCommand.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/AboutCommand.java
@@ -18,8 +18,8 @@
package net.momirealms.customcrops.command.subcmd;
import net.momirealms.customcrops.CustomCrops;
-import net.momirealms.customcrops.api.util.AdventureUtils;
import net.momirealms.customcrops.command.AbstractSubCommand;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.command.CommandSender;
import java.util.List;
diff --git a/src/main/java/net/momirealms/customcrops/command/subcmd/ConvertCommand.java b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/ConvertCommand.java
similarity index 99%
rename from src/main/java/net/momirealms/customcrops/command/subcmd/ConvertCommand.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/subcmd/ConvertCommand.java
index 470105e..dcb5145 100644
--- a/src/main/java/net/momirealms/customcrops/command/subcmd/ConvertCommand.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/ConvertCommand.java
@@ -1,8 +1,8 @@
package net.momirealms.customcrops.command.subcmd;
import net.momirealms.customcrops.CustomCrops;
-import net.momirealms.customcrops.api.util.AdventureUtils;
import net.momirealms.customcrops.command.AbstractSubCommand;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
diff --git a/src/main/java/net/momirealms/customcrops/command/subcmd/FixCommand.java b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/FixCommand.java
similarity index 96%
rename from src/main/java/net/momirealms/customcrops/command/subcmd/FixCommand.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/subcmd/FixCommand.java
index 8efdcd1..939b763 100644
--- a/src/main/java/net/momirealms/customcrops/command/subcmd/FixCommand.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/FixCommand.java
@@ -19,8 +19,8 @@ package net.momirealms.customcrops.command.subcmd;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.basic.MessageManager;
-import net.momirealms.customcrops.api.util.AdventureUtils;
import net.momirealms.customcrops.command.AbstractSubCommand;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.command.CommandSender;
import java.util.List;
diff --git a/src/main/java/net/momirealms/customcrops/command/subcmd/ForceCommand.java b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/ForceCommand.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/command/subcmd/ForceCommand.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/subcmd/ForceCommand.java
diff --git a/src/main/java/net/momirealms/customcrops/command/subcmd/HelpCommand.java b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/HelpCommand.java
similarity index 97%
rename from src/main/java/net/momirealms/customcrops/command/subcmd/HelpCommand.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/subcmd/HelpCommand.java
index bde93e5..c0959b9 100644
--- a/src/main/java/net/momirealms/customcrops/command/subcmd/HelpCommand.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/HelpCommand.java
@@ -17,8 +17,8 @@
package net.momirealms.customcrops.command.subcmd;
-import net.momirealms.customcrops.api.util.AdventureUtils;
import net.momirealms.customcrops.command.AbstractSubCommand;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.command.CommandSender;
import java.util.List;
diff --git a/src/main/java/net/momirealms/customcrops/command/subcmd/MigrateCommand.java b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/MigrateCommand.java
similarity index 99%
rename from src/main/java/net/momirealms/customcrops/command/subcmd/MigrateCommand.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/subcmd/MigrateCommand.java
index 46453e3..cc10877 100644
--- a/src/main/java/net/momirealms/customcrops/command/subcmd/MigrateCommand.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/MigrateCommand.java
@@ -27,8 +27,8 @@ import net.momirealms.customcrops.api.object.migrate.MigrateWorld;
import net.momirealms.customcrops.api.object.season.CCSeason;
import net.momirealms.customcrops.api.object.season.SeasonData;
import net.momirealms.customcrops.api.object.world.SimpleLocation;
-import net.momirealms.customcrops.api.util.AdventureUtils;
import net.momirealms.customcrops.command.AbstractSubCommand;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.YamlConfiguration;
diff --git a/src/main/java/net/momirealms/customcrops/command/subcmd/PerformanceTest.java b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/PerformanceTest.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/command/subcmd/PerformanceTest.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/subcmd/PerformanceTest.java
diff --git a/src/main/java/net/momirealms/customcrops/command/subcmd/ReloadCommand.java b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/ReloadCommand.java
similarity index 96%
rename from src/main/java/net/momirealms/customcrops/command/subcmd/ReloadCommand.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/subcmd/ReloadCommand.java
index b421c91..d3f1830 100644
--- a/src/main/java/net/momirealms/customcrops/command/subcmd/ReloadCommand.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/ReloadCommand.java
@@ -19,8 +19,8 @@ package net.momirealms.customcrops.command.subcmd;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.basic.MessageManager;
-import net.momirealms.customcrops.api.util.AdventureUtils;
import net.momirealms.customcrops.command.AbstractSubCommand;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.command.CommandSender;
import java.util.List;
diff --git a/src/main/java/net/momirealms/customcrops/command/subcmd/SetDateCommand.java b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/SetDateCommand.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/command/subcmd/SetDateCommand.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/subcmd/SetDateCommand.java
index e5a3208..4e1e844 100644
--- a/src/main/java/net/momirealms/customcrops/command/subcmd/SetDateCommand.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/SetDateCommand.java
@@ -21,8 +21,8 @@ import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.basic.ConfigManager;
import net.momirealms.customcrops.api.object.basic.MessageManager;
import net.momirealms.customcrops.api.object.season.SeasonData;
-import net.momirealms.customcrops.api.util.AdventureUtils;
import net.momirealms.customcrops.command.AbstractSubCommand;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
diff --git a/src/main/java/net/momirealms/customcrops/command/subcmd/SetSeasonCommand.java b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/SetSeasonCommand.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/command/subcmd/SetSeasonCommand.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/subcmd/SetSeasonCommand.java
index 5bc67d6..2aab230 100644
--- a/src/main/java/net/momirealms/customcrops/command/subcmd/SetSeasonCommand.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/SetSeasonCommand.java
@@ -21,8 +21,8 @@ import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.basic.MessageManager;
import net.momirealms.customcrops.api.object.season.CCSeason;
import net.momirealms.customcrops.api.object.season.SeasonData;
-import net.momirealms.customcrops.api.util.AdventureUtils;
import net.momirealms.customcrops.command.AbstractSubCommand;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
diff --git a/src/main/java/net/momirealms/customcrops/command/subcmd/Test.java b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/Test.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/command/subcmd/Test.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/subcmd/Test.java
diff --git a/src/main/java/net/momirealms/customcrops/command/subcmd/force/ConsumeTaskCommand.java b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/force/ConsumeTaskCommand.java
similarity index 97%
rename from src/main/java/net/momirealms/customcrops/command/subcmd/force/ConsumeTaskCommand.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/subcmd/force/ConsumeTaskCommand.java
index 2acbf7e..c6bdb55 100644
--- a/src/main/java/net/momirealms/customcrops/command/subcmd/force/ConsumeTaskCommand.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/force/ConsumeTaskCommand.java
@@ -20,8 +20,8 @@ package net.momirealms.customcrops.command.subcmd.force;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.basic.MessageManager;
import net.momirealms.customcrops.api.object.world.CCWorld;
-import net.momirealms.customcrops.api.util.AdventureUtils;
import net.momirealms.customcrops.command.AbstractSubCommand;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
diff --git a/src/main/java/net/momirealms/customcrops/command/subcmd/force/CropGrowCommand.java b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/force/CropGrowCommand.java
similarity index 97%
rename from src/main/java/net/momirealms/customcrops/command/subcmd/force/CropGrowCommand.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/subcmd/force/CropGrowCommand.java
index dc87507..1dfa240 100644
--- a/src/main/java/net/momirealms/customcrops/command/subcmd/force/CropGrowCommand.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/force/CropGrowCommand.java
@@ -20,8 +20,8 @@ package net.momirealms.customcrops.command.subcmd.force;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.basic.MessageManager;
import net.momirealms.customcrops.api.object.world.CCWorld;
-import net.momirealms.customcrops.api.util.AdventureUtils;
import net.momirealms.customcrops.command.AbstractSubCommand;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
diff --git a/src/main/java/net/momirealms/customcrops/command/subcmd/force/SprinklerWorkCommand.java b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/force/SprinklerWorkCommand.java
similarity index 97%
rename from src/main/java/net/momirealms/customcrops/command/subcmd/force/SprinklerWorkCommand.java
rename to plugin/src/main/java/net/momirealms/customcrops/command/subcmd/force/SprinklerWorkCommand.java
index 83bcc24..7461f25 100644
--- a/src/main/java/net/momirealms/customcrops/command/subcmd/force/SprinklerWorkCommand.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/command/subcmd/force/SprinklerWorkCommand.java
@@ -20,8 +20,8 @@ package net.momirealms.customcrops.command.subcmd.force;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.basic.MessageManager;
import net.momirealms.customcrops.api.object.world.CCWorld;
-import net.momirealms.customcrops.api.util.AdventureUtils;
import net.momirealms.customcrops.command.AbstractSubCommand;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
diff --git a/src/main/java/net/momirealms/customcrops/api/customplugin/Handler.java b/plugin/src/main/java/net/momirealms/customcrops/customplugin/Handler.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/api/customplugin/Handler.java
rename to plugin/src/main/java/net/momirealms/customcrops/customplugin/Handler.java
index 63e52c4..07339a9 100644
--- a/src/main/java/net/momirealms/customcrops/api/customplugin/Handler.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/customplugin/Handler.java
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-package net.momirealms.customcrops.api.customplugin;
+package net.momirealms.customcrops.customplugin;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.Function;
diff --git a/src/main/java/net/momirealms/customcrops/api/customplugin/Platform.java b/plugin/src/main/java/net/momirealms/customcrops/customplugin/Platform.java
similarity index 93%
rename from src/main/java/net/momirealms/customcrops/api/customplugin/Platform.java
rename to plugin/src/main/java/net/momirealms/customcrops/customplugin/Platform.java
index 9a45a4c..c1fd4ba 100644
--- a/src/main/java/net/momirealms/customcrops/api/customplugin/Platform.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/customplugin/Platform.java
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-package net.momirealms.customcrops.api.customplugin;
+package net.momirealms.customcrops.customplugin;
public enum Platform {
ItemsAdder,
diff --git a/src/main/java/net/momirealms/customcrops/api/customplugin/PlatformInterface.java b/plugin/src/main/java/net/momirealms/customcrops/customplugin/PlatformInterface.java
similarity index 99%
rename from src/main/java/net/momirealms/customcrops/api/customplugin/PlatformInterface.java
rename to plugin/src/main/java/net/momirealms/customcrops/customplugin/PlatformInterface.java
index 3fc0f1f..470c26c 100644
--- a/src/main/java/net/momirealms/customcrops/api/customplugin/PlatformInterface.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/customplugin/PlatformInterface.java
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-package net.momirealms.customcrops.api.customplugin;
+package net.momirealms.customcrops.customplugin;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.ItemMode;
diff --git a/src/main/java/net/momirealms/customcrops/api/customplugin/PlatformManager.java b/plugin/src/main/java/net/momirealms/customcrops/customplugin/PlatformManager.java
similarity index 97%
rename from src/main/java/net/momirealms/customcrops/api/customplugin/PlatformManager.java
rename to plugin/src/main/java/net/momirealms/customcrops/customplugin/PlatformManager.java
index d1f0065..8a63f26 100644
--- a/src/main/java/net/momirealms/customcrops/api/customplugin/PlatformManager.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/customplugin/PlatformManager.java
@@ -15,11 +15,9 @@
* along with this program. If not, see .
*/
-package net.momirealms.customcrops.api.customplugin;
+package net.momirealms.customcrops.customplugin;
import net.momirealms.customcrops.CustomCrops;
-import net.momirealms.customcrops.api.customplugin.itemsadder.ItemsAdderHandler;
-import net.momirealms.customcrops.api.customplugin.oraxen.OraxenHandler;
import net.momirealms.customcrops.api.event.*;
import net.momirealms.customcrops.api.object.BoneMeal;
import net.momirealms.customcrops.api.object.Function;
@@ -44,8 +42,10 @@ import net.momirealms.customcrops.api.object.sprinkler.Sprinkler;
import net.momirealms.customcrops.api.object.sprinkler.SprinklerConfig;
import net.momirealms.customcrops.api.object.wateringcan.WateringCanConfig;
import net.momirealms.customcrops.api.object.world.SimpleLocation;
-import net.momirealms.customcrops.api.util.AdventureUtils;
-import net.momirealms.customcrops.api.util.RotationUtils;
+import net.momirealms.customcrops.customplugin.itemsadder.ItemsAdderHandler;
+import net.momirealms.customcrops.customplugin.oraxen.OraxenHandler;
+import net.momirealms.customcrops.util.AdventureUtils;
+import net.momirealms.customcrops.util.RotationUtils;
import net.momirealms.protectionlib.ProtectionLib;
import org.bukkit.*;
import org.bukkit.block.Block;
@@ -389,7 +389,7 @@ public class PlatformManager extends Function {
PotConfig potConfig = plugin.getPotManager().getPotConfigByBlockID(id);
if (potConfig == null) return false;
- PotPlaceEvent potPlaceEvent = new PotPlaceEvent(player, location, potConfig);
+ PotPlaceEvent potPlaceEvent = new PotPlaceEvent(player, location, potConfig.getKey());
Bukkit.getPluginManager().callEvent(potPlaceEvent);
if (potPlaceEvent.isCancelled()) {
if (event != null) event.setCancelled(true);
@@ -404,7 +404,7 @@ public class PlatformManager extends Function {
return false;
}
- SprinklerInteractEvent sprinklerInteractEvent = new SprinklerInteractEvent(player, item_in_hand, location, sprinklerConfig);
+ SprinklerInteractEvent sprinklerInteractEvent = new SprinklerInteractEvent(player, item_in_hand, location, sprinklerConfig.getKey());
Bukkit.getPluginManager().callEvent(sprinklerInteractEvent);
if (sprinklerInteractEvent.isCancelled()) {
event.setCancelled(true);
@@ -417,7 +417,7 @@ public class PlatformManager extends Function {
for (PassiveFillMethod passiveFillMethod : passiveFillMethods) {
if (passiveFillMethod.isRightItem(item_in_hand_id)) {
- SprinklerFillEvent sprinklerFillEvent = new SprinklerFillEvent(player, item_in_hand, passiveFillMethod.getAmount(), location);
+ SprinklerFillEvent sprinklerFillEvent = new SprinklerFillEvent(player, sprinklerConfig.getKey(), item_in_hand, passiveFillMethod.getAmount(), location);
Bukkit.getPluginManager().callEvent(sprinklerFillEvent);
if (sprinklerFillEvent.isCancelled()) {
return true;
@@ -446,7 +446,7 @@ public class PlatformManager extends Function {
int current_water = plugin.getWateringCanManager().getCurrentWater(item_in_hand);
if (current_water <= 0) return true;
- SprinklerFillEvent sprinklerFillEvent = new SprinklerFillEvent(player, item_in_hand, 1, location);
+ SprinklerFillEvent sprinklerFillEvent = new SprinklerFillEvent(player, sprinklerConfig.getKey(), item_in_hand, 1, location);
Bukkit.getPluginManager().callEvent(sprinklerFillEvent);
if (sprinklerFillEvent.isCancelled()) {
return true;
@@ -518,7 +518,7 @@ public class PlatformManager extends Function {
Location sprinkler_loc = location.clone().add(0,1,0);
if (plugin.getPlatformInterface().detectAnyThing(sprinkler_loc)) return true;
- SprinklerPlaceEvent sprinklerPlaceEvent = new SprinklerPlaceEvent(player, item_in_hand, sprinkler_loc, sprinklerConfig);
+ SprinklerPlaceEvent sprinklerPlaceEvent = new SprinklerPlaceEvent(player, item_in_hand, sprinkler_loc, sprinklerConfig.getKey());
Bukkit.getPluginManager().callEvent(sprinklerPlaceEvent);
if (sprinklerPlaceEvent.isCancelled()) {
return true;
@@ -543,7 +543,7 @@ public class PlatformManager extends Function {
return true;
}
- CropInteractEvent cropInteractEvent = new CropInteractEvent(player, item_in_hand, location, cropConfig, stageConfig);
+ CropInteractEvent cropInteractEvent = new CropInteractEvent(player, item_in_hand, location, id, cropConfig.getKey());
Bukkit.getPluginManager().callEvent(cropInteractEvent);
if (cropInteractEvent.isCancelled()) {
event.setCancelled(true);
@@ -694,7 +694,7 @@ public class PlatformManager extends Function {
return false;
}
- PotInteractEvent potInteractEvent = new PotInteractEvent(player, item_in_hand, location, potConfig);
+ PotInteractEvent potInteractEvent = new PotInteractEvent(player, item_in_hand, location, pot_id);
Bukkit.getPluginManager().callEvent(potInteractEvent);
if (potInteractEvent.isCancelled()) {
return true;
@@ -827,7 +827,7 @@ public class PlatformManager extends Function {
}
}
- FertilizerUseEvent fertilizerUseEvent = new FertilizerUseEvent(player, item_in_hand, fertilizerConfig, location);
+ FertilizerUseEvent fertilizerUseEvent = new FertilizerUseEvent(player, item_in_hand, fertilizerConfig.getKey(), location);
Bukkit.getPluginManager().callEvent(fertilizerUseEvent);
if (fertilizerUseEvent.isCancelled()) {
return true;
@@ -854,7 +854,7 @@ public class PlatformManager extends Function {
Pot potData = Optional.ofNullable(plugin.getWorldDataManager().getPotData(SimpleLocation.getByBukkitLocation(location))).orElse(new Pot(pot_id, null, 0));
GrowingCrop growingCrop = plugin.getWorldDataManager().getCropData(SimpleLocation.getByBukkitLocation(location));
- PotInfoEvent potInfoEvent = new PotInfoEvent(player, location, item_in_hand, potConfig, potData.getFertilizer(), potData.getWater(), growingCrop);
+ PotInfoEvent potInfoEvent = new PotInfoEvent(player, location, item_in_hand, potData.getFertilizer(), potData.getWater(), growingCrop);
Bukkit.getPluginManager().callEvent(potInfoEvent);
if (potConfig.getPotInfoItem() != null && !item_in_hand_id.equals(potConfig.getPotInfoItem())) {
@@ -911,7 +911,7 @@ public class PlatformManager extends Function {
return false;
}
- PotBreakEvent potBreakEvent = new PotBreakEvent(entity, location, potConfig);
+ PotBreakEvent potBreakEvent = new PotBreakEvent(entity, location, potConfig.getKey());
Bukkit.getPluginManager().callEvent(potBreakEvent);
if (potBreakEvent.isCancelled()) {
event.setCancelled(true);
@@ -940,7 +940,7 @@ public class PlatformManager extends Function {
return false;
}
- SprinklerBreakEvent sprinklerBreakEvent = new SprinklerBreakEvent(player, location, sprinklerConfig);
+ SprinklerBreakEvent sprinklerBreakEvent = new SprinklerBreakEvent(player, location, sprinklerConfig.getKey());
Bukkit.getPluginManager().callEvent(sprinklerBreakEvent);
if (sprinklerBreakEvent.isCancelled()) {
event.setCancelled(true);
@@ -966,7 +966,7 @@ public class PlatformManager extends Function {
event.setCancelled(true);
return true;
}
- CropBreakEvent cropBreakEvent = new CropBreakEvent(entity, cropConfig, id, location);
+ CropBreakEvent cropBreakEvent = new CropBreakEvent(entity, cropConfig.getKey(), id, location);
Bukkit.getPluginManager().callEvent(cropBreakEvent);
if (cropBreakEvent.isCancelled()) {
return true;
@@ -983,7 +983,7 @@ public class PlatformManager extends Function {
}
}
} else {
- CropBreakEvent cropBreakEvent = new CropBreakEvent(entity, cropConfig, id, location);
+ CropBreakEvent cropBreakEvent = new CropBreakEvent(entity, cropConfig.getKey(), id, location);
Bukkit.getPluginManager().callEvent(cropBreakEvent);
if (cropBreakEvent.isCancelled()) {
return true;
diff --git a/src/main/java/net/momirealms/customcrops/api/customplugin/crucible/CrucibleHandler.java b/plugin/src/main/java/net/momirealms/customcrops/customplugin/crucible/CrucibleHandler.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/customplugin/crucible/CrucibleHandler.java
rename to plugin/src/main/java/net/momirealms/customcrops/customplugin/crucible/CrucibleHandler.java
diff --git a/src/main/java/net/momirealms/customcrops/api/customplugin/crucible/CruciblePluginImpl.java b/plugin/src/main/java/net/momirealms/customcrops/customplugin/crucible/CruciblePluginImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/api/customplugin/crucible/CruciblePluginImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/customplugin/crucible/CruciblePluginImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/customplugin/itemsadder/ItemsAdderHandler.java b/plugin/src/main/java/net/momirealms/customcrops/customplugin/itemsadder/ItemsAdderHandler.java
similarity index 91%
rename from src/main/java/net/momirealms/customcrops/api/customplugin/itemsadder/ItemsAdderHandler.java
rename to plugin/src/main/java/net/momirealms/customcrops/customplugin/itemsadder/ItemsAdderHandler.java
index 2d34715..90263d9 100644
--- a/src/main/java/net/momirealms/customcrops/api/customplugin/itemsadder/ItemsAdderHandler.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/customplugin/itemsadder/ItemsAdderHandler.java
@@ -15,11 +15,11 @@
* along with this program. If not, see .
*/
-package net.momirealms.customcrops.api.customplugin.itemsadder;
+package net.momirealms.customcrops.customplugin.itemsadder;
import dev.lone.itemsadder.api.Events.*;
-import net.momirealms.customcrops.api.customplugin.Handler;
-import net.momirealms.customcrops.api.customplugin.PlatformManager;
+import net.momirealms.customcrops.customplugin.Handler;
+import net.momirealms.customcrops.customplugin.PlatformManager;
import org.bukkit.event.EventHandler;
public class ItemsAdderHandler extends Handler {
diff --git a/src/main/java/net/momirealms/customcrops/api/customplugin/itemsadder/ItemsAdderPluginImpl.java b/plugin/src/main/java/net/momirealms/customcrops/customplugin/itemsadder/ItemsAdderPluginImpl.java
similarity index 96%
rename from src/main/java/net/momirealms/customcrops/api/customplugin/itemsadder/ItemsAdderPluginImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/customplugin/itemsadder/ItemsAdderPluginImpl.java
index 146b4da..f4b428e 100644
--- a/src/main/java/net/momirealms/customcrops/api/customplugin/itemsadder/ItemsAdderPluginImpl.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/customplugin/itemsadder/ItemsAdderPluginImpl.java
@@ -15,15 +15,15 @@
* along with this program. If not, see .
*/
-package net.momirealms.customcrops.api.customplugin.itemsadder;
+package net.momirealms.customcrops.customplugin.itemsadder;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTItem;
import dev.lone.itemsadder.api.CustomBlock;
import dev.lone.itemsadder.api.CustomFurniture;
import dev.lone.itemsadder.api.CustomStack;
-import net.momirealms.customcrops.api.customplugin.PlatformInterface;
-import net.momirealms.customcrops.api.util.AdventureUtils;
+import net.momirealms.customcrops.customplugin.PlatformInterface;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
diff --git a/src/main/java/net/momirealms/customcrops/api/customplugin/oraxen/OraxenHandler.java b/plugin/src/main/java/net/momirealms/customcrops/customplugin/oraxen/OraxenHandler.java
similarity index 94%
rename from src/main/java/net/momirealms/customcrops/api/customplugin/oraxen/OraxenHandler.java
rename to plugin/src/main/java/net/momirealms/customcrops/customplugin/oraxen/OraxenHandler.java
index 03a9d65..d8260ca 100644
--- a/src/main/java/net/momirealms/customcrops/api/customplugin/oraxen/OraxenHandler.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/customplugin/oraxen/OraxenHandler.java
@@ -15,14 +15,14 @@
* along with this program. If not, see .
*/
-package net.momirealms.customcrops.api.customplugin.oraxen;
+package net.momirealms.customcrops.customplugin.oraxen;
import io.th0rgal.oraxen.api.events.*;
import io.th0rgal.oraxen.mechanics.provided.gameplay.furniture.FurnitureMechanic;
import io.th0rgal.oraxen.mechanics.provided.gameplay.noteblock.NoteBlockMechanic;
import io.th0rgal.oraxen.mechanics.provided.gameplay.stringblock.StringBlockMechanic;
-import net.momirealms.customcrops.api.customplugin.Handler;
-import net.momirealms.customcrops.api.customplugin.PlatformManager;
+import net.momirealms.customcrops.customplugin.Handler;
+import net.momirealms.customcrops.customplugin.PlatformManager;
import org.bukkit.entity.Entity;
import org.bukkit.event.EventHandler;
diff --git a/src/main/java/net/momirealms/customcrops/api/customplugin/oraxen/OraxenPluginImpl.java b/plugin/src/main/java/net/momirealms/customcrops/customplugin/oraxen/OraxenPluginImpl.java
similarity index 97%
rename from src/main/java/net/momirealms/customcrops/api/customplugin/oraxen/OraxenPluginImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/customplugin/oraxen/OraxenPluginImpl.java
index ffb6bfb..d691296 100644
--- a/src/main/java/net/momirealms/customcrops/api/customplugin/oraxen/OraxenPluginImpl.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/customplugin/oraxen/OraxenPluginImpl.java
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-package net.momirealms.customcrops.api.customplugin.oraxen;
+package net.momirealms.customcrops.customplugin.oraxen;
import de.tr7zw.changeme.nbtapi.NBTCompound;
import de.tr7zw.changeme.nbtapi.NBTItem;
@@ -31,8 +31,8 @@ import io.th0rgal.oraxen.mechanics.provided.gameplay.furniture.FurnitureMechanic
import io.th0rgal.oraxen.mechanics.provided.gameplay.noteblock.NoteBlockMechanicFactory;
import io.th0rgal.oraxen.mechanics.provided.gameplay.stringblock.StringBlockMechanicFactory;
import io.th0rgal.oraxen.utils.drops.Drop;
-import net.momirealms.customcrops.api.customplugin.PlatformInterface;
-import net.momirealms.customcrops.api.util.AdventureUtils;
+import net.momirealms.customcrops.customplugin.PlatformInterface;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
diff --git a/src/main/java/net/momirealms/customcrops/helper/LibraryLoader.java b/plugin/src/main/java/net/momirealms/customcrops/helper/LibraryLoader.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/helper/LibraryLoader.java
rename to plugin/src/main/java/net/momirealms/customcrops/helper/LibraryLoader.java
diff --git a/src/main/java/net/momirealms/customcrops/helper/Log.java b/plugin/src/main/java/net/momirealms/customcrops/helper/Log.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/helper/Log.java
rename to plugin/src/main/java/net/momirealms/customcrops/helper/Log.java
diff --git a/src/main/java/net/momirealms/customcrops/helper/MavenLibraries.java b/plugin/src/main/java/net/momirealms/customcrops/helper/MavenLibraries.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/helper/MavenLibraries.java
rename to plugin/src/main/java/net/momirealms/customcrops/helper/MavenLibraries.java
diff --git a/src/main/java/net/momirealms/customcrops/helper/MavenLibrary.java b/plugin/src/main/java/net/momirealms/customcrops/helper/MavenLibrary.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/helper/MavenLibrary.java
rename to plugin/src/main/java/net/momirealms/customcrops/helper/MavenLibrary.java
diff --git a/src/main/java/net/momirealms/customcrops/helper/Repository.java b/plugin/src/main/java/net/momirealms/customcrops/helper/Repository.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/helper/Repository.java
rename to plugin/src/main/java/net/momirealms/customcrops/helper/Repository.java
diff --git a/src/main/java/net/momirealms/customcrops/helper/URLClassLoaderAccess.java b/plugin/src/main/java/net/momirealms/customcrops/helper/URLClassLoaderAccess.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/helper/URLClassLoaderAccess.java
rename to plugin/src/main/java/net/momirealms/customcrops/helper/URLClassLoaderAccess.java
diff --git a/src/main/java/net/momirealms/customcrops/helper/VersionHelper.java b/plugin/src/main/java/net/momirealms/customcrops/helper/VersionHelper.java
similarity index 99%
rename from src/main/java/net/momirealms/customcrops/helper/VersionHelper.java
rename to plugin/src/main/java/net/momirealms/customcrops/helper/VersionHelper.java
index 0330f3c..7fe65e0 100644
--- a/src/main/java/net/momirealms/customcrops/helper/VersionHelper.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/helper/VersionHelper.java
@@ -21,7 +21,7 @@ import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion;
import de.tr7zw.changeme.nbtapi.utils.VersionChecker;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.basic.ConfigManager;
-import net.momirealms.customcrops.api.util.AdventureUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
import java.io.BufferedReader;
import java.io.InputStream;
diff --git a/src/main/java/net/momirealms/customcrops/integration/IntegrationManager.java b/plugin/src/main/java/net/momirealms/customcrops/integration/IntegrationManager.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/integration/IntegrationManager.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/IntegrationManager.java
index e4751cf..732642a 100644
--- a/src/main/java/net/momirealms/customcrops/integration/IntegrationManager.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/integration/IntegrationManager.java
@@ -20,8 +20,6 @@ package net.momirealms.customcrops.integration;
import net.momirealms.customcrops.CustomCrops;
import net.momirealms.customcrops.api.object.Function;
import net.momirealms.customcrops.api.object.basic.ConfigManager;
-import net.momirealms.customcrops.api.util.AdventureUtils;
-import net.momirealms.customcrops.api.util.ConfigUtils;
import net.momirealms.customcrops.integration.item.DefaultImpl;
import net.momirealms.customcrops.integration.item.MMOItemsItemImpl;
import net.momirealms.customcrops.integration.item.MythicMobsItemImpl;
@@ -39,6 +37,8 @@ import net.momirealms.customcrops.integration.skill.AureliumsImpl;
import net.momirealms.customcrops.integration.skill.EcoSkillsImpl;
import net.momirealms.customcrops.integration.skill.MMOCoreImpl;
import net.momirealms.customcrops.integration.skill.mcMMOImpl;
+import net.momirealms.customcrops.util.AdventureUtils;
+import net.momirealms.customcrops.util.ConfigUtils;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
diff --git a/src/main/java/net/momirealms/customcrops/integration/ItemInterface.java b/plugin/src/main/java/net/momirealms/customcrops/integration/ItemInterface.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/ItemInterface.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/ItemInterface.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/JobInterface.java b/plugin/src/main/java/net/momirealms/customcrops/integration/JobInterface.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/JobInterface.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/JobInterface.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/SeasonInterface.java b/plugin/src/main/java/net/momirealms/customcrops/integration/SeasonInterface.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/SeasonInterface.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/SeasonInterface.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/SkillInterface.java b/plugin/src/main/java/net/momirealms/customcrops/integration/SkillInterface.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/SkillInterface.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/SkillInterface.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/VaultHook.java b/plugin/src/main/java/net/momirealms/customcrops/integration/VaultHook.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/VaultHook.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/VaultHook.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/item/DefaultImpl.java b/plugin/src/main/java/net/momirealms/customcrops/integration/item/DefaultImpl.java
similarity index 96%
rename from src/main/java/net/momirealms/customcrops/integration/item/DefaultImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/item/DefaultImpl.java
index 47eeff4..a0326d2 100644
--- a/src/main/java/net/momirealms/customcrops/integration/item/DefaultImpl.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/integration/item/DefaultImpl.java
@@ -18,8 +18,8 @@
package net.momirealms.customcrops.integration.item;
import net.momirealms.customcrops.CustomCrops;
-import net.momirealms.customcrops.api.util.ConfigUtils;
import net.momirealms.customcrops.integration.ItemInterface;
+import net.momirealms.customcrops.util.ConfigUtils;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
diff --git a/src/main/java/net/momirealms/customcrops/integration/item/MMOItemsItemImpl.java b/plugin/src/main/java/net/momirealms/customcrops/integration/item/MMOItemsItemImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/item/MMOItemsItemImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/item/MMOItemsItemImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/item/MythicMobsItemImpl.java b/plugin/src/main/java/net/momirealms/customcrops/integration/item/MythicMobsItemImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/item/MythicMobsItemImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/item/MythicMobsItemImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/item/NeigeItemsImpl.java b/plugin/src/main/java/net/momirealms/customcrops/integration/item/NeigeItemsImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/item/NeigeItemsImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/item/NeigeItemsImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/job/EcoJobsImpl.java b/plugin/src/main/java/net/momirealms/customcrops/integration/job/EcoJobsImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/job/EcoJobsImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/job/EcoJobsImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/job/JobsRebornImpl.java b/plugin/src/main/java/net/momirealms/customcrops/integration/job/JobsRebornImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/job/JobsRebornImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/job/JobsRebornImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/papi/ParseUtil.java b/plugin/src/main/java/net/momirealms/customcrops/integration/papi/ParseUtil.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/papi/ParseUtil.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/papi/ParseUtil.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/papi/PlaceholderManager.java b/plugin/src/main/java/net/momirealms/customcrops/integration/papi/PlaceholderManager.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/papi/PlaceholderManager.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/papi/PlaceholderManager.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/papi/SeasonPapi.java b/plugin/src/main/java/net/momirealms/customcrops/integration/papi/SeasonPapi.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/papi/SeasonPapi.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/papi/SeasonPapi.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/quest/BattlePassCCQuest.java b/plugin/src/main/java/net/momirealms/customcrops/integration/quest/BattlePassCCQuest.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/integration/quest/BattlePassCCQuest.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/quest/BattlePassCCQuest.java
index 190e8d6..fb69e22 100644
--- a/src/main/java/net/momirealms/customcrops/integration/quest/BattlePassCCQuest.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/integration/quest/BattlePassCCQuest.java
@@ -50,7 +50,7 @@ public class BattlePassCCQuest extends ExternalQuestExecutor implements Listener
@EventHandler
public void onPlant(CropPlantEvent event) {
if (event.isCancelled()) return;
- String id = event.getCrop();
+ String id = event.getCropKey();
this.execute("plant", event.getPlayer(), (result) -> result.root(id));
}
}
\ No newline at end of file
diff --git a/src/main/java/net/momirealms/customcrops/integration/quest/BetonQuestCCQuest.java b/plugin/src/main/java/net/momirealms/customcrops/integration/quest/BetonQuestCCQuest.java
similarity index 98%
rename from src/main/java/net/momirealms/customcrops/integration/quest/BetonQuestCCQuest.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/quest/BetonQuestCCQuest.java
index 725b5f0..a7f2802 100644
--- a/src/main/java/net/momirealms/customcrops/integration/quest/BetonQuestCCQuest.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/integration/quest/BetonQuestCCQuest.java
@@ -18,7 +18,7 @@
package net.momirealms.customcrops.integration.quest;
import net.momirealms.customcrops.api.event.CropBreakEvent;
-import net.momirealms.customcrops.api.util.AdventureUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.betonquest.betonquest.BetonQuest;
import org.betonquest.betonquest.Instruction;
import org.betonquest.betonquest.VariableNumber;
diff --git a/src/main/java/net/momirealms/customcrops/integration/quest/ClueScrollCCQuest.java b/plugin/src/main/java/net/momirealms/customcrops/integration/quest/ClueScrollCCQuest.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/quest/ClueScrollCCQuest.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/quest/ClueScrollCCQuest.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/quest/LegacyBetonQuestCCQuest.java b/plugin/src/main/java/net/momirealms/customcrops/integration/quest/LegacyBetonQuestCCQuest.java
similarity index 99%
rename from src/main/java/net/momirealms/customcrops/integration/quest/LegacyBetonQuestCCQuest.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/quest/LegacyBetonQuestCCQuest.java
index 38810c6..2ce1484 100644
--- a/src/main/java/net/momirealms/customcrops/integration/quest/LegacyBetonQuestCCQuest.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/integration/quest/LegacyBetonQuestCCQuest.java
@@ -18,7 +18,7 @@
package net.momirealms.customcrops.integration.quest;
import net.momirealms.customcrops.api.event.CropBreakEvent;
-import net.momirealms.customcrops.api.util.AdventureUtils;
+import net.momirealms.customcrops.util.AdventureUtils;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
diff --git a/src/main/java/net/momirealms/customcrops/integration/season/CustomCropsSeasonImpl.java b/plugin/src/main/java/net/momirealms/customcrops/integration/season/CustomCropsSeasonImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/season/CustomCropsSeasonImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/season/CustomCropsSeasonImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/season/RealisticSeasonsImpl.java b/plugin/src/main/java/net/momirealms/customcrops/integration/season/RealisticSeasonsImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/season/RealisticSeasonsImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/season/RealisticSeasonsImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/skill/AureliumsImpl.java b/plugin/src/main/java/net/momirealms/customcrops/integration/skill/AureliumsImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/skill/AureliumsImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/skill/AureliumsImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/skill/EcoSkillsImpl.java b/plugin/src/main/java/net/momirealms/customcrops/integration/skill/EcoSkillsImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/skill/EcoSkillsImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/skill/EcoSkillsImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/skill/MMOCoreImpl.java b/plugin/src/main/java/net/momirealms/customcrops/integration/skill/MMOCoreImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/skill/MMOCoreImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/skill/MMOCoreImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/integration/skill/mcMMOImpl.java b/plugin/src/main/java/net/momirealms/customcrops/integration/skill/mcMMOImpl.java
similarity index 100%
rename from src/main/java/net/momirealms/customcrops/integration/skill/mcMMOImpl.java
rename to plugin/src/main/java/net/momirealms/customcrops/integration/skill/mcMMOImpl.java
diff --git a/src/main/java/net/momirealms/customcrops/api/util/AdventureUtils.java b/plugin/src/main/java/net/momirealms/customcrops/util/AdventureUtils.java
similarity index 99%
rename from src/main/java/net/momirealms/customcrops/api/util/AdventureUtils.java
rename to plugin/src/main/java/net/momirealms/customcrops/util/AdventureUtils.java
index 3cd420e..b98532a 100644
--- a/src/main/java/net/momirealms/customcrops/api/util/AdventureUtils.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/util/AdventureUtils.java
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-package net.momirealms.customcrops.api.util;
+package net.momirealms.customcrops.util;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.key.Key;
diff --git a/src/main/java/net/momirealms/customcrops/api/util/ConfigUtils.java b/plugin/src/main/java/net/momirealms/customcrops/util/ConfigUtils.java
similarity index 99%
rename from src/main/java/net/momirealms/customcrops/api/util/ConfigUtils.java
rename to plugin/src/main/java/net/momirealms/customcrops/util/ConfigUtils.java
index c3b85dc..961645b 100644
--- a/src/main/java/net/momirealms/customcrops/api/util/ConfigUtils.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/util/ConfigUtils.java
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-package net.momirealms.customcrops.api.util;
+package net.momirealms.customcrops.util;
import dev.dejvokep.boostedyaml.YamlDocument;
import dev.dejvokep.boostedyaml.dvs.versioning.BasicVersioning;
@@ -26,7 +26,6 @@ import dev.dejvokep.boostedyaml.settings.updater.UpdaterSettings;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.sound.Sound;
import net.momirealms.customcrops.CustomCrops;
-import net.momirealms.customcrops.api.customplugin.Platform;
import net.momirealms.customcrops.api.object.BoneMeal;
import net.momirealms.customcrops.api.object.InteractCrop;
import net.momirealms.customcrops.api.object.ItemMode;
@@ -43,6 +42,7 @@ import net.momirealms.customcrops.api.object.loot.OtherLoot;
import net.momirealms.customcrops.api.object.loot.QualityLoot;
import net.momirealms.customcrops.api.object.requirement.*;
import net.momirealms.customcrops.api.object.season.CCSeason;
+import net.momirealms.customcrops.customplugin.Platform;
import net.momirealms.customcrops.helper.Log;
import org.bukkit.Particle;
import org.bukkit.World;
@@ -51,7 +51,6 @@ import org.bukkit.configuration.MemorySection;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
-import org.checkerframework.checker.units.qual.N;
import org.intellij.lang.annotations.Subst;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
diff --git a/src/main/java/net/momirealms/customcrops/api/util/FakeEntityUtils.java b/plugin/src/main/java/net/momirealms/customcrops/util/FakeEntityUtils.java
similarity index 99%
rename from src/main/java/net/momirealms/customcrops/api/util/FakeEntityUtils.java
rename to plugin/src/main/java/net/momirealms/customcrops/util/FakeEntityUtils.java
index cd2b9d5..a0df288 100644
--- a/src/main/java/net/momirealms/customcrops/api/util/FakeEntityUtils.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/util/FakeEntityUtils.java
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-package net.momirealms.customcrops.api.util;
+package net.momirealms.customcrops.util;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.events.PacketContainer;
diff --git a/src/main/java/net/momirealms/customcrops/api/util/RotationUtils.java b/plugin/src/main/java/net/momirealms/customcrops/util/RotationUtils.java
similarity index 96%
rename from src/main/java/net/momirealms/customcrops/api/util/RotationUtils.java
rename to plugin/src/main/java/net/momirealms/customcrops/util/RotationUtils.java
index 3ab73c0..534c311 100644
--- a/src/main/java/net/momirealms/customcrops/api/util/RotationUtils.java
+++ b/plugin/src/main/java/net/momirealms/customcrops/util/RotationUtils.java
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-package net.momirealms.customcrops.api.util;
+package net.momirealms.customcrops.util;
import org.bukkit.Rotation;
diff --git a/src/main/resources/config.yml b/plugin/src/main/resources/config.yml
similarity index 100%
rename from src/main/resources/config.yml
rename to plugin/src/main/resources/config.yml
diff --git a/src/main/resources/contents/crops/tomato.yml b/plugin/src/main/resources/contents/crops/tomato.yml
similarity index 100%
rename from src/main/resources/contents/crops/tomato.yml
rename to plugin/src/main/resources/contents/crops/tomato.yml
diff --git a/src/main/resources/contents/fertilizers/quality.yml b/plugin/src/main/resources/contents/fertilizers/quality.yml
similarity index 100%
rename from src/main/resources/contents/fertilizers/quality.yml
rename to plugin/src/main/resources/contents/fertilizers/quality.yml
diff --git a/src/main/resources/contents/fertilizers/soil-retain.yml b/plugin/src/main/resources/contents/fertilizers/soil-retain.yml
similarity index 100%
rename from src/main/resources/contents/fertilizers/soil-retain.yml
rename to plugin/src/main/resources/contents/fertilizers/soil-retain.yml
diff --git a/src/main/resources/contents/fertilizers/speed-grow.yml b/plugin/src/main/resources/contents/fertilizers/speed-grow.yml
similarity index 100%
rename from src/main/resources/contents/fertilizers/speed-grow.yml
rename to plugin/src/main/resources/contents/fertilizers/speed-grow.yml
diff --git a/src/main/resources/contents/fertilizers/variation.yml b/plugin/src/main/resources/contents/fertilizers/variation.yml
similarity index 100%
rename from src/main/resources/contents/fertilizers/variation.yml
rename to plugin/src/main/resources/contents/fertilizers/variation.yml
diff --git a/src/main/resources/contents/fertilizers/yield-increase.yml b/plugin/src/main/resources/contents/fertilizers/yield-increase.yml
similarity index 100%
rename from src/main/resources/contents/fertilizers/yield-increase.yml
rename to plugin/src/main/resources/contents/fertilizers/yield-increase.yml
diff --git a/src/main/resources/contents/pots/default.yml b/plugin/src/main/resources/contents/pots/default.yml
similarity index 100%
rename from src/main/resources/contents/pots/default.yml
rename to plugin/src/main/resources/contents/pots/default.yml
diff --git a/src/main/resources/contents/sprinklers/default.yml b/plugin/src/main/resources/contents/sprinklers/default.yml
similarity index 100%
rename from src/main/resources/contents/sprinklers/default.yml
rename to plugin/src/main/resources/contents/sprinklers/default.yml
diff --git a/src/main/resources/contents/watering-cans/default.yml b/plugin/src/main/resources/contents/watering-cans/default.yml
similarity index 100%
rename from src/main/resources/contents/watering-cans/default.yml
rename to plugin/src/main/resources/contents/watering-cans/default.yml
diff --git a/src/main/resources/messages/messages_chinese.yml b/plugin/src/main/resources/messages/messages_chinese.yml
similarity index 100%
rename from src/main/resources/messages/messages_chinese.yml
rename to plugin/src/main/resources/messages/messages_chinese.yml
diff --git a/src/main/resources/messages/messages_english.yml b/plugin/src/main/resources/messages/messages_english.yml
similarity index 100%
rename from src/main/resources/messages/messages_english.yml
rename to plugin/src/main/resources/messages/messages_english.yml
diff --git a/src/main/resources/messages/messages_russian.yml b/plugin/src/main/resources/messages/messages_russian.yml
similarity index 100%
rename from src/main/resources/messages/messages_russian.yml
rename to plugin/src/main/resources/messages/messages_russian.yml
diff --git a/src/main/resources/messages/messages_spanish.yml b/plugin/src/main/resources/messages/messages_spanish.yml
similarity index 100%
rename from src/main/resources/messages/messages_spanish.yml
rename to plugin/src/main/resources/messages/messages_spanish.yml
diff --git a/src/main/resources/messages/messages_turkish.yml b/plugin/src/main/resources/messages/messages_turkish.yml
similarity index 100%
rename from src/main/resources/messages/messages_turkish.yml
rename to plugin/src/main/resources/messages/messages_turkish.yml
diff --git a/src/main/resources/plugin.yml b/plugin/src/main/resources/plugin.yml
similarity index 100%
rename from src/main/resources/plugin.yml
rename to plugin/src/main/resources/plugin.yml
diff --git a/settings.gradle b/settings.gradle
index d4b6e37..f35bb11 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1,3 @@
rootProject.name = 'CustomCrops'
+include(":plugin")
+include(":api")
diff --git a/src/main/java/net/momirealms/customcrops/api/event/SeasonChangeEvent.java b/src/main/java/net/momirealms/customcrops/api/event/SeasonChangeEvent.java
deleted file mode 100644
index 10c0c12..0000000
--- a/src/main/java/net/momirealms/customcrops/api/event/SeasonChangeEvent.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package net.momirealms.customcrops.api.event;
-
-import net.momirealms.customcrops.api.object.season.CCSeason;
-import org.bukkit.World;
-import org.bukkit.event.HandlerList;
-import org.bukkit.event.world.WorldEvent;
-import org.jetbrains.annotations.NotNull;
-
-public class SeasonChangeEvent extends WorldEvent {
-
- private static final HandlerList handlers = new HandlerList();
- private final CCSeason ccSeason;
-
- public SeasonChangeEvent(@NotNull World world, CCSeason ccSeason) {
- super(world);
- this.ccSeason = ccSeason;
- }
-
- @NotNull
- public static HandlerList getHandlerList() {
- return handlers;
- }
-
- @NotNull
- @Override
- public HandlerList getHandlers() {
- return getHandlerList();
- }
-
- public CCSeason getCCSeason() {
- return ccSeason;
- }
-}