Project cleanup

This commit is contained in:
Christian Koop 2021-07-10 23:41:20 +02:00
parent a4121cb0a3
commit b6074e181b
84 changed files with 723 additions and 375 deletions

311
.editorconfig Normal file
View File

@ -0,0 +1,311 @@
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
# max_line_length = 120
tab_width = 4
trim_trailing_whitespace = true
ij_continuation_indent_size = 8
ij_formatter_off_tag = @formatter:off
ij_formatter_on_tag = @formatter:on
ij_formatter_tags_enabled = false
ij_smart_tabs = false
ij_visual_guides = none
ij_wrap_on_typing = false
[*.java]
ij_smart_tabs = true
ij_java_align_consecutive_assignments = false
ij_java_align_consecutive_variable_declarations = false
ij_java_align_group_field_declarations = false
ij_java_align_multiline_annotation_parameters = false
ij_java_align_multiline_array_initializer_expression = false
ij_java_align_multiline_assignment = false
ij_java_align_multiline_binary_operation = false
ij_java_align_multiline_chained_methods = false
ij_java_align_multiline_extends_list = false
ij_java_align_multiline_for = true
ij_java_align_multiline_method_parentheses = false
ij_java_align_multiline_parameters = true
ij_java_align_multiline_parameters_in_calls = false
ij_java_align_multiline_parenthesized_expression = false
ij_java_align_multiline_records = true
ij_java_align_multiline_resources = true
ij_java_align_multiline_ternary_operation = false
ij_java_align_multiline_text_blocks = false
ij_java_align_multiline_throws_list = false
ij_java_align_subsequent_simple_methods = false
ij_java_align_throws_keyword = false
ij_java_annotation_parameter_wrap = off
ij_java_array_initializer_new_line_after_left_brace = false
ij_java_array_initializer_right_brace_on_new_line = false
ij_java_array_initializer_wrap = off
ij_java_assert_statement_colon_on_next_line = false
ij_java_assert_statement_wrap = off
ij_java_assignment_wrap = off
ij_java_binary_operation_sign_on_next_line = false
ij_java_binary_operation_wrap = off
ij_java_blank_lines_after_anonymous_class_header = 0
ij_java_blank_lines_after_class_header = 0
ij_java_blank_lines_after_imports = 1
ij_java_blank_lines_after_package = 1
ij_java_blank_lines_around_class = 1
ij_java_blank_lines_around_field = 0
ij_java_blank_lines_around_field_in_interface = 0
ij_java_blank_lines_around_initializer = 1
ij_java_blank_lines_around_method = 1
ij_java_blank_lines_around_method_in_interface = 1
ij_java_blank_lines_before_class_end = 0
ij_java_blank_lines_before_imports = 1
ij_java_blank_lines_before_method_body = 0
ij_java_blank_lines_before_package = 0
ij_java_block_brace_style = end_of_line
ij_java_block_comment_at_first_column = true
ij_java_builder_methods = none
ij_java_call_parameters_new_line_after_left_paren = false
ij_java_call_parameters_right_paren_on_new_line = false
ij_java_call_parameters_wrap = off
ij_java_case_statement_on_separate_line = true
ij_java_catch_on_new_line = false
ij_java_class_annotation_wrap = split_into_lines
ij_java_class_brace_style = end_of_line
ij_java_class_count_to_use_import_on_demand = 15
ij_java_class_names_in_javadoc = 1
ij_java_do_not_indent_top_level_class_members = false
ij_java_do_not_wrap_after_single_annotation = false
ij_java_do_while_brace_force = never
ij_java_doc_add_blank_line_after_description = true
ij_java_doc_add_blank_line_after_param_comments = true
ij_java_doc_add_blank_line_after_return = true
ij_java_doc_add_p_tag_on_empty_lines = true
ij_java_doc_align_exception_comments = true
ij_java_doc_align_param_comments = true
ij_java_doc_do_not_wrap_if_one_line = true
ij_java_doc_enable_formatting = true
ij_java_doc_enable_leading_asterisks = true
ij_java_doc_indent_on_continuation = true
ij_java_doc_keep_empty_lines = true
ij_java_doc_keep_empty_parameter_tag = true
ij_java_doc_keep_empty_return_tag = true
ij_java_doc_keep_empty_throws_tag = true
ij_java_doc_keep_invalid_tags = true
ij_java_doc_param_description_on_new_line = false
ij_java_doc_preserve_line_breaks = false
ij_java_doc_use_throws_not_exception_tag = true
ij_java_else_on_new_line = false
ij_java_enum_constants_wrap = off
ij_java_extends_keyword_wrap = off
ij_java_extends_list_wrap = off
ij_java_field_annotation_wrap = split_into_lines
ij_java_finally_on_new_line = false
ij_java_for_brace_force = never
ij_java_for_statement_new_line_after_left_paren = false
ij_java_for_statement_right_paren_on_new_line = false
ij_java_for_statement_wrap = off
ij_java_generate_final_locals = false
ij_java_generate_final_parameters = false
ij_java_if_brace_force = never
ij_java_imports_layout = *, |, javax.**, java.**, |, $*
ij_java_indent_case_from_switch = true
ij_java_insert_inner_class_imports = false
ij_java_insert_override_annotation = true
ij_java_keep_blank_lines_before_right_brace = 0
ij_java_keep_blank_lines_between_package_declaration_and_header = 0
ij_java_keep_blank_lines_in_code = 1
ij_java_keep_blank_lines_in_declarations = 1
ij_java_keep_builder_methods_indents = false
ij_java_keep_control_statement_in_one_line = true
ij_java_keep_first_column_comment = true
ij_java_keep_indents_on_empty_lines = false
ij_java_keep_line_breaks = true
ij_java_keep_multiple_expressions_in_one_line = false
ij_java_keep_simple_blocks_in_one_line = false
ij_java_keep_simple_classes_in_one_line = true
ij_java_keep_simple_lambdas_in_one_line = true
ij_java_keep_simple_methods_in_one_line = true
ij_java_label_indent_absolute = false
ij_java_label_indent_size = 0
ij_java_lambda_brace_style = end_of_line
ij_java_layout_static_imports_separately = true
ij_java_line_comment_add_space = false
ij_java_line_comment_at_first_column = true
ij_java_method_annotation_wrap = split_into_lines
ij_java_method_brace_style = end_of_line
ij_java_method_call_chain_wrap = off
ij_java_method_parameters_new_line_after_left_paren = false
ij_java_method_parameters_right_paren_on_new_line = false
ij_java_method_parameters_wrap = off
ij_java_modifier_list_wrap = false
ij_java_names_count_to_use_import_on_demand = 9
ij_java_new_line_after_lparen_in_record_header = false
ij_java_packages_to_use_import_on_demand = _java.awt.*, _javax.swing.*
ij_java_parameter_annotation_wrap = off
ij_java_parentheses_expression_new_line_after_left_paren = false
ij_java_parentheses_expression_right_paren_on_new_line = false
ij_java_place_assignment_sign_on_next_line = false
ij_java_prefer_longer_names = true
ij_java_prefer_parameters_wrap = false
ij_java_record_components_wrap = normal
ij_java_repeat_synchronized = true
ij_java_replace_instanceof_and_cast = true
ij_java_replace_null_check = true
ij_java_replace_sum_lambda_with_method_ref = true
ij_java_resource_list_new_line_after_left_paren = false
ij_java_resource_list_right_paren_on_new_line = false
ij_java_resource_list_wrap = off
ij_java_rparen_on_new_line_in_record_header = false
ij_java_space_after_closing_angle_bracket_in_type_argument = false
ij_java_space_after_colon = true
ij_java_space_after_comma = true
ij_java_space_after_comma_in_type_arguments = true
ij_java_space_after_for_semicolon = true
ij_java_space_after_quest = true
ij_java_space_after_type_cast = true
ij_java_space_before_annotation_array_initializer_left_brace = false
ij_java_space_before_annotation_parameter_list = false
ij_java_space_before_array_initializer_left_brace = true
ij_java_space_before_catch_keyword = true
ij_java_space_before_catch_left_brace = true
ij_java_space_before_catch_parentheses = true
ij_java_space_before_class_left_brace = true
ij_java_space_before_colon = true
ij_java_space_before_colon_in_foreach = true
ij_java_space_before_comma = false
ij_java_space_before_do_left_brace = true
ij_java_space_before_else_keyword = true
ij_java_space_before_else_left_brace = true
ij_java_space_before_finally_keyword = true
ij_java_space_before_finally_left_brace = true
ij_java_space_before_for_left_brace = true
ij_java_space_before_for_parentheses = true
ij_java_space_before_for_semicolon = false
ij_java_space_before_if_left_brace = true
ij_java_space_before_if_parentheses = true
ij_java_space_before_method_call_parentheses = false
ij_java_space_before_method_left_brace = true
ij_java_space_before_method_parentheses = false
ij_java_space_before_opening_angle_bracket_in_type_parameter = false
ij_java_space_before_quest = true
ij_java_space_before_switch_left_brace = true
ij_java_space_before_switch_parentheses = true
ij_java_space_before_synchronized_left_brace = true
ij_java_space_before_synchronized_parentheses = true
ij_java_space_before_try_left_brace = true
ij_java_space_before_try_parentheses = true
ij_java_space_before_type_parameter_list = false
ij_java_space_before_while_keyword = true
ij_java_space_before_while_left_brace = true
ij_java_space_before_while_parentheses = true
ij_java_space_inside_one_line_enum_braces = false
ij_java_space_within_empty_array_initializer_braces = true
ij_java_space_within_empty_method_call_parentheses = false
ij_java_space_within_empty_method_parentheses = false
ij_java_spaces_around_additive_operators = true
ij_java_spaces_around_assignment_operators = true
ij_java_spaces_around_bitwise_operators = true
ij_java_spaces_around_equality_operators = true
ij_java_spaces_around_lambda_arrow = true
ij_java_spaces_around_logical_operators = true
ij_java_spaces_around_method_ref_dbl_colon = false
ij_java_spaces_around_multiplicative_operators = true
ij_java_spaces_around_relational_operators = true
ij_java_spaces_around_shift_operators = true
ij_java_spaces_around_type_bounds_in_type_parameters = true
ij_java_spaces_around_unary_operator = false
ij_java_spaces_within_angle_brackets = false
ij_java_spaces_within_annotation_parentheses = false
ij_java_spaces_within_array_initializer_braces = false
ij_java_spaces_within_braces = true
ij_java_spaces_within_brackets = false
ij_java_spaces_within_cast_parentheses = false
ij_java_spaces_within_catch_parentheses = false
ij_java_spaces_within_for_parentheses = false
ij_java_spaces_within_if_parentheses = false
ij_java_spaces_within_method_call_parentheses = false
ij_java_spaces_within_method_parentheses = false
ij_java_spaces_within_parentheses = false
ij_java_spaces_within_record_header = false
ij_java_spaces_within_switch_parentheses = false
ij_java_spaces_within_synchronized_parentheses = false
ij_java_spaces_within_try_parentheses = false
ij_java_spaces_within_while_parentheses = false
ij_java_special_else_if_treatment = true
ij_java_subclass_name_suffix = Impl
ij_java_ternary_operation_signs_on_next_line = false
ij_java_ternary_operation_wrap = off
ij_java_test_name_suffix = Test
ij_java_throws_keyword_wrap = off
ij_java_throws_list_wrap = off
ij_java_use_external_annotations = false
ij_java_use_fq_class_names = false
ij_java_use_relative_indents = false
ij_java_use_single_class_imports = true
ij_java_variable_annotation_wrap = off
ij_java_visibility = public
ij_java_while_brace_force = never
ij_java_while_on_new_line = false
ij_java_wrap_comments = false
ij_java_wrap_first_method_in_call_chain = false
ij_java_wrap_long_lines = false
[*.properties]
ij_properties_align_group_field_declarations = false
ij_properties_keep_blank_lines = false
ij_properties_key_value_delimiter = equals
ij_properties_spaces_around_key_value_delimiter = false
[.editorconfig]
ij_editorconfig_align_group_field_declarations = false
ij_editorconfig_space_after_colon = false
ij_editorconfig_space_after_comma = true
ij_editorconfig_space_before_colon = false
ij_editorconfig_space_before_comma = false
ij_editorconfig_spaces_around_assignment_operators = true
[{*.ant, *.fxml, *.jhm, *.jnlp, *.jrxml, *.pom, *.rng, *.tld, *.wsdl, *.xml, *.xsd, *.xsl, *.xslt, *.xul}]
ij_xml_align_attributes = true
ij_xml_align_text = false
ij_xml_attribute_wrap = normal
ij_xml_block_comment_at_first_column = true
ij_xml_keep_blank_lines = 2
ij_xml_keep_indents_on_empty_lines = false
ij_xml_keep_line_breaks = true
ij_xml_keep_line_breaks_in_text = true
ij_xml_keep_whitespaces = false
ij_xml_keep_whitespaces_around_cdata = preserve
ij_xml_keep_whitespaces_inside_cdata = false
ij_xml_line_comment_at_first_column = true
ij_xml_space_after_tag_name = false
ij_xml_space_around_equals_in_attribute = false
ij_xml_space_inside_empty_tag = false
ij_xml_text_wrap = normal
[{*.markdown, *.md}]
indent_size = 2
tab_width = 2
ij_markdown_force_one_space_after_blockquote_symbol = true
ij_markdown_force_one_space_after_header_symbol = true
ij_markdown_force_one_space_after_list_bullet = true
ij_markdown_force_one_space_between_words = true
ij_markdown_keep_indents_on_empty_lines = false
ij_markdown_max_lines_around_block_elements = 1
ij_markdown_max_lines_around_header = 1
ij_markdown_max_lines_between_paragraphs = 1
ij_markdown_min_lines_around_block_elements = 1
ij_markdown_min_lines_around_header = 1
ij_markdown_min_lines_between_paragraphs = 1
[{*.yaml, *.yml, *.lang}]
indent_size = 2
ij_yaml_align_values_properties = do_not_align
ij_yaml_autoinsert_sequence_marker = true
ij_yaml_block_mapping_on_new_line = false
ij_yaml_indent_sequence_value = true
ij_yaml_keep_indents_on_empty_lines = false
ij_yaml_keep_line_breaks = true
ij_yaml_sequence_on_new_line = false
ij_yaml_space_before_colon = false
ij_yaml_spaces_within_braces = true
ij_yaml_spaces_within_brackets = true

11
.gitignore vendored
View File

@ -1,5 +1,6 @@
out/ # JetBrains IDEs
.idea/ /.idea/
*.iml /*.iml
META-INF/
target/ # Maven
/target/

View File

@ -6,4 +6,4 @@ The same distribution rights and limitations above shall similarly apply to any
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

84
pom.xml
View File

@ -1,47 +1,48 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>EpicEnchants</artifactId> <artifactId>EpicEnchants</artifactId>
<modelVersion>4.0.0</modelVersion>
<version>1.1.11</version> <version>1.1.11</version>
<name>EpicEnchants</name>
<description>Unlock the potential of your weapons, tools and armor by making your own custom enchants.</description>
<url>https://songoda.com/marketplace/product/67</url>
<properties>
<java.version>1.8</java.version>
<java.release>8</java.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build> <build>
<defaultGoal>clean install</defaultGoal> <defaultGoal>clean install</defaultGoal>
<finalName>EpicEnchants-${project.version}</finalName> <finalName>EpicEnchants-${project.version}</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version> <version>3.8.1</version>
<configuration> <configuration>
<source>1.8</source> <source>${java.version}</source>
<target>1.8</target> <target>${java.version}</target>
</configuration>
</plugin> <!-- TODO: Requires jdk9+, prepare CI/CD before enabling this -->
<plugin> <!-- <release>${java.release}</release> -->
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>${project.build.directory}/classes/plugin.yml</file>
<replacements>
<replacement>
<token>maven-version-number</token>
<value>${project.version}</value>
</replacement>
</replacements>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>3.3.0-SNAPSHOT</version> <version>3.3.0-SNAPSHOT</version>
<executions> <executions>
<execution> <execution>
<id>shaded</id> <id>shaded</id>
@ -49,18 +50,22 @@
<goals> <goals>
<goal>shade</goal> <goal>shade</goal>
</goals> </goals>
<configuration> <configuration>
<minimizeJar>true</minimizeJar>
<shadedArtifactAttached>false</shadedArtifactAttached> <shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>false</createDependencyReducedPom> <createDependencyReducedPom>false</createDependencyReducedPom>
<artifactSet> <artifactSet>
<includes> <includes>
<include>com.songoda:SongodaCore</include> <include>com.songoda:SongodaCore</include>
<include>fr.mymicky:FastInv</include>
</includes> </includes>
</artifactSet> </artifactSet>
<filters> <filters>
<filter> <filter>
<artifact>*:*</artifact> <artifact>*:*</artifact>
<excludes> <excludes>
<exclude>META-INF/*.SF</exclude> <exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude> <exclude>META-INF/*.DSA</exclude>
@ -73,21 +78,31 @@
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build> </build>
<pluginRepositories> <pluginRepositories>
<pluginRepository> <pluginRepository>
<id>apache.snapshots</id> <id>apache.snapshots</id>
<url>https://repository.apache.org/snapshots/</url> <url>https://repository.apache.org/snapshots/</url>
</pluginRepository> </pluginRepository>
</pluginRepositories> </pluginRepositories>
<repositories> <repositories>
<repository> <repository>
<id>public</id> <id>songoda-public</id>
<url>https://repo.songoda.com/repository/public/</url> <url>https://repo.songoda.com/repository/public/</url>
</repository> </repository>
<repository> <repository>
<id>jitpack.io</id> <id>jitpack.io</id>
<url>https://jitpack.io</url> <url>https://jitpack.io/</url>
</repository> </repository>
</repositories> </repositories>
@ -98,24 +113,21 @@
<version>1.17</version> <version>1.17</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>fr.mrmicky</groupId>
<artifactId>FastInv</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore</artifactId> <artifactId>SongodaCore</artifactId>
<version>LATEST</version> <version>LATEST</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>UltimateBottles</artifactId> <artifactId>UltimateBottles</artifactId>
<version>1_0</version> <version>1_0</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>me.clip</groupId> <groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId> <artifactId>placeholderapi</artifactId>

View File

@ -7,7 +7,17 @@ import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.configuration.Config; import com.songoda.core.configuration.Config;
import com.songoda.core.gui.GuiManager; import com.songoda.core.gui.GuiManager;
import com.songoda.core.hooks.EconomyManager; import com.songoda.core.hooks.EconomyManager;
import com.songoda.epicenchants.commands.*; import com.songoda.epicenchants.commands.CommandAlchemist;
import com.songoda.epicenchants.commands.CommandApply;
import com.songoda.epicenchants.commands.CommandEnchanter;
import com.songoda.epicenchants.commands.CommandGiveBook;
import com.songoda.epicenchants.commands.CommandGiveItemDust;
import com.songoda.epicenchants.commands.CommandGiveRandomBook;
import com.songoda.epicenchants.commands.CommandGiveScroll;
import com.songoda.epicenchants.commands.CommandList;
import com.songoda.epicenchants.commands.CommandReload;
import com.songoda.epicenchants.commands.CommandSettings;
import com.songoda.epicenchants.commands.CommandTinkerer;
import com.songoda.epicenchants.listeners.ArmorListener; import com.songoda.epicenchants.listeners.ArmorListener;
import com.songoda.epicenchants.listeners.EntityListener; import com.songoda.epicenchants.listeners.EntityListener;
import com.songoda.epicenchants.listeners.HeldItemListener; import com.songoda.epicenchants.listeners.HeldItemListener;
@ -16,7 +26,11 @@ import com.songoda.epicenchants.listeners.item.BlackScrollListener;
import com.songoda.epicenchants.listeners.item.BookListener; import com.songoda.epicenchants.listeners.item.BookListener;
import com.songoda.epicenchants.listeners.item.DustListener; import com.songoda.epicenchants.listeners.item.DustListener;
import com.songoda.epicenchants.listeners.item.WhiteScrollListener; import com.songoda.epicenchants.listeners.item.WhiteScrollListener;
import com.songoda.epicenchants.managers.*; import com.songoda.epicenchants.managers.EnchantManager;
import com.songoda.epicenchants.managers.FileManager;
import com.songoda.epicenchants.managers.GroupManager;
import com.songoda.epicenchants.managers.HookManager;
import com.songoda.epicenchants.managers.InfoManager;
import com.songoda.epicenchants.objects.Enchant; import com.songoda.epicenchants.objects.Enchant;
import com.songoda.epicenchants.utils.EnchantUtils; import com.songoda.epicenchants.utils.EnchantUtils;
import com.songoda.epicenchants.utils.SpecialItems; import com.songoda.epicenchants.utils.SpecialItems;

View File

@ -17,10 +17,9 @@ public class CommandAlchemist extends AbstractCommand {
this.plugin = plugin; this.plugin = plugin;
} }
@Override @Override
protected ReturnType runCommand(CommandSender sender, String... args) { protected ReturnType runCommand(CommandSender sender, String... args) {
Player player = (Player)sender; Player player = (Player) sender;
new AlchemistMenu(plugin, plugin.getFileManager().getConfiguration("menus/alchemist-menu")).open(player); new AlchemistMenu(plugin, plugin.getFileManager().getConfiguration("menus/alchemist-menu")).open(player);
return ReturnType.SUCCESS; return ReturnType.SUCCESS;
} }

View File

@ -98,13 +98,13 @@ public class CommandApply extends AbstractCommand {
.stream().findFirst().orElse(null); .stream().findFirst().orElse(null);
List<String> levels = new ArrayList<>(); List<String> levels = new ArrayList<>();
if (enchant != null) { if (enchant != null) {
for (int i = 1; i <= enchant.getMaxLevel(); i ++) for (int i = 1; i <= enchant.getMaxLevel(); i++)
levels.add(String.valueOf(i)); levels.add(String.valueOf(i));
} }
return levels; return levels;
} else if (args.length == 3 || args.length == 4) { } else if (args.length == 3 || args.length == 4) {
List<String> rates = new ArrayList<>(); List<String> rates = new ArrayList<>();
for (int i = 1; i <= 100; i ++) for (int i = 1; i <= 100; i++)
rates.add(String.valueOf(i)); rates.add(String.valueOf(i));
return rates; return rates;
} }

View File

@ -19,7 +19,7 @@ public class CommandEnchanter extends AbstractCommand {
@Override @Override
protected ReturnType runCommand(CommandSender sender, String... args) { protected ReturnType runCommand(CommandSender sender, String... args) {
Player player = (Player)sender; Player player = (Player) sender;
new EnchanterMenu(plugin, plugin.getFileManager().getConfiguration("menus/enchanter-menu"), player).open(player); new EnchanterMenu(plugin, plugin.getFileManager().getConfiguration("menus/enchanter-menu"), player).open(player);
return ReturnType.SUCCESS; return ReturnType.SUCCESS;
} }

View File

@ -95,16 +95,16 @@ public class CommandGiveBook extends AbstractCommand {
} else if (args.length == 3) { } else if (args.length == 3) {
Enchant enchant = plugin.getEnchantManager().getValues() Enchant enchant = plugin.getEnchantManager().getValues()
.stream().findFirst().orElse(null); .stream().findFirst().orElse(null);
List<String> levels = new ArrayList<>(); List<String> levels = new ArrayList<>();
if (enchant != null) { if (enchant != null) {
for (int i = 1; i <= enchant.getMaxLevel(); i ++) for (int i = 1; i <= enchant.getMaxLevel(); i++)
levels.add(String.valueOf(i)); levels.add(String.valueOf(i));
} }
return levels; return levels;
} else if (args.length == 4 || args.length == 5) { } else if (args.length == 4 || args.length == 5) {
List<String> rates = new ArrayList<>(); List<String> rates = new ArrayList<>();
for (int i = 1; i <= 100; i ++) for (int i = 1; i <= 100; i++)
rates.add(String.valueOf(i)); rates.add(String.valueOf(i));
return rates; return rates;
} }
return null; return null;

View File

@ -85,7 +85,7 @@ public class CommandGiveItemDust extends AbstractCommand {
return dusts; return dusts;
} else if (args.length == 4) { } else if (args.length == 4) {
List<String> rates = new ArrayList<>(); List<String> rates = new ArrayList<>();
for (int i = 1; i <= 100; i ++) for (int i = 1; i <= 100; i++)
rates.add(String.valueOf(i)); rates.add(String.valueOf(i));
return rates; return rates;
} }

View File

@ -33,7 +33,6 @@ public class CommandGiveRandomBook extends AbstractCommand {
return ReturnType.FAILURE; return ReturnType.FAILURE;
} }
List<Group> groups = plugin.getGroupManager().getValues().stream() List<Group> groups = plugin.getGroupManager().getValues().stream()
.filter(group -> group.getIdentifier().equalsIgnoreCase(args[1])).collect(Collectors.toList()); .filter(group -> group.getIdentifier().equalsIgnoreCase(args[1])).collect(Collectors.toList());

View File

@ -39,11 +39,10 @@ public class CommandGiveScroll extends AbstractCommand {
int amount = 1; int amount = 1;
int successRate = -1; int successRate = -1;
if (args.length > 2) { if (args.length > 2) {
if (!CommandCommons.isInt(args[2], sender)) if (!CommandCommons.isInt(args[2], sender))
return ReturnType.FAILURE; return ReturnType.FAILURE;
amount = Integer.parseInt(args[2]); amount = Integer.parseInt(args[2]);
} }
if (args.length > 3) { if (args.length > 3) {
@ -85,7 +84,7 @@ public class CommandGiveScroll extends AbstractCommand {
return Bukkit.getOnlinePlayers().stream().map(Player::getName).collect(Collectors.toList()); return Bukkit.getOnlinePlayers().stream().map(Player::getName).collect(Collectors.toList());
} else if (args.length == 3 || args.length == 4) { } else if (args.length == 3 || args.length == 4) {
List<String> rates = new ArrayList<>(); List<String> rates = new ArrayList<>();
for (int i = 1; i <= (args.length == 3 ? 10 : 100); i ++) for (int i = 1; i <= (args.length == 3 ? 10 : 100); i++)
rates.add(String.valueOf(i)); rates.add(String.valueOf(i));
return rates; return rates;
} }

View File

@ -22,12 +22,12 @@ public class CommandList extends AbstractCommand {
protected ReturnType runCommand(CommandSender sender, String... args) { protected ReturnType runCommand(CommandSender sender, String... args) {
if (args.length > 1 && args[1].equalsIgnoreCase("chat")) { if (args.length > 1 && args[1].equalsIgnoreCase("chat")) {
plugin.getLocale().newMessage(plugin.getEnchantManager().getValues().stream() plugin.getLocale().newMessage(plugin.getEnchantManager().getValues().stream()
.sorted(Comparator.comparing(enchant -> enchant.getGroup().getOrder())) .sorted(Comparator.comparing(enchant -> enchant.getGroup().getOrder()))
.map(enchant -> enchant.getColoredIdentifier(true)).collect(Collectors.joining("&7, "))) .map(enchant -> enchant.getColoredIdentifier(true)).collect(Collectors.joining("&7, ")))
.sendPrefixedMessage(sender); .sendPrefixedMessage(sender);
return ReturnType.SUCCESS; return ReturnType.SUCCESS;
} }
plugin.getInfoManager().getMainInfoMenu().open((Player)sender); plugin.getInfoManager().getMainInfoMenu().open((Player) sender);
return ReturnType.SUCCESS; return ReturnType.SUCCESS;
} }

View File

@ -19,7 +19,7 @@ public class CommandTinkerer extends AbstractCommand {
@Override @Override
protected ReturnType runCommand(CommandSender sender, String... args) { protected ReturnType runCommand(CommandSender sender, String... args) {
Player player = (Player)sender; Player player = (Player) sender;
new TinkererMenu(plugin, plugin.getFileManager().getConfiguration("menus/tinkerer-menu")).open(player); new TinkererMenu(plugin, plugin.getFileManager().getConfiguration("menus/tinkerer-menu")).open(player);
return ReturnType.SUCCESS; return ReturnType.SUCCESS;
} }

View File

@ -19,5 +19,4 @@ public class Fly extends EffectExecutor {
user.setAllowFlight(eventType == ON); user.setAllowFlight(eventType == ON);
user.setFlying(eventType == ON); user.setFlying(eventType == ON);
} }
} }

View File

@ -44,5 +44,4 @@ public class Potion extends EffectExecutor {
consume(entity -> entity.addPotionEffect(new PotionEffect(effectType, (int) duration.get(level, 60, user, opponent) * 20, consume(entity -> entity.addPotionEffect(new PotionEffect(effectType, (int) duration.get(level, 60, user, opponent) * 20,
(int) amplifier.get(level - 1, 0, user, opponent), false, false)), user, opponent); (int) amplifier.get(level - 1, 0, user, opponent), false, false)), user, opponent);
} }
} }

View File

@ -1,10 +1,8 @@
package com.songoda.epicenchants.effect.effects; package com.songoda.epicenchants.effect.effects;
import com.songoda.core.nms.NmsManager;
import com.songoda.epicenchants.effect.EffectExecutor; import com.songoda.epicenchants.effect.EffectExecutor;
import com.songoda.epicenchants.enums.EventType; import com.songoda.epicenchants.enums.EventType;
import com.songoda.epicenchants.objects.LeveledModifier; import com.songoda.epicenchants.objects.LeveledModifier;
import com.songoda.core.nms.nbt.NBTEntity;
import com.songoda.epicenchants.utils.objects.ItemBuilder; import com.songoda.epicenchants.utils.objects.ItemBuilder;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.attribute.Attribute; import org.bukkit.attribute.Attribute;

View File

@ -2,7 +2,6 @@ package com.songoda.epicenchants.effect.effects;
import com.songoda.epicenchants.effect.EffectExecutor; import com.songoda.epicenchants.effect.EffectExecutor;
import com.songoda.epicenchants.enums.EventType; import com.songoda.epicenchants.enums.EventType;
import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -15,7 +14,7 @@ public class StealFood extends EffectExecutor {
@Override @Override
public void execute(@NotNull Player user, LivingEntity opponent, int level, EventType eventType) { public void execute(@NotNull Player user, LivingEntity opponent, int level, EventType eventType) {
int amount = (int)Math.floor(getAmount().get(level, 0, user, opponent)); int amount = (int) Math.floor(getAmount().get(level, 0, user, opponent));
if (!(opponent instanceof Player)) { if (!(opponent instanceof Player)) {
return; return;

View File

@ -150,6 +150,7 @@ public final class ArmorEquipEvent extends PlayerEvent implements Cancellable {
* Attempts to match the ArmorType for the specified ItemStack. * Attempts to match the ArmorType for the specified ItemStack.
* *
* @param itemStack The ItemStack to parse the type of. * @param itemStack The ItemStack to parse the type of.
*
* @return The parsed ArmorType. (null if none were found.) * @return The parsed ArmorType. (null if none were found.)
*/ */
public static ArmorType matchType(final ItemStack itemStack) { public static ArmorType matchType(final ItemStack itemStack) {

View File

@ -17,7 +17,7 @@ public final class HeldItemChangedEvent extends PlayerEvent implements Cancellab
/** /**
* Constructor for the HeldItemChangedEvent. * Constructor for the HeldItemChangedEvent.
* *
* @param player The player who put (un)equipped an item. * @param player The player who put (un)equipped an item.
* @param oldItem The ItemStack removed. * @param oldItem The ItemStack removed.
* @param newItem The ItemStack added. * @param newItem The ItemStack added.
*/ */
@ -116,11 +116,11 @@ public final class HeldItemChangedEvent extends PlayerEvent implements Cancellab
*/ */
DEATH, DEATH,
/** /**
* When an item is picked up into the selected hotbar slot by the player * When an item is picked up into the selected hotbar slot by the player
*/ */
DROP_ITEM, DROP_ITEM,
/** /**
* When an item is dropped from the selected hotbar slot by the player * When an item is dropped from the selected hotbar slot by the player
*/ */
PICKUP_ITEM, PICKUP_ITEM,
; ;

View File

@ -11,7 +11,11 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.block.Action; import org.bukkit.event.block.Action;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.*; import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.inventory.InventoryType.SlotType; import org.bukkit.event.inventory.InventoryType.SlotType;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerItemBreakEvent; import org.bukkit.event.player.PlayerItemBreakEvent;

View File

@ -57,7 +57,6 @@ public class EntityListener implements Listener {
} }
} }
//Player got hit //Player got hit
if (event.getEntity() instanceof Player) { if (event.getEntity() instanceof Player) {
Player defender = (Player) event.getEntity(); Player defender = (Player) event.getEntity();

View File

@ -1,14 +1,8 @@
package com.songoda.epicenchants.listeners; package com.songoda.epicenchants.listeners;
import static com.songoda.epicenchants.enums.EventType.OFF;
import static com.songoda.epicenchants.enums.EventType.ON;
import static com.songoda.epicenchants.enums.TriggerType.HELD_ITEM;
import com.songoda.epicenchants.events.ArmorEquipEvent; import com.songoda.epicenchants.events.ArmorEquipEvent;
import com.songoda.epicenchants.events.HeldItemChangedEvent.EquipMethod;
import com.songoda.epicenchants.events.HeldItemChangedEvent; import com.songoda.epicenchants.events.HeldItemChangedEvent;
import java.util.Arrays; import com.songoda.epicenchants.events.HeldItemChangedEvent.EquipMethod;
import java.util.OptionalInt;
import java.util.stream.IntStream;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -17,7 +11,11 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.*; import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.inventory.InventoryType.SlotType; import org.bukkit.event.inventory.InventoryType.SlotType;
import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerItemBreakEvent; import org.bukkit.event.player.PlayerItemBreakEvent;
@ -25,6 +23,10 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory; import org.bukkit.inventory.PlayerInventory;
import java.util.Arrays;
import java.util.OptionalInt;
import java.util.stream.IntStream;
public class HeldItemListener implements Listener { public class HeldItemListener implements Listener {
private static final boolean SWAP_OFFHAND_SUPPORTED = Arrays.stream(ClickType.values()).anyMatch(e -> e.name().equals("SWAP_OFFHAND")); private static final boolean SWAP_OFFHAND_SUPPORTED = Arrays.stream(ClickType.values()).anyMatch(e -> e.name().equals("SWAP_OFFHAND"));
@ -117,21 +119,21 @@ public class HeldItemListener implements Listener {
EquipMethod method; EquipMethod method;
if (numberKey) { if (numberKey) {
if (!(e.getClickedInventory() instanceof PlayerInventory) if (!(e.getClickedInventory() instanceof PlayerInventory)
|| e.getHotbarButton() != heldslot) //we only care about heldslot || e.getHotbarButton() != heldslot) //we only care about heldslot
return; return;
method = EquipMethod.HOTBAR_SWAP; method = EquipMethod.HOTBAR_SWAP;
newItem = e.getCurrentItem(); newItem = e.getCurrentItem();
oldItem = e.getClickedInventory().getItem(e.getHotbarButton()); oldItem = e.getClickedInventory().getItem(e.getHotbarButton());
} else if (swapoffhand) { } else if (swapoffhand) {
if (!(e.getClickedInventory() instanceof PlayerInventory) if (!(e.getClickedInventory() instanceof PlayerInventory)
|| e.getSlot() != heldslot) //we only care about heldslot || e.getSlot() != heldslot) //we only care about heldslot
return; return;
method = EquipMethod.OFFHAND_SWAP; method = EquipMethod.OFFHAND_SWAP;
newItem = e.getClickedInventory().getItem(40); newItem = e.getClickedInventory().getItem(40);
oldItem = e.getCurrentItem(); oldItem = e.getCurrentItem();
} else { } else {
if (!(e.getClickedInventory() instanceof PlayerInventory) if (!(e.getClickedInventory() instanceof PlayerInventory)
|| e.getSlot() != heldslot) //we only care about heldslot || e.getSlot() != heldslot) //we only care about heldslot
return; return;
method = EquipMethod.PICK_DROP; method = EquipMethod.PICK_DROP;
} }
@ -147,7 +149,7 @@ public class HeldItemListener implements Listener {
public void inventoryDrag(InventoryDragEvent event) { public void inventoryDrag(InventoryDragEvent event) {
if (event.getRawSlots().isEmpty()) if (event.getRawSlots().isEmpty())
return; return;
int rawslot = event.getRawSlots().stream().findFirst().orElse(0); int rawslot = event.getRawSlots().stream().findFirst().orElse(0);
int invslot = event.getView().convertSlot(rawslot); int invslot = event.getView().convertSlot(rawslot);
boolean bottominventory = rawslot != invslot; boolean bottominventory = rawslot != invslot;
@ -208,7 +210,7 @@ public class HeldItemListener implements Listener {
if (event.getItem().getItemStack().getMaxStackSize() == 1) { //tools maxStackSize is 1, ignore other items if (event.getItem().getItemStack().getMaxStackSize() == 1) { //tools maxStackSize is 1, ignore other items
int firstEmpty = event.getPlayer().getInventory().firstEmpty(); int firstEmpty = event.getPlayer().getInventory().firstEmpty();
if (0 <= firstEmpty && firstEmpty <= 8 if (0 <= firstEmpty && firstEmpty <= 8
&& event.getPlayer().getInventory().getHeldItemSlot() == firstEmpty) && event.getPlayer().getInventory().getHeldItemSlot() == firstEmpty)
Bukkit.getServer().getPluginManager().callEvent(new HeldItemChangedEvent(event.getPlayer(), EquipMethod.PICKUP_ITEM, null, event.getItem().getItemStack())); Bukkit.getServer().getPluginManager().callEvent(new HeldItemChangedEvent(event.getPlayer(), EquipMethod.PICKUP_ITEM, null, event.getItem().getItemStack()));
} }
} }

View File

@ -2,7 +2,9 @@ package com.songoda.epicenchants.listeners;
import com.songoda.epicenchants.EpicEnchants; import com.songoda.epicenchants.EpicEnchants;
import com.songoda.epicenchants.events.ArmorEquipEvent; import com.songoda.epicenchants.events.ArmorEquipEvent;
import com.songoda.epicenchants.events.HeldItemChangedEvent;
import com.songoda.epicenchants.objects.Enchant; import com.songoda.epicenchants.objects.Enchant;
import org.bukkit.Material;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
@ -12,6 +14,7 @@ import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerItemHeldEvent; import org.bukkit.event.player.PlayerItemHeldEvent;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.inventory.ItemStack;
import java.util.Arrays; import java.util.Arrays;
import java.util.Map; import java.util.Map;
@ -19,9 +22,6 @@ import java.util.Map;
import static com.songoda.epicenchants.enums.EventType.OFF; import static com.songoda.epicenchants.enums.EventType.OFF;
import static com.songoda.epicenchants.enums.EventType.ON; import static com.songoda.epicenchants.enums.EventType.ON;
import static com.songoda.epicenchants.enums.TriggerType.*; import static com.songoda.epicenchants.enums.TriggerType.*;
import com.songoda.epicenchants.events.HeldItemChangedEvent;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
public class PlayerListener implements Listener { public class PlayerListener implements Listener {
private final EpicEnchants instance; private final EpicEnchants instance;
@ -38,7 +38,7 @@ public class PlayerListener implements Listener {
oldArmorMap.forEach((enchant, level) -> enchant.onAction(event.getPlayer(), null, event, level, STATIC_EFFECT, OFF)); oldArmorMap.forEach((enchant, level) -> enchant.onAction(event.getPlayer(), null, event, level, STATIC_EFFECT, OFF));
newArmorMap.forEach((enchant, level) -> enchant.onAction(event.getPlayer(), null, event, level, STATIC_EFFECT, ON)); newArmorMap.forEach((enchant, level) -> enchant.onAction(event.getPlayer(), null, event, level, STATIC_EFFECT, ON));
} }
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onHeldItemChanged(HeldItemChangedEvent event) { public void onHeldItemChanged(HeldItemChangedEvent event) {
Map<Enchant, Integer> oldItemMap = instance.getEnchantUtils().getEnchants(event.getOldItem()); Map<Enchant, Integer> oldItemMap = instance.getEnchantUtils().getEnchants(event.getOldItem());

View File

@ -1,7 +1,7 @@
package com.songoda.epicenchants.listeners.item; package com.songoda.epicenchants.listeners.item;
import com.songoda.core.nms.nbt.NBTItem;
import com.songoda.core.compatibility.CompatibleMaterial; import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.nms.nbt.NBTItem;
import com.songoda.epicenchants.EpicEnchants; import com.songoda.epicenchants.EpicEnchants;
import com.songoda.epicenchants.enums.EnchantResult; import com.songoda.epicenchants.enums.EnchantResult;
import com.songoda.epicenchants.events.EnchantApplyEvent; import com.songoda.epicenchants.events.EnchantApplyEvent;

View File

@ -1,7 +1,6 @@
package com.songoda.epicenchants.listeners.item; package com.songoda.epicenchants.listeners.item;
import com.songoda.core.compatibility.CompatibleMaterial; import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.nms.nbt.NBTCompound;
import com.songoda.core.nms.nbt.NBTItem; import com.songoda.core.nms.nbt.NBTItem;
import com.songoda.epicenchants.EpicEnchants; import com.songoda.epicenchants.EpicEnchants;
import com.songoda.epicenchants.utils.objects.ItemBuilder; import com.songoda.epicenchants.utils.objects.ItemBuilder;

View File

@ -14,7 +14,11 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.nio.file.Files; import java.nio.file.Files;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Optional;
import static com.songoda.epicenchants.utils.objects.FileLocation.of; import static com.songoda.epicenchants.utils.objects.FileLocation.of;
import static java.io.File.separator; import static java.io.File.separator;

View File

@ -15,5 +15,4 @@ public class HookManager {
public Optional<UltimateBottles> getUltimateBottles() { public Optional<UltimateBottles> getUltimateBottles() {
return Optional.ofNullable(ultimateBottles); return Optional.ofNullable(ultimateBottles);
} }
} }

View File

@ -2,7 +2,11 @@ package com.songoda.epicenchants.managers;
import com.songoda.epicenchants.EpicEnchants; import com.songoda.epicenchants.EpicEnchants;
import java.util.*; import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
public abstract class Manager<K, V> { public abstract class Manager<K, V> {
@ -41,5 +45,4 @@ public abstract class Manager<K, V> {
public void clear() { public void clear() {
map.clear(); map.clear();
} }
} }

View File

@ -213,7 +213,7 @@ public class AlchemistMenu extends FastInv {
int leftDestroy = leftItem.getNBTObject("destroy-rate").asInt(); int leftDestroy = leftItem.getNBTObject("destroy-rate").asInt();
int rightDestroy = rightItem.getNBTObject("destroy-rate").asInt(); int rightDestroy = rightItem.getNBTObject("destroy-rate").asInt();
Placeholder[] placeholders = new Placeholder[]{ Placeholder[] placeholders = new Placeholder[] {
of("left_success_rate", leftSuccess), of("left_success_rate", leftSuccess),
of("right_success_rate", rightSuccess), of("right_success_rate", rightSuccess),
of("left_destroy_rate", leftDestroy), of("left_destroy_rate", leftDestroy),
@ -227,7 +227,7 @@ public class AlchemistMenu extends FastInv {
int successRate = getFromFormula("book.success-rate-formula", placeholders); int successRate = getFromFormula("book.success-rate-formula", placeholders);
int destroyRate = getFromFormula("book.destroy-rate-formula", placeholders); int destroyRate = getFromFormula("book.destroy-rate-formula", placeholders);
Placeholder[] costPlaceholders = new Placeholder[]{ Placeholder[] costPlaceholders = new Placeholder[] {
of("group_order_index", enchant.getGroup().getOrder()), of("group_order_index", enchant.getGroup().getOrder()),
of("final_success_rate", successRate), of("final_success_rate", successRate),
of("final_destroy_rate", destroyRate), of("final_destroy_rate", destroyRate),
@ -240,14 +240,14 @@ public class AlchemistMenu extends FastInv {
} else { } else {
Group group = instance.getGroupManager().getValue(leftItem.getNBTObject("group").asString()).orElseThrow(() -> new IllegalStateException("Dust without group!")); Group group = instance.getGroupManager().getValue(leftItem.getNBTObject("group").asString()).orElseThrow(() -> new IllegalStateException("Dust without group!"));
Placeholder[] placeholders = new Placeholder[]{ Placeholder[] placeholders = new Placeholder[] {
of("left_percentage", leftItem.getNBTObject("percentage").asInt()), of("left_percentage", leftItem.getNBTObject("percentage").asInt()),
of("right_percentage", rightItem.getNBTObject("percentage").asInt()) of("right_percentage", rightItem.getNBTObject("percentage").asInt())
}; };
int successRate = getFromFormula("dust.percentage-formula", placeholders); int successRate = getFromFormula("dust.percentage-formula", placeholders);
Placeholder[] costPlaceholders = new Placeholder[]{ Placeholder[] costPlaceholders = new Placeholder[] {
of("group_order_index", group.getOrder()), of("group_order_index", group.getOrder()),
of("final_success_rate", successRate), of("final_success_rate", successRate),
}; };
@ -294,4 +294,4 @@ public class AlchemistMenu extends FastInv {
return (int) Double.parseDouble(GeneralUtils.parseJS(toTest, "alchemist expression", 0).toString()); return (int) Double.parseDouble(GeneralUtils.parseJS(toTest, "alchemist expression", 0).toString());
} }
} }

View File

@ -14,8 +14,10 @@ import java.util.Map;
import java.util.UUID; import java.util.UUID;
import static com.songoda.epicenchants.objects.Placeholder.of; import static com.songoda.epicenchants.objects.Placeholder.of;
import static com.songoda.epicenchants.utils.single.Experience.*; import static com.songoda.epicenchants.utils.single.Experience.changeExp;
import static com.songoda.epicenchants.utils.single.GeneralUtils.*; import static com.songoda.epicenchants.utils.single.Experience.getExp;
import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
import static com.songoda.epicenchants.utils.single.GeneralUtils.getSlots;
public class EnchanterMenu extends FastInv { public class EnchanterMenu extends FastInv {
private final Map<UUID, Long> DELAY = new HashMap<>(); private final Map<UUID, Long> DELAY = new HashMap<>();

View File

@ -1,6 +1,5 @@
package com.songoda.epicenchants.menus; package com.songoda.epicenchants.menus;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.epicenchants.EpicEnchants; import com.songoda.epicenchants.EpicEnchants;
import com.songoda.epicenchants.objects.Enchant; import com.songoda.epicenchants.objects.Enchant;
import com.songoda.epicenchants.objects.Group; import com.songoda.epicenchants.objects.Group;
@ -15,7 +14,8 @@ import java.util.stream.Collectors;
import java.util.stream.IntStream; import java.util.stream.IntStream;
import static com.songoda.epicenchants.objects.Placeholder.of; import static com.songoda.epicenchants.objects.Placeholder.of;
import static com.songoda.epicenchants.utils.single.GeneralUtils.*; import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
import static com.songoda.epicenchants.utils.single.GeneralUtils.getSlots;
import static java.util.Arrays.stream; import static java.util.Arrays.stream;
public class InfoMenu extends FastInv { public class InfoMenu extends FastInv {
@ -44,7 +44,6 @@ public class InfoMenu extends FastInv {
} }
})); }));
Iterator<Enchant> enchantIterator = instance.getEnchantManager().getEnchants(group).iterator(); Iterator<Enchant> enchantIterator = instance.getEnchantManager().getEnchants(group).iterator();
slots.stream().filter(slot -> enchantIterator.hasNext()).forEach(slot -> { slots.stream().filter(slot -> enchantIterator.hasNext()).forEach(slot -> {
Enchant enchant = enchantIterator.next(); Enchant enchant = enchantIterator.next();

View File

@ -7,9 +7,8 @@ import com.songoda.epicenchants.utils.objects.ItemBuilder;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import java.util.Optional; import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
import static com.songoda.epicenchants.utils.single.GeneralUtils.getSlots;
import static com.songoda.epicenchants.utils.single.GeneralUtils.*;
public class MainInfoMenu extends FastInv implements Listener { public class MainInfoMenu extends FastInv implements Listener {
@ -26,6 +25,4 @@ public class MainInfoMenu extends FastInv implements Listener {
instance.getInfoManager().getMenu(group).ifPresent(menu -> menu.open(event.getPlayer())); instance.getInfoManager().getMenu(group).ifPresent(menu -> menu.open(event.getPlayer()));
})); }));
} }
} }

View File

@ -153,7 +153,6 @@ public class TinkererMenu extends FastInv {
} }
}); });
// Player closed inventory // Player closed inventory
onClose(event -> { onClose(event -> {
slotMap.keySet().stream().filter(s -> getInventory().getItem(s) != null).forEach(s -> { slotMap.keySet().stream().filter(s -> getInventory().getItem(s) != null).forEach(s -> {

View File

@ -1,6 +1,5 @@
package com.songoda.epicenchants.objects; package com.songoda.epicenchants.objects;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.nms.nbt.NBTItem; import com.songoda.core.nms.nbt.NBTItem;
import com.songoda.epicenchants.EpicEnchants; import com.songoda.epicenchants.EpicEnchants;
import com.songoda.epicenchants.utils.objects.ItemBuilder; import com.songoda.epicenchants.utils.objects.ItemBuilder;
@ -128,5 +127,4 @@ public class BookItem {
return "BookItem.BookItemBuilder(instance=" + this.instance + ", material=" + this.material + ", displayName=" + this.displayName + ", lore=" + this.lore + ")"; return "BookItem.BookItemBuilder(instance=" + this.instance + ", material=" + this.material + ", displayName=" + this.displayName + ", lore=" + this.lore + ")";
} }
} }
} }

View File

@ -5,7 +5,6 @@ import com.songoda.epicenchants.effect.EffectExecutor;
import com.songoda.epicenchants.enums.EventType; import com.songoda.epicenchants.enums.EventType;
import com.songoda.epicenchants.enums.TriggerType; import com.songoda.epicenchants.enums.TriggerType;
import com.songoda.epicenchants.utils.single.RomanNumber; import com.songoda.epicenchants.utils.single.RomanNumber;
import org.bukkit.Material;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Event; import org.bukkit.event.Event;

View File

@ -56,7 +56,6 @@ public class SpecialItems {
return nbtItem.finish(); return nbtItem.finish();
} }
public ItemStack getSecretDust(NBTItem book) { public ItemStack getSecretDust(NBTItem book) {
Group group = instance.getEnchantManager().getValueUnsafe(book.getNBTObject("enchant").asString()).getGroup(); Group group = instance.getEnchantManager().getValueUnsafe(book.getNBTObject("enchant").asString()).getGroup();
return getSecretDust(group, (int) Math.floor(book.getNBTObject("success-rate").asInt() / 10.0)); return getSecretDust(group, (int) Math.floor(book.getNBTObject("success-rate").asInt() / 10.0));

View File

@ -4,7 +4,11 @@ import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.inventory.*; import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.server.PluginDisableEvent; import org.bukkit.event.server.PluginDisableEvent;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.InventoryHolder;
@ -12,7 +16,10 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitTask; import org.bukkit.scheduler.BukkitTask;
import java.util.*; import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/** /**
* A fast API to easily create advanced GUI. * A fast API to easily create advanced GUI.
@ -125,6 +132,7 @@ public class FastInv implements InventoryHolder {
* Add an {@link ItemStack} to the menus. * Add an {@link ItemStack} to the menus.
* *
* @param item The item to add * @param item The item to add
*
* @return This FastInv instance, for chaining. * @return This FastInv instance, for chaining.
*/ */
public FastInv addItem(ItemStack item) { public FastInv addItem(ItemStack item) {
@ -136,6 +144,7 @@ public class FastInv implements InventoryHolder {
* *
* @param item The item to add. * @param item The item to add.
* @param listener The {@link FastInvClickListener} for the item. * @param listener The {@link FastInvClickListener} for the item.
*
* @return This FastInv instance, for chaining. * @return This FastInv instance, for chaining.
*/ */
public FastInv addItem(ItemStack item, FastInvClickListener listener) { public FastInv addItem(ItemStack item, FastInvClickListener listener) {
@ -153,6 +162,7 @@ public class FastInv implements InventoryHolder {
* *
* @param slot The slot of the item. * @param slot The slot of the item.
* @param item The item to add. * @param item The item to add.
*
* @return This FastInv instance, for chaining. * @return This FastInv instance, for chaining.
*/ */
public FastInv addItem(int slot, ItemStack item) { public FastInv addItem(int slot, ItemStack item) {
@ -165,6 +175,7 @@ public class FastInv implements InventoryHolder {
* @param slot The slot of the item. * @param slot The slot of the item.
* @param item The item to add. * @param item The item to add.
* @param listener The FastInvClickListener for the item. * @param listener The FastInvClickListener for the item.
*
* @return This FastInv instance, for chaining. * @return This FastInv instance, for chaining.
*/ */
public FastInv addItem(int slot, ItemStack item, FastInvClickListener listener) { public FastInv addItem(int slot, ItemStack item, FastInvClickListener listener) {
@ -187,6 +198,7 @@ public class FastInv implements InventoryHolder {
* @param slotFrom Starting slot to put the item in. * @param slotFrom Starting slot to put the item in.
* @param slotTo Ending slot to put the item in. * @param slotTo Ending slot to put the item in.
* @param item The item to add. * @param item The item to add.
*
* @return This FastInv instance, for chaining. * @return This FastInv instance, for chaining.
*/ */
public FastInv addItem(int slotFrom, int slotTo, ItemStack item) { public FastInv addItem(int slotFrom, int slotTo, ItemStack item) {
@ -200,6 +212,7 @@ public class FastInv implements InventoryHolder {
* @param slotTo Ending slot to put the item in. * @param slotTo Ending slot to put the item in.
* @param item The item to add. * @param item The item to add.
* @param listener The FastInvClickListener for the item. * @param listener The FastInvClickListener for the item.
*
* @return This FastInv instance, for chaining. * @return This FastInv instance, for chaining.
*/ */
public FastInv addItem(int slotFrom, int slotTo, ItemStack item, FastInvClickListener listener) { public FastInv addItem(int slotFrom, int slotTo, ItemStack item, FastInvClickListener listener) {
@ -214,6 +227,7 @@ public class FastInv implements InventoryHolder {
* *
* @param slots The slot of the item. * @param slots The slot of the item.
* @param item The item to add. * @param item The item to add.
*
* @return This FastInv instance, for chaining. * @return This FastInv instance, for chaining.
*/ */
public FastInv addItem(int[] slots, ItemStack item) { public FastInv addItem(int[] slots, ItemStack item) {
@ -224,6 +238,7 @@ public class FastInv implements InventoryHolder {
* Clear a spot in the inventory. * Clear a spot in the inventory.
* *
* @param slot The slot to clear. * @param slot The slot to clear.
*
* @return This FastInv instance, for chaining. * @return This FastInv instance, for chaining.
*/ */
public FastInv clear(int slot) { public FastInv clear(int slot) {
@ -234,6 +249,7 @@ public class FastInv implements InventoryHolder {
* Add an {@link ItemStack} to the menus on the edges. * Add an {@link ItemStack} to the menus on the edges.
* *
* @param item The item to add. * @param item The item to add.
*
* @return This FastInv instance, for chaining. * @return This FastInv instance, for chaining.
*/ */
public FastInv edge(ItemStack item) { public FastInv edge(ItemStack item) {
@ -256,6 +272,7 @@ public class FastInv implements InventoryHolder {
* @param slots The slots to place the item. * @param slots The slots to place the item.
* @param item The item to add. * @param item The item to add.
* @param listener The FastInvClickListener for the item. * @param listener The FastInvClickListener for the item.
*
* @return This FastInv instance, for chaining. * @return This FastInv instance, for chaining.
*/ */
public FastInv addItem(int[] slots, ItemStack item, FastInvClickListener listener) { public FastInv addItem(int[] slots, ItemStack item, FastInvClickListener listener) {
@ -280,6 +297,7 @@ public class FastInv implements InventoryHolder {
* Add a {@link FastInvCloseListener} to listen on menus close. * Add a {@link FastInvCloseListener} to listen on menus close.
* *
* @param listener The {@link FastInvCloseListener} to add. * @param listener The {@link FastInvCloseListener} to add.
*
* @return This FastInv instance, for chaining. * @return This FastInv instance, for chaining.
*/ */
public FastInv onClose(FastInvCloseListener listener) { public FastInv onClose(FastInvCloseListener listener) {
@ -291,6 +309,7 @@ public class FastInv implements InventoryHolder {
* Add a {@link FastInvClickListener} to listen on menus click. * Add a {@link FastInvClickListener} to listen on menus click.
* *
* @param listener The {@link FastInvClickListener} to add. * @param listener The {@link FastInvClickListener} to add.
*
* @return This FastInv instance, for chaining. * @return This FastInv instance, for chaining.
*/ */
public FastInv onClick(FastInvClickListener listener) { public FastInv onClick(FastInvClickListener listener) {
@ -303,6 +322,7 @@ public class FastInv implements InventoryHolder {
* *
* @param period Delay between each run. * @param period Delay between each run.
* @param runnable The {@link Runnable} task to run. * @param runnable The {@link Runnable} task to run.
*
* @return This FastInv instance, for chaining. * @return This FastInv instance, for chaining.
*/ */
public FastInv onUpdate(long period, Runnable runnable) { public FastInv onUpdate(long period, Runnable runnable) {
@ -315,6 +335,7 @@ public class FastInv implements InventoryHolder {
* @param delay Ticks to wait before starting the task. * @param delay Ticks to wait before starting the task.
* @param period Delay between each run. * @param period Delay between each run.
* @param runnable The {@link Runnable} task to run. * @param runnable The {@link Runnable} task to run.
*
* @return This FastInv instance, for chaining * @return This FastInv instance, for chaining
*/ */
public FastInv onUpdate(long delay, long period, Runnable runnable) { public FastInv onUpdate(long delay, long period, Runnable runnable) {
@ -366,6 +387,7 @@ public class FastInv implements InventoryHolder {
* Set if the tasks will be cancel on menus close. * Set if the tasks will be cancel on menus close.
* *
* @param cancelTasksOnClose Set if the tasks will be cancel * @param cancelTasksOnClose Set if the tasks will be cancel
*
* @return This FastInv instance, for chaining. * @return This FastInv instance, for chaining.
*/ */
public FastInv setCancelTasksOnClose(boolean cancelTasksOnClose) { public FastInv setCancelTasksOnClose(boolean cancelTasksOnClose) {

View File

@ -27,8 +27,8 @@ public class Settings {
public static final ConfigSetting FIRST_LOAD = new ConfigSetting(config, "System.First Load", true); public static final ConfigSetting FIRST_LOAD = new ConfigSetting(config, "System.First Load", true);
public static final ConfigSetting LANGUGE_MODE = new ConfigSetting(config, "System.Language Mode", "en_US", public static final ConfigSetting LANGUGE_MODE = new ConfigSetting(config, "System.Language Mode", "en_US",
"The enabled language file.", "The enabled language file.",
"More language files (if available) can be found in the plugins data folder."); "More language files (if available) can be found in the plugins data folder.");
/** /**
* In order to set dynamic economy comment correctly, this needs to be * In order to set dynamic economy comment correctly, this needs to be

View File

@ -13,6 +13,7 @@ public class Experience {
* Calculates a player's total exp based on level and progress to next. * Calculates a player's total exp based on level and progress to next.
* *
* @param player the Player * @param player the Player
*
* @return the amount of exp the Player has * @return the amount of exp the Player has
*/ */
public static int getExp(Player player) { public static int getExp(Player player) {
@ -30,6 +31,7 @@ public class Experience {
* 4.5[Level]2 - 162.5[Level] + 2220 (at level 31+)" * 4.5[Level]2 - 162.5[Level] + 2220 (at level 31+)"
* *
* @param level the level * @param level the level
*
* @return the total experience calculated * @return the total experience calculated
*/ */
public static int getExpFromLevel(int level) { public static int getExpFromLevel(int level) {
@ -46,6 +48,7 @@ public class Experience {
* Calculates level based on total experience. * Calculates level based on total experience.
* *
* @param exp the total experience * @param exp the total experience
*
* @return the level calculated * @return the level calculated
*/ */
public static double getLevelFromExp(long exp) { public static double getLevelFromExp(long exp) {
@ -99,5 +102,4 @@ public class Experience {
player.setLevel(level); player.setLevel(level);
player.setExp((float) (levelAndExp - level)); player.setExp((float) (levelAndExp - level));
} }
}
}

View File

@ -105,7 +105,6 @@ public class ItemGroup {
return out; return out;
} }
public enum Group { public enum Group {
AXES, AXES,
HOES, HOES,

View File

@ -12,7 +12,12 @@ import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import java.util.*; import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.function.BiFunction; import java.util.function.BiFunction;
@ -98,7 +103,6 @@ public class Placeholders {
AtomicReference<String> output = new AtomicReference<>(input); AtomicReference<String> output = new AtomicReference<>(input);
REGEX_CONSUMERS.forEach(consumer -> consumer.accept(output)); REGEX_CONSUMERS.forEach(consumer -> consumer.accept(output));
Optional.ofNullable(event).ifPresent(e -> EVENT_FUNCTIONS.forEach((toReplace, function) -> output.updateAndGet(string -> string.replace(toReplace, "'" + function.apply(e) + "'")))); Optional.ofNullable(event).ifPresent(e -> EVENT_FUNCTIONS.forEach((toReplace, function) -> output.updateAndGet(string -> string.replace(toReplace, "'" + function.apply(e) + "'"))));
@ -112,6 +116,4 @@ public class Placeholders {
return output.get(); return output.get();
} }
} }

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: AntiGravity identifier: AntiGravity
@ -29,4 +29,3 @@ effects:
potion-type: JUMP potion-type: JUMP
# The amplifier of the potion effect. # The amplifier of the potion effect.
amplifier: "{level}" amplifier: "{level}"

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Frozen identifier: Frozen
@ -36,4 +36,3 @@ effects:
chance: "5 * {level}" chance: "5 * {level}"
# Who should this effect be ran on. # Who should this effect be ran on.
who: OPPONENT who: OPPONENT

View File

@ -1,46 +1,35 @@
author: Auora
#Who made this?
Author: Auora
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Healy identifier: Healy
# The max level for this enchant. # The max level for this enchant.
max-level: 4 max-level: 4
# The group of this enchant. Configure the groups in the groups.yml file. # The group of this enchant. Configure the groups in the groups.yml file.
group: ELITE group: ELITE
book-item: book-item:
material: BOOK material: BOOK
display-name: "&a&lHealy {level}" display-name: "&a&lHealy {level}"
# The lore on the enchantments books. # The lore on the enchantments books.
lore: lore:
- "&7Drag on to enchant" - "&7Drag on to enchant"
- "&a{success_rate}% Success Rate" - "&a{success_rate}% Success Rate"
- "&c{destroy_rate}% Destroy Rate" - "&c{destroy_rate}% Destroy Rate"
# How the enchant should be formatted on the enchanted item. # How the enchant should be formatted on the enchanted item.
applied-format: "&aHealy {level}" applied-format: "&aHealy {level}"
# Description # Description
description: description:
- "A chance of remove the players effects" - "A chance of remove the players effects"
# What items this enchant can be applied to. # What items this enchant can be applied to.
item-whitelist: item-whitelist:
- "ARMOR" - "ARMOR"
# For a full list of effects, please visit: https://docs.songoda.com/epic-series/epicenchants/tutorials # For a full list of effects, please visit: https://docs.songoda.com/epic-series/epicenchants/tutorials
effects: effects:
REMOVE_EFFECT: REMOVE_EFFECT:
@ -51,4 +40,4 @@ effects:
# The potion type. # The potion type.
potion-type: POISON potion-type: POISON
# Chance of the effect firing. # Chance of the effect firing.
chance: "3 * {level}" chance: "3 * {level}"

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Poison identifier: Poison
@ -34,4 +34,4 @@ effects:
# Duration of the potion effect. # Duration of the potion effect.
duration: "{level} * 2" duration: "{level} * 2"
# Chance of the effect firing. # Chance of the effect firing.
chance: "3 * {level}" chance: "3 * {level}"

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: RocketEscape identifier: RocketEscape
@ -35,4 +35,3 @@ effects:
chance: "{level} * 10" chance: "{level} * 10"
# Only fire at low HP # Only fire at low HP
condition: "{user_health} < 5" condition: "{user_health} < 5"

View File

@ -1,54 +1,45 @@
author: Auora
# The enchant identifier must be unique. # The enchant identifier must be unique.
#Who made this?
Author: Auora
identifier: Shocky identifier: Shocky
# The max level for this enchant. # The max level for this enchant.
max-level: 5 max-level: 5
# The group of this enchant. Configure the groups in the groups.yml file. # The group of this enchant. Configure the groups in the groups.yml file.
group: ELITE group: ELITE
book-item: book-item:
material: BOOK material: BOOK
display-name: "&b&lShocky {level}" display-name: "&b&lShocky {level}"
# The lore on the enchantments books. # The lore on the enchantments books.
lore: lore:
- "&7Drag on to enchant" - "&7Drag on to enchant"
- "&a{success_rate}% Success Rate" - "&a{success_rate}% Success Rate"
- "&c{destroy_rate}% Destroy Rate" - "&c{destroy_rate}% Destroy Rate"
# How the enchant should be formatted on the enchanted item. # How the enchant should be formatted on the enchanted item.
applied-format: "&bShocky {level}" applied-format: "&bShocky {level}"
# Description # Description
description: description:
- "A chance of forming an explosion while mining" - "A chance of forming an explosion while mining"
# What items this enchant can be applied to. # What items this enchant can be applied to.
item-whitelist: item-whitelist:
- "PICKAXE" - "PICKAXE"
# For a full list of effects, please visit: https://docs.songoda.com/epic-series/epicenchants/tutorials # For a full list of effects, please visit: https://docs.songoda.com/epic-series/epicenchants/tutorials
effects: effects:
SPAWN_TNT: SPAWN_TNT:
# The trigger that will fire this effect. # The trigger that will fire this effect.
trigger: BLOCK_BREAK trigger: BLOCK_BREAK
fuse: 0 fuse: 0
amount: "{random(low=0, up={level})}" amount: "{random(low=0, up={level})}"
# Chance of the effect firing. # Chance of the effect firing.
chance: "5 * {level}" chance: "5 * {level}"

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Wither identifier: Wither
@ -36,4 +36,3 @@ effects:
chance: "5 * {level}" chance: "5 * {level}"
# Who should this effect be ran on. # Who should this effect be ran on.
who: OPPONENT who: OPPONENT

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: DeathBringer identifier: DeathBringer
@ -30,4 +30,4 @@ effects:
# The duration of the effect. # The duration of the effect.
duration: "{level} * 2" duration: "{level} * 2"
# Chance that this effect will fire. # Chance that this effect will fire.
chance: "{level} * 5" chance: "{level} * 5"

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: DeathGod identifier: DeathGod
@ -31,4 +31,4 @@ effects:
# Only trigger this effect when the user has less than 2 hearts. # Only trigger this effect when the user has less than 2 hearts.
condition: "{user_health} < 4" condition: "{user_health} < 4"
# Chance that this effect wil fire. # Chance that this effect wil fire.
chance: "100*{level}" chance: "100*{level}"

View File

@ -1,95 +1,65 @@
#Who made this? author: Auora
Author: Auora
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Divergent identifier: Divergent
# The max level for this enchant. # The max level for this enchant.
max-level: 4 max-level: 4
# The group of this enchant. Configure the groups in the groups.yml file. # The group of this enchant. Configure the groups in the groups.yml file.
group: LEGENDARY group: LEGENDARY
 
book-item: book-item:
material: BOOK
display-name: "&c&lDivergent {level}"
  material: BOOK # The lore on the enchantments books.
lore:
  display-name: "&c&lDivergent {level}" - "&7Drag on to enchant"
- "&a{success_rate}% Success Rate"
  # The lore on the enchantments books. - "&c{destroy_rate}% Destroy Rate"
 
  lore:
    - "&7Drag on to enchant"
    - "&a{success_rate}% Success Rate"
    - "&c{destroy_rate}% Destroy Rate"
# How the enchant should be formatted on the enchanted item. # How the enchant should be formatted on the enchanted item.
applied-format: "&cDivergent {level}" applied-format: "&cDivergent {level}"
# Description # Description
description: description:
- "A chance of giving your opponent slowness and you speed!"
  - "A chance of giving your opponent slowness and you speed!"
# What items this enchant can be applied to. # What items this enchant can be applied to.
item-whitelist: item-whitelist:
- "ARMOR"
  - "ARMOR" # For a full list of effects, please visit: https://wiki.songoda.com/Epic_Enchants#Tutorials
# For a full list of effects, please visit: https://docs.songoda.com/epic-series/epicenchants/tutorials
effects: effects:
POTION:
# The trigger that will fire this effect.
trigger: ATTACK_PLAYER_MELEE
  POTION: # Who do you want to give the effect?
who: OPPONENT
    # The trigger that will fire this effect. # What player should the effect be ran on: WEARER/OPPONENT.
potion-type: SLOWNESS
    trigger: ATTACK_PLAYER_MELEE amplifier: "{level}"
duration: "{level} * 3"
    # Who do you want to give the effect? # Chance of the effect firing.
chance: "4 * {level}"
    who: OPPONENT POTION-2:
# The trigger that will fire this effect.
trigger: ATTACK_PLAYER_MELEE
    # What player should the effect be ran on: WEARER/OPPONENT. # Who do you want to give the effect?
who: USER
    potion-type: SLOWNESS # What player should the effect be ran on: WEARER/OPPONENT.
potion-type: SPEED
    amplifier: "{level}" amplifier: "{level}"
duration: "{level} * 3"
    duration: "{level} * 3" # Chance of the effect firing.
chance: "4 * {level}"
    # Chance of the effect firing.
    chance: "4 * {level}"
  POTION-2:
    # The trigger that will fire this effect.
    trigger: ATTACK_PLAYER_MELEE
    # Who do you want to give the effect?
    who: USER
    # What player should the effect be ran on: WEARER/OPPONENT.
    potion-type: SPEED
    amplifier: "{level}"
    duration: "{level} * 3"
    # Chance of the effect firing.
    chance: "4 * {level}"

View File

@ -1,47 +1,35 @@
#Who made this? author: Auora
Author: Auora
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Drunk identifier: Drunk
# The max level for this enchant. # The max level for this enchant.
max-level: 4 max-level: 4
# The group of this enchant. Configure the groups in the groups.yml file. # The group of this enchant. Configure the groups in the groups.yml file.
group: LEGENDARY group: LEGENDARY
book-item: book-item:
material: BOOK material: BOOK
display-name: "&2&lDrunk {level}" display-name: "&2&lDrunk {level}"
# The lore on the enchantments books. # The lore on the enchantments books.
lore: lore:
- "&7Drag on to enchant" - "&7Drag on to enchant"
- "&a{success_rate}% Success Rate" - "&a{success_rate}% Success Rate"
- "&c{destroy_rate}% Destroy Rate" - "&c{destroy_rate}% Destroy Rate"
# How the enchant should be formatted on the enchanted item. # How the enchant should be formatted on the enchanted item.
applied-format: "&2Drunk {level}" applied-format: "&2Drunk {level}"
# Description # Description
description: description:
- "A chance of making your opponent drunk!" - "A chance of making your opponent drunk!"
# What items this enchant can be applied to. # What items this enchant can be applied to.
item-whitelist: item-whitelist:
- "ARMOR" - "ARMOR"
# For a full list of effects, please visit: https://docs.songoda.com/epic-series/epicenchants/tutorials # For a full list of effects, please visit: https://docs.songoda.com/epic-series/epicenchants/tutorials
effects: effects:
POTION: POTION:
@ -51,9 +39,9 @@ effects:
who: OPPONENT who: OPPONENT
# What player should the effect be ran on: WEARER/OPPONENT. # What player should the effect be ran on: WEARER/OPPONENT.
potion-type: NAUSEA potion-type: NAUSEA
amplifier: "{level}" amplifier: "{level}"
duration: "{level} * 3" duration: "{level} * 3"
# Chance of the effect firing. # Chance of the effect firing.
chance: "4 * {level}" chance: "4 * {level}"

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Enlightened identifier: Enlightened
@ -25,7 +25,9 @@ effects:
MODIFY_HEALTH: MODIFY_HEALTH:
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: "DEFENSE_PLAYER_MELEE, DEFENSE_MOB_MELEE" trigger: "DEFENSE_PLAYER_MELEE, DEFENSE_MOB_MELEE"
# How much life does it should add # How much life does it should add
amount: "+1" amount: "+1"
# Chances for the event to proceed # Chances for the event to proceed
chance: "10*{level}" chance: "10*{level}"

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Gears identifier: Gears
@ -25,7 +25,9 @@ effects:
POTION: POTION:
# The trigger that will fire this effect. # The trigger that will fire this effect.
trigger: STATIC_EFFECT trigger: STATIC_EFFECT
# The potion type. # The potion type.
potion-type: SPEED potion-type: SPEED
# The amplifier of the potion effect. # The amplifier of the potion effect.
amplifier: "{level}" amplifier: "{level}"

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: LifeSteal identifier: LifeSteal
@ -25,7 +25,9 @@ effects:
STEAL_HEALTH: STEAL_HEALTH:
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: ATTACK_PLAYER_MELEE trigger: ATTACK_PLAYER_MELEE
# How much life does it should steal # How much life does it should steal
amount: 1 amount: 1
# Chance that this effect wil fire. # Chance that this effect wil fire.
chance: "5*{level}" chance: "5*{level}"

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Overload identifier: Overload
@ -25,7 +25,9 @@ effects:
POTION: POTION:
# The trigger that will fire this effect. # The trigger that will fire this effect.
trigger: STATIC_EFFECT trigger: STATIC_EFFECT
# The potion type. # The potion type.
potion-type: HEALTH_BOOST potion-type: HEALTH_BOOST
# The amplifier of the potion effect. # The amplifier of the potion effect.
amplifier: "{level}" amplifier: "{level}"

View File

@ -12,9 +12,6 @@ group: LEGENDARY
# How the enchant should be formatted on the enchanted item. # How the enchant should be formatted on the enchanted item.
applied-format: "&bResist {level}" applied-format: "&bResist {level}"
# How the enchant should be formatted on the enchanted item.
applied-format: "&bResist {level}"
# Description # Description
description: description:
- "A chance of giving the resist effect." - "A chance of giving the resist effect."
@ -28,13 +25,18 @@ effects:
POTION: POTION:
# The trigger that will fire this effect. # The trigger that will fire this effect.
trigger: STATIC_EFFECT trigger: STATIC_EFFECT
# What player should the effect be ran on: WEARER/OPPONENT. # What player should the effect be ran on: WEARER/OPPONENT.
who: USER who: USER
# The potion type. # The potion type.
potion-type: DAMAGE_RESISTANCE potion-type: DAMAGE_RESISTANCE
# The amplifier of the potion effect. # The amplifier of the potion effect.
amplifier: "{level}" amplifier: "{level}"
# Duration of the potion effect. # Duration of the potion effect.
duration: "{level} * 10" duration: "{level} * 10"
# Chance of the effect firing. # Chance of the effect firing.
chance: "100" chance: "100"

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: SkillSwipe identifier: SkillSwipe
@ -25,7 +25,9 @@ effects:
STEAL_EXP: STEAL_EXP:
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: ATTACK_PLAYER_MELEE trigger: ATTACK_PLAYER_MELEE
# Chance that this effect wil fire. # Chance that this effect wil fire.
chance: "5 * {level}" chance: "5 * {level}"
# Amount of EXP to be stolen. # Amount of EXP to be stolen.
amount: 100 amount: 100

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Aquatic identifier: Aquatic
@ -25,5 +25,6 @@ effects:
POTION: POTION:
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: STATIC_EFFECT trigger: STATIC_EFFECT
# Potion Effect that should be applied. # Potion Effect that should be applied.
potion-type: WATER_BREATHING potion-type: WATER_BREATHING

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Confusion identifier: Confusion
@ -26,13 +26,18 @@ effects:
POTION: POTION:
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: ATTACK_PLAYER_MELEE trigger: ATTACK_PLAYER_MELEE
# What player should the effect be ran on: WEARER/OPPONENT. # What player should the effect be ran on: WEARER/OPPONENT.
who: OPPONENT who: OPPONENT
# Potion Effect that should be applied. # Potion Effect that should be applied.
potion-type: CONFUSION potion-type: CONFUSION
# Duration of the Potion Effect in seconds. # Duration of the Potion Effect in seconds.
duration: "3 * {level}" duration: "3 * {level}"
# Chance that the Effect gets activated. # Chance that the Effect gets activated.
chance: "5 * {level}" chance: "5 * {level}"
# Amplifier of 0 = SPEED 1 a Amplifier of 1 = SPEED 2, etc. # Amplifier of 0 = SPEED 1 a Amplifier of 1 = SPEED 2, etc.
amplifier: "{level}" amplifier: "{level}"

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Experience identifier: Experience
@ -26,9 +26,12 @@ effects:
MODIFY_EXP: MODIFY_EXP:
# Chance that this will happen # Chance that this will happen
chance: "20 * {level}" chance: "20 * {level}"
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: EXPERIENCE_BLOCK_BREAK trigger: EXPERIENCE_BLOCK_BREAK
# What player should the effect be ran on: USER/OPPONENT. # What player should the effect be ran on: USER/OPPONENT.
who: USER who: USER
# Amount of EXP to add # Amount of EXP to add
amount: "10 * {level}" amount: "10 * {level}"

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Glowing identifier: Glowing
@ -25,5 +25,6 @@ effects:
POTION-1: POTION-1:
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: STATIC_EFFECT trigger: STATIC_EFFECT
# Potion effect type # Potion effect type
potion-type: NIGHT_VISION potion-type: NIGHT_VISION

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Haste identifier: Haste
@ -26,8 +26,9 @@ effects:
POTION: POTION:
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: HELD_ITEM trigger: HELD_ITEM
# Potion Effect that should be applied. # Potion Effect that should be applied.
potion-type: FAST_DIGGING potion-type: FAST_DIGGING
# Amplifier of 0 = SPEED 1 a Amplifier of 1 = SPEED 2, etc. # Amplifier of 0 = SPEED 1 a Amplifier of 1 = SPEED 2, etc.
amplifier: "{level}" amplifier: "{level}"

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Insomnia identifier: Insomnia
@ -26,39 +26,52 @@ effects:
POTION-1: POTION-1:
# Chance that this will happen # Chance that this will happen
chance: "5 * {level}" chance: "5 * {level}"
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: ATTACK_PLAYER_MELEE trigger: ATTACK_PLAYER_MELEE
# What player should the effect be ran on: USER/OPPONENT. # What player should the effect be ran on: USER/OPPONENT.
who: OPPONENT who: OPPONENT
# Amount of EXP to add # Amount of EXP to add
potion-type: CONFUSION potion-type: CONFUSION
# Duration of the Potion Effect in seconds. # Duration of the Potion Effect in seconds.
duration: "3 * {level}" duration: "3 * {level}"
# Chance that the Effect gets activated.
chance: "5 * {level}"
# Amplifier of 0 = SPEED 1 a Amplifier of 1 = SPEED 2, etc. # Amplifier of 0 = SPEED 1 a Amplifier of 1 = SPEED 2, etc.
amplifier: "{level}" amplifier: "{level}"
# Simultaneous # Simultaneous
simultaneous: simultaneous:
POTION: POTION:
# What player should the effect be ran on: USER/OPPONENT. # What player should the effect be ran on: USER/OPPONENT.
who: OPPONENT who: OPPONENT
# Amount of EXP to add
potion-type: SLOW_DIGGING # Amount of EXP to add
# Duration of the Potion Effect in seconds. potion-type: SLOW_DIGGING
duration: "3 * {level}"
# Chance that the Effect gets activated. # Duration of the Potion Effect in seconds.
chance: "5 * {level}" duration: "3 * {level}"
# Amplifier of 0 = SPEED 1 a Amplifier of 1 = SPEED 2, etc.
amplifier: "{level}" # Chance that the Effect gets activated.
POTION-1: chance: "5 * {level}"
# What player should the effect be ran on: USER/OPPONENT.
who: OPPONENT # Amplifier of 0 = SPEED 1 a Amplifier of 1 = SPEED 2, etc.
# Amount of EXP to add amplifier: "{level}"
potion-type: SLOW
# Duration of the Potion Effect in seconds. POTION-1:
duration: "3 * {level}" # What player should the effect be ran on: USER/OPPONENT.
# Chance that the Effect gets activated. who: OPPONENT
chance: "5 * {level}"
# Amplifier of 0 = SPEED 1 a Amplifier of 1 = SPEED 2, etc. # Amount of EXP to add
amplifier: "{level}" potion-type: SLOW
# Duration of the Potion Effect in seconds.
duration: "3 * {level}"
# Chance that the Effect gets activated.
chance: "5 * {level}"
# Amplifier of 0 = SPEED 1 a Amplifier of 1 = SPEED 2, etc.
amplifier: "{level}"

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Lightning identifier: Lightning
@ -26,7 +26,9 @@ effects:
LIGHTNING: LIGHTNING:
# Chance that this will happen # Chance that this will happen
chance: "5 * {level}" chance: "5 * {level}"
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: ATTACK_PLAYER_RANGE trigger: ATTACK_PLAYER_RANGE
# What player should the effect be ran on: USER/OPPONENT. # What player should the effect be ran on: USER/OPPONENT.
who: OPPONENT who: OPPONENT

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Obliterate identifier: Obliterate
@ -25,13 +25,18 @@ effects:
THROW: THROW:
# Chance that this will happen # Chance that this will happen
chance: "5 * {level}" chance: "5 * {level}"
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: ATTACK_PLAYER_MELEE trigger: ATTACK_PLAYER_MELEE
# What player should the effect be ran on: USER/OPPONENT. # What player should the effect be ran on: USER/OPPONENT.
who: OPPONENT who: OPPONENT
# What direction the player should be moved in: UP/DOWN/BACKWARD/FORWARD # What direction the player should be moved in: UP/DOWN/BACKWARD/FORWARD
direction: FORWARD direction: FORWARD
# Magnitude of the throw # Magnitude of the throw
magnitude: "0.2 * {level}" magnitude: "0.2 * {level}"
# What the direction should relative to # What the direction should relative to
relative-to: USER relative-to: USER

View File

@ -1,4 +1,4 @@
author: "Songoda" author: Songoda
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Oxygenate identifier: Oxygenate
@ -26,11 +26,15 @@ effects:
POTION: POTION:
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: BLOCK_BREAK trigger: BLOCK_BREAK
# Potion Effect that should be applied. # Potion Effect that should be applied.
potion-type: WATER_BREATHING potion-type: WATER_BREATHING
# Chance that this will happen # Chance that this will happen
chance: "10 * {level}" chance: "10 * {level}"
# Amount of oxygen to refill # Amount of oxygen to refill
amount: "{level}" amount: "{level}"
# What player should the effect be ran on: USER/OPPONENT. # What player should the effect be ran on: USER/OPPONENT.
who: USER who: USER

View File

@ -1,4 +1,4 @@
author: "Songoda" author: "Songoda"
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Blind identifier: Blind
@ -20,7 +20,7 @@ description:
# What items this enchant can be applied to. # What items this enchant can be applied to.
item-whitelist: item-whitelist:
- "WEAPONS" - "WEAPONS"
# For a full list of effects, please visit: https://docs.songoda.com/epic-series/epicenchants/tutorials # For a full list of effects, please visit: https://docs.songoda.com/epic-series/epicenchants/tutorials
effects: effects:
POTION: POTION:
@ -35,4 +35,4 @@ effects:
# Who this effect should be ran on. # Who this effect should be ran on.
who: OPPONENT who: OPPONENT
# Chance that this effect wil fire. # Chance that this effect wil fire.
chance: "10*{level}" chance: "10*{level}"

View File

@ -28,4 +28,3 @@ effects:
trigger: "DEFENSE_PLAYER_MELEE,DEFENSE_MOB_MELEE" trigger: "DEFENSE_PLAYER_MELEE,DEFENSE_MOB_MELEE"
# Chance that this effect wil fire. # Chance that this effect wil fire.
chance: "{user_is_sneaking} ? (8 * {level}) : (4 * {level})" chance: "{user_is_sneaking} ? (8 * {level}) : (4 * {level})"

View File

@ -26,4 +26,4 @@ item-whitelist:
effects: effects:
FLY: FLY:
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: STATIC_EFFECT, HELD_ITEM trigger: STATIC_EFFECT, HELD_ITEM

View File

@ -28,4 +28,4 @@ effects:
# How much food does it should steal # How much food does it should steal
amount: 3 amount: 3
# Chance that this effect wil fire. # Chance that this effect wil fire.
chance: "5*{level}" chance: "5*{level}"

View File

@ -1,4 +1,4 @@
author: "Songoda" author: "Songoda"
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: StormFall identifier: StormFall
@ -35,7 +35,7 @@ effects:
trigger: ATTACK_PLAYER_RANGE trigger: ATTACK_PLAYER_RANGE
who: OPPONENT who: OPPONENT
chance: '100*{level}-200' chance: '100*{level}-200'
#--------------------------------------- # ---------------------------------------
LIGHTNING-4: LIGHTNING-4:
trigger: ATTACK_MOB_RANGE trigger: ATTACK_MOB_RANGE
who: OPPONENT who: OPPONENT
@ -47,4 +47,4 @@ effects:
LIGHTNING-6: LIGHTNING-6:
trigger: ATTACK_MOB_RANGE trigger: ATTACK_MOB_RANGE
who: OPPONENT who: OPPONENT
chance: '100*{level}-200' chance: '100*{level}-200'

View File

@ -44,4 +44,4 @@ effects:
# Chance that the Effect gets activated. # Chance that the Effect gets activated.
chance: "5 * {level}" chance: "5 * {level}"
# Amplifier of 0 = SPEED 1 a Amplifier of 1 = SPEED 2, etc. # Amplifier of 0 = SPEED 1 a Amplifier of 1 = SPEED 2, etc.
amplifier: "{level}" amplifier: "{level}"

View File

@ -2,25 +2,25 @@ author: Hipopotofobia
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Decapitation identifier: Decapitation
# The max level for this enchant. # The max level for this enchant.
max-level: 3 max-level: 3
# The group of this enchant. Configure the groups in the groups.yml file. # The group of this enchant. Configure the groups in the groups.yml file.
group: UNIQUE group: UNIQUE
# How the enchant should be formatted on the enchanted item. # How the enchant should be formatted on the enchanted item.
applied-format: "&eDecapitation {level}" applied-format: "&eDecapitation {level}"
# Description # Description
description: description:
- "Decapitate your victim and" - "Decapitate your victim and"
- "keep their head as a trophy!" - "keep their head as a trophy!"
# What items this enchant can be applied to. # What items this enchant can be applied to.
item-whitelist: item-whitelist:
- "AXES" - "AXES"
# For a full list of effects, please visit: https://docs.songoda.com/epic-series/epicenchants/tutorials # For a full list of effects, please visit: https://docs.songoda.com/epic-series/epicenchants/tutorials
effects: effects:
DROP_HEAD: DROP_HEAD:
@ -29,4 +29,4 @@ effects:
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: ATTACK_PLAYER_MELEE trigger: ATTACK_PLAYER_MELEE
# What player should the effect be ran on: USER/OPPONENT. # What player should the effect be ran on: USER/OPPONENT.
who: OPPONENT who: OPPONENT

View File

@ -31,4 +31,4 @@ effects:
# What player should the effect be ran on: USER/OPPONENT. # What player should the effect be ran on: USER/OPPONENT.
who: OPPONENT who: OPPONENT
# Magnitude of the throw # Magnitude of the throw
magnitude: "1 * {level}" magnitude: "1 * {level}"

View File

@ -31,4 +31,4 @@ effects:
# Amplifier of 0 = SPEED 1 a Amplifier of 1 = SPEED 2, etc. # Amplifier of 0 = SPEED 1 a Amplifier of 1 = SPEED 2, etc.
amplifier: "{level}" amplifier: "{level}"
# Chance that this will happen # Chance that this will happen
chance: "10 * {level}" chance: "10 * {level}"

View File

@ -2,21 +2,21 @@ author: Tin
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Inquisitive identifier: Inquisitive
# The max level for this enchant. # The max level for this enchant.
max-level: 5 max-level: 5
# The group of this enchant. Configure the groups in the groups.yml file. # The group of this enchant. Configure the groups in the groups.yml file.
group: UNIQUE group: UNIQUE
# The item that the enchantment book is. # The item that the enchantment book is.
description: description:
- "A chance to receive" - "A chance to receive"
- "more EXP when killing mobs." - "more EXP when killing mobs."
# How the enchant should be formatted on the enchanted item. # How the enchant should be formatted on the enchanted item.
applied-format: "&cInquisitive {level}" applied-format: "&cInquisitive {level}"
# What items this enchant can be applied too. # What items this enchant can be applied too.
item-whitelist: item-whitelist:
- "SWORDS" - "SWORDS"
@ -31,4 +31,4 @@ effects:
# Chance that this will happen # Chance that this will happen
chance: "20 * {level}" chance: "20 * {level}"
# Amount of EXP to add # Amount of EXP to add
amount: "3 * {level}" amount: "3 * {level}"

View File

@ -20,7 +20,7 @@ description:
# What items this enchant can be applied to. # What items this enchant can be applied to.
item-whitelist: item-whitelist:
- "LEGGINGS" - "LEGGINGS"
# For a full list of effects, please visit: https://docs.songoda.com/epic-series/epicenchants/tutorials # For a full list of effects, please visit: https://docs.songoda.com/epic-series/epicenchants/tutorials
effects: effects:
SPAWN_MOB: SPAWN_MOB:
@ -35,4 +35,4 @@ effects:
# Condition # Condition
condition: "{user_health} < 4" condition: "{user_health} < 4"
# Display name of the spawned mob # Display name of the spawned mob
display-name: "&cPlague carrier" display-name: "&cPlague carrier"

View File

@ -15,7 +15,7 @@ applied-format: "&Ragdoll {level}"
# Description # Description
description: description:
- "A chance to be pushed back when." - "A chance to be pushed back when."
- "you take damage." - "you take damage."
# What items this enchant can be applied to. # What items this enchant can be applied to.
item-whitelist: item-whitelist:
@ -35,4 +35,4 @@ effects:
# Magnitude of the throw # Magnitude of the throw
magnitude: "0.1 * {level}" magnitude: "0.1 * {level}"
# What the direction should relative to # What the direction should relative to
relative-to: USER relative-to: USER

View File

@ -19,7 +19,7 @@ description:
# What items this enchant can be applied to. # What items this enchant can be applied to.
item-whitelist: item-whitelist:
- "ARMOR" - "ARMOR"
# For a full list of effects, please visit: https://docs.songoda.com/epic-series/epicenchants/tutorials # For a full list of effects, please visit: https://docs.songoda.com/epic-series/epicenchants/tutorials
effects: effects:
SPAWN_TNT: SPAWN_TNT:
@ -32,4 +32,4 @@ effects:
# Condition # Condition
condition: "{user_health} < 4" condition: "{user_health} < 4"
# The fuse of the TNT # The fuse of the TNT
fuse: 60 fuse: 60

View File

@ -1,11 +1,20 @@
name: EpicEnchants name: ${project.name}
version: maven-version-number description: ${project.description}
main: com.songoda.epicenchants.EpicEnchants version: ${project.version}
authors: [Songoda]
website: https://songoda.com/
softdepend: [Vault, PlayerPoints, UltimateBottles, PlaceholderAPI]
api-version: 1.13 api-version: 1.13
main: com.songoda.epicenchants.EpicEnchants
softdepend:
- PlaceholderAPI
- PlayerPoints
- UltimateBottles
- Vault
author: Songoda
website: ${project.url}
commands: commands:
ee: ee:
aliases: [epicenchants] aliases:
ussage: reload - epicenchants
ussage: reload

View File

@ -1,10 +1,10 @@
title: "Enchanter" title: "Enchanter"
rows: 3 rows: 3
#You can choose to fill the entire inventory with this material # You can choose to fill the entire inventory with this material
#fill: # fill:
# material: "MATERIAL_HERE" # material: "MATERIAL_HERE"
# display-name: "&r" # display-name: "&r"
contents: contents:
1: 1:
@ -109,4 +109,4 @@ contents:
whites: whites:
material: STAINED_GLASS_PANE material: STAINED_GLASS_PANE
display-name: "&r" display-name: "&r"
slot: "10,16" slot: "10,16"

View File

@ -1,10 +1,10 @@
title: "Enchanter" title: "Enchanter"
rows: 3 rows: 3
#You can choose to fill the entire inventory with this material # You can choose to fill the entire inventory with this material
#fill: # fill:
# material: "MATERIAL_HERE" # material: "MATERIAL_HERE"
# display-name: "&r" # display-name: "&r"
contents: contents:
1: 1:
@ -102,4 +102,4 @@ contents:
whites: whites:
material: WHITE_STAINED_GLASS_PANE material: WHITE_STAINED_GLASS_PANE
display-name: "&r" display-name: "&r"
slot: "10,16" slot: "10,16"