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/
.idea/
*.iml
META-INF/
target/
# JetBrains IDEs
/.idea/
/*.iml
# Maven
/target/

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>
<artifactId>EpicEnchants</artifactId>
<modelVersion>4.0.0</modelVersion>
<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>
<defaultGoal>clean install</defaultGoal>
<finalName>EpicEnchants-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<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>
<source>${java.version}</source>
<target>${java.version}</target>
<!-- TODO: Requires jdk9+, prepare CI/CD before enabling this -->
<!-- <release>${java.release}</release> -->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0-SNAPSHOT</version>
<executions>
<execution>
<id>shaded</id>
@ -49,18 +50,22 @@
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>false</createDependencyReducedPom>
<artifactSet>
<includes>
<include>com.songoda:SongodaCore</include>
<include>fr.mymicky:FastInv</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
@ -73,21 +78,31 @@
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<pluginRepositories>
<pluginRepository>
<id>apache.snapshots</id>
<url>https://repository.apache.org/snapshots/</url>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>public</id>
<id>songoda-public</id>
<url>https://repo.songoda.com/repository/public/</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
<url>https://jitpack.io/</url>
</repository>
</repositories>
@ -98,24 +113,21 @@
<version>1.17</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>fr.mrmicky</groupId>
<artifactId>FastInv</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore</artifactId>
<version>LATEST</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.songoda</groupId>
<artifactId>UltimateBottles</artifactId>
<version>1_0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<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.gui.GuiManager;
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.EntityListener;
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.DustListener;
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.utils.EnchantUtils;
import com.songoda.epicenchants.utils.SpecialItems;

View File

@ -17,10 +17,9 @@ public class CommandAlchemist extends AbstractCommand {
this.plugin = plugin;
}
@Override
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);
return ReturnType.SUCCESS;
}

View File

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

View File

@ -19,7 +19,7 @@ public class CommandEnchanter extends AbstractCommand {
@Override
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);
return ReturnType.SUCCESS;
}

View File

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

View File

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

View File

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

View File

@ -39,7 +39,6 @@ public class CommandGiveScroll extends AbstractCommand {
int amount = 1;
int successRate = -1;
if (args.length > 2) {
if (!CommandCommons.isInt(args[2], sender))
return ReturnType.FAILURE;
@ -85,7 +84,7 @@ public class CommandGiveScroll extends AbstractCommand {
return Bukkit.getOnlinePlayers().stream().map(Player::getName).collect(Collectors.toList());
} else if (args.length == 3 || args.length == 4) {
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));
return rates;
}

View File

@ -27,7 +27,7 @@ public class CommandList extends AbstractCommand {
.sendPrefixedMessage(sender);
return ReturnType.SUCCESS;
}
plugin.getInfoManager().getMainInfoMenu().open((Player)sender);
plugin.getInfoManager().getMainInfoMenu().open((Player) sender);
return ReturnType.SUCCESS;
}

View File

@ -19,7 +19,7 @@ public class CommandTinkerer extends AbstractCommand {
@Override
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);
return ReturnType.SUCCESS;
}

View File

@ -19,5 +19,4 @@ public class Fly extends EffectExecutor {
user.setAllowFlight(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,
(int) amplifier.get(level - 1, 0, user, opponent), false, false)), user, opponent);
}
}

View File

@ -1,10 +1,8 @@
package com.songoda.epicenchants.effect.effects;
import com.songoda.core.nms.NmsManager;
import com.songoda.epicenchants.effect.EffectExecutor;
import com.songoda.epicenchants.enums.EventType;
import com.songoda.epicenchants.objects.LeveledModifier;
import com.songoda.core.nms.nbt.NBTEntity;
import com.songoda.epicenchants.utils.objects.ItemBuilder;
import org.bukkit.Location;
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.enums.EventType;
import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
@ -15,7 +14,7 @@ public class StealFood extends EffectExecutor {
@Override
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)) {
return;

View File

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

View File

@ -11,7 +11,11 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.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.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerItemBreakEvent;

View File

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

View File

@ -1,14 +1,8 @@
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.HeldItemChangedEvent.EquipMethod;
import com.songoda.epicenchants.events.HeldItemChangedEvent;
import java.util.Arrays;
import java.util.OptionalInt;
import java.util.stream.IntStream;
import com.songoda.epicenchants.events.HeldItemChangedEvent.EquipMethod;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@ -17,7 +11,11 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
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.player.PlayerDropItemEvent;
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.PlayerInventory;
import java.util.Arrays;
import java.util.OptionalInt;
import java.util.stream.IntStream;
public class HeldItemListener implements Listener {
private static final boolean SWAP_OFFHAND_SUPPORTED = Arrays.stream(ClickType.values()).anyMatch(e -> e.name().equals("SWAP_OFFHAND"));

View File

@ -2,7 +2,9 @@ package com.songoda.epicenchants.listeners;
import com.songoda.epicenchants.EpicEnchants;
import com.songoda.epicenchants.events.ArmorEquipEvent;
import com.songoda.epicenchants.events.HeldItemChangedEvent;
import com.songoda.epicenchants.objects.Enchant;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
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.PlayerItemHeldEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.inventory.ItemStack;
import java.util.Arrays;
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.ON;
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 {
private final EpicEnchants instance;

View File

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

View File

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

View File

@ -14,7 +14,11 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
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 java.io.File.separator;

View File

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

View File

@ -2,7 +2,11 @@ package com.songoda.epicenchants.managers;
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> {
@ -41,5 +45,4 @@ public abstract class Manager<K, V> {
public void clear() {
map.clear();
}
}

View File

@ -213,7 +213,7 @@ public class AlchemistMenu extends FastInv {
int leftDestroy = leftItem.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("right_success_rate", rightSuccess),
of("left_destroy_rate", leftDestroy),
@ -227,7 +227,7 @@ public class AlchemistMenu extends FastInv {
int successRate = getFromFormula("book.success-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("final_success_rate", successRate),
of("final_destroy_rate", destroyRate),
@ -240,14 +240,14 @@ public class AlchemistMenu extends FastInv {
} else {
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("right_percentage", rightItem.getNBTObject("percentage").asInt())
};
int successRate = getFromFormula("dust.percentage-formula", placeholders);
Placeholder[] costPlaceholders = new Placeholder[]{
Placeholder[] costPlaceholders = new Placeholder[] {
of("group_order_index", group.getOrder()),
of("final_success_rate", successRate),
};

View File

@ -14,8 +14,10 @@ import java.util.Map;
import java.util.UUID;
import static com.songoda.epicenchants.objects.Placeholder.of;
import static com.songoda.epicenchants.utils.single.Experience.*;
import static com.songoda.epicenchants.utils.single.GeneralUtils.*;
import static com.songoda.epicenchants.utils.single.Experience.changeExp;
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 {
private final Map<UUID, Long> DELAY = new HashMap<>();

View File

@ -1,6 +1,5 @@
package com.songoda.epicenchants.menus;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.epicenchants.EpicEnchants;
import com.songoda.epicenchants.objects.Enchant;
import com.songoda.epicenchants.objects.Group;
@ -15,7 +14,8 @@ import java.util.stream.Collectors;
import java.util.stream.IntStream;
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;
public class InfoMenu extends FastInv {
@ -44,7 +44,6 @@ public class InfoMenu extends FastInv {
}
}));
Iterator<Enchant> enchantIterator = instance.getEnchantManager().getEnchants(group).iterator();
slots.stream().filter(slot -> enchantIterator.hasNext()).forEach(slot -> {
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.event.Listener;
import java.util.Optional;
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;
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()));
}));
}
}

View File

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

View File

@ -1,6 +1,5 @@
package com.songoda.epicenchants.objects;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.nms.nbt.NBTItem;
import com.songoda.epicenchants.EpicEnchants;
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 + ")";
}
}
}

View File

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

View File

@ -56,7 +56,6 @@ public class SpecialItems {
return nbtItem.finish();
}
public ItemStack getSecretDust(NBTItem book) {
Group group = instance.getEnchantManager().getValueUnsafe(book.getNBTObject("enchant").asString()).getGroup();
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.event.EventHandler;
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.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
@ -12,7 +16,10 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
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.
@ -125,6 +132,7 @@ public class FastInv implements InventoryHolder {
* Add an {@link ItemStack} to the menus.
*
* @param item The item to add
*
* @return This FastInv instance, for chaining.
*/
public FastInv addItem(ItemStack item) {
@ -136,6 +144,7 @@ public class FastInv implements InventoryHolder {
*
* @param item The item to add.
* @param listener The {@link FastInvClickListener} for the item.
*
* @return This FastInv instance, for chaining.
*/
public FastInv addItem(ItemStack item, FastInvClickListener listener) {
@ -153,6 +162,7 @@ public class FastInv implements InventoryHolder {
*
* @param slot The slot of the item.
* @param item The item to add.
*
* @return This FastInv instance, for chaining.
*/
public FastInv addItem(int slot, ItemStack item) {
@ -165,6 +175,7 @@ public class FastInv implements InventoryHolder {
* @param slot The slot of the item.
* @param item The item to add.
* @param listener The FastInvClickListener for the item.
*
* @return This FastInv instance, for chaining.
*/
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 slotTo Ending slot to put the item in.
* @param item The item to add.
*
* @return This FastInv instance, for chaining.
*/
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 item The item to add.
* @param listener The FastInvClickListener for the item.
*
* @return This FastInv instance, for chaining.
*/
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 item The item to add.
*
* @return This FastInv instance, for chaining.
*/
public FastInv addItem(int[] slots, ItemStack item) {
@ -224,6 +238,7 @@ public class FastInv implements InventoryHolder {
* Clear a spot in the inventory.
*
* @param slot The slot to clear.
*
* @return This FastInv instance, for chaining.
*/
public FastInv clear(int slot) {
@ -234,6 +249,7 @@ public class FastInv implements InventoryHolder {
* Add an {@link ItemStack} to the menus on the edges.
*
* @param item The item to add.
*
* @return This FastInv instance, for chaining.
*/
public FastInv edge(ItemStack item) {
@ -256,6 +272,7 @@ public class FastInv implements InventoryHolder {
* @param slots The slots to place the item.
* @param item The item to add.
* @param listener The FastInvClickListener for the item.
*
* @return This FastInv instance, for chaining.
*/
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.
*
* @param listener The {@link FastInvCloseListener} to add.
*
* @return This FastInv instance, for chaining.
*/
public FastInv onClose(FastInvCloseListener listener) {
@ -291,6 +309,7 @@ public class FastInv implements InventoryHolder {
* Add a {@link FastInvClickListener} to listen on menus click.
*
* @param listener The {@link FastInvClickListener} to add.
*
* @return This FastInv instance, for chaining.
*/
public FastInv onClick(FastInvClickListener listener) {
@ -303,6 +322,7 @@ public class FastInv implements InventoryHolder {
*
* @param period Delay between each run.
* @param runnable The {@link Runnable} task to run.
*
* @return This FastInv instance, for chaining.
*/
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 period Delay between each run.
* @param runnable The {@link Runnable} task to run.
*
* @return This FastInv instance, for chaining
*/
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.
*
* @param cancelTasksOnClose Set if the tasks will be cancel
*
* @return This FastInv instance, for chaining.
*/
public FastInv setCancelTasksOnClose(boolean cancelTasksOnClose) {

View File

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

View File

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

View File

@ -12,7 +12,12 @@ import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
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.atomic.AtomicReference;
import java.util.function.BiFunction;
@ -98,7 +103,6 @@ public class Placeholders {
AtomicReference<String> output = new AtomicReference<>(input);
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) + "'"))));
@ -112,6 +116,4 @@ public class Placeholders {
return output.get();
}
}

View File

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

View File

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

View File

@ -1,6 +1,4 @@
#Who made this?
Author: Auora
author: Auora
# The enchant identifier must be unique.
identifier: Healy
@ -12,25 +10,16 @@ max-level: 4
group: ELITE
book-item:
material: BOOK
display-name: "&a&lHealy {level}"
# The lore on the enchantments books.
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.
applied-format: "&aHealy {level}"
# Description

View File

@ -1,4 +1,4 @@
author: "Songoda"
author: Songoda
# The enchant identifier must be unique.
identifier: Poison

View File

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

View File

@ -1,8 +1,6 @@
author: Auora
# The enchant identifier must be unique.
#Who made this?
Author: Auora
identifier: Shocky
# The max level for this enchant.
@ -12,25 +10,18 @@ max-level: 5
group: ELITE
book-item:
material: BOOK
display-name: "&b&lShocky {level}"
# The lore on the enchantments books.
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.
applied-format: "&bShocky {level}"
# Description

View File

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

View File

@ -1,4 +1,4 @@
author: "Songoda"
author: Songoda
# The enchant identifier must be unique.
identifier: DeathBringer

View File

@ -1,4 +1,4 @@
author: "Songoda"
author: Songoda
# The enchant identifier must be unique.
identifier: DeathGod

View File

@ -1,95 +1,65 @@
#Who made this?
Author: Auora
author: Auora
# The enchant identifier must be unique.
identifier: Divergent
# The max level for this enchant.
max-level: 4
# The group of this enchant. Configure the groups in the groups.yml file.
group: LEGENDARY
 
book-item:
material: BOOK
display-name: "&c&lDivergent {level}"
  material: BOOK
  display-name: "&c&lDivergent {level}"
  # The lore on the enchantments books.
 
  lore:
    - "&7Drag on to enchant"
    - "&a{success_rate}% Success Rate"
    - "&c{destroy_rate}% Destroy Rate"
# The lore on the enchantments books.
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.
applied-format: "&cDivergent {level}"
# 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.
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://wiki.songoda.com/Epic_Enchants#Tutorials
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}"
  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}"
# Chance of the effect firing.
chance: "4 * {level}"

View File

@ -1,7 +1,4 @@
#Who made this?
Author: Auora
author: Auora
# The enchant identifier must be unique.
identifier: Drunk
@ -13,25 +10,16 @@ max-level: 4
group: LEGENDARY
book-item:
material: BOOK
display-name: "&2&lDrunk {level}"
# The lore on the enchantments books.
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.
applied-format: "&2Drunk {level}"
# Description
@ -53,7 +41,7 @@ effects:
potion-type: NAUSEA
amplifier: "{level}"
duration: "{level} * 3"
# Chance of the effect firing.
chance: "4 * {level}"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
author: "Songoda"
author: Songoda
# The enchant identifier must be unique.
identifier: Confusion
@ -26,13 +26,18 @@ effects:
POTION:
# The trigger that will fire this effect
trigger: ATTACK_PLAYER_MELEE
# What player should the effect be ran on: WEARER/OPPONENT.
who: OPPONENT
# Potion Effect that should be applied.
potion-type: CONFUSION
# 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.
identifier: Experience
@ -26,9 +26,12 @@ effects:
MODIFY_EXP:
# Chance that this will happen
chance: "20 * {level}"
# The trigger that will fire this effect
trigger: EXPERIENCE_BLOCK_BREAK
# What player should the effect be ran on: USER/OPPONENT.
who: USER
# Amount of EXP to add
amount: "10 * {level}"

View File

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

View File

@ -1,4 +1,4 @@
author: "Songoda"
author: Songoda
# The enchant identifier must be unique.
identifier: Haste
@ -26,8 +26,9 @@ effects:
POTION:
# The trigger that will fire this effect
trigger: HELD_ITEM
# Potion Effect that should be applied.
potion-type: FAST_DIGGING
# 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.
identifier: Insomnia
@ -26,39 +26,52 @@ effects:
POTION-1:
# Chance that this will happen
chance: "5 * {level}"
# The trigger that will fire this effect
trigger: ATTACK_PLAYER_MELEE
# What player should the effect be ran on: USER/OPPONENT.
who: OPPONENT
# Amount of EXP to add
potion-type: CONFUSION
# 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}"
# Simultaneous
simultaneous:
POTION:
# What player should the effect be ran on: USER/OPPONENT.
who: OPPONENT
# Amount of EXP to add
potion-type: SLOW_DIGGING
# 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}"
POTION-1:
# What player should the effect be ran on: USER/OPPONENT.
who: OPPONENT
# Amount of EXP to add
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.
identifier: Lightning
@ -26,7 +26,9 @@ effects:
LIGHTNING:
# Chance that this will happen
chance: "5 * {level}"
# The trigger that will fire this effect
trigger: ATTACK_PLAYER_RANGE
# What player should the effect be ran on: USER/OPPONENT.
who: OPPONENT

View File

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

View File

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

View File

@ -1,4 +1,4 @@
author: "Songoda"
author: "Songoda"
# The enchant identifier must be unique.
identifier: Blind

View File

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

View File

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

View File

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

View File

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

View File

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