mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-04-23 19:56:24 +02:00
Compare commits
126 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
52823f5024 | ||
![]() |
1326c257a0 | ||
![]() |
fc3137cd96 | ||
![]() |
c46cc73f52 | ||
![]() |
f11acacedd | ||
![]() |
d1bac90745 | ||
![]() |
e98f628d34 | ||
![]() |
b2ab61559c | ||
![]() |
dd6eb8e74f | ||
![]() |
97cdd03ea4 | ||
![]() |
f5118e6802 | ||
![]() |
94ca5cf679 | ||
![]() |
5a55a1f602 | ||
![]() |
ed33635a15 | ||
![]() |
888682e5d0 | ||
![]() |
72bb5f00b0 | ||
![]() |
773fd6f59f | ||
![]() |
5cce86d924 | ||
![]() |
84567bcb00 | ||
![]() |
d7c2ab1d16 | ||
![]() |
0d359ade0c | ||
![]() |
ffbec24290 | ||
![]() |
ab357deb48 | ||
![]() |
6130c3dfa5 | ||
![]() |
5787588500 | ||
![]() |
b40383b5a4 | ||
![]() |
be8903128d | ||
![]() |
08800ec16d | ||
![]() |
83e274ff9f | ||
![]() |
0dd8b1053c | ||
![]() |
0558fcf5d5 | ||
![]() |
c45bbe3ec5 | ||
![]() |
07e598e48f | ||
![]() |
f6f00dfcda | ||
![]() |
63a6bdc1d6 | ||
![]() |
abbac057ed | ||
![]() |
c978322036 | ||
![]() |
39d2f1a72c | ||
![]() |
86919b8841 | ||
![]() |
00722bc463 | ||
![]() |
6a34a1996f | ||
![]() |
1d201b04ba | ||
![]() |
e887a59158 | ||
![]() |
d1b8f652a7 | ||
![]() |
4aa7bc51bc | ||
![]() |
0f0030916f | ||
![]() |
bbf1e4fe61 | ||
![]() |
febac6fa40 | ||
![]() |
99ee8a780d | ||
![]() |
577a0d8ed9 | ||
![]() |
02ae14894a | ||
![]() |
78dbe7fbbc | ||
![]() |
669293566b | ||
![]() |
707c7be5bd | ||
![]() |
becd8c4eaf | ||
![]() |
339ca8e30f | ||
![]() |
742d78a505 | ||
![]() |
120bf37196 | ||
![]() |
2a40a6b35e | ||
![]() |
ea1f35b45a | ||
![]() |
15e63378a7 | ||
![]() |
f3bc504a6f | ||
![]() |
3a8fae47a0 | ||
![]() |
70cb1cd100 | ||
![]() |
2067cc1670 | ||
![]() |
e6338976dd | ||
![]() |
90ebd5d5ed | ||
![]() |
c973ee8649 | ||
![]() |
c1543f034c | ||
![]() |
6baf339ecb | ||
![]() |
11906ef1c9 | ||
![]() |
ee8902154a | ||
![]() |
b5bc1988e5 | ||
![]() |
2147012beb | ||
![]() |
52bb561689 | ||
![]() |
25ce7a83f1 | ||
![]() |
55c8a590e7 | ||
![]() |
28bd993680 | ||
![]() |
8330f37d8a | ||
![]() |
985fae65b6 | ||
![]() |
db2d590e8e | ||
![]() |
c8d356783a | ||
![]() |
4947450ff0 | ||
![]() |
de4e91ff62 | ||
![]() |
fe5e3d5f6d | ||
![]() |
b8b3098022 | ||
![]() |
0ae8fc46b8 | ||
![]() |
e0762f63a8 | ||
![]() |
9f3850000c | ||
![]() |
76c6be9ba7 | ||
![]() |
308a5aa781 | ||
![]() |
e244527538 | ||
![]() |
11dd013333 | ||
![]() |
b740d5854c | ||
![]() |
d5445cfbef | ||
![]() |
3effaefda7 | ||
![]() |
49b19e0eaf | ||
![]() |
caef3a923b | ||
![]() |
d4c3ceaf2b | ||
![]() |
25e6aecf13 | ||
![]() |
33c11fdee9 | ||
![]() |
316dd92667 | ||
![]() |
e53d2ac449 | ||
![]() |
5786e8cc7a | ||
![]() |
1b717c9b10 | ||
![]() |
35abae99ca | ||
![]() |
d1a85982fb | ||
![]() |
3446b913cd | ||
![]() |
8b8fd6aab7 | ||
![]() |
520bb64eca | ||
![]() |
60d266b2d7 | ||
![]() |
8deeef4f7d | ||
![]() |
9b0b071c0c | ||
![]() |
81a3f1098d | ||
![]() |
efc248dcdb | ||
![]() |
476f3d328d | ||
![]() |
69f5f88183 | ||
![]() |
6df63f7fc7 | ||
![]() |
295b8a0135 | ||
![]() |
fcc5bc5473 | ||
![]() |
408b834376 | ||
![]() |
986812b9e4 | ||
![]() |
8d4333ad9d | ||
![]() |
9ff9097ff9 | ||
![]() |
1ef424a2f1 | ||
![]() |
9fd96dbaa2 |
630
.editorconfig
630
.editorconfig
@ -13,40 +13,6 @@ ij_formatter_tags_enabled = false
|
|||||||
ij_smart_tabs = false
|
ij_smart_tabs = false
|
||||||
ij_wrap_on_typing = true
|
ij_wrap_on_typing = true
|
||||||
|
|
||||||
[*.conf]
|
|
||||||
indent_size = 2
|
|
||||||
tab_width = 2
|
|
||||||
ij_continuation_indent_size = 2
|
|
||||||
ij_hocon_keep_blank_lines_before_right_brace = 2
|
|
||||||
ij_hocon_keep_indents_on_empty_lines = false
|
|
||||||
ij_hocon_keep_line_breaks = true
|
|
||||||
ij_hocon_space_after_colon = true
|
|
||||||
ij_hocon_space_after_comma = true
|
|
||||||
ij_hocon_space_before_colon = true
|
|
||||||
ij_hocon_space_before_comma = false
|
|
||||||
ij_hocon_spaces_within_braces = false
|
|
||||||
ij_hocon_spaces_within_brackets = false
|
|
||||||
ij_hocon_spaces_within_method_call_parentheses = false
|
|
||||||
|
|
||||||
[*.css]
|
|
||||||
ij_css_align_closing_brace_with_properties = false
|
|
||||||
ij_css_blank_lines_around_nested_selector = 1
|
|
||||||
ij_css_blank_lines_between_blocks = 1
|
|
||||||
ij_css_brace_placement = end_of_line
|
|
||||||
ij_css_enforce_quotes_on_format = false
|
|
||||||
ij_css_hex_color_long_format = false
|
|
||||||
ij_css_hex_color_lower_case = false
|
|
||||||
ij_css_hex_color_short_format = false
|
|
||||||
ij_css_hex_color_upper_case = false
|
|
||||||
ij_css_keep_blank_lines_in_code = 2
|
|
||||||
ij_css_keep_indents_on_empty_lines = false
|
|
||||||
ij_css_keep_single_line_blocks = false
|
|
||||||
ij_css_properties_order = font, font-family, font-size, font-weight, font-style, font-variant, font-size-adjust, font-stretch, line-height, position, z-index, top, right, bottom, left, display, visibility, float, clear, overflow, overflow-x, overflow-y, clip, zoom, align-content, align-items, align-self, flex, flex-flow, flex-basis, flex-direction, flex-grow, flex-shrink, flex-wrap, justify-content, order, box-sizing, width, min-width, max-width, height, min-height, max-height, margin, margin-top, margin-right, margin-bottom, margin-left, padding, padding-top, padding-right, padding-bottom, padding-left, table-layout, empty-cells, caption-side, border-spacing, border-collapse, list-style, list-style-position, list-style-type, list-style-image, content, quotes, counter-reset, counter-increment, resize, cursor, user-select, nav-index, nav-up, nav-right, nav-down, nav-left, transition, transition-delay, transition-timing-function, transition-duration, transition-property, transform, transform-origin, animation, animation-name, animation-duration, animation-play-state, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, text-align, text-align-last, vertical-align, white-space, text-decoration, text-emphasis, text-emphasis-color, text-emphasis-style, text-emphasis-position, text-indent, text-justify, letter-spacing, word-spacing, text-outline, text-transform, text-wrap, text-overflow, text-overflow-ellipsis, text-overflow-mode, word-wrap, word-break, tab-size, hyphens, pointer-events, opacity, color, border, border-width, border-style, border-color, border-top, border-top-width, border-top-style, border-top-color, border-right, border-right-width, border-right-style, border-right-color, border-bottom, border-bottom-width, border-bottom-style, border-bottom-color, border-left, border-left-width, border-left-style, border-left-color, border-radius, border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius, border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, border-image-repeat, outline, outline-width, outline-style, outline-color, outline-offset, background, background-color, background-image, background-repeat, background-attachment, background-position, background-position-x, background-position-y, background-clip, background-origin, background-size, box-decoration-break, box-shadow, text-shadow
|
|
||||||
ij_css_space_after_colon = true
|
|
||||||
ij_css_space_before_opening_brace = true
|
|
||||||
ij_css_use_double_quotes = true
|
|
||||||
ij_css_value_alignment = do_not_align
|
|
||||||
|
|
||||||
[*.java]
|
[*.java]
|
||||||
ij_java_align_consecutive_assignments = false
|
ij_java_align_consecutive_assignments = false
|
||||||
ij_java_align_consecutive_variable_declarations = false
|
ij_java_align_consecutive_variable_declarations = false
|
||||||
@ -277,63 +243,12 @@ ij_java_wrap_comments = false
|
|||||||
ij_java_wrap_first_method_in_call_chain = true
|
ij_java_wrap_first_method_in_call_chain = true
|
||||||
ij_java_wrap_long_lines = false
|
ij_java_wrap_long_lines = false
|
||||||
|
|
||||||
[*.nbtt]
|
|
||||||
max_line_length = 150
|
|
||||||
ij_continuation_indent_size = 4
|
|
||||||
ij_nbtt_keep_indents_on_empty_lines = false
|
|
||||||
ij_nbtt_space_after_colon = true
|
|
||||||
ij_nbtt_space_after_comma = true
|
|
||||||
ij_nbtt_space_before_colon = true
|
|
||||||
ij_nbtt_space_before_comma = false
|
|
||||||
ij_nbtt_spaces_within_brackets = false
|
|
||||||
ij_nbtt_spaces_within_parentheses = false
|
|
||||||
|
|
||||||
[*.properties]
|
[*.properties]
|
||||||
ij_properties_align_group_field_declarations = false
|
ij_properties_align_group_field_declarations = false
|
||||||
ij_properties_keep_blank_lines = false
|
ij_properties_keep_blank_lines = false
|
||||||
ij_properties_key_value_delimiter = equals
|
ij_properties_key_value_delimiter = equals
|
||||||
ij_properties_spaces_around_key_value_delimiter = false
|
ij_properties_spaces_around_key_value_delimiter = false
|
||||||
|
|
||||||
[*.sass]
|
|
||||||
indent_size = 2
|
|
||||||
ij_sass_align_closing_brace_with_properties = false
|
|
||||||
ij_sass_blank_lines_around_nested_selector = 1
|
|
||||||
ij_sass_blank_lines_between_blocks = 1
|
|
||||||
ij_sass_brace_placement = 0
|
|
||||||
ij_sass_enforce_quotes_on_format = false
|
|
||||||
ij_sass_hex_color_long_format = false
|
|
||||||
ij_sass_hex_color_lower_case = false
|
|
||||||
ij_sass_hex_color_short_format = false
|
|
||||||
ij_sass_hex_color_upper_case = false
|
|
||||||
ij_sass_keep_blank_lines_in_code = 2
|
|
||||||
ij_sass_keep_indents_on_empty_lines = false
|
|
||||||
ij_sass_keep_single_line_blocks = false
|
|
||||||
ij_sass_properties_order = font, font-family, font-size, font-weight, font-style, font-variant, font-size-adjust, font-stretch, line-height, position, z-index, top, right, bottom, left, display, visibility, float, clear, overflow, overflow-x, overflow-y, clip, zoom, align-content, align-items, align-self, flex, flex-flow, flex-basis, flex-direction, flex-grow, flex-shrink, flex-wrap, justify-content, order, box-sizing, width, min-width, max-width, height, min-height, max-height, margin, margin-top, margin-right, margin-bottom, margin-left, padding, padding-top, padding-right, padding-bottom, padding-left, table-layout, empty-cells, caption-side, border-spacing, border-collapse, list-style, list-style-position, list-style-type, list-style-image, content, quotes, counter-reset, counter-increment, resize, cursor, user-select, nav-index, nav-up, nav-right, nav-down, nav-left, transition, transition-delay, transition-timing-function, transition-duration, transition-property, transform, transform-origin, animation, animation-name, animation-duration, animation-play-state, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, text-align, text-align-last, vertical-align, white-space, text-decoration, text-emphasis, text-emphasis-color, text-emphasis-style, text-emphasis-position, text-indent, text-justify, letter-spacing, word-spacing, text-outline, text-transform, text-wrap, text-overflow, text-overflow-ellipsis, text-overflow-mode, word-wrap, word-break, tab-size, hyphens, pointer-events, opacity, color, border, border-width, border-style, border-color, border-top, border-top-width, border-top-style, border-top-color, border-right, border-right-width, border-right-style, border-right-color, border-bottom, border-bottom-width, border-bottom-style, border-bottom-color, border-left, border-left-width, border-left-style, border-left-color, border-radius, border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius, border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, border-image-repeat, outline, outline-width, outline-style, outline-color, outline-offset, background, background-color, background-image, background-repeat, background-attachment, background-position, background-position-x, background-position-y, background-clip, background-origin, background-size, box-decoration-break, box-shadow, text-shadow
|
|
||||||
ij_sass_space_after_colon = true
|
|
||||||
ij_sass_space_before_opening_brace = true
|
|
||||||
ij_sass_use_double_quotes = true
|
|
||||||
ij_sass_value_alignment = 0
|
|
||||||
|
|
||||||
[*.scss]
|
|
||||||
indent_size = 2
|
|
||||||
ij_scss_align_closing_brace_with_properties = false
|
|
||||||
ij_scss_blank_lines_around_nested_selector = 1
|
|
||||||
ij_scss_blank_lines_between_blocks = 1
|
|
||||||
ij_scss_brace_placement = 0
|
|
||||||
ij_scss_enforce_quotes_on_format = false
|
|
||||||
ij_scss_hex_color_long_format = false
|
|
||||||
ij_scss_hex_color_lower_case = false
|
|
||||||
ij_scss_hex_color_short_format = false
|
|
||||||
ij_scss_hex_color_upper_case = false
|
|
||||||
ij_scss_keep_blank_lines_in_code = 2
|
|
||||||
ij_scss_keep_indents_on_empty_lines = false
|
|
||||||
ij_scss_keep_single_line_blocks = false
|
|
||||||
ij_scss_properties_order = font, font-family, font-size, font-weight, font-style, font-variant, font-size-adjust, font-stretch, line-height, position, z-index, top, right, bottom, left, display, visibility, float, clear, overflow, overflow-x, overflow-y, clip, zoom, align-content, align-items, align-self, flex, flex-flow, flex-basis, flex-direction, flex-grow, flex-shrink, flex-wrap, justify-content, order, box-sizing, width, min-width, max-width, height, min-height, max-height, margin, margin-top, margin-right, margin-bottom, margin-left, padding, padding-top, padding-right, padding-bottom, padding-left, table-layout, empty-cells, caption-side, border-spacing, border-collapse, list-style, list-style-position, list-style-type, list-style-image, content, quotes, counter-reset, counter-increment, resize, cursor, user-select, nav-index, nav-up, nav-right, nav-down, nav-left, transition, transition-delay, transition-timing-function, transition-duration, transition-property, transform, transform-origin, animation, animation-name, animation-duration, animation-play-state, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, text-align, text-align-last, vertical-align, white-space, text-decoration, text-emphasis, text-emphasis-color, text-emphasis-style, text-emphasis-position, text-indent, text-justify, letter-spacing, word-spacing, text-outline, text-transform, text-wrap, text-overflow, text-overflow-ellipsis, text-overflow-mode, word-wrap, word-break, tab-size, hyphens, pointer-events, opacity, color, border, border-width, border-style, border-color, border-top, border-top-width, border-top-style, border-top-color, border-right, border-right-width, border-right-style, border-right-color, border-bottom, border-bottom-width, border-bottom-style, border-bottom-color, border-left, border-left-width, border-left-style, border-left-color, border-radius, border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius, border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, border-image-repeat, outline, outline-width, outline-style, outline-color, outline-offset, background, background-color, background-image, background-repeat, background-attachment, background-position, background-position-x, background-position-y, background-clip, background-origin, background-size, box-decoration-break, box-shadow, text-shadow
|
|
||||||
ij_scss_space_after_colon = true
|
|
||||||
ij_scss_space_before_opening_brace = true
|
|
||||||
ij_scss_use_double_quotes = true
|
|
||||||
ij_scss_value_alignment = 0
|
|
||||||
|
|
||||||
[.editorconfig]
|
[.editorconfig]
|
||||||
ij_editorconfig_align_group_field_declarations = false
|
ij_editorconfig_align_group_field_declarations = false
|
||||||
ij_editorconfig_space_after_colon = false
|
ij_editorconfig_space_after_colon = false
|
||||||
@ -342,548 +257,6 @@ ij_editorconfig_space_before_colon = false
|
|||||||
ij_editorconfig_space_before_comma = false
|
ij_editorconfig_space_before_comma = false
|
||||||
ij_editorconfig_spaces_around_assignment_operators = true
|
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
|
|
||||||
|
|
||||||
[{*.ats, *.ts}]
|
|
||||||
ij_continuation_indent_size = 4
|
|
||||||
ij_typescript_align_imports = false
|
|
||||||
ij_typescript_align_multiline_array_initializer_expression = false
|
|
||||||
ij_typescript_align_multiline_binary_operation = false
|
|
||||||
ij_typescript_align_multiline_chained_methods = false
|
|
||||||
ij_typescript_align_multiline_extends_list = false
|
|
||||||
ij_typescript_align_multiline_for = true
|
|
||||||
ij_typescript_align_multiline_parameters = true
|
|
||||||
ij_typescript_align_multiline_parameters_in_calls = false
|
|
||||||
ij_typescript_align_multiline_ternary_operation = false
|
|
||||||
ij_typescript_align_object_properties = 0
|
|
||||||
ij_typescript_align_union_types = false
|
|
||||||
ij_typescript_align_var_statements = 0
|
|
||||||
ij_typescript_array_initializer_new_line_after_left_brace = false
|
|
||||||
ij_typescript_array_initializer_right_brace_on_new_line = false
|
|
||||||
ij_typescript_array_initializer_wrap = off
|
|
||||||
ij_typescript_assignment_wrap = off
|
|
||||||
ij_typescript_binary_operation_sign_on_next_line = false
|
|
||||||
ij_typescript_binary_operation_wrap = off
|
|
||||||
ij_typescript_blacklist_imports = rxjs/Rx, node_modules/**, **/node_modules/**, @angular/material, @angular/material/typings/**
|
|
||||||
ij_typescript_blank_lines_after_imports = 1
|
|
||||||
ij_typescript_blank_lines_around_class = 1
|
|
||||||
ij_typescript_blank_lines_around_field = 0
|
|
||||||
ij_typescript_blank_lines_around_field_in_interface = 0
|
|
||||||
ij_typescript_blank_lines_around_function = 1
|
|
||||||
ij_typescript_blank_lines_around_method = 1
|
|
||||||
ij_typescript_blank_lines_around_method_in_interface = 1
|
|
||||||
ij_typescript_block_brace_style = end_of_line
|
|
||||||
ij_typescript_call_parameters_new_line_after_left_paren = false
|
|
||||||
ij_typescript_call_parameters_right_paren_on_new_line = false
|
|
||||||
ij_typescript_call_parameters_wrap = off
|
|
||||||
ij_typescript_catch_on_new_line = false
|
|
||||||
ij_typescript_chained_call_dot_on_new_line = true
|
|
||||||
ij_typescript_class_brace_style = end_of_line
|
|
||||||
ij_typescript_comma_on_new_line = false
|
|
||||||
ij_typescript_do_while_brace_force = never
|
|
||||||
ij_typescript_else_on_new_line = false
|
|
||||||
ij_typescript_enforce_trailing_comma = keep
|
|
||||||
ij_typescript_extends_keyword_wrap = off
|
|
||||||
ij_typescript_extends_list_wrap = off
|
|
||||||
ij_typescript_field_prefix = _
|
|
||||||
ij_typescript_file_name_style = relaxed
|
|
||||||
ij_typescript_finally_on_new_line = false
|
|
||||||
ij_typescript_for_brace_force = never
|
|
||||||
ij_typescript_for_statement_new_line_after_left_paren = false
|
|
||||||
ij_typescript_for_statement_right_paren_on_new_line = false
|
|
||||||
ij_typescript_for_statement_wrap = off
|
|
||||||
ij_typescript_force_quote_style = false
|
|
||||||
ij_typescript_force_semicolon_style = false
|
|
||||||
ij_typescript_function_expression_brace_style = end_of_line
|
|
||||||
ij_typescript_if_brace_force = never
|
|
||||||
ij_typescript_import_merge_members = global
|
|
||||||
ij_typescript_import_prefer_absolute_path = global
|
|
||||||
ij_typescript_import_sort_members = true
|
|
||||||
ij_typescript_import_sort_module_name = false
|
|
||||||
ij_typescript_import_use_node_resolution = true
|
|
||||||
ij_typescript_imports_wrap = on_every_item
|
|
||||||
ij_typescript_indent_case_from_switch = true
|
|
||||||
ij_typescript_indent_chained_calls = true
|
|
||||||
ij_typescript_indent_package_children = 0
|
|
||||||
ij_typescript_jsdoc_include_types = false
|
|
||||||
ij_typescript_jsx_attribute_value = braces
|
|
||||||
ij_typescript_keep_blank_lines_in_code = 2
|
|
||||||
ij_typescript_keep_first_column_comment = true
|
|
||||||
ij_typescript_keep_indents_on_empty_lines = false
|
|
||||||
ij_typescript_keep_line_breaks = true
|
|
||||||
ij_typescript_keep_simple_blocks_in_one_line = false
|
|
||||||
ij_typescript_keep_simple_methods_in_one_line = false
|
|
||||||
ij_typescript_line_comment_add_space = true
|
|
||||||
ij_typescript_line_comment_at_first_column = false
|
|
||||||
ij_typescript_method_brace_style = end_of_line
|
|
||||||
ij_typescript_method_call_chain_wrap = off
|
|
||||||
ij_typescript_method_parameters_new_line_after_left_paren = false
|
|
||||||
ij_typescript_method_parameters_right_paren_on_new_line = false
|
|
||||||
ij_typescript_method_parameters_wrap = off
|
|
||||||
ij_typescript_object_literal_wrap = on_every_item
|
|
||||||
ij_typescript_parentheses_expression_new_line_after_left_paren = false
|
|
||||||
ij_typescript_parentheses_expression_right_paren_on_new_line = false
|
|
||||||
ij_typescript_place_assignment_sign_on_next_line = false
|
|
||||||
ij_typescript_prefer_as_type_cast = false
|
|
||||||
ij_typescript_prefer_explicit_types_function_expression_returns = false
|
|
||||||
ij_typescript_prefer_explicit_types_function_returns = false
|
|
||||||
ij_typescript_prefer_explicit_types_vars_fields = false
|
|
||||||
ij_typescript_prefer_parameters_wrap = false
|
|
||||||
ij_typescript_reformat_c_style_comments = false
|
|
||||||
ij_typescript_space_after_colon = true
|
|
||||||
ij_typescript_space_after_comma = true
|
|
||||||
ij_typescript_space_after_dots_in_rest_parameter = false
|
|
||||||
ij_typescript_space_after_generator_mult = true
|
|
||||||
ij_typescript_space_after_property_colon = true
|
|
||||||
ij_typescript_space_after_quest = true
|
|
||||||
ij_typescript_space_after_type_colon = true
|
|
||||||
ij_typescript_space_after_unary_not = false
|
|
||||||
ij_typescript_space_before_async_arrow_lparen = true
|
|
||||||
ij_typescript_space_before_catch_keyword = true
|
|
||||||
ij_typescript_space_before_catch_left_brace = true
|
|
||||||
ij_typescript_space_before_catch_parentheses = true
|
|
||||||
ij_typescript_space_before_class_lbrace = true
|
|
||||||
ij_typescript_space_before_class_left_brace = true
|
|
||||||
ij_typescript_space_before_colon = true
|
|
||||||
ij_typescript_space_before_comma = false
|
|
||||||
ij_typescript_space_before_do_left_brace = true
|
|
||||||
ij_typescript_space_before_else_keyword = true
|
|
||||||
ij_typescript_space_before_else_left_brace = true
|
|
||||||
ij_typescript_space_before_finally_keyword = true
|
|
||||||
ij_typescript_space_before_finally_left_brace = true
|
|
||||||
ij_typescript_space_before_for_left_brace = true
|
|
||||||
ij_typescript_space_before_for_parentheses = true
|
|
||||||
ij_typescript_space_before_for_semicolon = false
|
|
||||||
ij_typescript_space_before_function_left_parenth = true
|
|
||||||
ij_typescript_space_before_generator_mult = false
|
|
||||||
ij_typescript_space_before_if_left_brace = true
|
|
||||||
ij_typescript_space_before_if_parentheses = true
|
|
||||||
ij_typescript_space_before_method_call_parentheses = false
|
|
||||||
ij_typescript_space_before_method_left_brace = true
|
|
||||||
ij_typescript_space_before_method_parentheses = false
|
|
||||||
ij_typescript_space_before_property_colon = false
|
|
||||||
ij_typescript_space_before_quest = true
|
|
||||||
ij_typescript_space_before_switch_left_brace = true
|
|
||||||
ij_typescript_space_before_switch_parentheses = true
|
|
||||||
ij_typescript_space_before_try_left_brace = true
|
|
||||||
ij_typescript_space_before_type_colon = false
|
|
||||||
ij_typescript_space_before_unary_not = false
|
|
||||||
ij_typescript_space_before_while_keyword = true
|
|
||||||
ij_typescript_space_before_while_left_brace = true
|
|
||||||
ij_typescript_space_before_while_parentheses = true
|
|
||||||
ij_typescript_spaces_around_additive_operators = true
|
|
||||||
ij_typescript_spaces_around_arrow_function_operator = true
|
|
||||||
ij_typescript_spaces_around_assignment_operators = true
|
|
||||||
ij_typescript_spaces_around_bitwise_operators = true
|
|
||||||
ij_typescript_spaces_around_equality_operators = true
|
|
||||||
ij_typescript_spaces_around_logical_operators = true
|
|
||||||
ij_typescript_spaces_around_multiplicative_operators = true
|
|
||||||
ij_typescript_spaces_around_relational_operators = true
|
|
||||||
ij_typescript_spaces_around_shift_operators = true
|
|
||||||
ij_typescript_spaces_around_unary_operator = false
|
|
||||||
ij_typescript_spaces_within_array_initializer_brackets = false
|
|
||||||
ij_typescript_spaces_within_brackets = false
|
|
||||||
ij_typescript_spaces_within_catch_parentheses = false
|
|
||||||
ij_typescript_spaces_within_for_parentheses = false
|
|
||||||
ij_typescript_spaces_within_if_parentheses = false
|
|
||||||
ij_typescript_spaces_within_imports = false
|
|
||||||
ij_typescript_spaces_within_interpolation_expressions = false
|
|
||||||
ij_typescript_spaces_within_method_call_parentheses = false
|
|
||||||
ij_typescript_spaces_within_method_parentheses = false
|
|
||||||
ij_typescript_spaces_within_object_literal_braces = false
|
|
||||||
ij_typescript_spaces_within_object_type_braces = true
|
|
||||||
ij_typescript_spaces_within_parentheses = false
|
|
||||||
ij_typescript_spaces_within_switch_parentheses = false
|
|
||||||
ij_typescript_spaces_within_type_assertion = false
|
|
||||||
ij_typescript_spaces_within_union_types = true
|
|
||||||
ij_typescript_spaces_within_while_parentheses = false
|
|
||||||
ij_typescript_special_else_if_treatment = true
|
|
||||||
ij_typescript_ternary_operation_signs_on_next_line = false
|
|
||||||
ij_typescript_ternary_operation_wrap = off
|
|
||||||
ij_typescript_union_types_wrap = on_every_item
|
|
||||||
ij_typescript_use_chained_calls_group_indents = false
|
|
||||||
ij_typescript_use_double_quotes = true
|
|
||||||
ij_typescript_use_explicit_js_extension = global
|
|
||||||
ij_typescript_use_path_mapping = always
|
|
||||||
ij_typescript_use_public_modifier = false
|
|
||||||
ij_typescript_use_semicolon_after_statement = true
|
|
||||||
ij_typescript_var_declaration_wrap = normal
|
|
||||||
ij_typescript_while_brace_force = never
|
|
||||||
ij_typescript_while_on_new_line = false
|
|
||||||
ij_typescript_wrap_comments = false
|
|
||||||
|
|
||||||
[{*.bash, *.sh, *.zsh}]
|
|
||||||
indent_size = 2
|
|
||||||
tab_width = 2
|
|
||||||
ij_shell_binary_ops_start_line = false
|
|
||||||
ij_shell_keep_column_alignment_padding = false
|
|
||||||
ij_shell_minify_program = false
|
|
||||||
ij_shell_redirect_followed_by_space = false
|
|
||||||
ij_shell_switch_cases_indented = false
|
|
||||||
|
|
||||||
[{*.cjs, *.js}]
|
|
||||||
ij_continuation_indent_size = 4
|
|
||||||
ij_javascript_align_imports = false
|
|
||||||
ij_javascript_align_multiline_array_initializer_expression = false
|
|
||||||
ij_javascript_align_multiline_binary_operation = false
|
|
||||||
ij_javascript_align_multiline_chained_methods = false
|
|
||||||
ij_javascript_align_multiline_extends_list = false
|
|
||||||
ij_javascript_align_multiline_for = true
|
|
||||||
ij_javascript_align_multiline_parameters = true
|
|
||||||
ij_javascript_align_multiline_parameters_in_calls = false
|
|
||||||
ij_javascript_align_multiline_ternary_operation = false
|
|
||||||
ij_javascript_align_object_properties = 0
|
|
||||||
ij_javascript_align_union_types = false
|
|
||||||
ij_javascript_align_var_statements = 0
|
|
||||||
ij_javascript_array_initializer_new_line_after_left_brace = false
|
|
||||||
ij_javascript_array_initializer_right_brace_on_new_line = false
|
|
||||||
ij_javascript_array_initializer_wrap = off
|
|
||||||
ij_javascript_assignment_wrap = off
|
|
||||||
ij_javascript_binary_operation_sign_on_next_line = false
|
|
||||||
ij_javascript_binary_operation_wrap = off
|
|
||||||
ij_javascript_blacklist_imports = rxjs/Rx, node_modules/**, **/node_modules/**, @angular/material, @angular/material/typings/**
|
|
||||||
ij_javascript_blank_lines_after_imports = 1
|
|
||||||
ij_javascript_blank_lines_around_class = 1
|
|
||||||
ij_javascript_blank_lines_around_field = 0
|
|
||||||
ij_javascript_blank_lines_around_function = 1
|
|
||||||
ij_javascript_blank_lines_around_method = 1
|
|
||||||
ij_javascript_block_brace_style = end_of_line
|
|
||||||
ij_javascript_call_parameters_new_line_after_left_paren = false
|
|
||||||
ij_javascript_call_parameters_right_paren_on_new_line = false
|
|
||||||
ij_javascript_call_parameters_wrap = off
|
|
||||||
ij_javascript_catch_on_new_line = false
|
|
||||||
ij_javascript_chained_call_dot_on_new_line = true
|
|
||||||
ij_javascript_class_brace_style = end_of_line
|
|
||||||
ij_javascript_comma_on_new_line = false
|
|
||||||
ij_javascript_do_while_brace_force = never
|
|
||||||
ij_javascript_else_on_new_line = false
|
|
||||||
ij_javascript_enforce_trailing_comma = keep
|
|
||||||
ij_javascript_extends_keyword_wrap = off
|
|
||||||
ij_javascript_extends_list_wrap = off
|
|
||||||
ij_javascript_field_prefix = _
|
|
||||||
ij_javascript_file_name_style = relaxed
|
|
||||||
ij_javascript_finally_on_new_line = false
|
|
||||||
ij_javascript_for_brace_force = never
|
|
||||||
ij_javascript_for_statement_new_line_after_left_paren = false
|
|
||||||
ij_javascript_for_statement_right_paren_on_new_line = false
|
|
||||||
ij_javascript_for_statement_wrap = off
|
|
||||||
ij_javascript_force_quote_style = false
|
|
||||||
ij_javascript_force_semicolon_style = false
|
|
||||||
ij_javascript_function_expression_brace_style = end_of_line
|
|
||||||
ij_javascript_if_brace_force = never
|
|
||||||
ij_javascript_import_merge_members = global
|
|
||||||
ij_javascript_import_prefer_absolute_path = global
|
|
||||||
ij_javascript_import_sort_members = true
|
|
||||||
ij_javascript_import_sort_module_name = false
|
|
||||||
ij_javascript_import_use_node_resolution = true
|
|
||||||
ij_javascript_imports_wrap = on_every_item
|
|
||||||
ij_javascript_indent_case_from_switch = true
|
|
||||||
ij_javascript_indent_chained_calls = true
|
|
||||||
ij_javascript_indent_package_children = 0
|
|
||||||
ij_javascript_jsx_attribute_value = braces
|
|
||||||
ij_javascript_keep_blank_lines_in_code = 2
|
|
||||||
ij_javascript_keep_first_column_comment = true
|
|
||||||
ij_javascript_keep_indents_on_empty_lines = false
|
|
||||||
ij_javascript_keep_line_breaks = true
|
|
||||||
ij_javascript_keep_simple_blocks_in_one_line = false
|
|
||||||
ij_javascript_keep_simple_methods_in_one_line = false
|
|
||||||
ij_javascript_line_comment_add_space = true
|
|
||||||
ij_javascript_line_comment_at_first_column = false
|
|
||||||
ij_javascript_method_brace_style = end_of_line
|
|
||||||
ij_javascript_method_call_chain_wrap = off
|
|
||||||
ij_javascript_method_parameters_new_line_after_left_paren = false
|
|
||||||
ij_javascript_method_parameters_right_paren_on_new_line = false
|
|
||||||
ij_javascript_method_parameters_wrap = off
|
|
||||||
ij_javascript_object_literal_wrap = on_every_item
|
|
||||||
ij_javascript_parentheses_expression_new_line_after_left_paren = false
|
|
||||||
ij_javascript_parentheses_expression_right_paren_on_new_line = false
|
|
||||||
ij_javascript_place_assignment_sign_on_next_line = false
|
|
||||||
ij_javascript_prefer_as_type_cast = false
|
|
||||||
ij_javascript_prefer_explicit_types_function_expression_returns = false
|
|
||||||
ij_javascript_prefer_explicit_types_function_returns = false
|
|
||||||
ij_javascript_prefer_explicit_types_vars_fields = false
|
|
||||||
ij_javascript_prefer_parameters_wrap = false
|
|
||||||
ij_javascript_reformat_c_style_comments = false
|
|
||||||
ij_javascript_space_after_colon = true
|
|
||||||
ij_javascript_space_after_comma = true
|
|
||||||
ij_javascript_space_after_dots_in_rest_parameter = false
|
|
||||||
ij_javascript_space_after_generator_mult = true
|
|
||||||
ij_javascript_space_after_property_colon = true
|
|
||||||
ij_javascript_space_after_quest = true
|
|
||||||
ij_javascript_space_after_type_colon = true
|
|
||||||
ij_javascript_space_after_unary_not = false
|
|
||||||
ij_javascript_space_before_async_arrow_lparen = true
|
|
||||||
ij_javascript_space_before_catch_keyword = true
|
|
||||||
ij_javascript_space_before_catch_left_brace = true
|
|
||||||
ij_javascript_space_before_catch_parentheses = true
|
|
||||||
ij_javascript_space_before_class_lbrace = true
|
|
||||||
ij_javascript_space_before_class_left_brace = true
|
|
||||||
ij_javascript_space_before_colon = true
|
|
||||||
ij_javascript_space_before_comma = false
|
|
||||||
ij_javascript_space_before_do_left_brace = true
|
|
||||||
ij_javascript_space_before_else_keyword = true
|
|
||||||
ij_javascript_space_before_else_left_brace = true
|
|
||||||
ij_javascript_space_before_finally_keyword = true
|
|
||||||
ij_javascript_space_before_finally_left_brace = true
|
|
||||||
ij_javascript_space_before_for_left_brace = true
|
|
||||||
ij_javascript_space_before_for_parentheses = true
|
|
||||||
ij_javascript_space_before_for_semicolon = false
|
|
||||||
ij_javascript_space_before_function_left_parenth = true
|
|
||||||
ij_javascript_space_before_generator_mult = false
|
|
||||||
ij_javascript_space_before_if_left_brace = true
|
|
||||||
ij_javascript_space_before_if_parentheses = true
|
|
||||||
ij_javascript_space_before_method_call_parentheses = false
|
|
||||||
ij_javascript_space_before_method_left_brace = true
|
|
||||||
ij_javascript_space_before_method_parentheses = false
|
|
||||||
ij_javascript_space_before_property_colon = false
|
|
||||||
ij_javascript_space_before_quest = true
|
|
||||||
ij_javascript_space_before_switch_left_brace = true
|
|
||||||
ij_javascript_space_before_switch_parentheses = true
|
|
||||||
ij_javascript_space_before_try_left_brace = true
|
|
||||||
ij_javascript_space_before_type_colon = false
|
|
||||||
ij_javascript_space_before_unary_not = false
|
|
||||||
ij_javascript_space_before_while_keyword = true
|
|
||||||
ij_javascript_space_before_while_left_brace = true
|
|
||||||
ij_javascript_space_before_while_parentheses = true
|
|
||||||
ij_javascript_spaces_around_additive_operators = true
|
|
||||||
ij_javascript_spaces_around_arrow_function_operator = true
|
|
||||||
ij_javascript_spaces_around_assignment_operators = true
|
|
||||||
ij_javascript_spaces_around_bitwise_operators = true
|
|
||||||
ij_javascript_spaces_around_equality_operators = true
|
|
||||||
ij_javascript_spaces_around_logical_operators = true
|
|
||||||
ij_javascript_spaces_around_multiplicative_operators = true
|
|
||||||
ij_javascript_spaces_around_relational_operators = true
|
|
||||||
ij_javascript_spaces_around_shift_operators = true
|
|
||||||
ij_javascript_spaces_around_unary_operator = false
|
|
||||||
ij_javascript_spaces_within_array_initializer_brackets = false
|
|
||||||
ij_javascript_spaces_within_brackets = false
|
|
||||||
ij_javascript_spaces_within_catch_parentheses = false
|
|
||||||
ij_javascript_spaces_within_for_parentheses = false
|
|
||||||
ij_javascript_spaces_within_if_parentheses = false
|
|
||||||
ij_javascript_spaces_within_imports = false
|
|
||||||
ij_javascript_spaces_within_interpolation_expressions = false
|
|
||||||
ij_javascript_spaces_within_method_call_parentheses = false
|
|
||||||
ij_javascript_spaces_within_method_parentheses = false
|
|
||||||
ij_javascript_spaces_within_object_literal_braces = false
|
|
||||||
ij_javascript_spaces_within_object_type_braces = true
|
|
||||||
ij_javascript_spaces_within_parentheses = false
|
|
||||||
ij_javascript_spaces_within_switch_parentheses = false
|
|
||||||
ij_javascript_spaces_within_type_assertion = false
|
|
||||||
ij_javascript_spaces_within_union_types = true
|
|
||||||
ij_javascript_spaces_within_while_parentheses = false
|
|
||||||
ij_javascript_special_else_if_treatment = true
|
|
||||||
ij_javascript_ternary_operation_signs_on_next_line = false
|
|
||||||
ij_javascript_ternary_operation_wrap = off
|
|
||||||
ij_javascript_union_types_wrap = on_every_item
|
|
||||||
ij_javascript_use_chained_calls_group_indents = false
|
|
||||||
ij_javascript_use_double_quotes = true
|
|
||||||
ij_javascript_use_explicit_js_extension = global
|
|
||||||
ij_javascript_use_path_mapping = always
|
|
||||||
ij_javascript_use_public_modifier = false
|
|
||||||
ij_javascript_use_semicolon_after_statement = true
|
|
||||||
ij_javascript_var_declaration_wrap = normal
|
|
||||||
ij_javascript_while_brace_force = never
|
|
||||||
ij_javascript_while_on_new_line = false
|
|
||||||
ij_javascript_wrap_comments = false
|
|
||||||
|
|
||||||
[{*.ft, *.vm, *.vsl}]
|
|
||||||
ij_vtl_keep_indents_on_empty_lines = false
|
|
||||||
|
|
||||||
[{*.gant, *.gradle, *.groovy, *.gy}]
|
|
||||||
ij_groovy_align_group_field_declarations = false
|
|
||||||
ij_groovy_align_multiline_array_initializer_expression = false
|
|
||||||
ij_groovy_align_multiline_assignment = false
|
|
||||||
ij_groovy_align_multiline_binary_operation = false
|
|
||||||
ij_groovy_align_multiline_chained_methods = false
|
|
||||||
ij_groovy_align_multiline_extends_list = false
|
|
||||||
ij_groovy_align_multiline_for = true
|
|
||||||
ij_groovy_align_multiline_list_or_map = true
|
|
||||||
ij_groovy_align_multiline_method_parentheses = false
|
|
||||||
ij_groovy_align_multiline_parameters = true
|
|
||||||
ij_groovy_align_multiline_parameters_in_calls = false
|
|
||||||
ij_groovy_align_multiline_resources = true
|
|
||||||
ij_groovy_align_multiline_ternary_operation = false
|
|
||||||
ij_groovy_align_multiline_throws_list = false
|
|
||||||
ij_groovy_align_named_args_in_map = true
|
|
||||||
ij_groovy_align_throws_keyword = false
|
|
||||||
ij_groovy_array_initializer_new_line_after_left_brace = false
|
|
||||||
ij_groovy_array_initializer_right_brace_on_new_line = false
|
|
||||||
ij_groovy_array_initializer_wrap = off
|
|
||||||
ij_groovy_assert_statement_wrap = off
|
|
||||||
ij_groovy_assignment_wrap = off
|
|
||||||
ij_groovy_binary_operation_wrap = off
|
|
||||||
ij_groovy_blank_lines_after_class_header = 0
|
|
||||||
ij_groovy_blank_lines_after_imports = 1
|
|
||||||
ij_groovy_blank_lines_after_package = 1
|
|
||||||
ij_groovy_blank_lines_around_class = 1
|
|
||||||
ij_groovy_blank_lines_around_field = 0
|
|
||||||
ij_groovy_blank_lines_around_field_in_interface = 0
|
|
||||||
ij_groovy_blank_lines_around_method = 1
|
|
||||||
ij_groovy_blank_lines_around_method_in_interface = 1
|
|
||||||
ij_groovy_blank_lines_before_imports = 1
|
|
||||||
ij_groovy_blank_lines_before_method_body = 0
|
|
||||||
ij_groovy_blank_lines_before_package = 0
|
|
||||||
ij_groovy_block_brace_style = end_of_line
|
|
||||||
ij_groovy_block_comment_at_first_column = true
|
|
||||||
ij_groovy_call_parameters_new_line_after_left_paren = false
|
|
||||||
ij_groovy_call_parameters_right_paren_on_new_line = false
|
|
||||||
ij_groovy_call_parameters_wrap = off
|
|
||||||
ij_groovy_catch_on_new_line = false
|
|
||||||
ij_groovy_class_annotation_wrap = split_into_lines
|
|
||||||
ij_groovy_class_brace_style = end_of_line
|
|
||||||
ij_groovy_class_count_to_use_import_on_demand = 5
|
|
||||||
ij_groovy_do_while_brace_force = never
|
|
||||||
ij_groovy_else_on_new_line = false
|
|
||||||
ij_groovy_enum_constants_wrap = off
|
|
||||||
ij_groovy_extends_keyword_wrap = off
|
|
||||||
ij_groovy_extends_list_wrap = off
|
|
||||||
ij_groovy_field_annotation_wrap = split_into_lines
|
|
||||||
ij_groovy_finally_on_new_line = false
|
|
||||||
ij_groovy_for_brace_force = never
|
|
||||||
ij_groovy_for_statement_new_line_after_left_paren = false
|
|
||||||
ij_groovy_for_statement_right_paren_on_new_line = false
|
|
||||||
ij_groovy_for_statement_wrap = off
|
|
||||||
ij_groovy_if_brace_force = never
|
|
||||||
ij_groovy_import_annotation_wrap = 2
|
|
||||||
ij_groovy_imports_layout = *, |, javax.**, java.**, |, $*
|
|
||||||
ij_groovy_indent_case_from_switch = true
|
|
||||||
ij_groovy_indent_label_blocks = true
|
|
||||||
ij_groovy_insert_inner_class_imports = false
|
|
||||||
ij_groovy_keep_blank_lines_before_right_brace = 2
|
|
||||||
ij_groovy_keep_blank_lines_in_code = 2
|
|
||||||
ij_groovy_keep_blank_lines_in_declarations = 2
|
|
||||||
ij_groovy_keep_control_statement_in_one_line = true
|
|
||||||
ij_groovy_keep_first_column_comment = true
|
|
||||||
ij_groovy_keep_indents_on_empty_lines = false
|
|
||||||
ij_groovy_keep_line_breaks = true
|
|
||||||
ij_groovy_keep_multiple_expressions_in_one_line = false
|
|
||||||
ij_groovy_keep_simple_blocks_in_one_line = false
|
|
||||||
ij_groovy_keep_simple_classes_in_one_line = true
|
|
||||||
ij_groovy_keep_simple_lambdas_in_one_line = true
|
|
||||||
ij_groovy_keep_simple_methods_in_one_line = true
|
|
||||||
ij_groovy_label_indent_absolute = false
|
|
||||||
ij_groovy_label_indent_size = 0
|
|
||||||
ij_groovy_lambda_brace_style = end_of_line
|
|
||||||
ij_groovy_layout_static_imports_separately = true
|
|
||||||
ij_groovy_line_comment_add_space = false
|
|
||||||
ij_groovy_line_comment_at_first_column = true
|
|
||||||
ij_groovy_method_annotation_wrap = split_into_lines
|
|
||||||
ij_groovy_method_brace_style = end_of_line
|
|
||||||
ij_groovy_method_call_chain_wrap = off
|
|
||||||
ij_groovy_method_parameters_new_line_after_left_paren = false
|
|
||||||
ij_groovy_method_parameters_right_paren_on_new_line = false
|
|
||||||
ij_groovy_method_parameters_wrap = off
|
|
||||||
ij_groovy_modifier_list_wrap = false
|
|
||||||
ij_groovy_names_count_to_use_import_on_demand = 3
|
|
||||||
ij_groovy_parameter_annotation_wrap = off
|
|
||||||
ij_groovy_parentheses_expression_new_line_after_left_paren = false
|
|
||||||
ij_groovy_parentheses_expression_right_paren_on_new_line = false
|
|
||||||
ij_groovy_prefer_parameters_wrap = false
|
|
||||||
ij_groovy_resource_list_new_line_after_left_paren = false
|
|
||||||
ij_groovy_resource_list_right_paren_on_new_line = false
|
|
||||||
ij_groovy_resource_list_wrap = off
|
|
||||||
ij_groovy_space_after_assert_separator = true
|
|
||||||
ij_groovy_space_after_colon = true
|
|
||||||
ij_groovy_space_after_comma = true
|
|
||||||
ij_groovy_space_after_comma_in_type_arguments = true
|
|
||||||
ij_groovy_space_after_for_semicolon = true
|
|
||||||
ij_groovy_space_after_quest = true
|
|
||||||
ij_groovy_space_after_type_cast = true
|
|
||||||
ij_groovy_space_before_annotation_parameter_list = false
|
|
||||||
ij_groovy_space_before_array_initializer_left_brace = false
|
|
||||||
ij_groovy_space_before_assert_separator = false
|
|
||||||
ij_groovy_space_before_catch_keyword = true
|
|
||||||
ij_groovy_space_before_catch_left_brace = true
|
|
||||||
ij_groovy_space_before_catch_parentheses = true
|
|
||||||
ij_groovy_space_before_class_left_brace = true
|
|
||||||
ij_groovy_space_before_closure_left_brace = true
|
|
||||||
ij_groovy_space_before_colon = true
|
|
||||||
ij_groovy_space_before_comma = false
|
|
||||||
ij_groovy_space_before_do_left_brace = true
|
|
||||||
ij_groovy_space_before_else_keyword = true
|
|
||||||
ij_groovy_space_before_else_left_brace = true
|
|
||||||
ij_groovy_space_before_finally_keyword = true
|
|
||||||
ij_groovy_space_before_finally_left_brace = true
|
|
||||||
ij_groovy_space_before_for_left_brace = true
|
|
||||||
ij_groovy_space_before_for_parentheses = true
|
|
||||||
ij_groovy_space_before_for_semicolon = false
|
|
||||||
ij_groovy_space_before_if_left_brace = true
|
|
||||||
ij_groovy_space_before_if_parentheses = true
|
|
||||||
ij_groovy_space_before_method_call_parentheses = false
|
|
||||||
ij_groovy_space_before_method_left_brace = true
|
|
||||||
ij_groovy_space_before_method_parentheses = false
|
|
||||||
ij_groovy_space_before_quest = true
|
|
||||||
ij_groovy_space_before_switch_left_brace = true
|
|
||||||
ij_groovy_space_before_switch_parentheses = true
|
|
||||||
ij_groovy_space_before_synchronized_left_brace = true
|
|
||||||
ij_groovy_space_before_synchronized_parentheses = true
|
|
||||||
ij_groovy_space_before_try_left_brace = true
|
|
||||||
ij_groovy_space_before_try_parentheses = true
|
|
||||||
ij_groovy_space_before_while_keyword = true
|
|
||||||
ij_groovy_space_before_while_left_brace = true
|
|
||||||
ij_groovy_space_before_while_parentheses = true
|
|
||||||
ij_groovy_space_in_named_argument = true
|
|
||||||
ij_groovy_space_in_named_argument_before_colon = false
|
|
||||||
ij_groovy_space_within_empty_array_initializer_braces = false
|
|
||||||
ij_groovy_space_within_empty_method_call_parentheses = false
|
|
||||||
ij_groovy_spaces_around_additive_operators = true
|
|
||||||
ij_groovy_spaces_around_assignment_operators = true
|
|
||||||
ij_groovy_spaces_around_bitwise_operators = true
|
|
||||||
ij_groovy_spaces_around_equality_operators = true
|
|
||||||
ij_groovy_spaces_around_lambda_arrow = true
|
|
||||||
ij_groovy_spaces_around_logical_operators = true
|
|
||||||
ij_groovy_spaces_around_multiplicative_operators = true
|
|
||||||
ij_groovy_spaces_around_regex_operators = true
|
|
||||||
ij_groovy_spaces_around_relational_operators = true
|
|
||||||
ij_groovy_spaces_around_shift_operators = true
|
|
||||||
ij_groovy_spaces_within_annotation_parentheses = false
|
|
||||||
ij_groovy_spaces_within_array_initializer_braces = false
|
|
||||||
ij_groovy_spaces_within_braces = true
|
|
||||||
ij_groovy_spaces_within_brackets = false
|
|
||||||
ij_groovy_spaces_within_cast_parentheses = false
|
|
||||||
ij_groovy_spaces_within_catch_parentheses = false
|
|
||||||
ij_groovy_spaces_within_for_parentheses = false
|
|
||||||
ij_groovy_spaces_within_gstring_injection_braces = false
|
|
||||||
ij_groovy_spaces_within_if_parentheses = false
|
|
||||||
ij_groovy_spaces_within_list_or_map = false
|
|
||||||
ij_groovy_spaces_within_method_call_parentheses = false
|
|
||||||
ij_groovy_spaces_within_method_parentheses = false
|
|
||||||
ij_groovy_spaces_within_parentheses = false
|
|
||||||
ij_groovy_spaces_within_switch_parentheses = false
|
|
||||||
ij_groovy_spaces_within_synchronized_parentheses = false
|
|
||||||
ij_groovy_spaces_within_try_parentheses = false
|
|
||||||
ij_groovy_spaces_within_tuple_expression = false
|
|
||||||
ij_groovy_spaces_within_while_parentheses = false
|
|
||||||
ij_groovy_special_else_if_treatment = true
|
|
||||||
ij_groovy_ternary_operation_wrap = off
|
|
||||||
ij_groovy_throws_keyword_wrap = off
|
|
||||||
ij_groovy_throws_list_wrap = off
|
|
||||||
ij_groovy_use_flying_geese_braces = false
|
|
||||||
ij_groovy_use_fq_class_names = false
|
|
||||||
ij_groovy_use_fq_class_names_in_javadoc = true
|
|
||||||
ij_groovy_use_relative_indents = false
|
|
||||||
ij_groovy_use_single_class_imports = true
|
|
||||||
ij_groovy_variable_annotation_wrap = off
|
|
||||||
ij_groovy_while_brace_force = never
|
|
||||||
ij_groovy_while_on_new_line = false
|
|
||||||
ij_groovy_wrap_long_lines = false
|
|
||||||
|
|
||||||
[{*.gradle.kts, *.kt, *.kts, *.main.kts}]
|
[{*.gradle.kts, *.kt, *.kts, *.main.kts}]
|
||||||
ij_kotlin_align_in_columns_case_branch = false
|
ij_kotlin_align_in_columns_case_branch = false
|
||||||
ij_kotlin_align_multiline_binary_operation = false
|
ij_kotlin_align_multiline_binary_operation = false
|
||||||
@ -963,7 +336,8 @@ ij_kotlin_wrap_elvis_expressions = 1
|
|||||||
ij_kotlin_wrap_expression_body_functions = 0
|
ij_kotlin_wrap_expression_body_functions = 0
|
||||||
ij_kotlin_wrap_first_method_in_call_chain = false
|
ij_kotlin_wrap_first_method_in_call_chain = false
|
||||||
|
|
||||||
[{*.har, *.jsb2, *.jsb3, *.json, .babelrc, .eslintrc, .stylelintrc, bowerrc, jest.config, mcmod.info}]
|
|
||||||
|
[*.json]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
ij_json_keep_blank_lines_in_code = 0
|
ij_json_keep_blank_lines_in_code = 0
|
||||||
ij_json_keep_indents_on_empty_lines = false
|
ij_json_keep_indents_on_empty_lines = false
|
||||||
|
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
* text=auto
|
||||||
|
|
||||||
|
*.java text
|
||||||
|
*.jar binary
|
1
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
1
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -27,6 +27,7 @@ body:
|
|||||||
description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first.
|
description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first.
|
||||||
multiple: false
|
multiple: false
|
||||||
options:
|
options:
|
||||||
|
- '1.19.3'
|
||||||
- '1.19.2'
|
- '1.19.2'
|
||||||
- '1.19.1'
|
- '1.19.1'
|
||||||
- '1.19'
|
- '1.19'
|
||||||
|
24
.github/workflows/announce-release-on-discord.yml
vendored
Normal file
24
.github/workflows/announce-release-on-discord.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
name: Announce release on discord
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
jobs:
|
||||||
|
send_announcement:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: send custom message with args
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
DISCORD_USERNAME: PlotSquared Release
|
||||||
|
DISCORD_AVATAR: https://raw.githubusercontent.com/IntellectualSites/Assets/main/plugins/PlotSquared/PlotSquared.png
|
||||||
|
uses: Ilshidur/action-discord@08d9328877d6954120eef2b07abbc79249bb6210 # ratchet:Ilshidur/action-discord@0.3.2
|
||||||
|
with:
|
||||||
|
args: |
|
||||||
|
"<@&525015541815967744> <@&679322738552471574> <@&699293353862496266>"
|
||||||
|
""
|
||||||
|
"<:plotsquared:730750385886593039> **PlotSquared ${{ github.event.release.tag_name }} has been released!**"
|
||||||
|
""
|
||||||
|
"Click here to view changelog: https://github.com/IntellectualSites/PlotSquared/releases/tag/${{ github.event.release.tag_name }}"
|
||||||
|
""
|
||||||
|
"The download is available at:"
|
||||||
|
"- Spigot: <https://www.spigotmc.org/resources/77506/>"
|
21
.github/workflows/build-pr.yml
vendored
Normal file
21
.github/workflows/build-pr.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
name: Build PR
|
||||||
|
on: [pull_request]
|
||||||
|
jobs:
|
||||||
|
build_pr:
|
||||||
|
if: github.repository_owner == 'IntellectualSites'
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Validate Gradle Wrapper
|
||||||
|
uses: gradle/wrapper-validation-action@55e685c48d84285a5b0418cd094606e199cca3b6 # v1
|
||||||
|
- name: Setup Java
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 17
|
||||||
|
- name: Clean Build
|
||||||
|
run: ./gradlew clean build
|
17
.github/workflows/build.yml
vendored
17
.github/workflows/build.yml
vendored
@ -1,16 +1,17 @@
|
|||||||
name: build
|
name: build
|
||||||
|
on:
|
||||||
on: [ pull_request, push ]
|
push:
|
||||||
|
branches:
|
||||||
|
- v6
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
|
if: github.repository_owner == 'IntellectualSites'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Validate Gradle Wrapper"
|
- name: Validate Gradle Wrapper
|
||||||
uses: gradle/wrapper-validation-action@v1
|
uses: gradle/wrapper-validation-action@55e685c48d84285a5b0418cd094606e199cca3b6 # v1
|
||||||
- name: Setup Java
|
- name: Setup Java
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
@ -42,7 +43,7 @@ jobs:
|
|||||||
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
|
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
|
||||||
- name: Publish core javadoc
|
- name: Publish core javadoc
|
||||||
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}}
|
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}}
|
||||||
uses: cpina/github-action-push-to-another-repository@main
|
uses: cpina/github-action-push-to-another-repository@0a14457bb28b04dfa1652e0ffdfda866d2845c73 # main
|
||||||
env:
|
env:
|
||||||
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
|
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
|
||||||
with:
|
with:
|
||||||
@ -54,7 +55,7 @@ jobs:
|
|||||||
target-directory: core
|
target-directory: core
|
||||||
- name: Publish bukkit javadoc
|
- name: Publish bukkit javadoc
|
||||||
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}}
|
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}}
|
||||||
uses: cpina/github-action-push-to-another-repository@main
|
uses: cpina/github-action-push-to-another-repository@0a14457bb28b04dfa1652e0ffdfda866d2845c73 # main
|
||||||
env:
|
env:
|
||||||
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
|
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
|
||||||
with:
|
with:
|
||||||
|
19
.github/workflows/codeql.yml
vendored
19
.github/workflows/codeql.yml
vendored
@ -1,12 +1,8 @@
|
|||||||
name: "CodeQL"
|
name: "CodeQL"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: [ v6 ]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
# The branches below must be a subset of the branches above
|
# The branches below must be a subset of the branches above
|
||||||
branches: [ v6 ]
|
branches: [v6]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
name: Analyze
|
name: Analyze
|
||||||
@ -15,23 +11,18 @@ jobs:
|
|||||||
actions: read
|
actions: read
|
||||||
contents: read
|
contents: read
|
||||||
security-events: write
|
security-events: write
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
language: [ 'java' ]
|
language: ['java']
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@32dc499307d133bb5085bae78498c0ac2cf762d5 # v2
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
|
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@v2
|
uses: github/codeql-action/autobuild@32dc499307d133bb5085bae78498c0ac2cf762d5 # v2
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v2
|
uses: github/codeql-action/analyze@32dc499307d133bb5085bae78498c0ac2cf762d5 # v2
|
||||||
|
6
.github/workflows/release-drafter.yml
vendored
6
.github/workflows/release-drafter.yml
vendored
@ -1,14 +1,12 @@
|
|||||||
name: draft release
|
name: draft release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- v6
|
- v6
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [ opened, reopened, synchronize ]
|
types: [opened, reopened, synchronize]
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [ opened, reopened, synchronize ]
|
types: [opened, reopened, synchronize]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update_release_draft:
|
update_release_draft:
|
||||||
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
|
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
|
||||||
|
@ -24,7 +24,7 @@ dependencies {
|
|||||||
implementation("org.bstats:bstats-bukkit")
|
implementation("org.bstats:bstats-bukkit")
|
||||||
|
|
||||||
// Paper
|
// Paper
|
||||||
compileOnly(libs.paper)
|
compileOnly("io.papermc.paper:paper-api")
|
||||||
implementation("io.papermc:paperlib")
|
implementation("io.papermc:paperlib")
|
||||||
|
|
||||||
// Plugins
|
// Plugins
|
||||||
@ -98,6 +98,7 @@ tasks.named<ShadowJar>("shadowJar") {
|
|||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
withType<Javadoc> {
|
withType<Javadoc> {
|
||||||
|
val isRelease = if (rootProject.version.toString().endsWith("-SNAPSHOT")) "TODO" else rootProject.version.toString()
|
||||||
val opt = options as StandardJavadocDocletOptions
|
val opt = options as StandardJavadocDocletOptions
|
||||||
opt.links("https://jd.papermc.io/paper/1.18/")
|
opt.links("https://jd.papermc.io/paper/1.18/")
|
||||||
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/" + libs.worldeditBukkit.get().versionConstraint.toString())
|
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/" + libs.worldeditBukkit.get().versionConstraint.toString())
|
||||||
@ -105,6 +106,11 @@ tasks {
|
|||||||
opt.links("https://jd.adventure.kyori.net/api/4.9.3/")
|
opt.links("https://jd.adventure.kyori.net/api/4.9.3/")
|
||||||
opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/")
|
opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/")
|
||||||
opt.links("https://checkerframework.org/api/")
|
opt.links("https://checkerframework.org/api/")
|
||||||
|
opt.isLinkSource = true
|
||||||
|
opt.bottom(File("$rootDir/javadocfooter.html").readText())
|
||||||
|
opt.isUse = true
|
||||||
opt.encoding("UTF-8")
|
opt.encoding("UTF-8")
|
||||||
|
opt.keyWords()
|
||||||
|
opt.addStringOption("-since", isRelease)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,11 +36,11 @@ import com.plotsquared.bukkit.listener.ChunkListener;
|
|||||||
import com.plotsquared.bukkit.listener.EntityEventListener;
|
import com.plotsquared.bukkit.listener.EntityEventListener;
|
||||||
import com.plotsquared.bukkit.listener.EntitySpawnListener;
|
import com.plotsquared.bukkit.listener.EntitySpawnListener;
|
||||||
import com.plotsquared.bukkit.listener.PaperListener;
|
import com.plotsquared.bukkit.listener.PaperListener;
|
||||||
import com.plotsquared.bukkit.listener.PaperListener113;
|
|
||||||
import com.plotsquared.bukkit.listener.PlayerEventListener;
|
import com.plotsquared.bukkit.listener.PlayerEventListener;
|
||||||
import com.plotsquared.bukkit.listener.ProjectileEventListener;
|
import com.plotsquared.bukkit.listener.ProjectileEventListener;
|
||||||
import com.plotsquared.bukkit.listener.ServerListener;
|
import com.plotsquared.bukkit.listener.ServerListener;
|
||||||
import com.plotsquared.bukkit.listener.SingleWorldListener;
|
import com.plotsquared.bukkit.listener.SingleWorldListener;
|
||||||
|
import com.plotsquared.bukkit.listener.SpigotListener;
|
||||||
import com.plotsquared.bukkit.listener.WorldEvents;
|
import com.plotsquared.bukkit.listener.WorldEvents;
|
||||||
import com.plotsquared.bukkit.placeholder.PAPIPlaceholders;
|
import com.plotsquared.bukkit.placeholder.PAPIPlaceholders;
|
||||||
import com.plotsquared.bukkit.placeholder.PlaceholderFormatter;
|
import com.plotsquared.bukkit.placeholder.PlaceholderFormatter;
|
||||||
@ -71,6 +71,8 @@ import com.plotsquared.core.configuration.Storage;
|
|||||||
import com.plotsquared.core.configuration.caption.ChatFormatter;
|
import com.plotsquared.core.configuration.caption.ChatFormatter;
|
||||||
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
||||||
import com.plotsquared.core.database.DBFunc;
|
import com.plotsquared.core.database.DBFunc;
|
||||||
|
import com.plotsquared.core.events.RemoveRoadEntityEvent;
|
||||||
|
import com.plotsquared.core.events.Result;
|
||||||
import com.plotsquared.core.generator.GeneratorWrapper;
|
import com.plotsquared.core.generator.GeneratorWrapper;
|
||||||
import com.plotsquared.core.generator.IndependentPlotGenerator;
|
import com.plotsquared.core.generator.IndependentPlotGenerator;
|
||||||
import com.plotsquared.core.generator.SingleWorldGenerator;
|
import com.plotsquared.core.generator.SingleWorldGenerator;
|
||||||
@ -109,6 +111,7 @@ import com.plotsquared.core.uuid.CacheUUIDService;
|
|||||||
import com.plotsquared.core.uuid.UUIDPipeline;
|
import com.plotsquared.core.uuid.UUIDPipeline;
|
||||||
import com.plotsquared.core.uuid.offline.OfflineModeUUIDService;
|
import com.plotsquared.core.uuid.offline.OfflineModeUUIDService;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
import io.papermc.lib.PaperLib;
|
import io.papermc.lib.PaperLib;
|
||||||
import net.kyori.adventure.audience.Audience;
|
import net.kyori.adventure.audience.Audience;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
@ -355,11 +358,9 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
getServer().getPluginManager().registerEvents(injector().getInstance(ServerListener.class), this);
|
getServer().getPluginManager().registerEvents(injector().getInstance(ServerListener.class), this);
|
||||||
getServer().getPluginManager().registerEvents(injector().getInstance(EntitySpawnListener.class), this);
|
getServer().getPluginManager().registerEvents(injector().getInstance(EntitySpawnListener.class), this);
|
||||||
if (PaperLib.isPaper() && Settings.Paper_Components.PAPER_LISTENERS) {
|
if (PaperLib.isPaper() && Settings.Paper_Components.PAPER_LISTENERS) {
|
||||||
if (serverVersion()[1] == 13) {
|
|
||||||
getServer().getPluginManager().registerEvents(injector().getInstance(PaperListener113.class), this);
|
|
||||||
} else {
|
|
||||||
getServer().getPluginManager().registerEvents(injector().getInstance(PaperListener.class), this);
|
getServer().getPluginManager().registerEvents(injector().getInstance(PaperListener.class), this);
|
||||||
}
|
} else {
|
||||||
|
getServer().getPluginManager().registerEvents(injector().getInstance(SpigotListener.class), this);
|
||||||
}
|
}
|
||||||
this.plotListener.startRunnable();
|
this.plotListener.startRunnable();
|
||||||
}
|
}
|
||||||
@ -812,8 +813,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
if (entity.hasMetadata("ps-tmp-teleport")) {
|
if (entity.hasMetadata("ps-tmp-teleport")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
iterator.remove();
|
this.removeRoadEntity(entity, iterator);
|
||||||
entity.remove();
|
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -826,8 +826,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
if (entity.hasMetadata("ps-tmp-teleport")) {
|
if (entity.hasMetadata("ps-tmp-teleport")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
iterator.remove();
|
this.removeRoadEntity(entity, iterator);
|
||||||
entity.remove();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@ -837,7 +836,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
case "DROPPED_ITEM":
|
case "DROPPED_ITEM":
|
||||||
if (Settings.Enabled_Components.KILL_ROAD_ITEMS
|
if (Settings.Enabled_Components.KILL_ROAD_ITEMS
|
||||||
&& plotArea.getOwnedPlotAbs(BukkitUtil.adapt(entity.getLocation())) == null) {
|
&& plotArea.getOwnedPlotAbs(BukkitUtil.adapt(entity.getLocation())) == null) {
|
||||||
entity.remove();
|
this.removeRoadEntity(entity, iterator);
|
||||||
}
|
}
|
||||||
// dropped item
|
// dropped item
|
||||||
continue;
|
continue;
|
||||||
@ -846,11 +845,11 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
// managed elsewhere
|
// managed elsewhere
|
||||||
continue;
|
continue;
|
||||||
case "SHULKER":
|
case "SHULKER":
|
||||||
if (Settings.Enabled_Components.KILL_ROAD_MOBS) {
|
if (Settings.Enabled_Components.KILL_ROAD_MOBS && (Settings.Enabled_Components.KILL_NAMED_ROAD_MOBS || entity.getCustomName() == null)) {
|
||||||
LivingEntity livingEntity = (LivingEntity) entity;
|
LivingEntity livingEntity = (LivingEntity) entity;
|
||||||
List<MetadataValue> meta = entity.getMetadata("shulkerPlot");
|
List<MetadataValue> meta = entity.getMetadata("shulkerPlot");
|
||||||
if (!meta.isEmpty()) {
|
if (!meta.isEmpty()) {
|
||||||
if (livingEntity.isLeashed()) {
|
if (livingEntity.isLeashed() && !Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
List<MetadataValue> keep = entity.getMetadata("keep");
|
List<MetadataValue> keep = entity.getMetadata("keep");
|
||||||
@ -863,15 +862,12 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
com.plotsquared.core.location.Location pLoc = BukkitUtil.adapt(entity.getLocation());
|
com.plotsquared.core.location.Location pLoc = BukkitUtil.adapt(entity.getLocation());
|
||||||
PlotArea area = pLoc.getPlotArea();
|
PlotArea area = pLoc.getPlotArea();
|
||||||
if (area != null) {
|
if (area != null) {
|
||||||
PlotId currentPlotId = area.getPlotAbs(pLoc).getId();
|
Plot currentPlot = area.getPlotAbs(pLoc);
|
||||||
if (!originalPlotId.equals(currentPlotId) && (currentPlotId == null || !area.getPlot(
|
if (currentPlot == null || !originalPlotId.equals(currentPlot.getId())) {
|
||||||
originalPlotId)
|
|
||||||
.equals(area.getPlot(currentPlotId)))) {
|
|
||||||
if (entity.hasMetadata("ps-tmp-teleport")) {
|
if (entity.hasMetadata("ps-tmp-teleport")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
iterator.remove();
|
this.removeRoadEntity(entity, iterator);
|
||||||
entity.remove();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -880,11 +876,11 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
com.plotsquared.core.location.Location pLoc = BukkitUtil.adapt(entity.getLocation());
|
com.plotsquared.core.location.Location pLoc = BukkitUtil.adapt(entity.getLocation());
|
||||||
PlotArea area = pLoc.getPlotArea();
|
PlotArea area = pLoc.getPlotArea();
|
||||||
if (area != null) {
|
if (area != null) {
|
||||||
PlotId currentPlotId = area.getPlotAbs(pLoc).getId();
|
Plot currentPlot = area.getPlotAbs(pLoc);
|
||||||
if (currentPlotId != null) {
|
if (currentPlot != null) {
|
||||||
entity.setMetadata(
|
entity.setMetadata(
|
||||||
"shulkerPlot",
|
"shulkerPlot",
|
||||||
new FixedMetadataValue((Plugin) PlotSquared.platform(), currentPlotId)
|
new FixedMetadataValue((Plugin) PlotSquared.platform(), currentPlot.getId())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -970,23 +966,24 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
|| !entity.hasMetadata("keep")) {
|
|| !entity.hasMetadata("keep")) {
|
||||||
Entity passenger = entity.getPassenger();
|
Entity passenger = entity.getPassenger();
|
||||||
if ((Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS
|
if ((Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS
|
||||||
|| !(passenger instanceof Player)) && entity.getMetadata("keep").isEmpty()) {
|
|| !((passenger instanceof Player) || livingEntity.isLeashed()))
|
||||||
|
&& (Settings.Enabled_Components.KILL_NAMED_ROAD_MOBS || entity.getCustomName() == null)
|
||||||
|
&& entity.getMetadata("keep").isEmpty()) {
|
||||||
if (entity.hasMetadata("ps-tmp-teleport")) {
|
if (entity.hasMetadata("ps-tmp-teleport")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
iterator.remove();
|
this.removeRoadEntity(entity, iterator);
|
||||||
entity.remove();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Entity passenger = entity.getPassenger();
|
Entity passenger = entity.getPassenger();
|
||||||
if ((Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS
|
if ((Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS || !(passenger instanceof Player))
|
||||||
|| !(passenger instanceof Player)) && entity.getMetadata("keep").isEmpty()) {
|
&& (Settings.Enabled_Components.KILL_NAMED_ROAD_MOBS && entity.getCustomName() != null)
|
||||||
|
&& entity.getMetadata("keep").isEmpty()) {
|
||||||
if (entity.hasMetadata("ps-tmp-teleport")) {
|
if (entity.hasMetadata("ps-tmp-teleport")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
iterator.remove();
|
this.removeRoadEntity(entity, iterator);
|
||||||
entity.remove();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1000,6 +997,17 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
}), TaskTime.seconds(1L));
|
}), TaskTime.seconds(1L));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void removeRoadEntity(Entity entity, Iterator<Entity> entityIterator) {
|
||||||
|
RemoveRoadEntityEvent event = eventDispatcher.callRemoveRoadEntity(BukkitAdapter.adapt(entity));
|
||||||
|
|
||||||
|
if (event.getEventResult() == Result.DENY) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
entityIterator.remove();
|
||||||
|
entity.remove();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @Nullable
|
public @Nullable
|
||||||
final ChunkGenerator getDefaultWorldGenerator(
|
final ChunkGenerator getDefaultWorldGenerator(
|
||||||
|
@ -161,6 +161,12 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
|
|||||||
world.setWaterAnimalSpawnLimit(limit);
|
world.setWaterAnimalSpawnLimit(limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The entire method is deprecated, but kept for compatibility with versions lower than or equal to 1.16.2.
|
||||||
|
* The method will be removed in future versions, because WorldEdit and FastAsyncWorldEdit only support the latest point
|
||||||
|
* release.
|
||||||
|
*/
|
||||||
|
@Deprecated(forRemoval = true, since = "6.11.0")
|
||||||
@Override
|
@Override
|
||||||
public @NonNull ChunkData generateChunkData(
|
public @NonNull ChunkData generateChunkData(
|
||||||
@NonNull World world, @NonNull Random random, int x, int z,
|
@NonNull World world, @NonNull Random random, int x, int z,
|
||||||
|
@ -33,7 +33,6 @@ import org.bukkit.Chunk;
|
|||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.generator.BlockPopulator;
|
import org.bukkit.generator.BlockPopulator;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@ -51,7 +50,7 @@ final class LegacyBlockStatePopulator extends BlockPopulator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void populate(@NotNull final World world, @NotNull final Random random, @NotNull final Chunk source) {
|
public void populate(@NonNull final World world, @NonNull final Random random, @NonNull final Chunk source) {
|
||||||
int chunkMinX = source.getX() << 4;
|
int chunkMinX = source.getX() << 4;
|
||||||
int chunkMinZ = source.getZ() << 4;
|
int chunkMinZ = source.getZ() << 4;
|
||||||
PlotArea area = Location.at(world.getName(), chunkMinX, 0, chunkMinZ).getPlotArea();
|
PlotArea area = Location.at(world.getName(), chunkMinX, 0, chunkMinZ).getPlotArea();
|
||||||
|
@ -55,7 +55,7 @@ import com.plotsquared.core.plot.flag.implementations.VineGrowFlag;
|
|||||||
import com.plotsquared.core.plot.flag.types.BlockTypeWrapper;
|
import com.plotsquared.core.plot.flag.types.BlockTypeWrapper;
|
||||||
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.PlotFlagUtil;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import com.plotsquared.core.util.task.TaskTime;
|
import com.plotsquared.core.util.task.TaskTime;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
@ -70,6 +70,8 @@ import org.bukkit.block.Block;
|
|||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.block.BlockState;
|
import org.bukkit.block.BlockState;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
|
import org.bukkit.block.data.type.Dispenser;
|
||||||
|
import org.bukkit.block.data.type.Farmland;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Fireball;
|
import org.bukkit.entity.Fireball;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -97,9 +99,9 @@ import org.bukkit.event.block.BlockSpreadEvent;
|
|||||||
import org.bukkit.event.block.CauldronLevelChangeEvent;
|
import org.bukkit.event.block.CauldronLevelChangeEvent;
|
||||||
import org.bukkit.event.block.EntityBlockFormEvent;
|
import org.bukkit.event.block.EntityBlockFormEvent;
|
||||||
import org.bukkit.event.block.LeavesDecayEvent;
|
import org.bukkit.event.block.LeavesDecayEvent;
|
||||||
|
import org.bukkit.event.block.MoistureChangeEvent;
|
||||||
import org.bukkit.event.block.SpongeAbsorbEvent;
|
import org.bukkit.event.block.SpongeAbsorbEvent;
|
||||||
import org.bukkit.event.world.StructureGrowEvent;
|
import org.bukkit.event.world.StructureGrowEvent;
|
||||||
import org.bukkit.material.Directional;
|
|
||||||
import org.bukkit.projectiles.BlockProjectileSource;
|
import org.bukkit.projectiles.BlockProjectileSource;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
@ -109,6 +111,8 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public class BlockEventListener implements Listener {
|
public class BlockEventListener implements Listener {
|
||||||
@ -121,22 +125,10 @@ public class BlockEventListener implements Listener {
|
|||||||
Material.TURTLE_EGG,
|
Material.TURTLE_EGG,
|
||||||
Material.TURTLE_SPAWN_EGG
|
Material.TURTLE_SPAWN_EGG
|
||||||
);
|
);
|
||||||
private static final Set<Material> SNOW; // needed as Tag.SNOW isn't present in 1.16.5
|
private static final Set<Material> SNOW = Stream.of(Material.values()) // needed as Tag.SNOW isn't present in 1.16.5
|
||||||
|
.filter(material -> material.name().contains("SNOW"))
|
||||||
static {
|
.filter(Material::isBlock)
|
||||||
if (PlotSquared.platform().serverVersion()[1] < 17) {
|
.collect(Collectors.toUnmodifiableSet());
|
||||||
SNOW = Set.of(
|
|
||||||
Material.SNOW,
|
|
||||||
Material.SNOW_BLOCK
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
SNOW = Set.of(
|
|
||||||
Material.SNOW,
|
|
||||||
Material.SNOW_BLOCK,
|
|
||||||
Material.POWDER_SNOW // only since 1.17
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private final PlotAreaManager plotAreaManager;
|
private final PlotAreaManager plotAreaManager;
|
||||||
private final WorldEdit worldEdit;
|
private final WorldEdit worldEdit;
|
||||||
@ -176,7 +168,7 @@ public class BlockEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
Plot plot = location.getOwnedPlot();
|
Plot plot = location.getOwnedPlot();
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (area.isRoadFlags() && !area.getRoadFlag(RedstoneFlag.class)) {
|
if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, RedstoneFlag.class, false)) {
|
||||||
event.setNewCurrent(0);
|
event.setNewCurrent(0);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -287,7 +279,7 @@ public class BlockEventListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
||||||
@ -304,7 +296,7 @@ public class BlockEventListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||||
@ -315,7 +307,7 @@ public class BlockEventListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("done.building_restricted")
|
TranslatableCaption.of("done.building_restricted")
|
||||||
);
|
);
|
||||||
@ -331,7 +323,7 @@ public class BlockEventListener implements Listener {
|
|||||||
+ " did not fall because of disable-physics = true");
|
+ " did not fall because of disable-physics = true");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
} else if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
||||||
@ -353,8 +345,7 @@ public class BlockEventListener implements Listener {
|
|||||||
BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
|
BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
|
||||||
// == rather than <= as we only care about the "ground level" not being destroyed
|
// == rather than <= as we only care about the "ground level" not being destroyed
|
||||||
if (event.getBlock().getY() == area.getMinGenHeight()) {
|
if (event.getBlock().getY() == area.getMinGenHeight()) {
|
||||||
if (!Permissions
|
if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) {
|
||||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL)) {
|
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_GROUNDLEVEL))
|
||||||
@ -367,8 +358,7 @@ public class BlockEventListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
if (!Permissions
|
if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED, true)) {
|
||||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED, true)) {
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -382,8 +372,7 @@ public class BlockEventListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Permissions
|
if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
|
||||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
@ -392,7 +381,7 @@ public class BlockEventListener implements Listener {
|
|||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("done.building_restricted")
|
TranslatableCaption.of("done.building_restricted")
|
||||||
);
|
);
|
||||||
@ -403,7 +392,7 @@ public class BlockEventListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BukkitPlayer pp = BukkitUtil.adapt(player);
|
BukkitPlayer pp = BukkitUtil.adapt(player);
|
||||||
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_ROAD)) {
|
if (pp.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_ROAD)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.worldEdit != null && pp.getAttribute("worldedit")) {
|
if (this.worldEdit != null && pp.getAttribute("worldedit")) {
|
||||||
@ -452,6 +441,7 @@ public class BlockEventListener implements Listener {
|
|||||||
case "TWISTING_VINES":
|
case "TWISTING_VINES":
|
||||||
case "CAVE_VINES":
|
case "CAVE_VINES":
|
||||||
case "VINE":
|
case "VINE":
|
||||||
|
case "GLOW_BERRIES":
|
||||||
if (!plot.getFlag(VineGrowFlag.class)) {
|
if (!plot.getFlag(VineGrowFlag.class)) {
|
||||||
plot.debug("Vine could not grow because vine-grow = false");
|
plot.debug("Vine could not grow because vine-grow = false");
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -487,18 +477,18 @@ public class BlockEventListener implements Listener {
|
|||||||
BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
|
BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) {
|
if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (!plot.isAdded(plotPlayer.getUUID())) {
|
} else if (!plot.isAdded(plotPlayer.getUUID())) {
|
||||||
if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.worldEdit != null && plotPlayer.getAttribute("worldedit")) {
|
if (this.worldEdit != null && plotPlayer.getAttribute("worldedit")) {
|
||||||
@ -643,8 +633,7 @@ public class BlockEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
|
BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
|
||||||
if (Permissions
|
if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
|
||||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -656,8 +645,7 @@ public class BlockEventListener implements Listener {
|
|||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
if (destroy
|
if (destroy
|
||||||
.contains(BlockTypeWrapper.get(BukkitAdapter.asBlockType(block.getType())))
|
.contains(BlockTypeWrapper.get(BukkitAdapter.asBlockType(block.getType())))
|
||||||
|| Permissions
|
|| plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
|
||||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
plot.debug(player.getName() + " could not break " + block.getType()
|
plot.debug(player.getName() + " could not break " + block.getType()
|
||||||
@ -668,7 +656,7 @@ public class BlockEventListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
|
BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
|
||||||
if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY_ROAD)) {
|
if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_ROAD)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -717,6 +705,41 @@ public class BlockEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
|
public void onMoistureChange(MoistureChangeEvent event) {
|
||||||
|
Block block = event.getBlock();
|
||||||
|
Location location = BukkitUtil.adapt(block.getLocation());
|
||||||
|
PlotArea area = location.getPlotArea();
|
||||||
|
|
||||||
|
if (area == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Plot plot = area.getOwnedPlot(location);
|
||||||
|
|
||||||
|
if (plot == null) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (block.getBlockData() instanceof Farmland farmland && event.getNewState().getBlockData() instanceof Farmland newFarmland) {
|
||||||
|
int currentMoisture = farmland.getMoisture();
|
||||||
|
int newMoisture = newFarmland.getMoisture();
|
||||||
|
|
||||||
|
// farmland gets moisturizes
|
||||||
|
if (newMoisture > currentMoisture) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (plot.getFlag(SoilDryFlag.class)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
plot.debug("Soil could not dry because soil-dry = false");
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onChange(BlockFromToEvent event) {
|
public void onChange(BlockFromToEvent event) {
|
||||||
Block fromBlock = event.getBlock();
|
Block fromBlock = event.getBlock();
|
||||||
@ -934,6 +957,9 @@ public class BlockEventListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onBlockDispense(BlockDispenseEvent event) {
|
public void onBlockDispense(BlockDispenseEvent event) {
|
||||||
|
if (!this.plotAreaManager.hasPlotArea(event.getBlock().getWorld().getName())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Material type = event.getItem().getType();
|
Material type = event.getItem().getType();
|
||||||
switch (type.toString()) {
|
switch (type.toString()) {
|
||||||
case "SHULKER_BOX", "WHITE_SHULKER_BOX", "ORANGE_SHULKER_BOX", "MAGENTA_SHULKER_BOX", "LIGHT_BLUE_SHULKER_BOX",
|
case "SHULKER_BOX", "WHITE_SHULKER_BOX", "ORANGE_SHULKER_BOX", "MAGENTA_SHULKER_BOX", "LIGHT_BLUE_SHULKER_BOX",
|
||||||
@ -945,7 +971,7 @@ public class BlockEventListener implements Listener {
|
|||||||
if (event.getBlock().getType() == Material.DROPPER) {
|
if (event.getBlock().getType() == Material.DROPPER) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BlockFace targetFace = ((Directional) event.getBlock().getState().getData()).getFacing();
|
BlockFace targetFace = ((Dispenser) event.getBlock().getBlockData()).getFacing();
|
||||||
Location location = BukkitUtil.adapt(event.getBlock().getRelative(targetFace).getLocation());
|
Location location = BukkitUtil.adapt(event.getBlock().getRelative(targetFace).getLocation());
|
||||||
if (location.isPlotRoad()) {
|
if (location.isPlotRoad()) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -1093,7 +1119,9 @@ public class BlockEventListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, BlockIgnitionFlag.class, true) && !pp.hasPermission(
|
||||||
|
Permission.PERMISSION_ADMIN_BUILD_ROAD
|
||||||
|
)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
||||||
@ -1101,7 +1129,9 @@ public class BlockEventListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, BlockIgnitionFlag.class, true) && !pp.hasPermission(
|
||||||
|
Permission.PERMISSION_ADMIN_BUILD_UNOWNED
|
||||||
|
)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
||||||
@ -1109,7 +1139,7 @@ public class BlockEventListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (!plot.isAdded(pp.getUUID())) {
|
} else if (!plot.isAdded(pp.getUUID())) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||||
@ -1233,8 +1263,7 @@ public class BlockEventListener implements Listener {
|
|||||||
|
|
||||||
for (final BlockState state : event.getReplacedBlockStates()) {
|
for (final BlockState state : event.getReplacedBlockStates()) {
|
||||||
Location currentLocation = BukkitUtil.adapt(state.getLocation());
|
Location currentLocation = BukkitUtil.adapt(state.getLocation());
|
||||||
if (!Permissions.hasPermission(
|
if (!pp.hasPermission(
|
||||||
pp,
|
|
||||||
Permission.PERMISSION_ADMIN_BUILD_ROAD
|
Permission.PERMISSION_ADMIN_BUILD_ROAD
|
||||||
) && !(Objects.equals(currentLocation.getPlot(), plot))) {
|
) && !(Objects.equals(currentLocation.getPlot(), plot))) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
|
@ -26,6 +26,7 @@ import com.plotsquared.core.plot.Plot;
|
|||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.plot.flag.implementations.CopperOxideFlag;
|
import com.plotsquared.core.plot.flag.implementations.CopperOxideFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.MiscInteractFlag;
|
import com.plotsquared.core.plot.flag.implementations.MiscInteractFlag;
|
||||||
|
import com.plotsquared.core.util.PlotFlagUtil;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
@ -91,7 +92,8 @@ public class BlockEventListener117 implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Plot plot = location.getOwnedPlot();
|
Plot plot = location.getOwnedPlot();
|
||||||
if (plot == null || !plot.getFlag(MiscInteractFlag.class)) {
|
if (plot == null && !PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, MiscInteractFlag.class, true) || plot != null && !plot.getFlag(
|
||||||
|
MiscInteractFlag.class)) {
|
||||||
if (plotPlayer != null) {
|
if (plotPlayer != null) {
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
if (!plot.isAdded(plotPlayer.getUUID())) {
|
if (!plot.isAdded(plotPlayer.getUUID())) {
|
||||||
@ -104,6 +106,12 @@ public class BlockEventListener117 implements Listener {
|
|||||||
if (entity instanceof Item item) {
|
if (entity instanceof Item item) {
|
||||||
UUID itemThrower = item.getThrower();
|
UUID itemThrower = item.getThrower();
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
|
if (itemThrower == null && (itemThrower = item.getOwner()) == null) {
|
||||||
|
plot.debug(
|
||||||
|
"A thrown item couldn't trigger sculk sensors because misc-interact = false and the item's owner could not be resolved.");
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!plot.isAdded(itemThrower)) {
|
if (!plot.isAdded(itemThrower)) {
|
||||||
if (!plot.isAdded(itemThrower)) {
|
if (!plot.isAdded(itemThrower)) {
|
||||||
plot.debug("A thrown item couldn't trigger sculk sensors because misc-interact = false");
|
plot.debug("A thrown item couldn't trigger sculk sensors because misc-interact = false");
|
||||||
|
@ -37,7 +37,7 @@ import com.plotsquared.core.plot.flag.implementations.ExplosionFlag;
|
|||||||
import com.plotsquared.core.plot.flag.implementations.InvincibleFlag;
|
import com.plotsquared.core.plot.flag.implementations.InvincibleFlag;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.PlotFlagUtil;
|
||||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -261,7 +261,7 @@ public class EntityEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
Plot plot = location.getOwnedPlot();
|
Plot plot = location.getOwnedPlot();
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (area.isRoadFlags() && area.getRoadFlag(InvincibleFlag.class)) {
|
if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, InvincibleFlag.class, true)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -370,14 +370,13 @@ public class EntityEventListener implements Listener {
|
|||||||
if (shooter instanceof Player) {
|
if (shooter instanceof Player) {
|
||||||
PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter);
|
PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter);
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
||||||
entity.remove();
|
entity.remove();
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plot.isAdded(pp.getUUID()) || Permissions
|
if (plot.isAdded(pp.getUUID()) || pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||||
.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
entity.remove();
|
entity.remove();
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.bukkit.listener;
|
package com.plotsquared.bukkit.listener;
|
||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
|
||||||
import com.plotsquared.bukkit.player.BukkitPlayer;
|
import com.plotsquared.bukkit.player.BukkitPlayer;
|
||||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||||
import com.plotsquared.core.location.Location;
|
import com.plotsquared.core.location.Location;
|
||||||
@ -26,7 +25,6 @@ import com.plotsquared.core.permissions.Permission;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.flag.implementations.ForcefieldFlag;
|
import com.plotsquared.core.plot.flag.implementations.ForcefieldFlag;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
@ -39,8 +37,11 @@ public class ForceFieldListener {
|
|||||||
|
|
||||||
private static Set<PlotPlayer<?>> getNearbyPlayers(Player player, Plot plot) {
|
private static Set<PlotPlayer<?>> getNearbyPlayers(Player player, Plot plot) {
|
||||||
Set<PlotPlayer<?>> players = new HashSet<>();
|
Set<PlotPlayer<?>> players = new HashSet<>();
|
||||||
for (Player nearPlayer : Iterables
|
for (Player nearPlayer : player.getNearbyEntities(5d, 5d, 5d).stream()
|
||||||
.filter(player.getNearbyEntities(5d, 5d, 5d), Player.class)) {
|
.filter(entity -> entity instanceof Player)
|
||||||
|
.map(entity -> (Player) entity)
|
||||||
|
.toList()
|
||||||
|
) {
|
||||||
PlotPlayer<?> plotPlayer;
|
PlotPlayer<?> plotPlayer;
|
||||||
if ((plotPlayer = BukkitUtil.adapt(nearPlayer)) == null || !plot
|
if ((plotPlayer = BukkitUtil.adapt(nearPlayer)) == null || !plot
|
||||||
.equals(plotPlayer.getCurrentPlot())) {
|
.equals(plotPlayer.getCurrentPlot())) {
|
||||||
@ -54,8 +55,11 @@ public class ForceFieldListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static PlotPlayer<?> hasNearbyPermitted(Player player, Plot plot) {
|
private static PlotPlayer<?> hasNearbyPermitted(Player player, Plot plot) {
|
||||||
for (Player nearPlayer : Iterables
|
for (Player nearPlayer : player.getNearbyEntities(5d, 5d, 5d).stream()
|
||||||
.filter(player.getNearbyEntities(5d, 5d, 5d), Player.class)) {
|
.filter(entity -> entity instanceof Player)
|
||||||
|
.map(entity -> (Player) entity)
|
||||||
|
.toList()
|
||||||
|
) {
|
||||||
PlotPlayer<?> plotPlayer;
|
PlotPlayer<?> plotPlayer;
|
||||||
if ((plotPlayer = BukkitUtil.adapt(nearPlayer)) == null || !plot
|
if ((plotPlayer = BukkitUtil.adapt(nearPlayer)) == null || !plot
|
||||||
.equals(plotPlayer.getCurrentPlot())) {
|
.equals(plotPlayer.getCurrentPlot())) {
|
||||||
@ -104,8 +108,7 @@ public class ForceFieldListener {
|
|||||||
if (plot.isAdded(uuid)) {
|
if (plot.isAdded(uuid)) {
|
||||||
Set<PlotPlayer<?>> players = getNearbyPlayers(player, plot);
|
Set<PlotPlayer<?>> players = getNearbyPlayers(player, plot);
|
||||||
for (PlotPlayer<?> oPlayer : players) {
|
for (PlotPlayer<?> oPlayer : players) {
|
||||||
if (!Permissions
|
if (!oPlayer.hasPermission(Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) {
|
||||||
.hasPermission(oPlayer, Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) {
|
|
||||||
((BukkitPlayer) oPlayer).player
|
((BukkitPlayer) oPlayer).player
|
||||||
.setVelocity(calculateVelocity(plotPlayer, oPlayer));
|
.setVelocity(calculateVelocity(plotPlayer, oPlayer));
|
||||||
}
|
}
|
||||||
@ -115,8 +118,7 @@ public class ForceFieldListener {
|
|||||||
if (oPlayer == null) {
|
if (oPlayer == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!Permissions
|
if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) {
|
||||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) {
|
|
||||||
player.setVelocity(calculateVelocity(oPlayer, plotPlayer));
|
player.setVelocity(calculateVelocity(oPlayer, plotPlayer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.bukkit.listener;
|
package com.plotsquared.bukkit.listener;
|
||||||
|
|
||||||
|
import com.destroystokyo.paper.event.block.BeaconEffectEvent;
|
||||||
import com.destroystokyo.paper.event.entity.EntityPathfindEvent;
|
import com.destroystokyo.paper.event.entity.EntityPathfindEvent;
|
||||||
import com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent;
|
import com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent;
|
||||||
import com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent;
|
import com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent;
|
||||||
@ -36,10 +37,13 @@ import com.plotsquared.core.permissions.Permission;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
|
import com.plotsquared.core.plot.flag.FlagContainer;
|
||||||
|
import com.plotsquared.core.plot.flag.implementations.BeaconEffectsFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag;
|
import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag;
|
||||||
|
import com.plotsquared.core.plot.flag.types.BooleanFlag;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.PlotFlagUtil;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
@ -322,14 +326,17 @@ public class PaperListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Location location = BukkitUtil.adapt(entity.getLocation());
|
Location location = BukkitUtil.adapt(entity.getLocation());
|
||||||
if (!this.plotAreaManager.hasPlotArea(location.getWorldName())) {
|
PlotArea area = location.getPlotArea();
|
||||||
|
if (area == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter);
|
PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter);
|
||||||
Plot plot = location.getOwnedPlot();
|
Plot plot = location.getOwnedPlot();
|
||||||
|
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) {
|
if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !pp.hasPermission(
|
||||||
|
Permission.PERMISSION_ADMIN_PROJECTILE_ROAD
|
||||||
|
)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))
|
||||||
@ -338,7 +345,7 @@ public class PaperListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED))
|
||||||
@ -348,7 +355,7 @@ public class PaperListener implements Listener {
|
|||||||
}
|
}
|
||||||
} else if (!plot.isAdded(pp.getUUID())) {
|
} else if (!plot.isAdded(pp.getUUID())) {
|
||||||
if (!plot.getFlag(ProjectilesFlag.class)) {
|
if (!plot.getFlag(ProjectilesFlag.class)) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
||||||
@ -400,4 +407,50 @@ public class PaperListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(ignoreCancelled = true)
|
||||||
|
public void onBeaconEffect(final BeaconEffectEvent event) {
|
||||||
|
Block block = event.getBlock();
|
||||||
|
Location beaconLocation = BukkitUtil.adapt(block.getLocation());
|
||||||
|
Plot beaconPlot = beaconLocation.getPlot();
|
||||||
|
|
||||||
|
PlotArea area = beaconLocation.getPlotArea();
|
||||||
|
if (area == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
Location playerLocation = BukkitUtil.adapt(player.getLocation());
|
||||||
|
|
||||||
|
PlotPlayer<Player> plotPlayer = BukkitUtil.adapt(player);
|
||||||
|
Plot playerStandingPlot = playerLocation.getPlot();
|
||||||
|
if (playerStandingPlot == null) {
|
||||||
|
FlagContainer container = area.getRoadFlagContainer();
|
||||||
|
if (!getBooleanFlagValue(container, BeaconEffectsFlag.class, true) ||
|
||||||
|
(beaconPlot != null && Settings.Enabled_Components.DISABLE_BEACON_EFFECT_OVERFLOW)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
FlagContainer container = playerStandingPlot.getFlagContainer();
|
||||||
|
boolean plotBeaconEffects = getBooleanFlagValue(container, BeaconEffectsFlag.class, true);
|
||||||
|
if (playerStandingPlot.equals(beaconPlot)) {
|
||||||
|
if (!plotBeaconEffects) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!plotBeaconEffects || Settings.Enabled_Components.DISABLE_BEACON_EFFECT_OVERFLOW) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean getBooleanFlagValue(@NonNull FlagContainer container,
|
||||||
|
@NonNull Class<? extends BooleanFlag<?>> flagClass,
|
||||||
|
boolean defaultValue) {
|
||||||
|
BooleanFlag<?> flag = container.getFlag(flagClass);
|
||||||
|
return flag == null ? defaultValue : flag.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,10 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated P2 effectively no longer supports 1.13
|
||||||
|
*/
|
||||||
|
@Deprecated(forRemoval = true, since = "6.10.4")
|
||||||
public class PaperListener113 extends PaperListener {
|
public class PaperListener113 extends PaperListener {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@ -67,7 +67,7 @@ import com.plotsquared.core.plot.flag.implementations.VillagerInteractFlag;
|
|||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.PlotFlagUtil;
|
||||||
import com.plotsquared.core.util.PremiumVerification;
|
import com.plotsquared.core.util.PremiumVerification;
|
||||||
import com.plotsquared.core.util.entity.EntityCategories;
|
import com.plotsquared.core.util.entity.EntityCategories;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
@ -106,6 +106,7 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.entity.EntityPickupItemEvent;
|
import org.bukkit.event.entity.EntityPickupItemEvent;
|
||||||
import org.bukkit.event.entity.EntityPlaceEvent;
|
import org.bukkit.event.entity.EntityPlaceEvent;
|
||||||
|
import org.bukkit.event.entity.EntityPotionEffectEvent;
|
||||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
|
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
|
||||||
import org.bukkit.event.hanging.HangingPlaceEvent;
|
import org.bukkit.event.hanging.HangingPlaceEvent;
|
||||||
@ -142,6 +143,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
import org.bukkit.metadata.FixedMetadataValue;
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
import org.bukkit.metadata.MetadataValue;
|
import org.bukkit.metadata.MetadataValue;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
@ -204,6 +206,29 @@ public class PlayerEventListener implements Listener {
|
|||||||
this.plotListener = plotListener;
|
this.plotListener = plotListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(ignoreCancelled = true)
|
||||||
|
public void onEffect(@NonNull EntityPotionEffectEvent event) {
|
||||||
|
if (Settings.Enabled_Components.DISABLE_BEACON_EFFECT_OVERFLOW ||
|
||||||
|
event.getCause() != EntityPotionEffectEvent.Cause.BEACON ||
|
||||||
|
!(event.getEntity() instanceof Player player)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
UUID uuid = player.getUniqueId();
|
||||||
|
PotionEffect effect = event.getNewEffect();
|
||||||
|
if (effect == null) {
|
||||||
|
PotionEffect oldEffect = event.getOldEffect();
|
||||||
|
if (oldEffect != null) {
|
||||||
|
String name = oldEffect.getType().getName();
|
||||||
|
plotListener.addEffect(uuid, name, -1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
long expiresAt = System.currentTimeMillis() + effect.getDuration() * 50L; //Convert ticks to milliseconds
|
||||||
|
String name = effect.getType().getName();
|
||||||
|
plotListener.addEffect(uuid, name, expiresAt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onVehicleEntityCollision(VehicleEntityCollisionEvent e) {
|
public void onVehicleEntityCollision(VehicleEntityCollisionEvent e) {
|
||||||
if (e.getVehicle().getType() == EntityType.BOAT) {
|
if (e.getVehicle().getType() == EntityType.BOAT) {
|
||||||
@ -249,8 +274,10 @@ public class PlayerEventListener implements Listener {
|
|||||||
switch (parts[0]) {
|
switch (parts[0]) {
|
||||||
case "up":
|
case "up":
|
||||||
case "worldedit:up":
|
case "worldedit:up":
|
||||||
if (plot == null || (!plot.isAdded(plotPlayer.getUUID()) && !Permissions
|
if (plot == null || (!plot.isAdded(plotPlayer.getUUID()) && !plotPlayer.hasPermission(
|
||||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER, true))) {
|
Permission.PERMISSION_ADMIN_BUILD_OTHER,
|
||||||
|
true
|
||||||
|
))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -265,7 +292,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
if (blockedCommands.isEmpty()) {
|
if (blockedCommands.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) {
|
if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// When using namespaced commands, we're not interested in the namespace
|
// When using namespaced commands, we're not interested in the namespace
|
||||||
@ -284,7 +311,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
} else {
|
} else {
|
||||||
perm = "plots.admin.command.blocked-cmds.road";
|
perm = "plots.admin.command.blocked-cmds.road";
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, perm)) {
|
if (!plotPlayer.hasPermission(perm)) {
|
||||||
plotPlayer.sendMessage(TranslatableCaption.of("blockedcmds.command_blocked"));
|
plotPlayer.sendMessage(TranslatableCaption.of("blockedcmds.command_blocked"));
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -574,7 +601,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
int border = area.getBorder();
|
int border = area.getBorder();
|
||||||
int x1;
|
int x1;
|
||||||
if (x2 > border && this.tmpTeleport) {
|
if (x2 > border && this.tmpTeleport) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||||
to.setX(border - 1);
|
to.setX(border - 1);
|
||||||
this.tmpTeleport = false;
|
this.tmpTeleport = false;
|
||||||
player.teleport(event.getTo());
|
player.teleport(event.getTo());
|
||||||
@ -584,7 +611,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
||||||
}
|
}
|
||||||
} else if (x2 < -border && this.tmpTeleport) {
|
} else if (x2 < -border && this.tmpTeleport) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||||
to.setX(-border + 1);
|
to.setX(-border + 1);
|
||||||
this.tmpTeleport = false;
|
this.tmpTeleport = false;
|
||||||
player.teleport(event.getTo());
|
player.teleport(event.getTo());
|
||||||
@ -594,7 +621,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
||||||
}
|
}
|
||||||
} else if (((x1 = MathMan.roundInt(from.getX())) >= border && x2 <= border) || (x1 <= -border && x2 >= -border)) {
|
} else if (((x1 = MathMan.roundInt(from.getX())) >= border && x2 <= border) || (x1 <= -border && x2 >= -border)) {
|
||||||
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
if (pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||||
pp.sendMessage(TranslatableCaption.of("border.bypass.entered"));
|
pp.sendMessage(TranslatableCaption.of("border.bypass.entered"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -665,7 +692,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
int border = area.getBorder();
|
int border = area.getBorder();
|
||||||
int z1;
|
int z1;
|
||||||
if (z2 > border && this.tmpTeleport) {
|
if (z2 > border && this.tmpTeleport) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||||
to.setZ(border - 1);
|
to.setZ(border - 1);
|
||||||
this.tmpTeleport = false;
|
this.tmpTeleport = false;
|
||||||
player.teleport(event.getTo());
|
player.teleport(event.getTo());
|
||||||
@ -675,7 +702,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
||||||
}
|
}
|
||||||
} else if (z2 < -border && this.tmpTeleport) {
|
} else if (z2 < -border && this.tmpTeleport) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||||
to.setZ(-border + 1);
|
to.setZ(-border + 1);
|
||||||
this.tmpTeleport = false;
|
this.tmpTeleport = false;
|
||||||
player.teleport(event.getTo());
|
player.teleport(event.getTo());
|
||||||
@ -685,7 +712,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
pp.sendMessage(TranslatableCaption.of("border.bypass.exited"));
|
||||||
}
|
}
|
||||||
} else if (((z1 = MathMan.roundInt(from.getZ())) >= border && z2 <= border) || (z1 <= -border && z2 >= -border)) {
|
} else if (((z1 = MathMan.roundInt(from.getZ())) >= border && z2 <= border) || (z1 <= -border && z2 >= -border)) {
|
||||||
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
if (pp.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||||
pp.sendMessage(TranslatableCaption.of("border.bypass.entered"));
|
pp.sendMessage(TranslatableCaption.of("border.bypass.entered"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -712,8 +739,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
|| area.isForcingPlotChat())) {
|
|| area.isForcingPlotChat())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plot.isDenied(plotPlayer.getUUID()) && !Permissions
|
if (plot.isDenied(plotPlayer.getUUID()) && !plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_CHAT_BYPASS)) {
|
||||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_CHAT_BYPASS)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -798,7 +824,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
plotListener.plotExit(pp, plot);
|
plotListener.plotExit(pp, plot);
|
||||||
}
|
}
|
||||||
if (this.worldEdit != null) {
|
if (this.worldEdit != null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_WORLDEDIT_BYPASS)) {
|
if (!pp.hasPermission(Permission.PERMISSION_WORLDEDIT_BYPASS)) {
|
||||||
if (pp.getAttribute("worldedit")) {
|
if (pp.getAttribute("worldedit")) {
|
||||||
pp.removeAttribute("worldedit");
|
pp.removeAttribute("worldedit");
|
||||||
}
|
}
|
||||||
@ -854,8 +880,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
final Plot plot = pp.getCurrentPlot();
|
final Plot plot = pp.getCurrentPlot();
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
if (plot.getFlag(PreventCreativeCopyFlag.class) && !plot
|
if (plot.getFlag(PreventCreativeCopyFlag.class) && !plot
|
||||||
.isAdded(player.getUniqueId()) && !Permissions
|
.isAdded(player.getUniqueId()) && !pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
||||||
.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
|
||||||
final ItemStack newStack =
|
final ItemStack newStack =
|
||||||
new ItemStack(newItem.getType(), newItem.getAmount());
|
new ItemStack(newItem.getType(), newItem.getAmount());
|
||||||
event.setCursor(newStack);
|
event.setCursor(newStack);
|
||||||
@ -864,8 +889,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
PlotArea area = pp.getPlotAreaAbs();
|
PlotArea area = pp.getPlotAreaAbs();
|
||||||
if (area != null && area.isRoadFlags() && area
|
if (area != null && PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, PreventCreativeCopyFlag.class, true)) {
|
||||||
.getRoadFlag(PreventCreativeCopyFlag.class)) {
|
|
||||||
final ItemStack newStack =
|
final ItemStack newStack =
|
||||||
new ItemStack(newItem.getType(), newItem.getAmount());
|
new ItemStack(newItem.getType(), newItem.getAmount());
|
||||||
event.setCursor(newStack);
|
event.setCursor(newStack);
|
||||||
@ -918,7 +942,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
Plot plot = area.getPlotAbs(location);
|
Plot plot = area.getPlotAbs(location);
|
||||||
boolean cancelled = false;
|
boolean cancelled = false;
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
|
||||||
@ -926,7 +950,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
cancelled = true;
|
cancelled = true;
|
||||||
}
|
}
|
||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED))
|
||||||
@ -936,7 +960,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
} else {
|
} else {
|
||||||
UUID uuid = pp.getUUID();
|
UUID uuid = pp.getUUID();
|
||||||
if (!plot.isAdded(uuid)) {
|
if (!plot.isAdded(uuid)) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER))
|
||||||
@ -973,8 +997,9 @@ public class PlayerEventListener implements Listener {
|
|||||||
Plot plot = location.getPlotAbs();
|
Plot plot = location.getPlotAbs();
|
||||||
BukkitPlayer pp = BukkitUtil.adapt(e.getPlayer());
|
BukkitPlayer pp = BukkitUtil.adapt(e.getPlayer());
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!area.isRoadFlags() && !area.getRoadFlag(MiscInteractFlag.class) && !Permissions
|
if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, MiscInteractFlag.class, true) && !pp.hasPermission(
|
||||||
.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
Permission.PERMISSION_ADMIN_INTERACT_ROAD
|
||||||
|
)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
|
||||||
@ -983,16 +1008,14 @@ public class PlayerEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(TranslatableCaption.of("done.building_restricted"));
|
||||||
TranslatableCaption.of("done.building_restricted")
|
|
||||||
);
|
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, "plots.admin.interact.unowned")) {
|
if (!pp.hasPermission("plots.admin.interact.unowned")) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED))
|
||||||
@ -1007,7 +1030,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
if (plot.getFlag(MiscInteractFlag.class)) {
|
if (plot.getFlag(MiscInteractFlag.class)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER))
|
||||||
@ -1232,7 +1255,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
BukkitPlayer pp = BukkitUtil.adapt(event.getPlayer());
|
BukkitPlayer pp = BukkitUtil.adapt(event.getPlayer());
|
||||||
Plot plot = area.getPlot(location);
|
Plot plot = area.getPlot(location);
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
if (pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
@ -1241,7 +1264,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
if (pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
@ -1250,7 +1273,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (!plot.isAdded(pp.getUUID())) {
|
} else if (!plot.isAdded(pp.getUUID())) {
|
||||||
if (Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
@ -1259,7 +1282,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("done.building_restricted")
|
TranslatableCaption.of("done.building_restricted")
|
||||||
);
|
);
|
||||||
@ -1297,7 +1320,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
|
BukkitPlayer plotPlayer = BukkitUtil.adapt(player);
|
||||||
Plot plot = area.getPlot(location);
|
Plot plot = area.getPlot(location);
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
@ -1306,7 +1329,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
@ -1315,7 +1338,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (!plot.isAdded(plotPlayer.getUUID())) {
|
} else if (!plot.isAdded(plotPlayer.getUUID())) {
|
||||||
if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
@ -1324,7 +1347,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
);
|
);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
} else if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("done.building_restricted")
|
TranslatableCaption.of("done.building_restricted")
|
||||||
);
|
);
|
||||||
@ -1349,7 +1372,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
BukkitPlayer pp = BukkitUtil.adapt(p);
|
BukkitPlayer pp = BukkitUtil.adapt(p);
|
||||||
Plot plot = area.getPlot(location);
|
Plot plot = area.getPlot(location);
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_ROAD)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
|
||||||
@ -1358,7 +1381,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))
|
||||||
@ -1369,7 +1392,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
if (!plot.isAdded(pp.getUUID())) {
|
if (!plot.isAdded(pp.getUUID())) {
|
||||||
if (!plot.getFlag(HangingPlaceFlag.class)) {
|
if (!plot.getFlag(HangingPlaceFlag.class)) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_OTHER))
|
||||||
@ -1398,7 +1421,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
BukkitPlayer pp = BukkitUtil.adapt(p);
|
BukkitPlayer pp = BukkitUtil.adapt(p);
|
||||||
Plot plot = area.getPlot(location);
|
Plot plot = area.getPlot(location);
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_ROAD)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_ROAD)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_ROAD))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_ROAD))
|
||||||
@ -1406,7 +1429,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED))
|
||||||
@ -1417,7 +1440,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
if (plot.getFlag(HangingBreakFlag.class)) {
|
if (plot.getFlag(HangingBreakFlag.class)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
|
||||||
@ -1438,8 +1461,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
Plot plot = area.getPlot(BukkitUtil.adapt(event.getEntity().getLocation()));
|
Plot plot = area.getPlot(BukkitUtil.adapt(event.getEntity().getLocation()));
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
if (!Permissions
|
if (!player.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_UNOWNED)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_UNOWNED))
|
||||||
@ -1448,8 +1470,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
} else if (!plot.isAdded(player.getUUID())) {
|
} else if (!plot.isAdded(player.getUUID())) {
|
||||||
if (!plot.getFlag(HangingBreakFlag.class)) {
|
if (!plot.getFlag(HangingBreakFlag.class)) {
|
||||||
if (!Permissions
|
if (!player.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_DESTROY_OTHER)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_OTHER))
|
||||||
@ -1481,7 +1502,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
BukkitPlayer pp = BukkitUtil.adapt(p);
|
BukkitPlayer pp = BukkitUtil.adapt(p);
|
||||||
Plot plot = area.getPlot(location);
|
Plot plot = area.getPlot(location);
|
||||||
if (plot == null && !area.isRoadFlags()) {
|
if (plot == null && !area.isRoadFlags()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
|
||||||
@ -1489,7 +1510,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (plot != null && !plot.hasOwner()) {
|
} else if (plot != null && !plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_UNOWNED))
|
||||||
@ -1547,7 +1568,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_INTERACT_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_OTHER))
|
||||||
@ -1569,7 +1590,9 @@ public class PlayerEventListener implements Listener {
|
|||||||
BukkitPlayer pp = BukkitUtil.adapt(p);
|
BukkitPlayer pp = BukkitUtil.adapt(p);
|
||||||
Plot plot = area.getPlot(location);
|
Plot plot = area.getPlot(location);
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD)) {
|
if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, VehicleBreakFlag.class, true) && !pp.hasPermission(
|
||||||
|
Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD
|
||||||
|
)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD))
|
||||||
@ -1578,7 +1601,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_UNOWNED))
|
||||||
@ -1592,7 +1615,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
if (plot.getFlag(VehicleBreakFlag.class)) {
|
if (plot.getFlag(VehicleBreakFlag.class)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_OTHER))
|
||||||
@ -1617,7 +1640,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
Plot plot = location.getOwnedPlot();
|
Plot plot = location.getOwnedPlot();
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (area.isRoadFlags() && !area.getRoadFlag(ItemDropFlag.class)) {
|
if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ItemDropFlag.class, false)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1643,7 +1666,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
Plot plot = location.getOwnedPlot();
|
Plot plot = location.getOwnedPlot();
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (area.isRoadFlags() && area.getRoadFlag(DropProtectionFlag.class)) {
|
if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, DropProtectionFlag.class, true)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1665,17 +1688,15 @@ public class PlayerEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
Plot plot = location.getOwnedPlot();
|
Plot plot = location.getOwnedPlot();
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (area.isRoadFlags() && area.getRoadFlag(KeepInventoryFlag.class)) {
|
if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, KeepInventoryFlag.class, true)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plot.getFlag(KeepInventoryFlag.class)) {
|
if (plot.getFlag(KeepInventoryFlag.class)) {
|
||||||
if (plot.getFlag(KeepInventoryFlag.class)) {
|
plot.debug(event.getEntity().getName() + " kept their inventory because of keep-inventory = true");
|
||||||
plot.debug(event.getEntity().getName() + " kept their inventory because of keep-inventory = true");
|
event.getDrops().clear();
|
||||||
event.getDrops().clear();
|
event.setKeepInventory(true);
|
||||||
event.setKeepInventory(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1700,16 +1721,14 @@ public class PlayerEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
Plot plot = location.getOwnedPlot();
|
Plot plot = location.getOwnedPlot();
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (area.isRoadFlags() && area.getRoadFlag(DenyPortalTravelFlag.class)) {
|
if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, DenyPortalTravelFlag.class, true)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plot.getFlag(DenyPortalTravelFlag.class)) {
|
if (plot.getFlag(DenyPortalTravelFlag.class)) {
|
||||||
if (plot.getFlag(DenyPortalTravelFlag.class)) {
|
plot.debug(event.getPlayer().getName() + " did not travel thru a portal because of deny-portal-travel = true");
|
||||||
plot.debug(event.getPlayer().getName() + " did not travel thru a portal because of deny-portal-travel = true");
|
event.setCancelled(true);
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1731,11 +1750,11 @@ public class PlayerEventListener implements Listener {
|
|||||||
maxZ = Math.max(state.getZ(), maxZ);
|
maxZ = Math.max(state.getZ(), maxZ);
|
||||||
}
|
}
|
||||||
int y = event.getBlocks().get(0).getY(); // Don't need to worry about this too much
|
int y = event.getBlocks().get(0).getY(); // Don't need to worry about this too much
|
||||||
for (Location location : Set.of( // Use Set to lazily avoid duplicate locations
|
for (Location location : List.of( // We don't care about duplicate locations
|
||||||
Location.at(world, minX, y, maxX),
|
Location.at(world, minX, y, minZ),
|
||||||
Location.at(world, minZ, y, maxZ),
|
|
||||||
Location.at(world, minX, y, maxZ),
|
Location.at(world, minX, y, maxZ),
|
||||||
Location.at(world, minZ, y, maxX)
|
Location.at(world, maxX, y, minZ),
|
||||||
|
Location.at(world, maxX, y, maxZ)
|
||||||
)) {
|
)) {
|
||||||
PlotArea area = location.getPlotArea();
|
PlotArea area = location.getPlotArea();
|
||||||
if (area == null) {
|
if (area == null) {
|
||||||
@ -1747,7 +1766,7 @@ public class PlayerEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
Plot plot = location.getOwnedPlot();
|
Plot plot = location.getOwnedPlot();
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (area.isRoadFlags() && area.getRoadFlag(DenyPortalsFlag.class)) {
|
if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, DenyPortalsFlag.class, true)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1776,16 +1795,14 @@ public class PlayerEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
Plot plot = location.getOwnedPlot();
|
Plot plot = location.getOwnedPlot();
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (area.isRoadFlags() && area.getRoadFlag(LecternReadBookFlag.class)) {
|
if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, LecternReadBookFlag.class, true)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plot.getFlag(LecternReadBookFlag.class)) {
|
if (plot.getFlag(LecternReadBookFlag.class)) {
|
||||||
if (plot.getFlag(LecternReadBookFlag.class)) {
|
plot.debug(event.getPlayer().getName() + " could not take the book because of lectern-read-book = true");
|
||||||
plot.debug(event.getPlayer().getName() + " could not take the book because of lectern-read-book = true");
|
event.setCancelled(true);
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ import com.plotsquared.core.plot.PlotArea;
|
|||||||
import com.plotsquared.core.plot.PlotHandler;
|
import com.plotsquared.core.plot.PlotHandler;
|
||||||
import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag;
|
import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.PlotFlagUtil;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
@ -97,14 +97,17 @@ public class ProjectileEventListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Location location = BukkitUtil.adapt(entity.getLocation());
|
Location location = BukkitUtil.adapt(entity.getLocation());
|
||||||
if (!this.plotAreaManager.hasPlotArea(location.getWorldName())) {
|
PlotArea area = location.getPlotArea();
|
||||||
|
if (area == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter);
|
PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter);
|
||||||
Plot plot = location.getOwnedPlot();
|
Plot plot = location.getOwnedPlot();
|
||||||
|
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) {
|
if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !pp.hasPermission(
|
||||||
|
Permission.PERMISSION_ADMIN_PROJECTILE_ROAD
|
||||||
|
)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))
|
||||||
@ -113,7 +116,7 @@ public class ProjectileEventListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED))
|
||||||
@ -123,7 +126,7 @@ public class ProjectileEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
} else if (!plot.isAdded(pp.getUUID())) {
|
} else if (!plot.isAdded(pp.getUUID())) {
|
||||||
if (!plot.getFlag(ProjectilesFlag.class)) {
|
if (!plot.getFlag(ProjectilesFlag.class)) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
if (!pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER)) {
|
||||||
pp.sendMessage(
|
pp.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER))
|
||||||
@ -154,6 +157,8 @@ public class ProjectileEventListener implements Listener {
|
|||||||
if (plot.isAdded(((Player) shooter).getUniqueId()) || plot.getFlag(ProjectilesFlag.class)) {
|
if (plot.isAdded(((Player) shooter).getUniqueId()) || plot.getFlag(ProjectilesFlag.class)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true)) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
entity.remove();
|
entity.remove();
|
||||||
@ -163,14 +168,16 @@ public class ProjectileEventListener implements Listener {
|
|||||||
|
|
||||||
PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter);
|
PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter);
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) {
|
if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !pp.hasPermission(
|
||||||
|
Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED
|
||||||
|
)) {
|
||||||
entity.remove();
|
entity.remove();
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plot.isAdded(pp.getUUID()) || Permissions
|
if (plot.isAdded(pp.getUUID()) || pp.hasPermission(Permission.PERMISSION_ADMIN_PROJECTILE_OTHER) || plot.getFlag(
|
||||||
.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_OTHER) || plot.getFlag(ProjectilesFlag.class)) {
|
ProjectilesFlag.class)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
entity.remove();
|
entity.remove();
|
||||||
@ -194,7 +201,6 @@ public class ProjectileEventListener implements Listener {
|
|||||||
if (sPlot == null || !PlotHandler.sameOwners(plot, sPlot)) {
|
if (sPlot == null || !PlotHandler.sameOwners(plot, sPlot)) {
|
||||||
entity.remove();
|
entity.remove();
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* PlotSquared, a land and world management plugin for Minecraft.
|
||||||
|
* Copyright (C) IntellectualSites <https://intellectualsites.com>
|
||||||
|
* Copyright (C) IntellectualSites team and contributors
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.plotsquared.bukkit.listener;
|
||||||
|
|
||||||
|
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||||
|
import com.plotsquared.core.location.Location;
|
||||||
|
import com.plotsquared.core.plot.Plot;
|
||||||
|
import com.plotsquared.core.plot.flag.FlagContainer;
|
||||||
|
import com.plotsquared.core.plot.flag.implementations.BeaconEffectsFlag;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.entity.EntityPotionEffectEvent;
|
||||||
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fallback listener for paper events on spigot
|
||||||
|
*/
|
||||||
|
public class SpigotListener implements Listener {
|
||||||
|
|
||||||
|
@EventHandler(ignoreCancelled = true)
|
||||||
|
public void onEffect(@NonNull EntityPotionEffectEvent event) {
|
||||||
|
if (event.getCause() != EntityPotionEffectEvent.Cause.BEACON) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Entity entity = event.getEntity();
|
||||||
|
Location location = BukkitUtil.adapt(entity.getLocation());
|
||||||
|
Plot plot = location.getPlot();
|
||||||
|
if (plot == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
FlagContainer container = plot.getFlagContainer();
|
||||||
|
BeaconEffectsFlag effectsEnabled = container.getFlag(BeaconEffectsFlag.class);
|
||||||
|
if (effectsEnabled != null && !effectsEnabled.getValue()) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -30,8 +30,9 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
|||||||
*
|
*
|
||||||
* @deprecated Deprecated and scheduled for removal without replacement
|
* @deprecated Deprecated and scheduled for removal without replacement
|
||||||
* in favor of the build in setup wizard.
|
* in favor of the build in setup wizard.
|
||||||
|
* However, this class will be kept around for a while, given it's not a maintenance burden.
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.0.0")
|
@Deprecated
|
||||||
@Singleton
|
@Singleton
|
||||||
public class MultiverseWorldManager extends BukkitWorldManager {
|
public class MultiverseWorldManager extends BukkitWorldManager {
|
||||||
|
|
||||||
|
@ -87,4 +87,9 @@ public class BukkitOfflinePlayer implements OfflinePlotPlayer {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasPermission(@NonNull final String permission, final boolean notify) {
|
||||||
|
return hasPermission(permission);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -47,13 +47,13 @@ import org.bukkit.event.EventException;
|
|||||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||||
import org.bukkit.plugin.RegisteredListener;
|
import org.bukkit.plugin.RegisteredListener;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
import org.checkerframework.checker.index.qual.NonNegative;
|
import org.checkerframework.checker.index.qual.NonNegative;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static com.sk89q.worldedit.world.gamemode.GameModes.ADVENTURE;
|
import static com.sk89q.worldedit.world.gamemode.GameModes.ADVENTURE;
|
||||||
import static com.sk89q.worldedit.world.gamemode.GameModes.CREATIVE;
|
import static com.sk89q.worldedit.world.gamemode.GameModes.CREATIVE;
|
||||||
@ -67,14 +67,15 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Please do not use this method. Instead use
|
|
||||||
* BukkitUtil.getPlayer(Player), as it caches player objects.</p>
|
|
||||||
*
|
|
||||||
* @param plotAreaManager PlotAreaManager instance
|
* @param plotAreaManager PlotAreaManager instance
|
||||||
* @param eventDispatcher EventDispatcher instance
|
* @param eventDispatcher EventDispatcher instance
|
||||||
* @param player Bukkit player instance
|
* @param player Bukkit player instance
|
||||||
* @param permissionHandler PermissionHandler instance
|
* @param permissionHandler PermissionHandler instance
|
||||||
|
*
|
||||||
|
* @deprecated Please do not use this method. Instead use {@link BukkitUtil#adapt(Player)}, as it caches player objects.
|
||||||
|
* This method will be made private in a future release.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated(forRemoval = true, since = "6.10.9")
|
||||||
public BukkitPlayer(
|
public BukkitPlayer(
|
||||||
final @NonNull PlotAreaManager plotAreaManager, final @NonNull EventDispatcher eventDispatcher,
|
final @NonNull PlotAreaManager plotAreaManager, final @NonNull EventDispatcher eventDispatcher,
|
||||||
final @NonNull Player player, final @NonNull PermissionHandler permissionHandler
|
final @NonNull Player player, final @NonNull PermissionHandler permissionHandler
|
||||||
@ -82,6 +83,16 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
this(plotAreaManager, eventDispatcher, player, false, permissionHandler);
|
this(plotAreaManager, eventDispatcher, player, false, permissionHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param plotAreaManager PlotAreaManager instance
|
||||||
|
* @param eventDispatcher EventDispatcher instance
|
||||||
|
* @param player Bukkit player instance
|
||||||
|
* @param permissionHandler PermissionHandler instance
|
||||||
|
*
|
||||||
|
* @deprecated Please do not use this method. Instead use {@link BukkitUtil#adapt(Player)}, as it caches player objects.
|
||||||
|
* This method will be made private in a future release.
|
||||||
|
*/
|
||||||
|
@Deprecated(forRemoval = true, since = "6.10.9")
|
||||||
public BukkitPlayer(
|
public BukkitPlayer(
|
||||||
final @NonNull PlotAreaManager plotAreaManager, final @NonNull
|
final @NonNull PlotAreaManager plotAreaManager, final @NonNull
|
||||||
EventDispatcher eventDispatcher, final @NonNull Player player,
|
EventDispatcher eventDispatcher, final @NonNull Player player,
|
||||||
@ -348,6 +359,14 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
return BukkitUtil.BUKKIT_AUDIENCES.player(this.player);
|
return BukkitUtil.BUKKIT_AUDIENCES.player(this.player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeEffect(@NonNull String name) {
|
||||||
|
PotionEffectType type = PotionEffectType.getByName(name);
|
||||||
|
if (type != null) {
|
||||||
|
player.removePotionEffect(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSee(final PlotPlayer<?> other) {
|
public boolean canSee(final PlotPlayer<?> other) {
|
||||||
if (other instanceof ConsolePlayer) {
|
if (other instanceof ConsolePlayer) {
|
||||||
|
@ -54,6 +54,7 @@ public class BukkitPlayerManager extends PlayerManager<BukkitPlayer, Player> {
|
|||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BukkitPlayer getPlayer(final @NonNull Player object) {
|
public BukkitPlayer getPlayer(final @NonNull Player object) {
|
||||||
if (object.getUniqueId().version() == 2) { // not a real player
|
if (object.getUniqueId().version() == 2) { // not a real player
|
||||||
return new BukkitPlayer(this.plotAreaManager, this.eventDispatcher, object, false, this.permissionHandler);
|
return new BukkitPlayer(this.plotAreaManager, this.eventDispatcher, object, false, this.permissionHandler);
|
||||||
@ -65,6 +66,7 @@ public class BukkitPlayerManager extends PlayerManager<BukkitPlayer, Player> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public @NonNull BukkitPlayer createPlayer(final @NonNull UUID uuid) {
|
public @NonNull BukkitPlayer createPlayer(final @NonNull UUID uuid) {
|
||||||
final Player player = Bukkit.getPlayer(uuid);
|
final Player player = Bukkit.getPlayer(uuid);
|
||||||
if (player == null || !player.isOnline()) {
|
if (player == null || !player.isOnline()) {
|
||||||
|
@ -239,9 +239,11 @@ public final class BukkitChunkCoordinator extends ChunkCoordinator {
|
|||||||
* server's main thread.
|
* server's main thread.
|
||||||
*/
|
*/
|
||||||
private void processChunk(final @NonNull Chunk chunk) {
|
private void processChunk(final @NonNull Chunk chunk) {
|
||||||
|
/* Chunk#isLoaded does not necessarily return true shortly after PaperLib#getChunkAtAsync completes, but the chunk is
|
||||||
|
still loaded.
|
||||||
if (!chunk.isLoaded()) {
|
if (!chunk.isLoaded()) {
|
||||||
throw new IllegalArgumentException(String.format("Chunk %d;%d is is not loaded", chunk.getX(), chunk.getZ()));
|
throw new IllegalArgumentException(String.format("Chunk %d;%d is is not loaded", chunk.getX(), chunk.getZ());
|
||||||
}
|
}*/
|
||||||
if (finished) {
|
if (finished) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,11 @@ public class GenChunk extends ScopedQueueCoordinator {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBlock(int x, int y, int z, @NonNull Pattern pattern) {
|
public boolean setBlock(int x, int y, int z, @NonNull Pattern pattern) {
|
||||||
return setBlock(x, y, z, PatternUtil.apply(Preconditions.checkNotNull(pattern, "Pattern may not be null"), x, y, z));
|
final BaseBlock block = PatternUtil.apply(Preconditions.checkNotNull(
|
||||||
|
pattern,
|
||||||
|
"Pattern may not be null"
|
||||||
|
), x + (chunkX << 4), y, z + (chunkZ << 4));
|
||||||
|
return setBlock(x, y, z, block);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -44,6 +44,7 @@ public class LimitedRegionWrapperQueue extends DelegateQueueCoordinator {
|
|||||||
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + LimitedRegionWrapperQueue.class.getSimpleName());
|
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + LimitedRegionWrapperQueue.class.getSimpleName());
|
||||||
|
|
||||||
private final LimitedRegion limitedRegion;
|
private final LimitedRegion limitedRegion;
|
||||||
|
private boolean useOtherRestoreTagMethod = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 6.9.0
|
* @since 6.9.0
|
||||||
@ -65,10 +66,18 @@ public class LimitedRegionWrapperQueue extends DelegateQueueCoordinator {
|
|||||||
CompoundTag tag = id.getNbtData();
|
CompoundTag tag = id.getNbtData();
|
||||||
StateWrapper sw = new StateWrapper(tag);
|
StateWrapper sw = new StateWrapper(tag);
|
||||||
try {
|
try {
|
||||||
sw.restoreTag(limitedRegion.getBlockState(x, y, z).getBlock());
|
if (useOtherRestoreTagMethod && getWorld() != null) {
|
||||||
|
sw.restoreTag(getWorld().getName(), x, y, z);
|
||||||
|
} else {
|
||||||
|
sw.restoreTag(limitedRegion.getBlockState(x, y, z).getBlock());
|
||||||
|
}
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
LOGGER.error("Error attempting to populate tile entity into the world at location {},{},{}", x, y, z, e);
|
LOGGER.error("Error attempting to populate tile entity into the world at location {},{},{}", x, y, z, e);
|
||||||
return false;
|
return false;
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
useOtherRestoreTagMethod = true;
|
||||||
|
LOGGER.warn("IllegalStateException attempting to populate tile entity into the world at location {},{},{}. " +
|
||||||
|
"Possibly on <=1.17.1, switching to secondary method.", x, y, z, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -40,7 +40,6 @@ import com.plotsquared.core.plot.flag.implementations.PvpFlag;
|
|||||||
import com.plotsquared.core.plot.flag.implementations.TamedAttackFlag;
|
import com.plotsquared.core.plot.flag.implementations.TamedAttackFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.VehicleCapFlag;
|
import com.plotsquared.core.plot.flag.implementations.VehicleCapFlag;
|
||||||
import com.plotsquared.core.util.EntityUtil;
|
import com.plotsquared.core.util.EntityUtil;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.entity.EntityCategories;
|
import com.plotsquared.core.util.entity.EntityCategories;
|
||||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
@ -168,8 +167,7 @@ public class BukkitEntityUtil {
|
|||||||
if (plot != null && (plot.getFlag(HangingBreakFlag.class) || plot
|
if (plot != null && (plot.getFlag(HangingBreakFlag.class) || plot
|
||||||
.isAdded(plotPlayer.getUUID()))) {
|
.isAdded(plotPlayer.getUUID()))) {
|
||||||
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
|
||||||
if (!Permissions
|
if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
||||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
|
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("done.building_restricted")
|
TranslatableCaption.of("done.building_restricted")
|
||||||
);
|
);
|
||||||
@ -178,7 +176,7 @@ public class BukkitEntityUtil {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) {
|
if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub)
|
||||||
@ -190,7 +188,7 @@ public class BukkitEntityUtil {
|
|||||||
.isAdded(plotPlayer.getUUID()))) {
|
.isAdded(plotPlayer.getUUID()))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) {
|
if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_DESTROY + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_DESTROY + "." + stub)
|
||||||
@ -211,7 +209,7 @@ public class BukkitEntityUtil {
|
|||||||
.getFlag(PveFlag.class))) {
|
.getFlag(PveFlag.class))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||||
@ -232,7 +230,7 @@ public class BukkitEntityUtil {
|
|||||||
.getFlag(PveFlag.class))) {
|
.getFlag(PveFlag.class))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||||
@ -245,8 +243,7 @@ public class BukkitEntityUtil {
|
|||||||
}
|
}
|
||||||
} else if (EntityCategories.PLAYER.contains(entityType)) {
|
} else if (EntityCategories.PLAYER.contains(entityType)) {
|
||||||
if (isPlot) {
|
if (isPlot) {
|
||||||
if (!plot.getFlag(PvpFlag.class) && !Permissions
|
if (!plot.getFlag(PvpFlag.class) && !plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_PVP + "." + stub)) {
|
||||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) {
|
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_PVP + "." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_PVP + "." + stub)
|
||||||
@ -260,7 +257,7 @@ public class BukkitEntityUtil {
|
|||||||
} else if (roadFlags && area.getRoadFlag(PvpFlag.class)) {
|
} else if (roadFlags && area.getRoadFlag(PvpFlag.class)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVP + "." + stub)) {
|
if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_PVP + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_PVP + "." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_PVP + "." + stub)
|
||||||
@ -277,7 +274,7 @@ public class BukkitEntityUtil {
|
|||||||
.getFlag(PveFlag.class))) {
|
.getFlag(PveFlag.class))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||||
@ -299,7 +296,7 @@ public class BukkitEntityUtil {
|
|||||||
} else if (roadFlags && area.getRoadFlag(PveFlag.class)) {
|
} else if (roadFlags && area.getRoadFlag(PveFlag.class)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
if (!plotPlayer.hasPermission(Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||||
|
@ -58,6 +58,7 @@ import org.bukkit.block.BlockFace;
|
|||||||
import org.bukkit.block.Sign;
|
import org.bukkit.block.Sign;
|
||||||
import org.bukkit.block.data.Directional;
|
import org.bukkit.block.data.Directional;
|
||||||
import org.bukkit.block.data.type.WallSign;
|
import org.bukkit.block.data.type.WallSign;
|
||||||
|
import org.bukkit.entity.Allay;
|
||||||
import org.bukkit.entity.Ambient;
|
import org.bukkit.entity.Ambient;
|
||||||
import org.bukkit.entity.Animals;
|
import org.bukkit.entity.Animals;
|
||||||
import org.bukkit.entity.AreaEffectCloud;
|
import org.bukkit.entity.AreaEffectCloud;
|
||||||
@ -437,6 +438,9 @@ public class BukkitUtil extends WorldUtil {
|
|||||||
allowedInterfaces.add(Animals.class);
|
allowedInterfaces.add(Animals.class);
|
||||||
allowedInterfaces.add(WaterMob.class);
|
allowedInterfaces.add(WaterMob.class);
|
||||||
allowedInterfaces.add(Ambient.class);
|
allowedInterfaces.add(Ambient.class);
|
||||||
|
if (PlotSquared.platform().serverVersion()[1] >= 19) {
|
||||||
|
allowedInterfaces.add(Allay.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case "tameable" -> allowedInterfaces.add(Tameable.class);
|
case "tameable" -> allowedInterfaces.add(Tameable.class);
|
||||||
case "vehicle" -> allowedInterfaces.add(Vehicle.class);
|
case "vehicle" -> allowedInterfaces.add(Vehicle.class);
|
||||||
|
@ -24,7 +24,6 @@ import org.bukkit.Bukkit;
|
|||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class BukkitWorld implements World<org.bukkit.World> {
|
public class BukkitWorld implements World<org.bukkit.World> {
|
||||||
|
|
||||||
|
@ -36,8 +36,7 @@ import com.sk89q.worldedit.function.pattern.Pattern;
|
|||||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@ -46,10 +45,7 @@ public class FaweRegionManager extends BukkitRegionManager {
|
|||||||
private final FaweDelegateRegionManager delegate = new FaweDelegateRegionManager();
|
private final FaweDelegateRegionManager delegate = new FaweDelegateRegionManager();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public FaweRegionManager(
|
public FaweRegionManager(WorldUtil worldUtil, GlobalBlockQueue blockQueue, ProgressSubscriberFactory subscriberFactory) {
|
||||||
@NonNull WorldUtil worldUtil, @NonNull GlobalBlockQueue blockQueue, @NonNull
|
|
||||||
ProgressSubscriberFactory subscriberFactory
|
|
||||||
) {
|
|
||||||
super(worldUtil, blockQueue, subscriberFactory);
|
super(worldUtil, blockQueue, subscriberFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,9 +72,9 @@ public class FaweRegionManager extends BukkitRegionManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handleClear(
|
public boolean handleClear(
|
||||||
@NotNull Plot plot,
|
@NonNull Plot plot,
|
||||||
@Nullable Runnable whenDone,
|
@Nullable Runnable whenDone,
|
||||||
@NotNull PlotManager manager,
|
@NonNull PlotManager manager,
|
||||||
final @Nullable PlotPlayer<?> player
|
final @Nullable PlotPlayer<?> player
|
||||||
) {
|
) {
|
||||||
if (!Settings.FAWE_Components.CLEAR || !(manager instanceof HybridPlotManager)) {
|
if (!Settings.FAWE_Components.CLEAR || !(manager instanceof HybridPlotManager)) {
|
||||||
|
@ -29,7 +29,7 @@ import com.plotsquared.core.util.SchematicHandler;
|
|||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
import com.plotsquared.core.util.task.RunnableVal;
|
import com.plotsquared.core.util.task.RunnableVal;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
@ -40,7 +40,7 @@ public class FaweSchematicHandler extends SchematicHandler {
|
|||||||
private final FaweDelegateSchematicHandler delegate = new FaweDelegateSchematicHandler();
|
private final FaweDelegateSchematicHandler delegate = new FaweDelegateSchematicHandler();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public FaweSchematicHandler(@NotNull WorldUtil worldUtil, @NotNull ProgressSubscriberFactory subscriberFactory) {
|
public FaweSchematicHandler(WorldUtil worldUtil, ProgressSubscriberFactory subscriberFactory) {
|
||||||
super(worldUtil, subscriberFactory);
|
super(worldUtil, subscriberFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,9 +75,8 @@ public class FaweSchematicHandler extends SchematicHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Schematic getSchematic(@NotNull InputStream is) {
|
public Schematic getSchematic(@NonNull InputStream is) {
|
||||||
return delegate.getSchematic(is);
|
return delegate.getSchematic(is);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
|||||||
## Enforcement
|
## Enforcement
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
reported by contacting the project team at contact@intellectualsites.com. All
|
reported by contacting the project team at contact<at>intellectualsites.com. All
|
||||||
complaints will be reviewed and investigated and will result in a response that
|
complaints will be reviewed and investigated and will result in a response that
|
||||||
is deemed necessary and appropriate to the circumstances. The project team is
|
is deemed necessary and appropriate to the circumstances. The project team is
|
||||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||||
|
@ -54,16 +54,29 @@ tasks.processResources {
|
|||||||
"date" to rootProject.grgit.head().dateTime.format(DateTimeFormatter.ofPattern("yy.MM.dd"))
|
"date" to rootProject.grgit.head().dateTime.format(DateTimeFormatter.ofPattern("yy.MM.dd"))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
copy {
|
||||||
|
from(File("$rootDir/LICENSE"))
|
||||||
|
into("$buildDir/resources/main/")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
withType<Javadoc> {
|
withType<Javadoc> {
|
||||||
|
val isRelease = if (rootProject.version.toString().endsWith("-SNAPSHOT")) "TODO" else rootProject.version.toString()
|
||||||
val opt = options as StandardJavadocDocletOptions
|
val opt = options as StandardJavadocDocletOptions
|
||||||
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-core/" + libs.worldeditCore.get().versionConstraint.toString())
|
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-core/" + libs.worldeditCore.get().versionConstraint.toString())
|
||||||
opt.links("https://jd.adventure.kyori.net/api/4.9.3/")
|
opt.links("https://jd.adventure.kyori.net/api/4.9.3/")
|
||||||
opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/")
|
opt.links("https://google.github.io/guice/api-docs/" + libs.guice.get().versionConstraint.toString() + "/javadoc/")
|
||||||
opt.links("https://checkerframework.org/api/")
|
opt.links("https://checkerframework.org/api/")
|
||||||
opt.links("https://javadoc.io/doc/com.intellectualsites.informative-annotations/informative-annotations/latest/")
|
opt.links("https://javadoc.io/doc/com.intellectualsites.informative-annotations/informative-annotations/latest/")
|
||||||
|
opt.isLinkSource = true
|
||||||
|
opt.bottom(File("$rootDir/javadocfooter.html").readText())
|
||||||
|
opt.isUse = true
|
||||||
opt.encoding("UTF-8")
|
opt.encoding("UTF-8")
|
||||||
|
opt.keyWords()
|
||||||
|
opt.addStringOption("-since", isRelease)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@ import com.plotsquared.core.inject.annotations.DefaultGenerator;
|
|||||||
import com.plotsquared.core.location.World;
|
import com.plotsquared.core.location.World;
|
||||||
import com.plotsquared.core.permissions.PermissionHandler;
|
import com.plotsquared.core.permissions.PermissionHandler;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
|
import com.plotsquared.core.plot.expiration.ExpireManager;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.queue.GlobalBlockQueue;
|
import com.plotsquared.core.queue.GlobalBlockQueue;
|
||||||
import com.plotsquared.core.util.ChunkManager;
|
import com.plotsquared.core.util.ChunkManager;
|
||||||
@ -284,6 +285,16 @@ public interface PlotPlatform<P> extends LocaleHolder {
|
|||||||
return injector().getInstance(ChunkManager.class);
|
return injector().getInstance(ChunkManager.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the {@link ExpireManager} implementation for the platform
|
||||||
|
*
|
||||||
|
* @return Expire manager
|
||||||
|
* @since 6.10.2
|
||||||
|
*/
|
||||||
|
default @NonNull ExpireManager expireManager() {
|
||||||
|
return injector().getInstance(ExpireManager.class);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the {@link PlotAreaManager} implementation.
|
* Get the {@link PlotAreaManager} implementation.
|
||||||
*
|
*
|
||||||
|
@ -290,11 +290,11 @@ public class PlotSquared {
|
|||||||
|
|
||||||
public void startExpiryTasks() {
|
public void startExpiryTasks() {
|
||||||
if (Settings.Enabled_Components.PLOT_EXPIRY) {
|
if (Settings.Enabled_Components.PLOT_EXPIRY) {
|
||||||
ExpireManager.IMP = new ExpireManager(this.eventDispatcher);
|
ExpireManager expireManager = PlotSquared.platform().expireManager();
|
||||||
ExpireManager.IMP.runAutomatedTask();
|
expireManager.runAutomatedTask();
|
||||||
for (Settings.Auto_Clear settings : Settings.AUTO_CLEAR.getInstances()) {
|
for (Settings.Auto_Clear settings : Settings.AUTO_CLEAR.getInstances()) {
|
||||||
ExpiryTask task = new ExpiryTask(settings, this.getPlotAreaManager());
|
ExpiryTask task = new ExpiryTask(settings, this.getPlotAreaManager());
|
||||||
ExpireManager.IMP.addTask(task);
|
expireManager.addTask(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -645,7 +645,8 @@ public class PlotSquared {
|
|||||||
} else {
|
} else {
|
||||||
list = new ArrayList<>(input);
|
list = new ArrayList<>(input);
|
||||||
}
|
}
|
||||||
list.sort(Comparator.comparingLong(a -> ExpireManager.IMP.getTimestamp(a.getOwnerAbs())));
|
ExpireManager expireManager = PlotSquared.platform().expireManager();
|
||||||
|
list.sort(Comparator.comparingLong(a -> expireManager.getTimestamp(a.getOwnerAbs())));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@ import com.plotsquared.core.permissions.Permission;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlayerManager;
|
import com.plotsquared.core.util.PlayerManager;
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
@ -58,18 +57,20 @@ public class Add extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompletableFuture<Boolean> execute(
|
public CompletableFuture<Boolean> execute(
|
||||||
final PlotPlayer<?> player, String[] args,
|
final PlotPlayer<?> player,
|
||||||
|
String[] args,
|
||||||
RunnableVal3<Command, Runnable, Runnable> confirm,
|
RunnableVal3<Command, Runnable, Runnable> confirm,
|
||||||
RunnableVal2<Command, CommandResult> whenDone
|
RunnableVal2<Command, CommandResult> whenDone
|
||||||
) throws CommandException {
|
) throws CommandException {
|
||||||
final Plot plot = check(player.getCurrentPlot(), TranslatableCaption.of("errors.not_in_plot"));
|
final Plot plot = check(player.getCurrentPlot(), TranslatableCaption.of("errors.not_in_plot"));
|
||||||
checkTrue(plot.hasOwner(), TranslatableCaption.of("info.plot_unowned"));
|
checkTrue(plot.hasOwner(), TranslatableCaption.of("info.plot_unowned"));
|
||||||
checkTrue(
|
checkTrue(
|
||||||
plot.isOwner(player.getUUID()) || Permissions
|
plot.isOwner(player.getUUID()) || player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_TRUST),
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST),
|
|
||||||
TranslatableCaption.of("permission.no_plot_perms")
|
TranslatableCaption.of("permission.no_plot_perms")
|
||||||
);
|
);
|
||||||
checkTrue(args.length == 1, TranslatableCaption.of("commandconfig.command_syntax"),
|
checkTrue(
|
||||||
|
args.length == 1,
|
||||||
|
TranslatableCaption.of("commandconfig.command_syntax"),
|
||||||
Template.of("value", "/plot add <player | *>")
|
Template.of("value", "/plot add <player | *>")
|
||||||
);
|
);
|
||||||
final CompletableFuture<Boolean> future = new CompletableFuture<>();
|
final CompletableFuture<Boolean> future = new CompletableFuture<>();
|
||||||
@ -94,9 +95,8 @@ public class Add extends Command {
|
|||||||
int size = plot.getTrusted().size() + plot.getMembers().size();
|
int size = plot.getTrusted().size() + plot.getMembers().size();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
UUID uuid = iterator.next();
|
UUID uuid = iterator.next();
|
||||||
if (uuid == DBFunc.EVERYONE && !(
|
if (uuid == DBFunc.EVERYONE && !(player.hasPermission(Permission.PERMISSION_TRUST_EVERYONE) || player.hasPermission(
|
||||||
Permissions.hasPermission(player, Permission.PERMISSION_TRUST_EVERYONE) || Permissions
|
Permission.PERMISSION_ADMIN_COMMAND_TRUST))) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST))) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("errors.invalid_player"),
|
TranslatableCaption.of("errors.invalid_player"),
|
||||||
Template.of("value", PlayerManager.resolveName(uuid).getComponent(player))
|
Template.of("value", PlayerManager.resolveName(uuid).getComponent(player))
|
||||||
@ -124,7 +124,7 @@ public class Add extends Command {
|
|||||||
}
|
}
|
||||||
checkTrue(!uuids.isEmpty(), null);
|
checkTrue(!uuids.isEmpty(), null);
|
||||||
int localAddSize = plot.getMembers().size();
|
int localAddSize = plot.getMembers().size();
|
||||||
int maxAddSize = Permissions.hasPermissionRange(player, Permission.PERMISSION_ADD, Settings.Limit.MAX_PLOTS);
|
int maxAddSize = player.hasPermissionRange(Permission.PERMISSION_ADD, Settings.Limit.MAX_PLOTS);
|
||||||
if (localAddSize >= maxAddSize) {
|
if (localAddSize >= maxAddSize) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("members.plot_max_members_added"),
|
TranslatableCaption.of("members.plot_max_members_added"),
|
||||||
|
@ -26,7 +26,6 @@ import com.plotsquared.core.permissions.Permission;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.query.PlotQuery;
|
import com.plotsquared.core.util.query.PlotQuery;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
|
|
||||||
@ -194,7 +193,7 @@ public class Alias extends SubCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isPermitted(PlotPlayer<?> player, Permission permission) {
|
private boolean isPermitted(PlotPlayer<?> player, Permission permission) {
|
||||||
return Permissions.hasPermission(player, permission);
|
return player.hasPermission(permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,6 @@ import com.plotsquared.core.queue.QueueCoordinator;
|
|||||||
import com.plotsquared.core.setup.PlotAreaBuilder;
|
import com.plotsquared.core.setup.PlotAreaBuilder;
|
||||||
import com.plotsquared.core.util.FileUtils;
|
import com.plotsquared.core.util.FileUtils;
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.RegionUtil;
|
import com.plotsquared.core.util.RegionUtil;
|
||||||
import com.plotsquared.core.util.SchematicHandler;
|
import com.plotsquared.core.util.SchematicHandler;
|
||||||
import com.plotsquared.core.util.SetupUtils;
|
import com.plotsquared.core.util.SetupUtils;
|
||||||
@ -57,6 +56,7 @@ import com.plotsquared.core.util.TabCompletions;
|
|||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import com.sk89q.worldedit.EditSession;
|
import com.sk89q.worldedit.EditSession;
|
||||||
|
import com.sk89q.worldedit.EditSessionBuilder;
|
||||||
import com.sk89q.worldedit.LocalSession;
|
import com.sk89q.worldedit.LocalSession;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.entity.Player;
|
import com.sk89q.worldedit.entity.Player;
|
||||||
@ -138,7 +138,7 @@ public class Area extends SubCommand {
|
|||||||
player.sendMessage(RequiredType.CONSOLE.getErrorMessage());
|
player.sendMessage(RequiredType.CONSOLE.getErrorMessage());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_CREATE)) {
|
if (!player.hasPermission(Permission.PERMISSION_AREA_CREATE)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_AREA_CREATE))
|
Template.of("node", String.valueOf(Permission.PERMISSION_AREA_CREATE))
|
||||||
@ -229,10 +229,9 @@ public class Area extends SubCommand {
|
|||||||
try (final ClipboardWriter clipboardWriter = BuiltInClipboardFormat.SPONGE_SCHEMATIC.getWriter(new FileOutputStream(
|
try (final ClipboardWriter clipboardWriter = BuiltInClipboardFormat.SPONGE_SCHEMATIC.getWriter(new FileOutputStream(
|
||||||
file))) {
|
file))) {
|
||||||
final BlockArrayClipboard clipboard = new BlockArrayClipboard(selectedRegion);
|
final BlockArrayClipboard clipboard = new BlockArrayClipboard(selectedRegion);
|
||||||
final EditSession editSession = WorldEdit
|
EditSessionBuilder editSessionBuilder = WorldEdit.getInstance().newEditSessionBuilder();
|
||||||
.getInstance()
|
editSessionBuilder.world(selectedRegion.getWorld());
|
||||||
.getEditSessionFactory()
|
final EditSession editSession = editSessionBuilder.build();
|
||||||
.getEditSession(selectedRegion.getWorld(), -1);
|
|
||||||
final ForwardExtentCopy forwardExtentCopy =
|
final ForwardExtentCopy forwardExtentCopy =
|
||||||
new ForwardExtentCopy(editSession, selectedRegion, clipboard, selectedRegion.getMinimumPoint());
|
new ForwardExtentCopy(editSession, selectedRegion, clipboard, selectedRegion.getMinimumPoint());
|
||||||
forwardExtentCopy.setCopyingBiomes(true);
|
forwardExtentCopy.setCopyingBiomes(true);
|
||||||
@ -288,7 +287,7 @@ public class Area extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case "c", "setup", "create" -> {
|
case "c", "setup", "create" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_CREATE)) {
|
if (!player.hasPermission(Permission.PERMISSION_AREA_CREATE)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_AREA_CREATE))
|
Template.of("node", String.valueOf(Permission.PERMISSION_AREA_CREATE))
|
||||||
@ -575,7 +574,7 @@ public class Area extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case "i", "info" -> {
|
case "i", "info" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_INFO)) {
|
if (!player.hasPermission(Permission.PERMISSION_AREA_INFO)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_AREA_INFO))
|
Template.of("node", String.valueOf(Permission.PERMISSION_AREA_INFO))
|
||||||
@ -653,7 +652,7 @@ public class Area extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case "l", "list" -> {
|
case "l", "list" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_LIST)) {
|
if (!player.hasPermission(Permission.PERMISSION_AREA_LIST)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_AREA_LIST))
|
Template.of("node", String.valueOf(Permission.PERMISSION_AREA_LIST))
|
||||||
@ -736,7 +735,7 @@ public class Area extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case "regen", "clear", "reset", "regenerate" -> {
|
case "regen", "clear", "reset", "regenerate" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_REGEN)) {
|
if (!player.hasPermission(Permission.PERMISSION_AREA_REGEN)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_AREA_REGEN))
|
Template.of("node", String.valueOf(Permission.PERMISSION_AREA_REGEN))
|
||||||
@ -769,7 +768,7 @@ public class Area extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case "goto", "v", "teleport", "visit", "tp" -> {
|
case "goto", "v", "teleport", "visit", "tp" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_AREA_TP)) {
|
if (!player.hasPermission(Permission.PERMISSION_AREA_TP)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_AREA_TP))
|
Template.of("node", String.valueOf(Permission.PERMISSION_AREA_TP))
|
||||||
@ -825,19 +824,19 @@ public class Area extends SubCommand {
|
|||||||
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
final List<String> completions = new LinkedList<>();
|
final List<String> completions = new LinkedList<>();
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_CREATE)) {
|
if (player.hasPermission(Permission.PERMISSION_AREA_CREATE)) {
|
||||||
completions.add("create");
|
completions.add("create");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_CREATE)) {
|
if (player.hasPermission(Permission.PERMISSION_AREA_CREATE)) {
|
||||||
completions.add("single");
|
completions.add("single");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_LIST)) {
|
if (player.hasPermission(Permission.PERMISSION_AREA_LIST)) {
|
||||||
completions.add("list");
|
completions.add("list");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_INFO)) {
|
if (player.hasPermission(Permission.PERMISSION_AREA_INFO)) {
|
||||||
completions.add("info");
|
completions.add("info");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_TP)) {
|
if (player.hasPermission(Permission.PERMISSION_AREA_TP)) {
|
||||||
completions.add("tp");
|
completions.add("tp");
|
||||||
}
|
}
|
||||||
final List<Command> commands = completions.stream().filter(completion -> completion
|
final List<Command> commands = completions.stream().filter(completion -> completion
|
||||||
@ -852,7 +851,7 @@ public class Area extends SubCommand {
|
|||||||
CommandCategory.ADMINISTRATION
|
CommandCategory.ADMINISTRATION
|
||||||
) {
|
) {
|
||||||
}).collect(Collectors.toCollection(LinkedList::new));
|
}).collect(Collectors.toCollection(LinkedList::new));
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_AREA) && args[0].length() > 0) {
|
if (player.hasPermission(Permission.PERMISSION_AREA) && args[0].length() > 0) {
|
||||||
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
||||||
}
|
}
|
||||||
return commands;
|
return commands;
|
||||||
|
@ -38,7 +38,6 @@ import com.plotsquared.core.plot.world.PlotAreaManager;
|
|||||||
import com.plotsquared.core.services.plots.AutoService;
|
import com.plotsquared.core.services.plots.AutoService;
|
||||||
import com.plotsquared.core.util.EconHandler;
|
import com.plotsquared.core.util.EconHandler;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlotExpression;
|
import com.plotsquared.core.util.PlotExpression;
|
||||||
import com.plotsquared.core.util.task.AutoClaimFinishTask;
|
import com.plotsquared.core.util.task.AutoClaimFinishTask;
|
||||||
import com.plotsquared.core.util.task.RunnableVal;
|
import com.plotsquared.core.util.task.RunnableVal;
|
||||||
@ -246,11 +245,12 @@ public class Auto extends SubCommand {
|
|||||||
sizeX = event.getSizeX();
|
sizeX = event.getSizeX();
|
||||||
sizeZ = event.getSizeZ();
|
sizeZ = event.getSizeZ();
|
||||||
schematic = event.getSchematic();
|
schematic = event.getSchematic();
|
||||||
if (!force && mega && !Permissions.hasPermission(player, Permission.PERMISSION_AUTO_MEGA)) {
|
if (!force && mega && !player.hasPermission(Permission.PERMISSION_AUTO_MEGA)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_AUTO_MEGA))
|
Template.of("node", String.valueOf(Permission.PERMISSION_AUTO_MEGA))
|
||||||
);
|
);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
if (!force && sizeX * sizeZ > Settings.Claim.MAX_AUTO_AREA) {
|
if (!force && sizeX * sizeZ > Settings.Claim.MAX_AUTO_AREA) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
@ -278,11 +278,9 @@ public class Auto extends SubCommand {
|
|||||||
);
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!force && !Permissions.hasPermission(
|
if (!force && !player.hasPermission(
|
||||||
player,
|
|
||||||
Permission.PERMISSION_CLAIM_SCHEMATIC.format(schematic)
|
Permission.PERMISSION_CLAIM_SCHEMATIC.format(schematic)
|
||||||
) && !Permissions
|
) && !player.hasPermission("plots.admin.command.schematic")) {
|
||||||
.hasPermission(player, "plots.admin.command.schematic")) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", "plots.claim.%s0")
|
Template.of("node", "plots.claim.%s0")
|
||||||
|
@ -27,7 +27,6 @@ import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
|||||||
import com.plotsquared.core.permissions.Permission;
|
import com.plotsquared.core.permissions.Permission;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
@ -144,8 +143,7 @@ public final class Backup extends Command {
|
|||||||
TranslatableCaption.of("backups.backup_impossible"),
|
TranslatableCaption.of("backups.backup_impossible"),
|
||||||
Template.of("plot", TranslatableCaption.of("generic.generic_merged").getComponent(player))
|
Template.of("plot", TranslatableCaption.of("generic.generic_merged").getComponent(player))
|
||||||
);
|
);
|
||||||
} else if (!plot.isOwner(player.getUUID()) && !Permissions
|
} else if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_BACKUP_OTHER)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_BACKUP_OTHER)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BACKUP_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BACKUP_OTHER))
|
||||||
@ -198,8 +196,7 @@ public final class Backup extends Command {
|
|||||||
);
|
);
|
||||||
} else if (plot.getVolume() > Integer.MAX_VALUE) {
|
} else if (plot.getVolume() > Integer.MAX_VALUE) {
|
||||||
player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large"));
|
player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large"));
|
||||||
} else if (!plot.isOwner(player.getUUID()) && !Permissions
|
} else if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_BACKUP_OTHER)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_BACKUP_OTHER)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BACKUP_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BACKUP_OTHER))
|
||||||
@ -269,8 +266,7 @@ public final class Backup extends Command {
|
|||||||
);
|
);
|
||||||
} else if (plot.getVolume() > Integer.MAX_VALUE) {
|
} else if (plot.getVolume() > Integer.MAX_VALUE) {
|
||||||
player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large"));
|
player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large"));
|
||||||
} else if (!plot.isOwner(player.getUUID()) && !Permissions
|
} else if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_BACKUP_OTHER)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_BACKUP_OTHER)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BACKUP_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BACKUP_OTHER))
|
||||||
|
@ -126,6 +126,7 @@ public class Buy extends Command {
|
|||||||
plot.removeFlag(event.getFlag());
|
plot.removeFlag(event.getFlag());
|
||||||
}
|
}
|
||||||
plot.setOwner(player.getUUID());
|
plot.setOwner(player.getUUID());
|
||||||
|
plot.getPlotModificationManager().setSign(player.getName());
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("working.claimed"),
|
TranslatableCaption.of("working.claimed"),
|
||||||
Template.of("plot", plot.getId().toString())
|
Template.of("plot", plot.getId().toString())
|
||||||
|
@ -29,7 +29,6 @@ import com.plotsquared.core.plot.flag.implementations.HostileCapFlag;
|
|||||||
import com.plotsquared.core.plot.flag.implementations.MiscCapFlag;
|
import com.plotsquared.core.plot.flag.implementations.MiscCapFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.MobCapFlag;
|
import com.plotsquared.core.plot.flag.implementations.MobCapFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.VehicleCapFlag;
|
import com.plotsquared.core.plot.flag.implementations.VehicleCapFlag;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
|
|
||||||
import static com.plotsquared.core.util.entity.EntityCategories.CAP_ANIMAL;
|
import static com.plotsquared.core.util.entity.EntityCategories.CAP_ANIMAL;
|
||||||
@ -51,8 +50,7 @@ public class Caps extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot.isAdded(player.getUUID()) && !Permissions
|
if (!plot.isAdded(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_CAPS_OTHER)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_CAPS_OTHER)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_CAPS_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_CAPS_OTHER))
|
||||||
|
@ -35,7 +35,6 @@ import com.plotsquared.core.plot.Plot;
|
|||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.util.EconHandler;
|
import com.plotsquared.core.util.EconHandler;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlotExpression;
|
import com.plotsquared.core.util.PlotExpression;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
@ -127,9 +126,8 @@ public class Claim extends SubCommand {
|
|||||||
Template.of("reason", "non-existent")
|
Template.of("reason", "non-existent")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLAIM_SCHEMATIC
|
if (!player.hasPermission(Permission.PERMISSION_CLAIM_SCHEMATIC
|
||||||
.format(schematic)) && !Permissions.hasPermission(
|
.format(schematic)) && !player.hasPermission(
|
||||||
player,
|
|
||||||
"plots.admin.command.schematic"
|
"plots.admin.command.schematic"
|
||||||
) && !force) {
|
) && !force) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
@ -176,7 +174,7 @@ public class Claim extends SubCommand {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
if (!player.hasPermission(Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||||
int border = area.getBorder();
|
int border = area.getBorder();
|
||||||
if (border != Integer.MAX_VALUE && plot.getDistanceFromOrigin() > border && !force) {
|
if (border != Integer.MAX_VALUE && plot.getDistanceFromOrigin() > border && !force) {
|
||||||
player.sendMessage(TranslatableCaption.of("border.denied"));
|
player.sendMessage(TranslatableCaption.of("border.denied"));
|
||||||
|
@ -32,7 +32,6 @@ import com.plotsquared.core.plot.flag.implementations.AnalysisFlag;
|
|||||||
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
||||||
import com.plotsquared.core.queue.GlobalBlockQueue;
|
import com.plotsquared.core.queue.GlobalBlockQueue;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
@ -89,13 +88,14 @@ public class Clear extends Command {
|
|||||||
}
|
}
|
||||||
boolean force = eventResult == Result.FORCE;
|
boolean force = eventResult == Result.FORCE;
|
||||||
checkTrue(
|
checkTrue(
|
||||||
force || plot.isOwner(player.getUUID()) || Permissions
|
force || plot.isOwner(player.getUUID()) || player.hasPermission("plots.admin.command.clear"),
|
||||||
.hasPermission(player, "plots.admin.command.clear"),
|
|
||||||
TranslatableCaption.of("permission.no_plot_perms")
|
TranslatableCaption.of("permission.no_plot_perms")
|
||||||
);
|
);
|
||||||
checkTrue(plot.getRunning() == 0, TranslatableCaption.of("errors.wait_for_timer"));
|
checkTrue(plot.getRunning() == 0, TranslatableCaption.of("errors.wait_for_timer"));
|
||||||
checkTrue(force || !Settings.Done.RESTRICT_BUILDING || !DoneFlag.isDone(plot) || Permissions
|
checkTrue(
|
||||||
.hasPermission(player, "plots.continue"), TranslatableCaption.of("done.done_already_done"));
|
force || !Settings.Done.RESTRICT_BUILDING || !DoneFlag.isDone(plot) || player.hasPermission("plots.continue"),
|
||||||
|
TranslatableCaption.of("done.done_already_done")
|
||||||
|
);
|
||||||
confirm.run(this, () -> {
|
confirm.run(this, () -> {
|
||||||
if (Settings.Teleport.ON_CLEAR) {
|
if (Settings.Teleport.ON_CLEAR) {
|
||||||
plot.getPlayersInPlot().forEach(playerInPlot -> plot.teleportPlayer(playerInPlot, TeleportCause.COMMAND_CLEAR,
|
plot.getPlayersInPlot().forEach(playerInPlot -> plot.teleportPlayer(playerInPlot, TeleportCause.COMMAND_CLEAR,
|
||||||
@ -106,7 +106,6 @@ public class Clear extends Command {
|
|||||||
BackupManager.backup(player, plot, () -> {
|
BackupManager.backup(player, plot, () -> {
|
||||||
final long start = System.currentTimeMillis();
|
final long start = System.currentTimeMillis();
|
||||||
boolean result = plot.getPlotModificationManager().clear(true, false, player, () -> {
|
boolean result = plot.getPlotModificationManager().clear(true, false, player, () -> {
|
||||||
plot.getPlotModificationManager().unlink();
|
|
||||||
TaskManager.runTask(() -> {
|
TaskManager.runTask(() -> {
|
||||||
plot.removeRunning();
|
plot.removeRunning();
|
||||||
// If the state changes, then mark it as no longer done
|
// If the state changes, then mark it as no longer done
|
||||||
|
@ -32,7 +32,6 @@ import com.plotsquared.core.plot.Plot;
|
|||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.plot.PlotCluster;
|
import com.plotsquared.core.plot.PlotCluster;
|
||||||
import com.plotsquared.core.plot.PlotId;
|
import com.plotsquared.core.plot.PlotId;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.query.PlotQuery;
|
import com.plotsquared.core.util.query.PlotQuery;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
@ -73,7 +72,7 @@ public class Cluster extends SubCommand {
|
|||||||
switch (sub) {
|
switch (sub) {
|
||||||
case "l":
|
case "l":
|
||||||
case "list": {
|
case "list": {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_LIST)) {
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_LIST)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_LIST))
|
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_LIST))
|
||||||
@ -126,7 +125,7 @@ public class Cluster extends SubCommand {
|
|||||||
}
|
}
|
||||||
case "c":
|
case "c":
|
||||||
case "create": {
|
case "create": {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_CREATE)) {
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_CREATE)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_CREATE))
|
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_CREATE))
|
||||||
@ -197,8 +196,7 @@ public class Cluster extends SubCommand {
|
|||||||
}
|
}
|
||||||
Set<Plot> plots = area.getPlotSelectionOwned(pos1, pos2);
|
Set<Plot> plots = area.getPlotSelectionOwned(pos1, pos2);
|
||||||
if (!plots.isEmpty()) {
|
if (!plots.isEmpty()) {
|
||||||
if (!Permissions
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_CREATE_OTHER)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_CLUSTER_CREATE_OTHER)) {
|
|
||||||
UUID uuid = player.getUUID();
|
UUID uuid = player.getUUID();
|
||||||
for (Plot plot : plots) {
|
for (Plot plot : plots) {
|
||||||
if (!plot.isOwner(uuid)) {
|
if (!plot.isOwner(uuid)) {
|
||||||
@ -219,10 +217,10 @@ public class Cluster extends SubCommand {
|
|||||||
} else {
|
} else {
|
||||||
current = player.getPlayerClusterCount(player.getLocation().getWorldName());
|
current = player.getPlayerClusterCount(player.getLocation().getWorldName());
|
||||||
}
|
}
|
||||||
int allowed = Permissions
|
int allowed = player.hasPermissionRange(
|
||||||
.hasPermissionRange(player, Permission.PERMISSION_CLUSTER_SIZE,
|
Permission.PERMISSION_CLUSTER_SIZE,
|
||||||
Settings.Limit.MAX_PLOTS
|
Settings.Limit.MAX_PLOTS
|
||||||
);
|
);
|
||||||
if (current + cluster.getArea() > allowed) {
|
if (current + cluster.getArea() > allowed) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
@ -252,7 +250,7 @@ public class Cluster extends SubCommand {
|
|||||||
case "disband":
|
case "disband":
|
||||||
case "del":
|
case "del":
|
||||||
case "delete": {
|
case "delete": {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_DELETE)) {
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_DELETE)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_DELETE))
|
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_DELETE))
|
||||||
@ -289,8 +287,7 @@ public class Cluster extends SubCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!cluster.owner.equals(player.getUUID())) {
|
if (!cluster.owner.equals(player.getUUID())) {
|
||||||
if (!Permissions
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_DELETE_OTHER)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_CLUSTER_DELETE_OTHER)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_DELETE_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_DELETE_OTHER))
|
||||||
@ -307,7 +304,7 @@ public class Cluster extends SubCommand {
|
|||||||
}
|
}
|
||||||
case "res":
|
case "res":
|
||||||
case "resize": {
|
case "resize": {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE)) {
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_RESIZE)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE))
|
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE))
|
||||||
@ -347,8 +344,7 @@ public class Cluster extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!cluster.hasHelperRights(player.getUUID())) {
|
if (!cluster.hasHelperRights(player.getUUID())) {
|
||||||
if (!Permissions
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_RESIZE_OTHER)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE_OTHER)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE_OTHER))
|
||||||
@ -373,8 +369,7 @@ public class Cluster extends SubCommand {
|
|||||||
removed.removeAll(newPlots);
|
removed.removeAll(newPlots);
|
||||||
// Check expand / shrink
|
// Check expand / shrink
|
||||||
if (!removed.isEmpty()) {
|
if (!removed.isEmpty()) {
|
||||||
if (!Permissions
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_RESIZE_SHRINK)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE_SHRINK)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE_SHRINK))
|
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE_SHRINK))
|
||||||
@ -384,8 +379,7 @@ public class Cluster extends SubCommand {
|
|||||||
}
|
}
|
||||||
newPlots.removeAll(existing);
|
newPlots.removeAll(existing);
|
||||||
if (!newPlots.isEmpty()) {
|
if (!newPlots.isEmpty()) {
|
||||||
if (!Permissions
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_RESIZE_EXPAND)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE_EXPAND)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE_EXPAND))
|
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_RESIZE_EXPAND))
|
||||||
@ -401,7 +395,8 @@ public class Cluster extends SubCommand {
|
|||||||
current = player.getPlayerClusterCount(player.getLocation().getWorldName());
|
current = player.getPlayerClusterCount(player.getLocation().getWorldName());
|
||||||
}
|
}
|
||||||
current -= cluster.getArea() + (1 + pos2.getX() - pos1.getX()) * (1 + pos2.getY() - pos1.getY());
|
current -= cluster.getArea() + (1 + pos2.getX() - pos1.getX()) * (1 + pos2.getY() - pos1.getY());
|
||||||
int allowed = Permissions.hasPermissionRange(player, Permission.PERMISSION_CLUSTER,
|
int allowed = player.hasPermissionRange(
|
||||||
|
Permission.PERMISSION_CLUSTER,
|
||||||
Settings.Limit.MAX_PLOTS
|
Settings.Limit.MAX_PLOTS
|
||||||
);
|
);
|
||||||
if (current + cluster.getArea() > allowed) {
|
if (current + cluster.getArea() > allowed) {
|
||||||
@ -419,7 +414,7 @@ public class Cluster extends SubCommand {
|
|||||||
case "add":
|
case "add":
|
||||||
case "inv":
|
case "inv":
|
||||||
case "invite": {
|
case "invite": {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_INVITE)) {
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_INVITE)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_INVITE))
|
Template.of("node", String.valueOf(Permission.PERMISSION_CLUSTER_INVITE))
|
||||||
@ -444,8 +439,7 @@ public class Cluster extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!cluster.hasHelperRights(player.getUUID())) {
|
if (!cluster.hasHelperRights(player.getUUID())) {
|
||||||
if (!Permissions
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_INVITE_OTHER)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_CLUSTER_INVITE_OTHER)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_CLUSTER_INVITE_OTHER.toString())
|
Template.of("node", Permission.PERMISSION_CLUSTER_INVITE_OTHER.toString())
|
||||||
@ -485,7 +479,7 @@ public class Cluster extends SubCommand {
|
|||||||
case "k":
|
case "k":
|
||||||
case "remove":
|
case "remove":
|
||||||
case "kick": {
|
case "kick": {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_KICK)) {
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_KICK)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_CLUSTER_KICK.toString())
|
Template.of("node", Permission.PERMISSION_CLUSTER_KICK.toString())
|
||||||
@ -509,8 +503,7 @@ public class Cluster extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!cluster.hasHelperRights(player.getUUID())) {
|
if (!cluster.hasHelperRights(player.getUUID())) {
|
||||||
if (!Permissions
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_KICK_OTHER)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_CLUSTER_KICK_OTHER)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_CLUSTER_KICK_OTHER.toString())
|
Template.of("node", Permission.PERMISSION_CLUSTER_KICK_OTHER.toString())
|
||||||
@ -561,7 +554,7 @@ public class Cluster extends SubCommand {
|
|||||||
}
|
}
|
||||||
case "quit":
|
case "quit":
|
||||||
case "leave": {
|
case "leave": {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_LEAVE)) {
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_LEAVE)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_CLUSTER_LEAVE.toString())
|
Template.of("node", Permission.PERMISSION_CLUSTER_LEAVE.toString())
|
||||||
@ -619,7 +612,7 @@ public class Cluster extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case "members": {
|
case "members": {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_HELPERS)) {
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_HELPERS)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_CLUSTER_HELPERS.toString())
|
Template.of("node", Permission.PERMISSION_CLUSTER_HELPERS.toString())
|
||||||
@ -674,7 +667,7 @@ public class Cluster extends SubCommand {
|
|||||||
case "spawn":
|
case "spawn":
|
||||||
case "home":
|
case "home":
|
||||||
case "tp": {
|
case "tp": {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_TP)) {
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_TP)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_CLUSTER_TP.toString())
|
Template.of("node", Permission.PERMISSION_CLUSTER_TP.toString())
|
||||||
@ -703,7 +696,7 @@ public class Cluster extends SubCommand {
|
|||||||
}
|
}
|
||||||
UUID uuid = player.getUUID();
|
UUID uuid = player.getUUID();
|
||||||
if (!cluster.isAdded(uuid)) {
|
if (!cluster.isAdded(uuid)) {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_TP_OTHER)) {
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_TP_OTHER)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_CLUSTER_TP_OTHER.toString())
|
Template.of("node", Permission.PERMISSION_CLUSTER_TP_OTHER.toString())
|
||||||
@ -719,7 +712,7 @@ public class Cluster extends SubCommand {
|
|||||||
case "info":
|
case "info":
|
||||||
case "show":
|
case "show":
|
||||||
case "information": {
|
case "information": {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_INFO)) {
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_INFO)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_CLUSTER_TP.toString())
|
Template.of("node", Permission.PERMISSION_CLUSTER_TP.toString())
|
||||||
@ -792,7 +785,7 @@ public class Cluster extends SubCommand {
|
|||||||
case "sh":
|
case "sh":
|
||||||
case "setspawn":
|
case "setspawn":
|
||||||
case "sethome": {
|
case "sethome": {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_SETHOME)) {
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_SETHOME)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_CLUSTER_SETHOME.toString())
|
Template.of("node", Permission.PERMISSION_CLUSTER_SETHOME.toString())
|
||||||
@ -816,8 +809,7 @@ public class Cluster extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!cluster.hasHelperRights(player.getUUID())) {
|
if (!cluster.hasHelperRights(player.getUUID())) {
|
||||||
if (!Permissions
|
if (!player.hasPermission(Permission.PERMISSION_CLUSTER_SETHOME_OTHER)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_CLUSTER_SETHOME_OTHER)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_CLUSTER_SETHOME_OTHER.toString())
|
Template.of("node", Permission.PERMISSION_CLUSTER_SETHOME_OTHER.toString())
|
||||||
@ -869,37 +861,37 @@ public class Cluster extends SubCommand {
|
|||||||
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
final List<String> completions = new LinkedList<>();
|
final List<String> completions = new LinkedList<>();
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_LIST)) {
|
if (player.hasPermission(Permission.PERMISSION_CLUSTER_LIST)) {
|
||||||
completions.add("list");
|
completions.add("list");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_CREATE)) {
|
if (player.hasPermission(Permission.PERMISSION_CLUSTER_CREATE)) {
|
||||||
completions.add("create");
|
completions.add("create");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_DELETE)) {
|
if (player.hasPermission(Permission.PERMISSION_CLUSTER_DELETE)) {
|
||||||
completions.add("delete");
|
completions.add("delete");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_RESIZE)) {
|
if (player.hasPermission(Permission.PERMISSION_CLUSTER_RESIZE)) {
|
||||||
completions.add("resize");
|
completions.add("resize");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_INVITE)) {
|
if (player.hasPermission(Permission.PERMISSION_CLUSTER_INVITE)) {
|
||||||
completions.add("invite");
|
completions.add("invite");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_KICK)) {
|
if (player.hasPermission(Permission.PERMISSION_CLUSTER_KICK)) {
|
||||||
completions.add("kick");
|
completions.add("kick");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_KICK)) {
|
if (player.hasPermission(Permission.PERMISSION_CLUSTER_KICK)) {
|
||||||
completions.add("leave");
|
completions.add("leave");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_HELPERS)) {
|
if (player.hasPermission(Permission.PERMISSION_CLUSTER_HELPERS)) {
|
||||||
completions.add("members");
|
completions.add("members");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_INFO)) {
|
if (player.hasPermission(Permission.PERMISSION_CLUSTER_INFO)) {
|
||||||
completions.add("info");
|
completions.add("info");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_TP)) {
|
if (player.hasPermission(Permission.PERMISSION_CLUSTER_TP)) {
|
||||||
completions.add("tp");
|
completions.add("tp");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_SETHOME)) {
|
if (player.hasPermission(Permission.PERMISSION_CLUSTER_SETHOME)) {
|
||||||
completions.add("sethome");
|
completions.add("sethome");
|
||||||
}
|
}
|
||||||
final List<Command> commands = completions.stream().filter(completion -> completion
|
final List<Command> commands = completions.stream().filter(completion -> completion
|
||||||
@ -914,7 +906,7 @@ public class Cluster extends SubCommand {
|
|||||||
CommandCategory.ADMINISTRATION
|
CommandCategory.ADMINISTRATION
|
||||||
) {
|
) {
|
||||||
}).collect(Collectors.toCollection(LinkedList::new));
|
}).collect(Collectors.toCollection(LinkedList::new));
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER) && args[0].length() > 0) {
|
if (player.hasPermission(Permission.PERMISSION_CLUSTER) && args[0].length() > 0) {
|
||||||
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
||||||
}
|
}
|
||||||
return commands;
|
return commands;
|
||||||
|
@ -25,7 +25,6 @@ import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
|||||||
import com.plotsquared.core.permissions.PermissionHolder;
|
import com.plotsquared.core.permissions.PermissionHolder;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.StringComparison;
|
import com.plotsquared.core.util.StringComparison;
|
||||||
import com.plotsquared.core.util.StringMan;
|
import com.plotsquared.core.util.StringMan;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
@ -466,7 +465,7 @@ public abstract class Command {
|
|||||||
if (message) {
|
if (message) {
|
||||||
player.sendMessage(this.required.getErrorMessage());
|
player.sendMessage(this.required.getErrorMessage());
|
||||||
}
|
}
|
||||||
} else if (!Permissions.hasPermission(player, getPermission())) {
|
} else if (!player.hasPermission(getPermission())) {
|
||||||
if (message) {
|
if (message) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
|
@ -29,7 +29,6 @@ import com.plotsquared.core.plot.Plot;
|
|||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
@ -53,8 +52,7 @@ public class Continue extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot.isOwner(player.getUUID()) && !Permissions
|
if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_CONTINUE)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_CONTINUE)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", TranslatableCaption.of("permission.no_plot_perms").getComponent(player))
|
Template.of("node", TranslatableCaption.of("permission.no_plot_perms").getComponent(player))
|
||||||
|
@ -23,7 +23,6 @@ import com.plotsquared.core.location.Location;
|
|||||||
import com.plotsquared.core.permissions.Permission;
|
import com.plotsquared.core.permissions.Permission;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
|
|
||||||
@CommandDeclaration(command = "copy",
|
@CommandDeclaration(command = "copy",
|
||||||
@ -42,8 +41,7 @@ public class Copy extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot1.isOwner(player.getUUID()) && !Permissions
|
if (!plot1.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN.toString())) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN.toString())) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ public class DatabaseCommand extends SubCommand {
|
|||||||
);
|
);
|
||||||
worldFile.renameTo(newFile);
|
worldFile.renameTo(newFile);
|
||||||
}
|
}
|
||||||
plot.setId(newId.copy());
|
plot.setId(newId);
|
||||||
plot.setArea(pa);
|
plot.setArea(pa);
|
||||||
plots.add(plot);
|
plots.add(plot);
|
||||||
continue;
|
continue;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
package com.plotsquared.core.command;
|
package com.plotsquared.core.command;
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
import com.plotsquared.core.PlotSquared;
|
||||||
import com.plotsquared.core.configuration.caption.StaticCaption;
|
import com.plotsquared.core.configuration.caption.StaticCaption;
|
||||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.events.PlotFlagRemoveEvent;
|
import com.plotsquared.core.events.PlotFlagRemoveEvent;
|
||||||
@ -27,7 +28,6 @@ import com.plotsquared.core.generator.HybridUtils;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.plot.expiration.ExpireManager;
|
|
||||||
import com.plotsquared.core.plot.expiration.PlotAnalysis;
|
import com.plotsquared.core.plot.expiration.PlotAnalysis;
|
||||||
import com.plotsquared.core.plot.flag.GlobalFlagContainer;
|
import com.plotsquared.core.plot.flag.GlobalFlagContainer;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
@ -41,7 +41,6 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
@ -139,10 +138,7 @@ public class DebugExec extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case "start-expire" -> {
|
case "start-expire" -> {
|
||||||
if (ExpireManager.IMP == null) {
|
if (PlotSquared.platform().expireManager().runAutomatedTask()) {
|
||||||
ExpireManager.IMP = new ExpireManager(this.eventDispatcher);
|
|
||||||
}
|
|
||||||
if (ExpireManager.IMP.runAutomatedTask()) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("debugexec.expiry_started"));
|
player.sendMessage(TranslatableCaption.of("debugexec.expiry_started"));
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(TranslatableCaption.of("debugexec.expiry_already_started"));
|
player.sendMessage(TranslatableCaption.of("debugexec.expiry_already_started"));
|
||||||
@ -150,7 +146,7 @@ public class DebugExec extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case "stop-expire" -> {
|
case "stop-expire" -> {
|
||||||
if (ExpireManager.IMP == null || !ExpireManager.IMP.cancelTask()) {
|
if (!PlotSquared.platform().expireManager().cancelTask()) {
|
||||||
player.sendMessage(TranslatableCaption.of("debugexec.task_halted"));
|
player.sendMessage(TranslatableCaption.of("debugexec.task_halted"));
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(TranslatableCaption.of("debugexec.task_cancelled"));
|
player.sendMessage(TranslatableCaption.of("debugexec.task_cancelled"));
|
||||||
|
@ -30,7 +30,6 @@ import com.plotsquared.core.plot.Plot;
|
|||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.util.EconHandler;
|
import com.plotsquared.core.util.EconHandler;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlotExpression;
|
import com.plotsquared.core.util.PlotExpression;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
@ -83,8 +82,7 @@ public class Delete extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
boolean force = eventResult == Result.FORCE;
|
boolean force = eventResult == Result.FORCE;
|
||||||
if (!force && !plot.isOwner(player.getUUID()) && !Permissions
|
if (!force && !plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_DELETE)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_DELETE)) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,6 @@ import com.plotsquared.core.player.PlotPlayer;
|
|||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlayerManager;
|
import com.plotsquared.core.util.PlayerManager;
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
@ -79,13 +78,12 @@ public class Deny extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot.isOwner(player.getUUID()) && !Permissions
|
if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_DENY)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_DENY)) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int maxDenySize = Permissions.hasPermissionRange(player, Permission.PERMISSION_DENY, Settings.Limit.MAX_PLOTS);
|
int maxDenySize = player.hasPermissionRange(Permission.PERMISSION_DENY, Settings.Limit.MAX_PLOTS);
|
||||||
int size = plot.getDenied().size();
|
int size = plot.getDenied().size();
|
||||||
if (size >= maxDenySize) {
|
if (size >= maxDenySize) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
@ -106,8 +104,7 @@ public class Deny extends SubCommand {
|
|||||||
} else {
|
} else {
|
||||||
for (UUID uuid : uuids) {
|
for (UUID uuid : uuids) {
|
||||||
if (uuid == DBFunc.EVERYONE && !(
|
if (uuid == DBFunc.EVERYONE && !(
|
||||||
Permissions.hasPermission(player, Permission.PERMISSION_DENY_EVERYONE) || Permissions
|
player.hasPermission(Permission.PERMISSION_DENY_EVERYONE) || player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_DENY))) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_DENY))) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("errors.invalid_player"),
|
TranslatableCaption.of("errors.invalid_player"),
|
||||||
Template.of("value", args[0])
|
Template.of("value", args[0])
|
||||||
|
@ -21,7 +21,6 @@ package com.plotsquared.core.command;
|
|||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.plotsquared.core.permissions.Permission;
|
import com.plotsquared.core.permissions.Permission;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
@ -54,7 +53,7 @@ public class Dislike extends SubCommand {
|
|||||||
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
final List<String> completions = new LinkedList<>();
|
final List<String> completions = new LinkedList<>();
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS)) {
|
if (player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS)) {
|
||||||
completions.add("purge");
|
completions.add("purge");
|
||||||
}
|
}
|
||||||
final List<Command> commands = completions.stream().filter(completion -> completion
|
final List<Command> commands = completions.stream().filter(completion -> completion
|
||||||
@ -62,7 +61,7 @@ public class Dislike extends SubCommand {
|
|||||||
.startsWith(args[0].toLowerCase()))
|
.startsWith(args[0].toLowerCase()))
|
||||||
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) {
|
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) {
|
||||||
}).collect(Collectors.toCollection(LinkedList::new));
|
}).collect(Collectors.toCollection(LinkedList::new));
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_RATE) && args[0].length() > 0) {
|
if (player.hasPermission(Permission.PERMISSION_RATE) && args[0].length() > 0) {
|
||||||
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
||||||
}
|
}
|
||||||
return commands;
|
return commands;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
package com.plotsquared.core.command;
|
package com.plotsquared.core.command;
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
import com.plotsquared.core.PlotSquared;
|
||||||
import com.plotsquared.core.configuration.Settings;
|
import com.plotsquared.core.configuration.Settings;
|
||||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.events.PlotDoneEvent;
|
import com.plotsquared.core.events.PlotDoneEvent;
|
||||||
@ -29,12 +30,10 @@ import com.plotsquared.core.location.Location;
|
|||||||
import com.plotsquared.core.permissions.Permission;
|
import com.plotsquared.core.permissions.Permission;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.expiration.ExpireManager;
|
|
||||||
import com.plotsquared.core.plot.expiration.PlotAnalysis;
|
import com.plotsquared.core.plot.expiration.PlotAnalysis;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.task.RunnableVal;
|
import com.plotsquared.core.util.task.RunnableVal;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
@ -75,8 +74,7 @@ public class Done extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
boolean force = event.getEventResult() == Result.FORCE;
|
boolean force = event.getEventResult() == Result.FORCE;
|
||||||
if (!force && !plot.isOwner(player.getUUID()) && !Permissions
|
if (!force && !plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_DONE)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_DONE)) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -94,7 +92,7 @@ public class Done extends SubCommand {
|
|||||||
Template.of("plot", plot.getId().toString())
|
Template.of("plot", plot.getId().toString())
|
||||||
);
|
);
|
||||||
final Settings.Auto_Clear doneRequirements = Settings.AUTO_CLEAR.get("done");
|
final Settings.Auto_Clear doneRequirements = Settings.AUTO_CLEAR.get("done");
|
||||||
if (ExpireManager.IMP == null || doneRequirements == null) {
|
if (PlotSquared.platform().expireManager() == null || doneRequirements == null) {
|
||||||
finish(plot, player, true);
|
finish(plot, player, true);
|
||||||
plot.removeRunning();
|
plot.removeRunning();
|
||||||
} else {
|
} else {
|
||||||
|
@ -27,7 +27,6 @@ import com.plotsquared.core.player.PlotPlayer;
|
|||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlotUploader;
|
import com.plotsquared.core.util.PlotUploader;
|
||||||
import com.plotsquared.core.util.SchematicHandler;
|
import com.plotsquared.core.util.SchematicHandler;
|
||||||
import com.plotsquared.core.util.StringMan;
|
import com.plotsquared.core.util.StringMan;
|
||||||
@ -87,13 +86,11 @@ public class Download extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ((Settings.Done.REQUIRED_FOR_DOWNLOAD && !DoneFlag.isDone(plot)) && !Permissions
|
if ((Settings.Done.REQUIRED_FOR_DOWNLOAD && !DoneFlag.isDone(plot)) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_DOWNLOAD)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_DOWNLOAD)) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("done.done_not_done"));
|
player.sendMessage(TranslatableCaption.of("done.done_not_done"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot.isOwner(player.getUUID()) && !Permissions
|
if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN.toString())) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN.toString())) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -111,7 +108,7 @@ public class Download extends SubCommand {
|
|||||||
upload(player, plot);
|
upload(player, plot);
|
||||||
} else if (args.length == 1 && StringMan
|
} else if (args.length == 1 && StringMan
|
||||||
.isEqualIgnoreCaseToAny(args[0], "mcr", "world", "mca")) {
|
.isEqualIgnoreCaseToAny(args[0], "mcr", "world", "mca")) {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_DOWNLOAD_WORLD)) {
|
if (!player.hasPermission(Permission.PERMISSION_DOWNLOAD_WORLD)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_DOWNLOAD_WORLD.toString())
|
Template.of("node", Permission.PERMISSION_DOWNLOAD_WORLD.toString())
|
||||||
@ -147,10 +144,10 @@ public class Download extends SubCommand {
|
|||||||
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
final List<String> completions = new LinkedList<>();
|
final List<String> completions = new LinkedList<>();
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_DOWNLOAD)) {
|
if (player.hasPermission(Permission.PERMISSION_DOWNLOAD)) {
|
||||||
completions.add("schem");
|
completions.add("schem");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_DOWNLOAD_WORLD)) {
|
if (player.hasPermission(Permission.PERMISSION_DOWNLOAD_WORLD)) {
|
||||||
completions.add("world");
|
completions.add("world");
|
||||||
}
|
}
|
||||||
final List<Command> commands = completions.stream().filter(completion -> completion
|
final List<Command> commands = completions.stream().filter(completion -> completion
|
||||||
@ -165,7 +162,7 @@ public class Download extends SubCommand {
|
|||||||
CommandCategory.ADMINISTRATION
|
CommandCategory.ADMINISTRATION
|
||||||
) {
|
) {
|
||||||
}).collect(Collectors.toCollection(LinkedList::new));
|
}).collect(Collectors.toCollection(LinkedList::new));
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_DOWNLOAD) && args[0].length() > 0) {
|
if (player.hasPermission(Permission.PERMISSION_DOWNLOAD) && args[0].length() > 0) {
|
||||||
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
||||||
}
|
}
|
||||||
return commands;
|
return commands;
|
||||||
@ -181,6 +178,7 @@ public class Download extends SubCommand {
|
|||||||
schematicHandler.upload(compoundTag, null, null, new RunnableVal<>() {
|
schematicHandler.upload(compoundTag, null, null, new RunnableVal<>() {
|
||||||
@Override
|
@Override
|
||||||
public void run(URL value) {
|
public void run(URL value) {
|
||||||
|
plot.removeRunning();
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("web.generation_link_success"),
|
TranslatableCaption.of("web.generation_link_success"),
|
||||||
Template.of("download", value.toString()),
|
Template.of("download", value.toString()),
|
||||||
|
@ -40,7 +40,6 @@ import com.plotsquared.core.plot.flag.types.IntegerFlag;
|
|||||||
import com.plotsquared.core.plot.flag.types.ListFlag;
|
import com.plotsquared.core.plot.flag.types.ListFlag;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.StringComparison;
|
import com.plotsquared.core.util.StringComparison;
|
||||||
import com.plotsquared.core.util.StringMan;
|
import com.plotsquared.core.util.StringMan;
|
||||||
import com.plotsquared.core.util.helpmenu.HelpMenu;
|
import com.plotsquared.core.util.helpmenu.HelpMenu;
|
||||||
@ -128,7 +127,7 @@ public final class FlagCommand extends Command {
|
|||||||
key.toLowerCase(),
|
key.toLowerCase(),
|
||||||
entry.toString().toLowerCase()
|
entry.toString().toLowerCase()
|
||||||
);
|
);
|
||||||
final boolean result = Permissions.hasPermission(player, permission);
|
final boolean result = player.hasPermission(permission);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", permission));
|
player.sendMessage(TranslatableCaption.of("permission.no_permission"), Template.of("node", permission));
|
||||||
return false;
|
return false;
|
||||||
@ -150,9 +149,9 @@ public final class FlagCommand extends Command {
|
|||||||
boolean result;
|
boolean result;
|
||||||
String basePerm = Permission.PERMISSION_SET_FLAG_KEY.format(key.toLowerCase());
|
String basePerm = Permission.PERMISSION_SET_FLAG_KEY.format(key.toLowerCase());
|
||||||
if (flag.isValuedPermission()) {
|
if (flag.isValuedPermission()) {
|
||||||
result = Permissions.hasKeyedPermission(player, basePerm, value);
|
result = player.hasKeyedPermission(basePerm, value);
|
||||||
} else {
|
} else {
|
||||||
result = Permissions.hasPermission(player, basePerm);
|
result = player.hasPermission(basePerm);
|
||||||
perm = basePerm;
|
perm = basePerm;
|
||||||
}
|
}
|
||||||
if (!result) {
|
if (!result) {
|
||||||
@ -177,8 +176,7 @@ public final class FlagCommand extends Command {
|
|||||||
player.sendMessage(TranslatableCaption.of("working.plot_not_claimed"));
|
player.sendMessage(TranslatableCaption.of("working.plot_not_claimed"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot.isOwner(player.getUUID()) && !Permissions
|
if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_SET_FLAG_OTHER)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_SET_FLAG_OTHER)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_SET_FLAG_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_SET_FLAG_OTHER))
|
||||||
@ -473,7 +471,7 @@ public final class FlagCommand extends Command {
|
|||||||
}
|
}
|
||||||
boolean force = event.getEventResult() == Result.FORCE;
|
boolean force = event.getEventResult() == Result.FORCE;
|
||||||
flag = event.getFlag();
|
flag = event.getFlag();
|
||||||
if (!force && !Permissions.hasPermission(player, Permission.PERMISSION_SET_FLAG_KEY.format(args[0].toLowerCase()))) {
|
if (!force && !player.hasPermission(Permission.PERMISSION_SET_FLAG_KEY.format(args[0].toLowerCase()))) {
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
|
@ -26,7 +26,6 @@ import com.plotsquared.core.permissions.Permission;
|
|||||||
import com.plotsquared.core.player.MetaDataAccess;
|
import com.plotsquared.core.player.MetaDataAccess;
|
||||||
import com.plotsquared.core.player.PlayerMetaDataKeys;
|
import com.plotsquared.core.player.PlayerMetaDataKeys;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlayerManager;
|
import com.plotsquared.core.util.PlayerManager;
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.task.RunnableVal;
|
import com.plotsquared.core.util.task.RunnableVal;
|
||||||
@ -69,7 +68,7 @@ public class Grant extends Command {
|
|||||||
final String arg0 = args[0].toLowerCase();
|
final String arg0 = args[0].toLowerCase();
|
||||||
switch (arg0) {
|
switch (arg0) {
|
||||||
case "add", "check" -> {
|
case "add", "check" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_GRANT.format(arg0))) {
|
if (!player.hasPermission(Permission.PERMISSION_GRANT.format(arg0))) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_GRANT.format(arg0))
|
Template.of("node", Permission.PERMISSION_GRANT.format(arg0))
|
||||||
@ -150,10 +149,10 @@ public class Grant extends Command {
|
|||||||
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
final List<String> completions = new LinkedList<>();
|
final List<String> completions = new LinkedList<>();
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_GRANT_ADD)) {
|
if (player.hasPermission(Permission.PERMISSION_GRANT_ADD)) {
|
||||||
completions.add("add");
|
completions.add("add");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_GRANT_CHECK)) {
|
if (player.hasPermission(Permission.PERMISSION_GRANT_CHECK)) {
|
||||||
completions.add("check");
|
completions.add("check");
|
||||||
}
|
}
|
||||||
final List<Command> commands = completions.stream().filter(completion -> completion
|
final List<Command> commands = completions.stream().filter(completion -> completion
|
||||||
@ -168,7 +167,7 @@ public class Grant extends Command {
|
|||||||
CommandCategory.ADMINISTRATION
|
CommandCategory.ADMINISTRATION
|
||||||
) {
|
) {
|
||||||
}).collect(Collectors.toCollection(LinkedList::new));
|
}).collect(Collectors.toCollection(LinkedList::new));
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_GRANT_SINGLE) && args[0].length() > 0) {
|
if (player.hasPermission(Permission.PERMISSION_GRANT_SINGLE) && args[0].length() > 0) {
|
||||||
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
||||||
}
|
}
|
||||||
return commands;
|
return commands;
|
||||||
|
@ -29,7 +29,6 @@ import com.plotsquared.core.plot.PlotArea;
|
|||||||
import com.plotsquared.core.plot.PlotId;
|
import com.plotsquared.core.plot.PlotId;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.query.PlotQuery;
|
import com.plotsquared.core.util.query.PlotQuery;
|
||||||
import com.plotsquared.core.util.query.SortingStrategy;
|
import com.plotsquared.core.util.query.SortingStrategy;
|
||||||
@ -104,8 +103,7 @@ public class HomeCommand extends Command {
|
|||||||
// /plot home <[area;]x;y>
|
// /plot home <[area;]x;y>
|
||||||
// /plot home <area> <x;y>
|
// /plot home <area> <x;y>
|
||||||
// /plot home <area> <page>
|
// /plot home <area> <page>
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_OWNED) && !Permissions
|
if (!player.hasPermission(Permission.PERMISSION_VISIT_OWNED) && !player.hasPermission(Permission.PERMISSION_HOME)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_HOME)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_VISIT_OWNED.toString())
|
Template.of("node", Permission.PERMISSION_VISIT_OWNED.toString())
|
||||||
|
@ -30,7 +30,6 @@ import com.plotsquared.core.plot.Plot;
|
|||||||
import com.plotsquared.core.plot.comment.CommentInbox;
|
import com.plotsquared.core.plot.comment.CommentInbox;
|
||||||
import com.plotsquared.core.plot.comment.CommentManager;
|
import com.plotsquared.core.plot.comment.CommentManager;
|
||||||
import com.plotsquared.core.plot.comment.PlotComment;
|
import com.plotsquared.core.plot.comment.PlotComment;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.StringMan;
|
import com.plotsquared.core.util.StringMan;
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.task.RunnableVal;
|
import com.plotsquared.core.util.task.RunnableVal;
|
||||||
@ -285,13 +284,13 @@ public class Inbox extends SubCommand {
|
|||||||
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
final List<String> completions = new LinkedList<>();
|
final List<String> completions = new LinkedList<>();
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_INBOX_READ_OWNER)) {
|
if (player.hasPermission(Permission.PERMISSION_INBOX_READ_OWNER)) {
|
||||||
completions.add("owner");
|
completions.add("owner");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_INBOX_READ_PUBLIC)) {
|
if (player.hasPermission(Permission.PERMISSION_INBOX_READ_PUBLIC)) {
|
||||||
completions.add("public");
|
completions.add("public");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_INBOX_READ_REPORT)) {
|
if (player.hasPermission(Permission.PERMISSION_INBOX_READ_REPORT)) {
|
||||||
completions.add("report");
|
completions.add("report");
|
||||||
}
|
}
|
||||||
final List<Command> commands = completions.stream().filter(completion -> completion
|
final List<Command> commands = completions.stream().filter(completion -> completion
|
||||||
@ -299,7 +298,7 @@ public class Inbox extends SubCommand {
|
|||||||
.startsWith(args[0].toLowerCase()))
|
.startsWith(args[0].toLowerCase()))
|
||||||
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.CHAT) {
|
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.CHAT) {
|
||||||
}).collect(Collectors.toCollection(LinkedList::new));
|
}).collect(Collectors.toCollection(LinkedList::new));
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_INBOX) && args[0].length() > 0) {
|
if (player.hasPermission(Permission.PERMISSION_INBOX) && args[0].length() > 0) {
|
||||||
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
||||||
}
|
}
|
||||||
return commands;
|
return commands;
|
||||||
|
@ -27,7 +27,6 @@ import com.plotsquared.core.permissions.Permission;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.flag.implementations.HideInfoFlag;
|
import com.plotsquared.core.plot.flag.implementations.HideInfoFlag;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
|
|
||||||
@ -144,7 +143,7 @@ public class Info extends SubCommand {
|
|||||||
@Override
|
@Override
|
||||||
public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
|
public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
|
||||||
final List<String> completions = new LinkedList<>();
|
final List<String> completions = new LinkedList<>();
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_INFO_FORCE)) {
|
if (player.hasPermission(Permission.PERMISSION_AREA_INFO_FORCE)) {
|
||||||
completions.add("-f");
|
completions.add("-f");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,7 +153,7 @@ public class Info extends SubCommand {
|
|||||||
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) {
|
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) {
|
||||||
}).collect(Collectors.toCollection(LinkedList::new));
|
}).collect(Collectors.toCollection(LinkedList::new));
|
||||||
|
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_AREA_INFO_FORCE) && args[0].length() > 0) {
|
if (player.hasPermission(Permission.PERMISSION_AREA_INFO_FORCE) && args[0].length() > 0) {
|
||||||
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ import com.plotsquared.core.permissions.Permission;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlayerManager;
|
import com.plotsquared.core.util.PlayerManager;
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
@ -70,8 +69,7 @@ public class Kick extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ((!plot.hasOwner() || !plot.isOwner(player.getUUID())) && !Permissions
|
if ((!plot.hasOwner() || !plot.isOwner(player.getUUID())) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_KICK)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_KICK)) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -89,8 +87,7 @@ public class Kick extends SubCommand {
|
|||||||
for (UUID uuid : uuids) {
|
for (UUID uuid : uuids) {
|
||||||
if (uuid == DBFunc.EVERYONE) {
|
if (uuid == DBFunc.EVERYONE) {
|
||||||
for (PlotPlayer<?> pp : plot.getPlayersInPlot()) {
|
for (PlotPlayer<?> pp : plot.getPlayersInPlot()) {
|
||||||
if (pp == player || Permissions
|
if (pp == player || pp.hasPermission(Permission.PERMISSION_ADMIN_ENTRY_DENIED)) {
|
||||||
.hasPermission(pp, Permission.PERMISSION_ADMIN_ENTRY_DENIED)) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
players.add(pp);
|
players.add(pp);
|
||||||
@ -118,7 +115,7 @@ public class Kick extends SubCommand {
|
|||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player2, Permission.PERMISSION_ADMIN_ENTRY_DENIED)) {
|
if (player2.hasPermission(Permission.PERMISSION_ADMIN_ENTRY_DENIED)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("cluster.cannot_kick_player"),
|
TranslatableCaption.of("cluster.cannot_kick_player"),
|
||||||
Template.of("name", player2.getName())
|
Template.of("name", player2.getName())
|
||||||
|
@ -30,7 +30,6 @@ import com.plotsquared.core.plot.Plot;
|
|||||||
import com.plotsquared.core.plot.Rating;
|
import com.plotsquared.core.plot.Rating;
|
||||||
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.query.PlotQuery;
|
import com.plotsquared.core.util.query.PlotQuery;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
@ -121,8 +120,7 @@ public class Like extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!Permissions
|
if (!player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS, true)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS, true)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
plot.clearRatings();
|
plot.clearRatings();
|
||||||
@ -204,7 +202,7 @@ public class Like extends SubCommand {
|
|||||||
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
final List<String> completions = new LinkedList<>();
|
final List<String> completions = new LinkedList<>();
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS)) {
|
if (player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS)) {
|
||||||
completions.add("purge");
|
completions.add("purge");
|
||||||
}
|
}
|
||||||
final List<Command> commands = completions.stream().filter(completion -> completion
|
final List<Command> commands = completions.stream().filter(completion -> completion
|
||||||
@ -212,7 +210,7 @@ public class Like extends SubCommand {
|
|||||||
.startsWith(args[0].toLowerCase()))
|
.startsWith(args[0].toLowerCase()))
|
||||||
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) {
|
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) {
|
||||||
}).collect(Collectors.toCollection(LinkedList::new));
|
}).collect(Collectors.toCollection(LinkedList::new));
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_RATE) && args[0].length() > 0) {
|
if (player.hasPermission(Permission.PERMISSION_RATE) && args[0].length() > 0) {
|
||||||
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
||||||
}
|
}
|
||||||
return commands;
|
return commands;
|
||||||
|
@ -30,14 +30,12 @@ import com.plotsquared.core.permissions.Permission;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.plot.expiration.ExpireManager;
|
|
||||||
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.PriceFlag;
|
import com.plotsquared.core.plot.flag.implementations.PriceFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag;
|
import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.EconHandler;
|
import com.plotsquared.core.util.EconHandler;
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlayerManager;
|
import com.plotsquared.core.util.PlayerManager;
|
||||||
import com.plotsquared.core.util.StringComparison;
|
import com.plotsquared.core.util.StringComparison;
|
||||||
import com.plotsquared.core.util.StringMan;
|
import com.plotsquared.core.util.StringMan;
|
||||||
@ -83,40 +81,40 @@ public class ListCmd extends SubCommand {
|
|||||||
|
|
||||||
private String[] getArgumentList(PlotPlayer<?> player) {
|
private String[] getArgumentList(PlotPlayer<?> player) {
|
||||||
List<String> args = new ArrayList<>();
|
List<String> args = new ArrayList<>();
|
||||||
if (this.econHandler != null && Permissions.hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) {
|
if (this.econHandler != null && player.hasPermission(Permission.PERMISSION_LIST_FOR_SALE)) {
|
||||||
args.add("forsale");
|
args.add("forsale");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_MINE)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_MINE)) {
|
||||||
args.add("mine");
|
args.add("mine");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_SHARED)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_SHARED)) {
|
||||||
args.add("shared");
|
args.add("shared");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_WORLD)) {
|
||||||
args.add("world");
|
args.add("world");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_TOP)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_TOP)) {
|
||||||
args.add("top");
|
args.add("top");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_ALL)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_ALL)) {
|
||||||
args.add("all");
|
args.add("all");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_UNOWNED)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_UNOWNED)) {
|
||||||
args.add("unowned");
|
args.add("unowned");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_PLAYER)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_PLAYER)) {
|
||||||
args.add("<player>");
|
args.add("<player>");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_WORLD)) {
|
||||||
args.add("<world>");
|
args.add("<world>");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_DONE)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_DONE)) {
|
||||||
args.add("done");
|
args.add("done");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_EXPIRED)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_EXPIRED)) {
|
||||||
args.add("expired");
|
args.add("expired");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_FUZZY)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_FUZZY)) {
|
||||||
args.add("fuzzy <search...>");
|
args.add("fuzzy <search...>");
|
||||||
}
|
}
|
||||||
return args.toArray(new String[args.size()]);
|
return args.toArray(new String[args.size()]);
|
||||||
@ -188,7 +186,7 @@ public class ListCmd extends SubCommand {
|
|||||||
|
|
||||||
switch (arg) {
|
switch (arg) {
|
||||||
case "mine" -> {
|
case "mine" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_MINE)) {
|
if (!player.hasPermission(Permission.PERMISSION_LIST_MINE)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.mine")
|
Templates.of("node", "plots.list.mine")
|
||||||
@ -203,7 +201,7 @@ public class ListCmd extends SubCommand {
|
|||||||
.withSortingStrategy(SortingStrategy.SORT_BY_TEMP));
|
.withSortingStrategy(SortingStrategy.SORT_BY_TEMP));
|
||||||
}
|
}
|
||||||
case "shared" -> {
|
case "shared" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_SHARED)) {
|
if (!player.hasPermission(Permission.PERMISSION_LIST_SHARED)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.shared")
|
Templates.of("node", "plots.list.shared")
|
||||||
@ -216,14 +214,14 @@ public class ListCmd extends SubCommand {
|
|||||||
.thatPasses(plot -> !plot.isOwnerAbs(player.getUUID())));
|
.thatPasses(plot -> !plot.isOwnerAbs(player.getUUID())));
|
||||||
}
|
}
|
||||||
case "world" -> {
|
case "world" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) {
|
if (!player.hasPermission(Permission.PERMISSION_LIST_WORLD)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.world")
|
Templates.of("node", "plots.list.world")
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(player, "plots.list.world." + world)) {
|
if (!player.hasPermission("plots.list.world." + world)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.world." + world)
|
Templates.of("node", "plots.list.world." + world)
|
||||||
@ -233,28 +231,28 @@ public class ListCmd extends SubCommand {
|
|||||||
plotConsumer.accept(PlotQuery.newQuery().inWorld(world));
|
plotConsumer.accept(PlotQuery.newQuery().inWorld(world));
|
||||||
}
|
}
|
||||||
case "expired" -> {
|
case "expired" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_EXPIRED)) {
|
if (!player.hasPermission(Permission.PERMISSION_LIST_EXPIRED)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.expired")
|
Templates.of("node", "plots.list.expired")
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (ExpireManager.IMP == null) {
|
if (PlotSquared.platform().expireManager() == null) {
|
||||||
plotConsumer.accept(PlotQuery.newQuery().noPlots());
|
plotConsumer.accept(PlotQuery.newQuery().noPlots());
|
||||||
} else {
|
} else {
|
||||||
plotConsumer.accept(PlotQuery.newQuery().expiredPlots());
|
plotConsumer.accept(PlotQuery.newQuery().expiredPlots());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "area" -> {
|
case "area" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_AREA)) {
|
if (!player.hasPermission(Permission.PERMISSION_LIST_AREA)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.area")
|
Templates.of("node", "plots.list.area")
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(player, "plots.list.world." + world)) {
|
if (!player.hasPermission("plots.list.world." + world)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.world." + world)
|
Templates.of("node", "plots.list.world." + world)
|
||||||
@ -268,7 +266,7 @@ public class ListCmd extends SubCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "all" -> {
|
case "all" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_ALL)) {
|
if (!player.hasPermission(Permission.PERMISSION_LIST_ALL)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.all")
|
Templates.of("node", "plots.list.all")
|
||||||
@ -278,7 +276,7 @@ public class ListCmd extends SubCommand {
|
|||||||
plotConsumer.accept(PlotQuery.newQuery().allPlots());
|
plotConsumer.accept(PlotQuery.newQuery().allPlots());
|
||||||
}
|
}
|
||||||
case "done" -> {
|
case "done" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_DONE)) {
|
if (!player.hasPermission(Permission.PERMISSION_LIST_DONE)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.done")
|
Templates.of("node", "plots.list.done")
|
||||||
@ -293,7 +291,7 @@ public class ListCmd extends SubCommand {
|
|||||||
.withSortingStrategy(SortingStrategy.SORT_BY_DONE));
|
.withSortingStrategy(SortingStrategy.SORT_BY_DONE));
|
||||||
}
|
}
|
||||||
case "top" -> {
|
case "top" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_TOP)) {
|
if (!player.hasPermission(Permission.PERMISSION_LIST_TOP)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.top")
|
Templates.of("node", "plots.list.top")
|
||||||
@ -304,7 +302,7 @@ public class ListCmd extends SubCommand {
|
|||||||
plotConsumer.accept(PlotQuery.newQuery().allPlots().withSortingStrategy(SortingStrategy.SORT_BY_RATING));
|
plotConsumer.accept(PlotQuery.newQuery().allPlots().withSortingStrategy(SortingStrategy.SORT_BY_RATING));
|
||||||
}
|
}
|
||||||
case "forsale" -> {
|
case "forsale" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) {
|
if (!player.hasPermission(Permission.PERMISSION_LIST_FOR_SALE)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.forsale")
|
Templates.of("node", "plots.list.forsale")
|
||||||
@ -317,7 +315,7 @@ public class ListCmd extends SubCommand {
|
|||||||
plotConsumer.accept(PlotQuery.newQuery().allPlots().thatPasses(plot -> plot.getFlag(PriceFlag.class) > 0));
|
plotConsumer.accept(PlotQuery.newQuery().allPlots().thatPasses(plot -> plot.getFlag(PriceFlag.class) > 0));
|
||||||
}
|
}
|
||||||
case "unowned" -> {
|
case "unowned" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_UNOWNED)) {
|
if (!player.hasPermission(Permission.PERMISSION_LIST_UNOWNED)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.unowned")
|
Templates.of("node", "plots.list.unowned")
|
||||||
@ -327,7 +325,7 @@ public class ListCmd extends SubCommand {
|
|||||||
plotConsumer.accept(PlotQuery.newQuery().allPlots().thatPasses(plot -> plot.getOwner() == null));
|
plotConsumer.accept(PlotQuery.newQuery().allPlots().thatPasses(plot -> plot.getOwner() == null));
|
||||||
}
|
}
|
||||||
case "fuzzy" -> {
|
case "fuzzy" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_FUZZY)) {
|
if (!player.hasPermission(Permission.PERMISSION_LIST_FUZZY)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.fuzzy")
|
Templates.of("node", "plots.list.fuzzy")
|
||||||
@ -352,14 +350,14 @@ public class ListCmd extends SubCommand {
|
|||||||
}
|
}
|
||||||
default -> {
|
default -> {
|
||||||
if (this.plotAreaManager.hasPlotArea(args[0])) {
|
if (this.plotAreaManager.hasPlotArea(args[0])) {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) {
|
if (!player.hasPermission(Permission.PERMISSION_LIST_WORLD)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.world")
|
Templates.of("node", "plots.list.world")
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!Permissions.hasPermission(player, "plots.list.world." + args[0])) {
|
if (!player.hasPermission("plots.list.world." + args[0])) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.world." + args[0])
|
Templates.of("node", "plots.list.world." + args[0])
|
||||||
@ -383,7 +381,7 @@ public class ListCmd extends SubCommand {
|
|||||||
if (uuid == null) {
|
if (uuid == null) {
|
||||||
player.sendMessage(TranslatableCaption.of("errors.invalid_player"), Templates.of("value", args[0]));
|
player.sendMessage(TranslatableCaption.of("errors.invalid_player"), Templates.of("value", args[0]));
|
||||||
} else {
|
} else {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_LIST_PLAYER)) {
|
if (!player.hasPermission(Permission.PERMISSION_LIST_PLAYER)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.list.player")
|
Templates.of("node", "plots.list.player")
|
||||||
@ -516,31 +514,31 @@ public class ListCmd extends SubCommand {
|
|||||||
@Override
|
@Override
|
||||||
public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
|
public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
|
||||||
final List<String> completions = new LinkedList<>();
|
final List<String> completions = new LinkedList<>();
|
||||||
if (this.econHandler.isSupported() && Permissions.hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) {
|
if (this.econHandler.isSupported() && player.hasPermission(Permission.PERMISSION_LIST_FOR_SALE)) {
|
||||||
completions.add("forsale");
|
completions.add("forsale");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_MINE)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_MINE)) {
|
||||||
completions.add("mine");
|
completions.add("mine");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_SHARED)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_SHARED)) {
|
||||||
completions.add("shared");
|
completions.add("shared");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_WORLD)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_WORLD)) {
|
||||||
completions.addAll(PlotSquared.platform().worldManager().getWorlds());
|
completions.addAll(PlotSquared.platform().worldManager().getWorlds());
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_TOP)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_TOP)) {
|
||||||
completions.add("top");
|
completions.add("top");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_ALL)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_ALL)) {
|
||||||
completions.add("all");
|
completions.add("all");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_UNOWNED)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_UNOWNED)) {
|
||||||
completions.add("unowned");
|
completions.add("unowned");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_DONE)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_DONE)) {
|
||||||
completions.add("done");
|
completions.add("done");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_EXPIRED)) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_EXPIRED)) {
|
||||||
completions.add("expired");
|
completions.add("expired");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -550,7 +548,7 @@ public class ListCmd extends SubCommand {
|
|||||||
.map(completion -> new Command(null, true, completion, "", RequiredType.NONE, CommandCategory.TELEPORT) {
|
.map(completion -> new Command(null, true, completion, "", RequiredType.NONE, CommandCategory.TELEPORT) {
|
||||||
}).collect(Collectors.toCollection(LinkedList::new));
|
}).collect(Collectors.toCollection(LinkedList::new));
|
||||||
|
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_LIST_PLAYER) && args[0].length() > 0) {
|
if (player.hasPermission(Permission.PERMISSION_LIST_PLAYER) && args[0].length() > 0) {
|
||||||
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@ import com.plotsquared.core.plot.PlotArea;
|
|||||||
import com.plotsquared.core.plot.PlotId;
|
import com.plotsquared.core.plot.PlotId;
|
||||||
import com.plotsquared.core.plot.schematic.Schematic;
|
import com.plotsquared.core.plot.schematic.Schematic;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.SchematicHandler;
|
import com.plotsquared.core.util.SchematicHandler;
|
||||||
import com.plotsquared.core.util.TimeUtil;
|
import com.plotsquared.core.util.TimeUtil;
|
||||||
import com.plotsquared.core.util.task.RunnableVal;
|
import com.plotsquared.core.util.task.RunnableVal;
|
||||||
@ -80,8 +79,7 @@ public class Load extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot.isOwner(player.getUUID()) && !Permissions
|
if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_LOAD)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_LOAD)) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,6 @@ import com.plotsquared.core.plot.Plot;
|
|||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.plot.world.SinglePlotArea;
|
import com.plotsquared.core.plot.world.SinglePlotArea;
|
||||||
import com.plotsquared.core.util.EconHandler;
|
import com.plotsquared.core.util.EconHandler;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlotExpression;
|
import com.plotsquared.core.util.PlotExpression;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
@ -244,8 +243,8 @@ public class MainCommand extends Command {
|
|||||||
PlotArea area = player.getApplicablePlotArea();
|
PlotArea area = player.getApplicablePlotArea();
|
||||||
Plot newPlot = Plot.fromString(area, args[0]);
|
Plot newPlot = Plot.fromString(area, args[0]);
|
||||||
if (newPlot != null && (player instanceof ConsolePlayer || newPlot.getArea()
|
if (newPlot != null && (player instanceof ConsolePlayer || newPlot.getArea()
|
||||||
.equals(area) || Permissions.hasPermission(player, Permission.PERMISSION_ADMIN)
|
.equals(area) || player.hasPermission(Permission.PERMISSION_ADMIN)
|
||||||
|| Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_AREA_SUDO))
|
|| player.hasPermission(Permission.PERMISSION_ADMIN_AREA_SUDO))
|
||||||
&& !newPlot.isDenied(player.getUUID())) {
|
&& !newPlot.isDenied(player.getUUID())) {
|
||||||
final Location newLoc;
|
final Location newLoc;
|
||||||
if (newPlot.getArea() instanceof SinglePlotArea) {
|
if (newPlot.getArea() instanceof SinglePlotArea) {
|
||||||
|
@ -32,7 +32,6 @@ import com.plotsquared.core.plot.Plot;
|
|||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.util.EconHandler;
|
import com.plotsquared.core.util.EconHandler;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlotExpression;
|
import com.plotsquared.core.util.PlotExpression;
|
||||||
import com.plotsquared.core.util.StringMan;
|
import com.plotsquared.core.util.StringMan;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
@ -124,7 +123,7 @@ public class Merge extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final int size = plot.getConnectedPlots().size();
|
final int size = plot.getConnectedPlots().size();
|
||||||
int max = Permissions.hasPermissionRange(player, "plots.merge", Settings.Limit.MAX_PLOTS);
|
int max = player.hasPermissionRange("plots.merge", Settings.Limit.MAX_PLOTS);
|
||||||
PlotMergeEvent event =
|
PlotMergeEvent event =
|
||||||
this.eventDispatcher.callMerge(plot, direction, max, player);
|
this.eventDispatcher.callMerge(plot, direction, max, player);
|
||||||
if (event.getEventResult() == Result.DENY) {
|
if (event.getEventResult() == Result.DENY) {
|
||||||
@ -152,7 +151,7 @@ public class Merge extends SubCommand {
|
|||||||
UUID uuid = player.getUUID();
|
UUID uuid = player.getUUID();
|
||||||
|
|
||||||
if (!force && !plot.isOwner(uuid)) {
|
if (!force && !plot.isOwner(uuid)) {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_MERGE)) {
|
if (!player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_MERGE)) {
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -164,8 +163,7 @@ public class Merge extends SubCommand {
|
|||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
terrain = "true".equalsIgnoreCase(args[1]);
|
terrain = "true".equalsIgnoreCase(args[1]);
|
||||||
}
|
}
|
||||||
if (!force && !terrain && !Permissions
|
if (!force && !terrain && !player.hasPermission(Permission.PERMISSION_MERGE_KEEP_ROAD)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_MERGE_KEEP_ROAD)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_MERGE_KEEP_ROAD))
|
Template.of("node", String.valueOf(Permission.PERMISSION_MERGE_KEEP_ROAD))
|
||||||
@ -202,8 +200,7 @@ public class Merge extends SubCommand {
|
|||||||
} else {
|
} else {
|
||||||
terrain = true;
|
terrain = true;
|
||||||
}
|
}
|
||||||
if (!force && !terrain && !Permissions
|
if (!force && !terrain && !player.hasPermission(Permission.PERMISSION_MERGE_KEEP_ROAD)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_MERGE_KEEP_ROAD)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_MERGE_KEEP_ROAD))
|
Template.of("node", String.valueOf(Permission.PERMISSION_MERGE_KEEP_ROAD))
|
||||||
@ -228,7 +225,7 @@ public class Merge extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("merge.no_available_automerge"));
|
player.sendMessage(TranslatableCaption.of("merge.no_available_automerge"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!force && !Permissions.hasPermission(player, Permission.PERMISSION_MERGE_OTHER)) {
|
if (!force && !player.hasPermission(Permission.PERMISSION_MERGE_OTHER)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_MERGE_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_MERGE_OTHER))
|
||||||
@ -282,7 +279,34 @@ public class Merge extends SubCommand {
|
|||||||
run.run();
|
run.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!force && !isOnline) {
|
if (force || !isOnline) {
|
||||||
|
if (force || player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_MERGE_OTHER_OFFLINE)) {
|
||||||
|
if (plot.getPlotModificationManager().autoMerge(
|
||||||
|
direction,
|
||||||
|
maxSize - size,
|
||||||
|
uuids.iterator().next(),
|
||||||
|
player,
|
||||||
|
terrain
|
||||||
|
)) {
|
||||||
|
if (this.econHandler.isEnabled(plotArea) && price > 0d) {
|
||||||
|
if (!force && this.econHandler.getMoney(player) < price) {
|
||||||
|
player.sendMessage(
|
||||||
|
TranslatableCaption.of("economy.cannot_afford_merge"),
|
||||||
|
Template.of("money", this.econHandler.format(price))
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.econHandler.withdrawMoney(player, price);
|
||||||
|
player.sendMessage(
|
||||||
|
TranslatableCaption.of("economy.removed_balance"),
|
||||||
|
Template.of("money", this.econHandler.format(price))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
player.sendMessage(TranslatableCaption.of("merge.success_merge"));
|
||||||
|
eventDispatcher.callPostMerge(player, plot);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
player.sendMessage(TranslatableCaption.of("merge.no_available_automerge"));
|
player.sendMessage(TranslatableCaption.of("merge.no_available_automerge"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,6 @@ import com.plotsquared.core.player.PlotPlayer;
|
|||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
@ -60,8 +59,7 @@ public class Move extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
||||||
return CompletableFuture.completedFuture(false);
|
return CompletableFuture.completedFuture(false);
|
||||||
}
|
}
|
||||||
if (!plot1.isOwner(player.getUUID()) && !Permissions
|
if (!plot1.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN)) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return CompletableFuture.completedFuture(false);
|
return CompletableFuture.completedFuture(false);
|
||||||
}
|
}
|
||||||
@ -88,8 +86,7 @@ public class Move extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("invalid.origin_cant_be_target"));
|
player.sendMessage(TranslatableCaption.of("invalid.origin_cant_be_target"));
|
||||||
return CompletableFuture.completedFuture(false);
|
return CompletableFuture.completedFuture(false);
|
||||||
}
|
}
|
||||||
if (!plot1.getArea().isCompatible(plot2.getArea()) && (!override || !Permissions
|
if (!plot1.getArea().isCompatible(plot2.getArea()) && (!override || !player.hasPermission(Permission.PERMISSION_ADMIN))) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN))) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("errors.plotworld_incompatible"));
|
player.sendMessage(TranslatableCaption.of("errors.plotworld_incompatible"));
|
||||||
return CompletableFuture.completedFuture(false);
|
return CompletableFuture.completedFuture(false);
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,6 @@ import com.plotsquared.core.plot.flag.PlotFlag;
|
|||||||
import com.plotsquared.core.plot.flag.implementations.MusicFlag;
|
import com.plotsquared.core.plot.flag.implementations.MusicFlag;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.InventoryUtil;
|
import com.plotsquared.core.util.InventoryUtil;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.sk89q.worldedit.world.item.ItemType;
|
import com.sk89q.worldedit.world.item.ItemType;
|
||||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
@ -79,8 +78,7 @@ public class Music extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot.isAdded(player.getUUID()) && !Permissions
|
if (!plot.isAdded(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_MUSIC_OTHER)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_MUSIC_OTHER)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_MUSIC_OTHER))
|
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_MUSIC_OTHER))
|
||||||
|
@ -26,6 +26,7 @@ import com.plotsquared.core.util.task.RunnableVal2;
|
|||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
@CommandDeclaration(command = "near",
|
@CommandDeclaration(command = "near",
|
||||||
@ -48,9 +49,13 @@ public class Near extends Command {
|
|||||||
final Plot plot = check(player.getCurrentPlot(), TranslatableCaption.of("errors.not_in_plot"));
|
final Plot plot = check(player.getCurrentPlot(), TranslatableCaption.of("errors.not_in_plot"));
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("near.plot_near"),
|
TranslatableCaption.of("near.plot_near"),
|
||||||
Template.of("list", StringMan.join(plot.getPlayersInPlot(), ", "))
|
Template.of("list", StringMan.join(getPlayersInPlotVisible(plot, player), ", "))
|
||||||
);
|
);
|
||||||
return CompletableFuture.completedFuture(true);
|
return CompletableFuture.completedFuture(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<PlotPlayer<?>> getPlayersInPlotVisible(Plot plot, PlotPlayer<?> executor) {
|
||||||
|
return plot.getPlayersInPlot().stream().filter(executor::canSee).toList();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,6 @@ import com.plotsquared.core.player.PlayerMetaDataKeys;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlayerManager;
|
import com.plotsquared.core.util.PlayerManager;
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
@ -99,10 +98,10 @@ public class Owner extends SetCommand {
|
|||||||
uuid = event.getNewOwner();
|
uuid = event.getNewOwner();
|
||||||
boolean force = event.getEventResult() == Result.FORCE;
|
boolean force = event.getEventResult() == Result.FORCE;
|
||||||
if (uuid == null) {
|
if (uuid == null) {
|
||||||
if (!force && !Permissions
|
if (!force && !player.hasPermission(
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_SET_OWNER,
|
Permission.PERMISSION_ADMIN_COMMAND_SET_OWNER,
|
||||||
true
|
true
|
||||||
)) {
|
)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PlotUnlinkEvent unlinkEvent = this.eventDispatcher.callUnlink(
|
PlotUnlinkEvent unlinkEvent = this.eventDispatcher.callUnlink(
|
||||||
@ -139,8 +138,7 @@ public class Owner extends SetCommand {
|
|||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!force && !Permissions
|
if (!force && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_SET_OWNER)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_SET_OWNER)) {
|
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("errors.invalid_player_offline"),
|
TranslatableCaption.of("errors.invalid_player_offline"),
|
||||||
|
@ -34,7 +34,6 @@ import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
|||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.InventoryUtil;
|
import com.plotsquared.core.util.InventoryUtil;
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.query.PlotQuery;
|
import com.plotsquared.core.util.query.PlotQuery;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
@ -114,8 +113,7 @@ public class Rate extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!Permissions
|
if (!player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS, true)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS, true)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
plot.clearRatings();
|
plot.clearRatings();
|
||||||
@ -273,10 +271,10 @@ public class Rate extends SubCommand {
|
|||||||
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
final List<String> completions = new LinkedList<>();
|
final List<String> completions = new LinkedList<>();
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_RATE)) {
|
if (player.hasPermission(Permission.PERMISSION_RATE)) {
|
||||||
completions.add("1 - 10");
|
completions.add("1 - 10");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS)) {
|
if (player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_PURGE_RATINGS)) {
|
||||||
completions.add("purge");
|
completions.add("purge");
|
||||||
}
|
}
|
||||||
final List<Command> commands = completions.stream().filter(completion -> completion
|
final List<Command> commands = completions.stream().filter(completion -> completion
|
||||||
@ -284,7 +282,7 @@ public class Rate extends SubCommand {
|
|||||||
.startsWith(args[0].toLowerCase()))
|
.startsWith(args[0].toLowerCase()))
|
||||||
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) {
|
.map(completion -> new Command(null, true, completion, "", RequiredType.PLAYER, CommandCategory.INFO) {
|
||||||
}).collect(Collectors.toCollection(LinkedList::new));
|
}).collect(Collectors.toCollection(LinkedList::new));
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_RATE) && args[0].length() > 0) {
|
if (player.hasPermission(Permission.PERMISSION_RATE) && args[0].length() > 0) {
|
||||||
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
||||||
}
|
}
|
||||||
return commands;
|
return commands;
|
||||||
|
@ -26,7 +26,6 @@ import com.plotsquared.core.permissions.Permission;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlayerManager;
|
import com.plotsquared.core.util.PlayerManager;
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
@ -65,8 +64,7 @@ public class Remove extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot.isOwner(player.getUUID()) && !Permissions
|
if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_REMOVE)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_REMOVE)) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@ import com.plotsquared.core.player.PlotPlayer;
|
|||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.PlotId;
|
import com.plotsquared.core.plot.PlotId;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.SchematicHandler;
|
import com.plotsquared.core.util.SchematicHandler;
|
||||||
import com.plotsquared.core.util.task.RunnableVal;
|
import com.plotsquared.core.util.task.RunnableVal;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
@ -82,8 +81,7 @@ public class Save extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large"));
|
player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot.isOwner(player.getUUID()) && !Permissions
|
if (!plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_SAVE)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_SAVE)) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,6 @@ import com.plotsquared.core.plot.Plot;
|
|||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.plot.schematic.Schematic;
|
import com.plotsquared.core.plot.schematic.Schematic;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.SchematicHandler;
|
import com.plotsquared.core.util.SchematicHandler;
|
||||||
import com.plotsquared.core.util.StringMan;
|
import com.plotsquared.core.util.StringMan;
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
@ -80,7 +79,7 @@ public class SchematicCmd extends SubCommand {
|
|||||||
String arg = args[0].toLowerCase();
|
String arg = args[0].toLowerCase();
|
||||||
switch (arg) {
|
switch (arg) {
|
||||||
case "paste" -> {
|
case "paste" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_PASTE)) {
|
if (!player.hasPermission(Permission.PERMISSION_SCHEMATIC_PASTE)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_SCHEMATIC_PASTE))
|
Template.of("node", String.valueOf(Permission.PERMISSION_SCHEMATIC_PASTE))
|
||||||
@ -104,8 +103,7 @@ public class SchematicCmd extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot.isOwner(player.getUUID()) && !Permissions
|
if (!plot.isOwner(player.getUUID()) && !player.hasPermission("plots.admin.command.schematic.paste")) {
|
||||||
.hasPermission(player, "plots.admin.command.schematic.paste")) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -218,7 +216,7 @@ public class SchematicCmd extends SubCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "export", "save" -> {
|
case "export", "save" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_SAVE)) {
|
if (!player.hasPermission(Permission.PERMISSION_SCHEMATIC_SAVE)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_SCHEMATIC_SAVE))
|
Template.of("node", String.valueOf(Permission.PERMISSION_SCHEMATIC_SAVE))
|
||||||
@ -243,8 +241,7 @@ public class SchematicCmd extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large"));
|
player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot.isOwner(player.getUUID()) && !Permissions
|
if (!plot.isOwner(player.getUUID()) && !player.hasPermission("plots.admin.command.schematic.save")) {
|
||||||
.hasPermission(player, "plots.admin.command.schematic.save")) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -261,7 +258,7 @@ public class SchematicCmd extends SubCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "list" -> {
|
case "list" -> {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_LIST)) {
|
if (!player.hasPermission(Permission.PERMISSION_SCHEMATIC_LIST)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_SCHEMATIC_LIST))
|
Template.of("node", String.valueOf(Permission.PERMISSION_SCHEMATIC_LIST))
|
||||||
@ -286,13 +283,13 @@ public class SchematicCmd extends SubCommand {
|
|||||||
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
final List<String> completions = new LinkedList<>();
|
final List<String> completions = new LinkedList<>();
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_SAVE)) {
|
if (player.hasPermission(Permission.PERMISSION_SCHEMATIC_SAVE)) {
|
||||||
completions.add("save");
|
completions.add("save");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_LIST)) {
|
if (player.hasPermission(Permission.PERMISSION_SCHEMATIC_LIST)) {
|
||||||
completions.add("list");
|
completions.add("list");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC_PASTE)) {
|
if (player.hasPermission(Permission.PERMISSION_SCHEMATIC_PASTE)) {
|
||||||
completions.add("paste");
|
completions.add("paste");
|
||||||
}
|
}
|
||||||
final List<Command> commands = completions.stream().filter(completion -> completion
|
final List<Command> commands = completions.stream().filter(completion -> completion
|
||||||
@ -307,7 +304,7 @@ public class SchematicCmd extends SubCommand {
|
|||||||
CommandCategory.ADMINISTRATION
|
CommandCategory.ADMINISTRATION
|
||||||
) {
|
) {
|
||||||
}).collect(Collectors.toCollection(LinkedList::new));
|
}).collect(Collectors.toCollection(LinkedList::new));
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SCHEMATIC) && args[0].length() > 0) {
|
if (player.hasPermission(Permission.PERMISSION_SCHEMATIC) && args[0].length() > 0) {
|
||||||
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
||||||
}
|
}
|
||||||
return commands;
|
return commands;
|
||||||
|
@ -32,7 +32,6 @@ import com.plotsquared.core.plot.PlotArea;
|
|||||||
import com.plotsquared.core.plot.PlotManager;
|
import com.plotsquared.core.plot.PlotManager;
|
||||||
import com.plotsquared.core.queue.QueueCoordinator;
|
import com.plotsquared.core.queue.QueueCoordinator;
|
||||||
import com.plotsquared.core.util.PatternUtil;
|
import com.plotsquared.core.util.PatternUtil;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.StringMan;
|
import com.plotsquared.core.util.StringMan;
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
@ -96,7 +95,7 @@ public class Set extends SubCommand {
|
|||||||
BlockType::getName).toList());
|
BlockType::getName).toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_ALLOW_UNSAFE) &&
|
if (!player.hasPermission(Permission.PERMISSION_ADMIN_ALLOW_UNSAFE) &&
|
||||||
!forbiddenTypes.isEmpty()) {
|
!forbiddenTypes.isEmpty()) {
|
||||||
for (String forbiddenType : forbiddenTypes) {
|
for (String forbiddenType : forbiddenTypes) {
|
||||||
forbiddenType = forbiddenType.toLowerCase(Locale.ENGLISH);
|
forbiddenType = forbiddenType.toLowerCase(Locale.ENGLISH);
|
||||||
@ -132,7 +131,7 @@ public class Set extends SubCommand {
|
|||||||
|
|
||||||
for (String component : components) {
|
for (String component : components) {
|
||||||
if (component.equalsIgnoreCase(args[0])) {
|
if (component.equalsIgnoreCase(args[0])) {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_SET_COMPONENT.format(component))) {
|
if (!player.hasPermission(Permission.PERMISSION_SET_COMPONENT.format(component))) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_SET_COMPONENT.format(component))
|
Template.of("node", Permission.PERMISSION_SET_COMPONENT.format(component))
|
||||||
@ -211,7 +210,7 @@ public class Set extends SubCommand {
|
|||||||
}
|
}
|
||||||
Command cmd = MainCommand.getInstance().getCommand("set" + args[0]);
|
Command cmd = MainCommand.getInstance().getCommand("set" + args[0]);
|
||||||
if (cmd != null) {
|
if (cmd != null) {
|
||||||
if (!Permissions.hasPermission(player, cmd.getPermission(), true)) {
|
if (!player.hasPermission(cmd.getPermission(), true)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
cmd.execute(player, Arrays.copyOfRange(args, 1, args.length), null, null);
|
cmd.execute(player, Arrays.copyOfRange(args, 1, args.length), null, null);
|
||||||
@ -241,37 +240,37 @@ public class Set extends SubCommand {
|
|||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
final List<String> completions = new LinkedList<>();
|
final List<String> completions = new LinkedList<>();
|
||||||
|
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SET_BIOME)) {
|
if (player.hasPermission(Permission.PERMISSION_SET_BIOME)) {
|
||||||
completions.add("biome");
|
completions.add("biome");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SET_ALIAS)) {
|
if (player.hasPermission(Permission.PERMISSION_SET_ALIAS)) {
|
||||||
completions.add("alias");
|
completions.add("alias");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SET_HOME)) {
|
if (player.hasPermission(Permission.PERMISSION_SET_HOME)) {
|
||||||
completions.add("home");
|
completions.add("home");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SET_MAIN)) {
|
if (player.hasPermission(Permission.PERMISSION_SET_MAIN)) {
|
||||||
completions.add("main");
|
completions.add("main");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SET_FLOOR)) {
|
if (player.hasPermission(Permission.PERMISSION_SET_FLOOR)) {
|
||||||
completions.add("floor");
|
completions.add("floor");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SET_AIR)) {
|
if (player.hasPermission(Permission.PERMISSION_SET_AIR)) {
|
||||||
completions.add("air");
|
completions.add("air");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SET_ALL)) {
|
if (player.hasPermission(Permission.PERMISSION_SET_ALL)) {
|
||||||
completions.add("all");
|
completions.add("all");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SET_BORDER)) {
|
if (player.hasPermission(Permission.PERMISSION_SET_BORDER)) {
|
||||||
completions.add("border");
|
completions.add("border");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SET_WALL)) {
|
if (player.hasPermission(Permission.PERMISSION_SET_WALL)) {
|
||||||
completions.add("wall");
|
completions.add("wall");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SET_OUTLINE)) {
|
if (player.hasPermission(Permission.PERMISSION_SET_OUTLINE)) {
|
||||||
completions.add("outline");
|
completions.add("outline");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SET_MIDDLE)) {
|
if (player.hasPermission(Permission.PERMISSION_SET_MIDDLE)) {
|
||||||
completions.add("middle");
|
completions.add("middle");
|
||||||
}
|
}
|
||||||
final List<Command> commands = completions.stream().filter(completion -> completion
|
final List<Command> commands = completions.stream().filter(completion -> completion
|
||||||
@ -280,7 +279,7 @@ public class Set extends SubCommand {
|
|||||||
.map(completion -> new Command(null, true, completion, "", RequiredType.NONE, CommandCategory.APPEARANCE) {
|
.map(completion -> new Command(null, true, completion, "", RequiredType.NONE, CommandCategory.APPEARANCE) {
|
||||||
}).collect(Collectors.toCollection(LinkedList::new));
|
}).collect(Collectors.toCollection(LinkedList::new));
|
||||||
|
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_SET) && args[0].length() > 0) {
|
if (player.hasPermission(Permission.PERMISSION_SET) && args[0].length() > 0) {
|
||||||
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
||||||
}
|
}
|
||||||
return commands;
|
return commands;
|
||||||
@ -296,7 +295,7 @@ public class Set extends SubCommand {
|
|||||||
|
|
||||||
final Command cmd = MainCommand.getInstance().getCommand("set" + args[0]);
|
final Command cmd = MainCommand.getInstance().getCommand("set" + args[0]);
|
||||||
if (cmd != null) {
|
if (cmd != null) {
|
||||||
if (!Permissions.hasPermission(player, cmd.getPermission(), true)) {
|
if (!player.hasPermission(cmd.getPermission(), true)) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
return cmd.tab(player, newArgs, space);
|
return cmd.tab(player, newArgs, space);
|
||||||
|
@ -23,7 +23,6 @@ import com.plotsquared.core.location.Location;
|
|||||||
import com.plotsquared.core.permissions.Permission;
|
import com.plotsquared.core.permissions.Permission;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.StringMan;
|
import com.plotsquared.core.util.StringMan;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
|
|
||||||
@ -38,7 +37,7 @@ public abstract class SetCommand extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND.format(getFullId()))) {
|
if (!player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND.format(getFullId()))) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_COMMAND.format(getFullId()))
|
Template.of("node", Permission.PERMISSION_ADMIN_COMMAND.format(getFullId()))
|
||||||
@ -48,7 +47,7 @@ public abstract class SetCommand extends SubCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!plot.isOwner(player.getUUID())) {
|
if (!plot.isOwner(player.getUUID())) {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND.format(getFullId()))) {
|
if (!player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND.format(getFullId()))) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_COMMAND.format(getFullId()))
|
Template.of("node", Permission.PERMISSION_ADMIN_COMMAND.format(getFullId()))
|
||||||
|
@ -23,7 +23,6 @@ import com.plotsquared.core.location.Location;
|
|||||||
import com.plotsquared.core.permissions.Permission;
|
import com.plotsquared.core.permissions.Permission;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
@ -49,8 +48,7 @@ public class Swap extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
||||||
return CompletableFuture.completedFuture(false);
|
return CompletableFuture.completedFuture(false);
|
||||||
}
|
}
|
||||||
if (!plot1.isOwner(player.getUUID()) && !Permissions
|
if (!plot1.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN)) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return CompletableFuture.completedFuture(false);
|
return CompletableFuture.completedFuture(false);
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,6 @@ import com.plotsquared.core.setup.PlotAreaBuilder;
|
|||||||
import com.plotsquared.core.setup.SettingsNodesWrapper;
|
import com.plotsquared.core.setup.SettingsNodesWrapper;
|
||||||
import com.plotsquared.core.util.FileBytes;
|
import com.plotsquared.core.util.FileBytes;
|
||||||
import com.plotsquared.core.util.FileUtils;
|
import com.plotsquared.core.util.FileUtils;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.SetupUtils;
|
import com.plotsquared.core.util.SetupUtils;
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
@ -279,10 +278,10 @@ public class Template extends SubCommand {
|
|||||||
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
final List<String> completions = new LinkedList<>();
|
final List<String> completions = new LinkedList<>();
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_TEMPLATE_EXPORT)) {
|
if (player.hasPermission(Permission.PERMISSION_TEMPLATE_EXPORT)) {
|
||||||
completions.add("export");
|
completions.add("export");
|
||||||
}
|
}
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_TEMPLATE_IMPORT)) {
|
if (player.hasPermission(Permission.PERMISSION_TEMPLATE_IMPORT)) {
|
||||||
completions.add("import");
|
completions.add("import");
|
||||||
}
|
}
|
||||||
final List<Command> commands = completions.stream().filter(completion -> completion
|
final List<Command> commands = completions.stream().filter(completion -> completion
|
||||||
@ -297,7 +296,7 @@ public class Template extends SubCommand {
|
|||||||
CommandCategory.ADMINISTRATION
|
CommandCategory.ADMINISTRATION
|
||||||
) {
|
) {
|
||||||
}).collect(Collectors.toCollection(LinkedList::new));
|
}).collect(Collectors.toCollection(LinkedList::new));
|
||||||
if (Permissions.hasPermission(player, Permission.PERMISSION_TEMPLATE) && args[0].length() > 0) {
|
if (player.hasPermission(Permission.PERMISSION_TEMPLATE) && args[0].length() > 0) {
|
||||||
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
commands.addAll(TabCompletions.completePlayers(player, args[0], Collections.emptyList()));
|
||||||
}
|
}
|
||||||
return commands;
|
return commands;
|
||||||
|
@ -25,7 +25,6 @@ import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
|||||||
import com.plotsquared.core.location.Location;
|
import com.plotsquared.core.location.Location;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.expiration.ExpireManager;
|
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.queue.GlobalBlockQueue;
|
import com.plotsquared.core.queue.GlobalBlockQueue;
|
||||||
import com.plotsquared.core.queue.QueueCoordinator;
|
import com.plotsquared.core.queue.QueueCoordinator;
|
||||||
@ -92,8 +91,8 @@ public class Trim extends SubCommand {
|
|||||||
}
|
}
|
||||||
TranslatableCaption.of("trim.trim_starting");
|
TranslatableCaption.of("trim.trim_starting");
|
||||||
final List<Plot> plots = PlotQuery.newQuery().inWorld(world).asList();
|
final List<Plot> plots = PlotQuery.newQuery().inWorld(world).asList();
|
||||||
if (ExpireManager.IMP != null) {
|
if (PlotSquared.platform().expireManager() != null) {
|
||||||
plots.removeAll(ExpireManager.IMP.getPendingExpired());
|
plots.removeAll(PlotSquared.platform().expireManager().getPendingExpired());
|
||||||
}
|
}
|
||||||
result.value1 = new HashSet<>(PlotSquared.platform().worldUtil().getChunkChunks(world));
|
result.value1 = new HashSet<>(PlotSquared.platform().worldUtil().getChunkChunks(world));
|
||||||
result.value2 = new HashSet<>();
|
result.value2 = new HashSet<>();
|
||||||
|
@ -27,7 +27,6 @@ import com.plotsquared.core.permissions.Permission;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlayerManager;
|
import com.plotsquared.core.util.PlayerManager;
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
@ -69,8 +68,7 @@ public class Trust extends Command {
|
|||||||
}
|
}
|
||||||
checkTrue(currentPlot.hasOwner(), TranslatableCaption.of("info.plot_unowned"));
|
checkTrue(currentPlot.hasOwner(), TranslatableCaption.of("info.plot_unowned"));
|
||||||
checkTrue(
|
checkTrue(
|
||||||
currentPlot.isOwner(player.getUUID()) || Permissions
|
currentPlot.isOwner(player.getUUID()) || player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_TRUST),
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST),
|
|
||||||
TranslatableCaption.of("permission.no_plot_perms")
|
TranslatableCaption.of("permission.no_plot_perms")
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -101,8 +99,7 @@ public class Trust extends Command {
|
|||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
UUID uuid = iterator.next();
|
UUID uuid = iterator.next();
|
||||||
if (uuid == DBFunc.EVERYONE && !(
|
if (uuid == DBFunc.EVERYONE && !(
|
||||||
Permissions.hasPermission(player, Permission.PERMISSION_TRUST_EVERYONE) || Permissions
|
player.hasPermission(Permission.PERMISSION_TRUST_EVERYONE) || player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_TRUST))) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_TRUST))) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("errors.invalid_player"),
|
TranslatableCaption.of("errors.invalid_player"),
|
||||||
Template.of("value", PlayerManager.resolveName(uuid).getComponent(player))
|
Template.of("value", PlayerManager.resolveName(uuid).getComponent(player))
|
||||||
@ -130,7 +127,7 @@ public class Trust extends Command {
|
|||||||
}
|
}
|
||||||
checkTrue(!uuids.isEmpty(), null);
|
checkTrue(!uuids.isEmpty(), null);
|
||||||
int localTrustSize = currentPlot.getTrusted().size();
|
int localTrustSize = currentPlot.getTrusted().size();
|
||||||
int maxTrustSize = Permissions.hasPermissionRange(player, Permission.PERMISSION_TRUST, Settings.Limit.MAX_PLOTS);
|
int maxTrustSize = player.hasPermissionRange(Permission.PERMISSION_TRUST, Settings.Limit.MAX_PLOTS);
|
||||||
if (localTrustSize >= maxTrustSize) {
|
if (localTrustSize >= maxTrustSize) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("members.plot_max_members_trusted"),
|
TranslatableCaption.of("members.plot_max_members_trusted"),
|
||||||
|
@ -27,7 +27,6 @@ import com.plotsquared.core.permissions.Permission;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.StringMan;
|
import com.plotsquared.core.util.StringMan;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
@ -91,8 +90,7 @@ public class Unlink extends SubCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
boolean force = event.getEventResult() == Result.FORCE;
|
boolean force = event.getEventResult() == Result.FORCE;
|
||||||
if (!force && !plot.isOwner(player.getUUID()) && !Permissions
|
if (!force && !plot.isOwner(player.getUUID()) && !player.hasPermission(Permission.PERMISSION_ADMIN_COMMAND_UNLINK)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_UNLINK)) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,6 @@ import com.plotsquared.core.plot.PlotArea;
|
|||||||
import com.plotsquared.core.plot.flag.implementations.UntrustedVisitFlag;
|
import com.plotsquared.core.plot.flag.implementations.UntrustedVisitFlag;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlayerManager;
|
import com.plotsquared.core.util.PlayerManager;
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.query.PlotQuery;
|
import com.plotsquared.core.util.query.PlotQuery;
|
||||||
@ -108,7 +107,7 @@ public class Visit extends Command {
|
|||||||
|
|
||||||
final Plot plot = plots.get(page - 1);
|
final Plot plot = plots.get(page - 1);
|
||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_UNOWNED)) {
|
if (!player.hasPermission(Permission.PERMISSION_VISIT_UNOWNED)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.visit.unowned")
|
Templates.of("node", "plots.visit.unowned")
|
||||||
@ -116,8 +115,7 @@ public class Visit extends Command {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (plot.isOwner(player.getUUID())) {
|
} else if (plot.isOwner(player.getUUID())) {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_OWNED) && !Permissions
|
if (!player.hasPermission(Permission.PERMISSION_VISIT_OWNED) && !player.hasPermission(Permission.PERMISSION_HOME)) {
|
||||||
.hasPermission(player, Permission.PERMISSION_HOME)) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.visit.owned")
|
Templates.of("node", "plots.visit.owned")
|
||||||
@ -125,7 +123,7 @@ public class Visit extends Command {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (plot.isAdded(player.getUUID())) {
|
} else if (plot.isAdded(player.getUUID())) {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_SHARED)) {
|
if (!player.hasPermission(Permission.PERMISSION_SHARED)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.visit.shared")
|
Templates.of("node", "plots.visit.shared")
|
||||||
@ -135,8 +133,8 @@ public class Visit extends Command {
|
|||||||
} else {
|
} else {
|
||||||
// allow visit, if UntrustedVisit flag is set, or if the player has either the plot.visit.other or
|
// allow visit, if UntrustedVisit flag is set, or if the player has either the plot.visit.other or
|
||||||
// plot.admin.visit.untrusted permission
|
// plot.admin.visit.untrusted permission
|
||||||
if (!plot.getFlag(UntrustedVisitFlag.class) && !Permissions.hasPermission(player, Permission.PERMISSION_VISIT_OTHER)
|
if (!plot.getFlag(UntrustedVisitFlag.class) && !player.hasPermission(Permission.PERMISSION_VISIT_OTHER)
|
||||||
&& !Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_VISIT_UNTRUSTED)) {
|
&& !player.hasPermission(Permission.PERMISSION_ADMIN_VISIT_UNTRUSTED)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Templates.of("node", "plots.visit.other")
|
Templates.of("node", "plots.visit.other")
|
||||||
@ -144,7 +142,7 @@ public class Visit extends Command {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plot.isDenied(player.getUUID())) {
|
if (plot.isDenied(player.getUUID())) {
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_DENIED)) {
|
if (!player.hasPermission(Permission.PERMISSION_VISIT_DENIED)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
TranslatableCaption.of("permission.no_permission"),
|
||||||
Template.of("node", String.valueOf(Permission.PERMISSION_VISIT_DENIED))
|
Template.of("node", String.valueOf(Permission.PERMISSION_VISIT_DENIED))
|
||||||
|
@ -62,7 +62,7 @@ public class ComponentPreset implements ConfigurationSerializable {
|
|||||||
public static ComponentPreset deserialize(final @NonNull Map<String, Object> map) {
|
public static ComponentPreset deserialize(final @NonNull Map<String, Object> map) {
|
||||||
final ClassicPlotManagerComponent classicPlotManagerComponent = ClassicPlotManagerComponent
|
final ClassicPlotManagerComponent classicPlotManagerComponent = ClassicPlotManagerComponent
|
||||||
.fromString(map.getOrDefault("component", "").toString()).orElseThrow(() ->
|
.fromString(map.getOrDefault("component", "").toString()).orElseThrow(() ->
|
||||||
new IllegalArgumentException("The preset needs a valid target component"));
|
new IllegalArgumentException("The preset in components.yml needs a valid target component, got: " + map.get("component")));
|
||||||
final String pattern = map.getOrDefault("pattern", "").toString();
|
final String pattern = map.getOrDefault("pattern", "").toString();
|
||||||
final double cost = Double.parseDouble(map.getOrDefault("cost", "0.0").toString());
|
final double cost = Double.parseDouble(map.getOrDefault("cost", "0.0").toString());
|
||||||
final String permission = map.getOrDefault("permission", "").toString();
|
final String permission = map.getOrDefault("permission", "").toString();
|
||||||
|
@ -35,7 +35,6 @@ import com.plotsquared.core.queue.QueueCoordinator;
|
|||||||
import com.plotsquared.core.util.EconHandler;
|
import com.plotsquared.core.util.EconHandler;
|
||||||
import com.plotsquared.core.util.InventoryUtil;
|
import com.plotsquared.core.util.InventoryUtil;
|
||||||
import com.plotsquared.core.util.PatternUtil;
|
import com.plotsquared.core.util.PatternUtil;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
@ -51,7 +50,6 @@ import java.nio.file.Files;
|
|||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -153,8 +151,7 @@ public class ComponentPresetManager {
|
|||||||
} else if (!plot.hasOwner()) {
|
} else if (!plot.hasOwner()) {
|
||||||
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
|
||||||
return null;
|
return null;
|
||||||
} else if (!plot.isOwner(player.getUUID()) && !plot.getTrusted().contains(player.getUUID()) && !Permissions.hasPermission(
|
} else if (!plot.isOwner(player.getUUID()) && !plot.getTrusted().contains(player.getUUID()) && !player.hasPermission(
|
||||||
player,
|
|
||||||
Permission.PERMISSION_ADMIN_COMPONENTS_OTHER
|
Permission.PERMISSION_ADMIN_COMPONENTS_OTHER
|
||||||
)) {
|
)) {
|
||||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||||
@ -166,8 +163,7 @@ public class ComponentPresetManager {
|
|||||||
|
|
||||||
final List<ComponentPreset> allowedPresets = new ArrayList<>(this.presets.size());
|
final List<ComponentPreset> allowedPresets = new ArrayList<>(this.presets.size());
|
||||||
for (final ComponentPreset componentPreset : this.presets) {
|
for (final ComponentPreset componentPreset : this.presets) {
|
||||||
if (!componentPreset.getPermission().isEmpty() && !Permissions.hasPermission(
|
if (!componentPreset.getPermission().isEmpty() && !player.hasPermission(
|
||||||
player,
|
|
||||||
componentPreset.getPermission()
|
componentPreset.getPermission()
|
||||||
)) {
|
)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -759,6 +759,8 @@ public class Settings extends Config {
|
|||||||
@Comment("Also kill any road mobs that are being ridden, or are leashed")
|
@Comment("Also kill any road mobs that are being ridden, or are leashed")
|
||||||
public static boolean
|
public static boolean
|
||||||
KILL_OWNED_ROAD_MOBS = false;
|
KILL_OWNED_ROAD_MOBS = false;
|
||||||
|
@Comment("Also kill any road mobs that are named")
|
||||||
|
public static boolean KILL_NAMED_ROAD_MOBS = false;
|
||||||
@Comment("Kill items on roads (Stick, Paper, etc.)")
|
@Comment("Kill items on roads (Stick, Paper, etc.)")
|
||||||
public static boolean KILL_ROAD_ITEMS = false;
|
public static boolean KILL_ROAD_ITEMS = false;
|
||||||
@Comment("Kill vehicles on roads (Boat, Minecart, etc.)")
|
@Comment("Kill vehicles on roads (Boat, Minecart, etc.)")
|
||||||
@ -808,6 +810,8 @@ public class Settings extends Config {
|
|||||||
);
|
);
|
||||||
@Comment("Whether PlotSquared should hook into MvDWPlaceholderAPI or not")
|
@Comment("Whether PlotSquared should hook into MvDWPlaceholderAPI or not")
|
||||||
public static boolean USE_MVDWAPI = true;
|
public static boolean USE_MVDWAPI = true;
|
||||||
|
@Comment("Prevent cross plot beacon effects")
|
||||||
|
public static boolean DISABLE_BEACON_EFFECT_OVERFLOW = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,16 +21,15 @@ package com.plotsquared.core.configuration.caption;
|
|||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.text.event.ClickEvent;
|
import net.kyori.adventure.text.event.ClickEvent;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
final class ClickStripTransform implements ComponentTransform {
|
final class ClickStripTransform implements ComponentTransform {
|
||||||
|
|
||||||
private final Set<ClickEvent.@NotNull Action> actionsToStrip;
|
private final Set<ClickEvent.@NonNull Action> actionsToStrip;
|
||||||
|
|
||||||
public ClickStripTransform(final Set<ClickEvent.@NotNull Action> actionsToStrip) {
|
public ClickStripTransform(final Set<ClickEvent.@NonNull Action> actionsToStrip) {
|
||||||
this.actionsToStrip = EnumSet.copyOf(actionsToStrip);
|
this.actionsToStrip = EnumSet.copyOf(actionsToStrip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,10 @@ final class ClassLoaderCaptionProvider implements DefaultCaptionProvider {
|
|||||||
try {
|
try {
|
||||||
final InputStream stream = this.classLoader.getResourceAsStream(url);
|
final InputStream stream = this.classLoader.getResourceAsStream(url);
|
||||||
if (stream == null) {
|
if (stream == null) {
|
||||||
LOGGER.warn("No resource for locale '{}' found", locale);
|
LOGGER.info("No resource for locale '{}' found in the plugin file." +
|
||||||
|
"Please ensure you have placed the latest version of the file messages_{}.json in the 'lang' folder." +
|
||||||
|
"You may be able to find completed translations at https://intellectualsites.crowdin.com/plotsquared",
|
||||||
|
locale, locale);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
try (final BufferedReader reader = new BufferedReader(new InputStreamReader(stream))) {
|
try (final BufferedReader reader = new BufferedReader(new InputStreamReader(stream))) {
|
||||||
|
@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* PlotSquared, a land and world management plugin for Minecraft.
|
||||||
|
* Copyright (C) IntellectualSites <https://intellectualsites.com>
|
||||||
|
* Copyright (C) IntellectualSites team and contributors
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.plotsquared.core.events;
|
||||||
|
|
||||||
|
import com.sk89q.worldedit.entity.Entity;
|
||||||
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since TODO
|
||||||
|
*/
|
||||||
|
public abstract class EntityEvent {
|
||||||
|
|
||||||
|
private final Entity entity;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 6.11.0
|
||||||
|
*/
|
||||||
|
public EntityEvent(Entity entity) {
|
||||||
|
this.entity = entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain the entity involved in the event
|
||||||
|
*
|
||||||
|
* @return Entity
|
||||||
|
* @since 6.11.0
|
||||||
|
*/
|
||||||
|
public Entity getEntity() {
|
||||||
|
return this.entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain the event's class name
|
||||||
|
*
|
||||||
|
* @return the event class name
|
||||||
|
* @since 6.11.0
|
||||||
|
*/
|
||||||
|
@NonNull public String getEventName() {
|
||||||
|
if (this.name == null) {
|
||||||
|
this.name = this.getClass().getSimpleName();
|
||||||
|
}
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -114,7 +114,7 @@ public class PlayerAutoPlotEvent extends PlotEvent implements CancellablePlotEve
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated for removal. Use {@link PlayerAutoPlotEvent#setSizeX(int)} )}
|
* @deprecated for removal. Use {@link PlayerAutoPlotEvent#setSizeX(int)}
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.1.0")
|
@Deprecated(forRemoval = true, since = "6.1.0")
|
||||||
public void setSize_x(int sizeX) {
|
public void setSize_x(int sizeX) {
|
||||||
@ -130,7 +130,7 @@ public class PlayerAutoPlotEvent extends PlotEvent implements CancellablePlotEve
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated for removal. Use {@link PlayerAutoPlotEvent#setSizeZ(int)} )}
|
* @deprecated for removal. Use {@link PlayerAutoPlotEvent#setSizeZ(int)}
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.1.0")
|
@Deprecated(forRemoval = true, since = "6.1.0")
|
||||||
public void setSize_z(int sizeZ) {
|
public void setSize_z(int sizeZ) {
|
||||||
|
@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* PlotSquared, a land and world management plugin for Minecraft.
|
||||||
|
* Copyright (C) IntellectualSites <https://intellectualsites.com>
|
||||||
|
* Copyright (C) IntellectualSites team and contributors
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.plotsquared.core.events;
|
||||||
|
|
||||||
|
import com.sk89q.worldedit.entity.Entity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 6.11.0
|
||||||
|
*/
|
||||||
|
public class RemoveRoadEntityEvent extends EntityEvent implements CancellablePlotEvent {
|
||||||
|
|
||||||
|
private Result eventResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RemoveRoadEntityEvent: Called when an entity on road is removed.
|
||||||
|
*
|
||||||
|
* @param entity The entity to remove
|
||||||
|
* @since 6.11.0
|
||||||
|
*/
|
||||||
|
public RemoveRoadEntityEvent(Entity entity) {
|
||||||
|
super(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result getEventResult() {
|
||||||
|
return this.eventResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setEventResult(Result eventResult) {
|
||||||
|
this.eventResult = eventResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -144,7 +144,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
plot.getRegions(),
|
plot.getRegions(),
|
||||||
blocks,
|
blocks,
|
||||||
classicPlotWorld.getMinBuildHeight(),
|
classicPlotWorld.getMinBuildHeight(),
|
||||||
classicPlotWorld.getMaxBuildHeight(),
|
classicPlotWorld.getMaxBuildHeight() - 1,
|
||||||
actor,
|
actor,
|
||||||
queue
|
queue
|
||||||
);
|
);
|
||||||
@ -175,7 +175,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
plot.getRegions(),
|
plot.getRegions(),
|
||||||
blocks,
|
blocks,
|
||||||
classicPlotWorld.PLOT_HEIGHT + 1,
|
classicPlotWorld.PLOT_HEIGHT + 1,
|
||||||
classicPlotWorld.getMaxBuildHeight(),
|
classicPlotWorld.getMaxBuildHeight() - 1,
|
||||||
actor,
|
actor,
|
||||||
queue
|
queue
|
||||||
);
|
);
|
||||||
@ -281,7 +281,7 @@ public class ClassicPlotManager extends SquarePlotManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int maxY = classicPlotWorld.getMaxBuildHeight();
|
int maxY = classicPlotWorld.getMaxBuildHeight() - 1;
|
||||||
if (!plot.isMerged(Direction.NORTH)) {
|
if (!plot.isMerged(Direction.NORTH)) {
|
||||||
int z = bottom.getZ();
|
int z = bottom.getZ();
|
||||||
for (int x = bottom.getX(); x <= top.getX(); x++) {
|
for (int x = bottom.getX(); x <= top.getX(); x++) {
|
||||||
|
@ -28,13 +28,17 @@ import com.plotsquared.core.inject.annotations.WorldConfig;
|
|||||||
import com.plotsquared.core.plot.BlockBucket;
|
import com.plotsquared.core.plot.BlockBucket;
|
||||||
import com.plotsquared.core.plot.PlotId;
|
import com.plotsquared.core.plot.PlotId;
|
||||||
import com.plotsquared.core.queue.GlobalBlockQueue;
|
import com.plotsquared.core.queue.GlobalBlockQueue;
|
||||||
|
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
@SuppressWarnings("WeakerAccess")
|
@SuppressWarnings("WeakerAccess")
|
||||||
public abstract class ClassicPlotWorld extends SquarePlotWorld {
|
public abstract class ClassicPlotWorld extends SquarePlotWorld {
|
||||||
|
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + ClassicPlotWorld.class.getSimpleName());
|
||||||
|
|
||||||
public int ROAD_HEIGHT = 62;
|
public int ROAD_HEIGHT = 62;
|
||||||
public int PLOT_HEIGHT = 62;
|
public int PLOT_HEIGHT = 62;
|
||||||
@ -121,15 +125,15 @@ public abstract class ClassicPlotWorld extends SquarePlotWorld {
|
|||||||
super.loadConfiguration(config);
|
super.loadConfiguration(config);
|
||||||
this.PLOT_BEDROCK = config.getBoolean("plot.bedrock");
|
this.PLOT_BEDROCK = config.getBoolean("plot.bedrock");
|
||||||
this.PLOT_HEIGHT = Math.min(getMaxGenHeight(), config.getInt("plot.height"));
|
this.PLOT_HEIGHT = Math.min(getMaxGenHeight(), config.getInt("plot.height"));
|
||||||
this.MAIN_BLOCK = new BlockBucket(config.getString("plot.filling"));
|
this.MAIN_BLOCK = createCheckedBlockBucket(config.getString("plot.filling"), MAIN_BLOCK);
|
||||||
this.TOP_BLOCK = new BlockBucket(config.getString("plot.floor"));
|
this.TOP_BLOCK = createCheckedBlockBucket(config.getString("plot.floor"), TOP_BLOCK);
|
||||||
this.WALL_BLOCK = new BlockBucket(config.getString("wall.block"));
|
this.WALL_BLOCK = createCheckedBlockBucket(config.getString("wall.block"), WALL_BLOCK);
|
||||||
this.ROAD_HEIGHT = Math.min(getMaxGenHeight(), config.getInt("road.height"));
|
this.ROAD_HEIGHT = Math.min(getMaxGenHeight(), config.getInt("road.height"));
|
||||||
this.ROAD_BLOCK = new BlockBucket(config.getString("road.block"));
|
this.ROAD_BLOCK = createCheckedBlockBucket(config.getString("road.block"), ROAD_BLOCK);
|
||||||
this.WALL_FILLING = new BlockBucket(config.getString("wall.filling"));
|
this.WALL_FILLING = createCheckedBlockBucket(config.getString("wall.filling"), WALL_FILLING);
|
||||||
this.PLACE_TOP_BLOCK = config.getBoolean("wall.place_top_block");
|
this.PLACE_TOP_BLOCK = config.getBoolean("wall.place_top_block");
|
||||||
this.WALL_HEIGHT = Math.min(getMaxGenHeight() - (PLACE_TOP_BLOCK ? 1 : 0), config.getInt("wall.height"));
|
this.WALL_HEIGHT = Math.min(getMaxGenHeight() - (PLACE_TOP_BLOCK ? 1 : 0), config.getInt("wall.height"));
|
||||||
this.CLAIMED_WALL_BLOCK = new BlockBucket(config.getString("wall.block_claimed"));
|
this.CLAIMED_WALL_BLOCK = createCheckedBlockBucket(config.getString("wall.block_claimed"), CLAIMED_WALL_BLOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
int schematicStartHeight() {
|
int schematicStartHeight() {
|
||||||
@ -140,4 +144,19 @@ public abstract class ClassicPlotWorld extends SquarePlotWorld {
|
|||||||
return Math.min(WALL_HEIGHT, plotRoadMin);
|
return Math.min(WALL_HEIGHT, plotRoadMin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static BlockBucket createCheckedBlockBucket(String input, BlockBucket def) {
|
||||||
|
final BlockBucket bucket = new BlockBucket(input);
|
||||||
|
Pattern pattern = null;
|
||||||
|
try {
|
||||||
|
pattern = bucket.toPattern();
|
||||||
|
} catch (Exception ignore) {
|
||||||
|
}
|
||||||
|
if (pattern == null) {
|
||||||
|
LOGGER.error("Failed to parse pattern '{}', check your worlds.yml", input);
|
||||||
|
LOGGER.error("Falling back to {}", def);
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
return bucket;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -174,8 +174,9 @@ public class HybridPlotManager extends ClassicPlotManager {
|
|||||||
for (int y = 0; y < blocks.length; y++) {
|
for (int y = 0; y < blocks.length; y++) {
|
||||||
if (blocks[y] != null) {
|
if (blocks[y] != null) {
|
||||||
queue.setBlock(x, minY + y, z, blocks[y]);
|
queue.setBlock(x, minY + y, z, blocks[y]);
|
||||||
} else {
|
} else if (!isRoad) {
|
||||||
// This is necessary, otherwise any blocks not specified in the schematic will remain after a clear
|
// This is necessary, otherwise any blocks not specified in the schematic will remain after a clear
|
||||||
|
// Do not set air for road as this may cause cavernous roads when debugroadregen is used
|
||||||
queue.setBlock(x, minY + y, z, airBlock);
|
queue.setBlock(x, minY + y, z, airBlock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@ package com.plotsquared.core.generator;
|
|||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.assistedinject.Assisted;
|
import com.google.inject.assistedinject.Assisted;
|
||||||
import com.intellectualsites.annotations.DoNotUse;
|
import com.intellectualsites.annotations.DoNotUse;
|
||||||
import com.intellectualsites.annotations.NotPublic;
|
|
||||||
import com.plotsquared.core.PlotSquared;
|
import com.plotsquared.core.PlotSquared;
|
||||||
import com.plotsquared.core.configuration.ConfigurationSection;
|
import com.plotsquared.core.configuration.ConfigurationSection;
|
||||||
import com.plotsquared.core.configuration.Settings;
|
import com.plotsquared.core.configuration.Settings;
|
||||||
@ -75,6 +74,9 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
public short PATH_WIDTH_UPPER;
|
public short PATH_WIDTH_UPPER;
|
||||||
public HashMap<Integer, BaseBlock[]> G_SCH;
|
public HashMap<Integer, BaseBlock[]> G_SCH;
|
||||||
public HashMap<Integer, BiomeType> G_SCH_B;
|
public HashMap<Integer, BiomeType> G_SCH_B;
|
||||||
|
/**
|
||||||
|
* The Y level at which schematic generation will start, lowest of either road or plot schematic generation.
|
||||||
|
*/
|
||||||
public int SCHEM_Y;
|
public int SCHEM_Y;
|
||||||
private Location SIGN_LOCATION;
|
private Location SIGN_LOCATION;
|
||||||
private File root = null;
|
private File root = null;
|
||||||
@ -91,10 +93,10 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
@Inject
|
@Inject
|
||||||
public HybridPlotWorld(
|
public HybridPlotWorld(
|
||||||
@Assisted("world") final String worldName,
|
@Assisted("world") final String worldName,
|
||||||
@Nullable @Assisted("id") final String id,
|
@javax.annotation.Nullable @Assisted("id") final String id,
|
||||||
@Assisted final @NonNull IndependentPlotGenerator generator,
|
@Assisted final @NonNull IndependentPlotGenerator generator,
|
||||||
@Nullable @Assisted("min") final PlotId min,
|
@javax.annotation.Nullable @Assisted("min") final PlotId min,
|
||||||
@Nullable @Assisted("max") final PlotId max,
|
@javax.annotation.Nullable @Assisted("max") final PlotId max,
|
||||||
@WorldConfig final @NonNull YamlConfiguration worldConfiguration,
|
@WorldConfig final @NonNull YamlConfiguration worldConfiguration,
|
||||||
final @NonNull GlobalBlockQueue blockQueue
|
final @NonNull GlobalBlockQueue blockQueue
|
||||||
) {
|
) {
|
||||||
@ -267,34 +269,67 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
int oddshift = (this.ROAD_WIDTH & 1);
|
int oddshift = (this.ROAD_WIDTH & 1);
|
||||||
|
|
||||||
SCHEM_Y = schematicStartHeight();
|
SCHEM_Y = schematicStartHeight();
|
||||||
|
|
||||||
|
// plotY and roadY are important to allow plot and/or road schematic "overflow" into each other without causing AIOOB
|
||||||
|
// exceptions when attempting either to set blocks to, or get block from G_SCH
|
||||||
|
// Default plot schematic start height, normalized to the minimum height schematics are pasted from.
|
||||||
int plotY = PLOT_HEIGHT - SCHEM_Y;
|
int plotY = PLOT_HEIGHT - SCHEM_Y;
|
||||||
int minRoadWall = Settings.Schematics.USE_WALL_IN_ROAD_SCHEM_HEIGHT ? Math.min(ROAD_HEIGHT, WALL_HEIGHT) : ROAD_HEIGHT;
|
int minRoadWall = Settings.Schematics.USE_WALL_IN_ROAD_SCHEM_HEIGHT ? Math.min(ROAD_HEIGHT, WALL_HEIGHT) : ROAD_HEIGHT;
|
||||||
|
// Default road schematic start height, normalized to the minimum height schematics are pasted from.
|
||||||
int roadY = minRoadWall - SCHEM_Y;
|
int roadY = minRoadWall - SCHEM_Y;
|
||||||
|
|
||||||
int worldHeight = getMaxGenHeight() - getMinGenHeight() + 1;
|
int worldGenHeight = getMaxGenHeight() - getMinGenHeight() + 1;
|
||||||
|
|
||||||
|
int maxSchematicHeight = 0;
|
||||||
|
int plotSchemHeight = 0;
|
||||||
|
|
||||||
// SCHEM_Y should be normalised to the plot "start" height
|
// SCHEM_Y should be normalised to the plot "start" height
|
||||||
if (schematic3 != null) {
|
if (schematic3 != null) {
|
||||||
if (schematic3.getClipboard().getDimensions().getY() == worldHeight) {
|
plotSchemHeight = maxSchematicHeight = schematic3.getClipboard().getDimensions().getY();
|
||||||
SCHEM_Y = plotY = 0;
|
if (maxSchematicHeight == worldGenHeight) {
|
||||||
|
SCHEM_Y = getMinGenHeight();
|
||||||
|
plotY = 0;
|
||||||
} else if (!Settings.Schematics.PASTE_ON_TOP) {
|
} else if (!Settings.Schematics.PASTE_ON_TOP) {
|
||||||
SCHEM_Y = plotY = getMinBuildHeight() - getMinGenHeight();
|
SCHEM_Y = getMinBuildHeight();
|
||||||
|
plotY = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int roadSchemHeight;
|
||||||
|
|
||||||
if (schematic1 != null) {
|
if (schematic1 != null) {
|
||||||
if (schematic1.getClipboard().getDimensions().getY() == worldHeight) {
|
roadSchemHeight = Math.max(
|
||||||
SCHEM_Y = roadY = getMinGenHeight();
|
schematic1.getClipboard().getDimensions().getY(),
|
||||||
if (schematic3 != null && schematic3.getClipboard().getDimensions().getY() != worldHeight
|
schematic2.getClipboard().getDimensions().getY()
|
||||||
&& !Settings.Schematics.PASTE_ON_TOP) {
|
);
|
||||||
plotY = PLOT_HEIGHT;
|
maxSchematicHeight = Math.max(roadSchemHeight, maxSchematicHeight);
|
||||||
|
if (maxSchematicHeight == worldGenHeight) {
|
||||||
|
SCHEM_Y = getMinGenHeight();
|
||||||
|
roadY = 0; // Road is the lowest schematic
|
||||||
|
if (schematic3 != null && schematic3.getClipboard().getDimensions().getY() != worldGenHeight) {
|
||||||
|
// Road is the lowest schematic. Normalize plotY to it.
|
||||||
|
if (Settings.Schematics.PASTE_ON_TOP) {
|
||||||
|
plotY = PLOT_HEIGHT - getMinGenHeight();
|
||||||
|
} else {
|
||||||
|
plotY = getMinBuildHeight() - getMinGenHeight();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (!Settings.Schematics.PASTE_ROAD_ON_TOP) {
|
} else if (!Settings.Schematics.PASTE_ROAD_ON_TOP) {
|
||||||
SCHEM_Y = roadY = getMinBuildHeight();
|
if (SCHEM_Y == getMinGenHeight()) { // Only possible if plot schematic is enabled
|
||||||
if (schematic3 != null && schematic3.getClipboard().getDimensions().getY() != worldHeight
|
// Plot is still the lowest schematic, normalize roadY to it
|
||||||
&& !Settings.Schematics.PASTE_ON_TOP) {
|
roadY = getMinBuildHeight() - getMinGenHeight();
|
||||||
plotY = PLOT_HEIGHT;
|
} else if (schematic3 != null) {
|
||||||
|
SCHEM_Y = getMinBuildHeight();
|
||||||
|
roadY = 0;// Road is the lowest schematic
|
||||||
|
if (Settings.Schematics.PASTE_ON_TOP) {
|
||||||
|
// Road is the lowest schematic. Normalize plotY to it.
|
||||||
|
plotY = PLOT_HEIGHT - getMinBuildHeight();
|
||||||
|
}
|
||||||
|
maxSchematicHeight = Math.max(maxSchematicHeight, plotY + plotSchemHeight);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
roadY = minRoadWall - SCHEM_Y;
|
||||||
|
maxSchematicHeight = Math.max(maxSchematicHeight, roadY + roadSchemHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -331,17 +366,15 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
y + min.getBlockY(),
|
y + min.getBlockY(),
|
||||||
z + min.getBlockZ()
|
z + min.getBlockZ()
|
||||||
));
|
));
|
||||||
if (!id.getBlockType().getMaterial().isAir()) {
|
schem3PopulationNeeded |= id.hasNbtData();
|
||||||
schem3PopulationNeeded |= id.hasNbtData();
|
addOverlayBlock(
|
||||||
addOverlayBlock(
|
(short) (x + shift + oddshift + centerShiftX),
|
||||||
(short) (x + shift + oddshift + centerShiftX),
|
(short) (y + plotY),
|
||||||
(short) (y + plotY),
|
(short) (z + shift + oddshift + centerShiftZ),
|
||||||
(short) (z + shift + oddshift + centerShiftZ),
|
id,
|
||||||
id,
|
false,
|
||||||
false,
|
maxSchematicHeight
|
||||||
h3
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (blockArrayClipboard3.hasBiomes()) {
|
if (blockArrayClipboard3.hasBiomes()) {
|
||||||
BiomeType biome = blockArrayClipboard3.getBiome(BlockVector2.at(
|
BiomeType biome = blockArrayClipboard3.getBiome(BlockVector2.at(
|
||||||
@ -391,18 +424,23 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
y + min.getBlockY(),
|
y + min.getBlockY(),
|
||||||
z + min.getBlockZ()
|
z + min.getBlockZ()
|
||||||
));
|
));
|
||||||
if (!id.getBlockType().getMaterial().isAir()) {
|
schem1PopulationNeeded |= id.hasNbtData();
|
||||||
schem1PopulationNeeded |= id.hasNbtData();
|
addOverlayBlock(
|
||||||
addOverlayBlock((short) (x - shift), (short) (y + roadY), (short) (z + shift + oddshift), id, false, h1);
|
(short) (x - shift),
|
||||||
addOverlayBlock(
|
(short) (y + roadY),
|
||||||
(short) (z + shift + oddshift),
|
(short) (z + shift + oddshift),
|
||||||
(short) (y + roadY),
|
id,
|
||||||
(short) (shift - x + (oddshift - 1)),
|
false,
|
||||||
id,
|
maxSchematicHeight
|
||||||
true,
|
);
|
||||||
h1
|
addOverlayBlock(
|
||||||
);
|
(short) (z + shift + oddshift),
|
||||||
}
|
(short) (y + roadY),
|
||||||
|
(short) (shift - x + (oddshift - 1)),
|
||||||
|
id,
|
||||||
|
true,
|
||||||
|
maxSchematicHeight
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (blockArrayClipboard1.hasBiomes()) {
|
if (blockArrayClipboard1.hasBiomes()) {
|
||||||
BiomeType biome = blockArrayClipboard1.getBiome(BlockVector2.at(x + min.getBlockX(), z + min.getBlockZ()));
|
BiomeType biome = blockArrayClipboard1.getBiome(BlockVector2.at(x + min.getBlockX(), z + min.getBlockZ()));
|
||||||
@ -430,10 +468,15 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
y + min.getBlockY(),
|
y + min.getBlockY(),
|
||||||
z + min.getBlockZ()
|
z + min.getBlockZ()
|
||||||
));
|
));
|
||||||
if (!id.getBlockType().getMaterial().isAir()) {
|
schem2PopulationNeeded |= id.hasNbtData();
|
||||||
schem2PopulationNeeded |= id.hasNbtData();
|
addOverlayBlock(
|
||||||
addOverlayBlock((short) (x - shift), (short) (y + roadY), (short) (z - shift), id, false, h2);
|
(short) (x - shift),
|
||||||
}
|
(short) (y + roadY),
|
||||||
|
(short) (z - shift),
|
||||||
|
id,
|
||||||
|
false,
|
||||||
|
maxSchematicHeight
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (blockArrayClipboard2.hasBiomes()) {
|
if (blockArrayClipboard2.hasBiomes()) {
|
||||||
BiomeType biome = blockArrayClipboard2.getBiome(BlockVector2.at(x + min.getBlockX(), z + min.getBlockZ()));
|
BiomeType biome = blockArrayClipboard2.getBiome(BlockVector2.at(x + min.getBlockX(), z + min.getBlockZ()));
|
||||||
@ -443,6 +486,10 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated This method should not be available for public API usage and will be made private.
|
||||||
|
*/
|
||||||
|
@Deprecated(forRemoval = true, since = "6.10.2")
|
||||||
public void addOverlayBlock(short x, short y, short z, BaseBlock id, boolean rotate, int height) {
|
public void addOverlayBlock(short x, short y, short z, BaseBlock id, boolean rotate, int height) {
|
||||||
if (z < 0) {
|
if (z < 0) {
|
||||||
z += this.SIZE;
|
z += this.SIZE;
|
||||||
@ -462,13 +509,22 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
if (y >= height) {
|
if (y >= height) {
|
||||||
if (y > lastOverlayHeightError) {
|
if (y > lastOverlayHeightError) {
|
||||||
lastOverlayHeightError = y;
|
lastOverlayHeightError = y;
|
||||||
LOGGER.error(String.format("Error adding overlay block. `y > height`. y=%s, height=%s", y, height));
|
LOGGER.error(
|
||||||
|
"Error adding overlay block in world {}. `y > height`. y={}, height={}",
|
||||||
|
getWorldName(),
|
||||||
|
y,
|
||||||
|
height
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
existing[y] = id;
|
existing[y] = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated This method should not be available for public API usage and will be made private.
|
||||||
|
*/
|
||||||
|
@Deprecated(forRemoval = true, since = "6.10.2")
|
||||||
public void addOverlayBiome(short x, short z, BiomeType id) {
|
public void addOverlayBiome(short x, short z, BiomeType id) {
|
||||||
if (z < 0) {
|
if (z < 0) {
|
||||||
z += this.SIZE;
|
z += this.SIZE;
|
||||||
|
@ -234,44 +234,52 @@ public class HybridUtils {
|
|||||||
Set<BlockType> types = new HashSet<>();
|
Set<BlockType> types = new HashSet<>();
|
||||||
for (int yIndex = 0; yIndex < height; yIndex++) {
|
for (int yIndex = 0; yIndex < height; yIndex++) {
|
||||||
BlockState old = oldBlocks[yIndex][x][z]; // Nullable
|
BlockState old = oldBlocks[yIndex][x][z]; // Nullable
|
||||||
try {
|
BlockState now = newBlocks[yIndex][x][z]; // Not null
|
||||||
BlockState now = newBlocks[yIndex][x][z]; // Not null
|
if (now == null) {
|
||||||
if (!now.equals(old) && !(old == null && now.getBlockType().equals(BlockTypes.AIR))) {
|
throw new NullPointerException(String.format(
|
||||||
changes[i]++;
|
"\"now\" block null attempting to perform plot analysis. Indexes: x=%d of %d, yIndex=%d" +
|
||||||
}
|
" of %d, z=%d of %d",
|
||||||
if (now.getBlockType().getMaterial().isAir()) {
|
x,
|
||||||
air[i]++;
|
width,
|
||||||
} else {
|
yIndex,
|
||||||
// check vertices
|
height,
|
||||||
// modifications_adjacent
|
z,
|
||||||
if (x > 0 && z > 0 && yIndex > 0 && x < width - 1 && z < length - 1 && yIndex < (height - 1)) {
|
length
|
||||||
if (newBlocks[yIndex - 1][x][z].getBlockType().getMaterial().isAir()) {
|
));
|
||||||
faces[i]++;
|
}
|
||||||
}
|
if (!now.equals(old) && !(old == null && now.getBlockType().equals(BlockTypes.AIR))) {
|
||||||
if (newBlocks[yIndex][x - 1][z].getBlockType().getMaterial().isAir()) {
|
changes[i]++;
|
||||||
faces[i]++;
|
}
|
||||||
}
|
if (now.getBlockType().getMaterial().isAir()) {
|
||||||
if (newBlocks[yIndex][x][z - 1].getBlockType().getMaterial().isAir()) {
|
air[i]++;
|
||||||
faces[i]++;
|
} else {
|
||||||
}
|
// check vertices
|
||||||
if (newBlocks[yIndex + 1][x][z].getBlockType().getMaterial().isAir()) {
|
// modifications_adjacent
|
||||||
faces[i]++;
|
if (x > 0 && z > 0 && yIndex > 0 && x < width - 1 && z < length - 1 && yIndex < (height - 1)) {
|
||||||
}
|
if (newBlocks[yIndex - 1][x][z].getBlockType().getMaterial().isAir()) {
|
||||||
if (newBlocks[yIndex][x + 1][z].getBlockType().getMaterial().isAir()) {
|
faces[i]++;
|
||||||
faces[i]++;
|
|
||||||
}
|
|
||||||
if (newBlocks[yIndex][x][z + 1].getBlockType().getMaterial().isAir()) {
|
|
||||||
faces[i]++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (newBlocks[yIndex][x - 1][z].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex][x][z - 1].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex + 1][x][z].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex][x + 1][z].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex][x][z + 1].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!now.equals(now.getBlockType().getDefaultState())) {
|
if (!now.equals(now.getBlockType().getDefaultState())) {
|
||||||
data[i]++;
|
data[i]++;
|
||||||
}
|
|
||||||
types.add(now.getBlockType());
|
|
||||||
}
|
}
|
||||||
} catch (NullPointerException e) {
|
types.add(now.getBlockType());
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
variety[i] = types.size();
|
variety[i] = types.size();
|
||||||
|
@ -114,26 +114,14 @@ public abstract class SquarePlotManager extends GridPlotManager {
|
|||||||
end = pathWidthLower + squarePlotWorld.PLOT_WIDTH;
|
end = pathWidthLower + squarePlotWorld.PLOT_WIDTH;
|
||||||
}
|
}
|
||||||
int size = squarePlotWorld.PLOT_WIDTH + squarePlotWorld.ROAD_WIDTH;
|
int size = squarePlotWorld.PLOT_WIDTH + squarePlotWorld.ROAD_WIDTH;
|
||||||
int idx;
|
int dx = Math.floorDiv(x, size) + 1;
|
||||||
if (x < 0) {
|
int rx = Math.floorMod(x, size);
|
||||||
idx = x / size;
|
int dz = Math.floorDiv(z, size) + 1;
|
||||||
x = size + (x % size);
|
int rz = Math.floorMod(z, size);
|
||||||
} else {
|
if (rz <= pathWidthLower || rz > end || rx <= pathWidthLower || rx > end) {
|
||||||
idx = (x / size) + 1;
|
|
||||||
x = x % size;
|
|
||||||
}
|
|
||||||
int idz;
|
|
||||||
if (z < 0) {
|
|
||||||
idz = z / size;
|
|
||||||
z = size + (z % size);
|
|
||||||
} else {
|
|
||||||
idz = (z / size) + 1;
|
|
||||||
z = z % size;
|
|
||||||
}
|
|
||||||
if (z <= pathWidthLower || z > end || x <= pathWidthLower || x > end) {
|
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return PlotId.of(idx, idz);
|
return PlotId.of(dx, dz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,24 +168,10 @@ public abstract class SquarePlotManager extends GridPlotManager {
|
|||||||
}
|
}
|
||||||
end = pathWidthLower + squarePlotWorld.PLOT_WIDTH;
|
end = pathWidthLower + squarePlotWorld.PLOT_WIDTH;
|
||||||
}
|
}
|
||||||
int dx;
|
int dx = Math.floorDiv(x, size) + 1;
|
||||||
int rx;
|
int rx = Math.floorMod(x, size);
|
||||||
if (x < 0) {
|
int dz = Math.floorDiv(z, size) + 1;
|
||||||
dx = x / size;
|
int rz = Math.floorMod(z, size);
|
||||||
rx = size + (x % size);
|
|
||||||
} else {
|
|
||||||
dx = (x / size) + 1;
|
|
||||||
rx = x % size;
|
|
||||||
}
|
|
||||||
int dz;
|
|
||||||
int rz;
|
|
||||||
if (z < 0) {
|
|
||||||
dz = z / size;
|
|
||||||
rz = size + (z % size);
|
|
||||||
} else {
|
|
||||||
dz = (z / size) + 1;
|
|
||||||
rz = z % size;
|
|
||||||
}
|
|
||||||
PlotId id = PlotId.of(dx, dz);
|
PlotId id = PlotId.of(dx, dz);
|
||||||
boolean[] merged = new boolean[]{rz <= pathWidthLower, rx > end, rz > end, rx <= pathWidthLower};
|
boolean[] merged = new boolean[]{rz <= pathWidthLower, rx > end, rz > end, rx <= pathWidthLower};
|
||||||
int hash = HashUtil.hash(merged);
|
int hash = HashUtil.hash(merged);
|
||||||
|
@ -36,7 +36,6 @@ import com.plotsquared.core.plot.PlotArea;
|
|||||||
import com.plotsquared.core.plot.PlotTitle;
|
import com.plotsquared.core.plot.PlotTitle;
|
||||||
import com.plotsquared.core.plot.PlotWeather;
|
import com.plotsquared.core.plot.PlotWeather;
|
||||||
import com.plotsquared.core.plot.comment.CommentManager;
|
import com.plotsquared.core.plot.comment.CommentManager;
|
||||||
import com.plotsquared.core.plot.expiration.ExpireManager;
|
|
||||||
import com.plotsquared.core.plot.flag.GlobalFlagContainer;
|
import com.plotsquared.core.plot.flag.GlobalFlagContainer;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
import com.plotsquared.core.plot.flag.implementations.DenyExitFlag;
|
import com.plotsquared.core.plot.flag.implementations.DenyExitFlag;
|
||||||
@ -57,7 +56,6 @@ import com.plotsquared.core.plot.flag.implementations.TitlesFlag;
|
|||||||
import com.plotsquared.core.plot.flag.implementations.WeatherFlag;
|
import com.plotsquared.core.plot.flag.implementations.WeatherFlag;
|
||||||
import com.plotsquared.core.plot.flag.types.TimedFlag;
|
import com.plotsquared.core.plot.flag.types.TimedFlag;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.PlayerManager;
|
import com.plotsquared.core.util.PlayerManager;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import com.plotsquared.core.util.task.TaskTime;
|
import com.plotsquared.core.util.task.TaskTime;
|
||||||
@ -67,10 +65,13 @@ import com.sk89q.worldedit.world.item.ItemType;
|
|||||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -82,6 +83,7 @@ public class PlotListener {
|
|||||||
|
|
||||||
private final HashMap<UUID, Interval> feedRunnable = new HashMap<>();
|
private final HashMap<UUID, Interval> feedRunnable = new HashMap<>();
|
||||||
private final HashMap<UUID, Interval> healRunnable = new HashMap<>();
|
private final HashMap<UUID, Interval> healRunnable = new HashMap<>();
|
||||||
|
private final Map<UUID, List<StatusEffect>> playerEffects = new HashMap<>();
|
||||||
|
|
||||||
private final EventDispatcher eventDispatcher;
|
private final EventDispatcher eventDispatcher;
|
||||||
|
|
||||||
@ -131,12 +133,22 @@ public class PlotListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!playerEffects.isEmpty()) {
|
||||||
|
long currentTime = System.currentTimeMillis();
|
||||||
|
for (Iterator<Map.Entry<UUID, List<StatusEffect>>> iterator =
|
||||||
|
playerEffects.entrySet().iterator(); iterator.hasNext(); ) {
|
||||||
|
Map.Entry<UUID, List<StatusEffect>> entry = iterator.next();
|
||||||
|
List<StatusEffect> effects = entry.getValue();
|
||||||
|
effects.removeIf(effect -> currentTime > effect.expiresAt);
|
||||||
|
if (effects.isEmpty()) iterator.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
}, TaskTime.seconds(1L));
|
}, TaskTime.seconds(1L));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean plotEntry(final PlotPlayer<?> player, final Plot plot) {
|
public boolean plotEntry(final PlotPlayer<?> player, final Plot plot) {
|
||||||
if (plot.isDenied(player.getUUID()) && !Permissions
|
if (plot.isDenied(player.getUUID()) && !player.hasPermission("plots.admin.entry.denied")) {
|
||||||
.hasPermission(player, "plots.admin.entry.denied")) {
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("deny.no_enter"),
|
TranslatableCaption.of("deny.no_enter"),
|
||||||
Template.of("plot", plot.toString())
|
Template.of("plot", plot.toString())
|
||||||
@ -148,8 +160,8 @@ public class PlotListener {
|
|||||||
if ((last != null) && !last.getId().equals(plot.getId())) {
|
if ((last != null) && !last.getId().equals(plot.getId())) {
|
||||||
plotExit(player, last);
|
plotExit(player, last);
|
||||||
}
|
}
|
||||||
if (ExpireManager.IMP != null) {
|
if (PlotSquared.platform().expireManager() != null) {
|
||||||
ExpireManager.IMP.handleEntry(player, plot);
|
PlotSquared.platform().expireManager().handleEntry(player, plot);
|
||||||
}
|
}
|
||||||
lastPlot.set(plot);
|
lastPlot.set(plot);
|
||||||
}
|
}
|
||||||
@ -174,7 +186,7 @@ public class PlotListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (plot.getFlag(NotifyEnterFlag.class)) {
|
if (plot.getFlag(NotifyEnterFlag.class)) {
|
||||||
if (!Permissions.hasPermission(player, "plots.flag.notify-enter.bypass")) {
|
if (!player.hasPermission("plots.flag.notify-enter.bypass")) {
|
||||||
for (UUID uuid : plot.getOwners()) {
|
for (UUID uuid : plot.getOwners()) {
|
||||||
final PlotPlayer<?> owner = PlotSquared.platform().playerManager().getPlayerIfExists(uuid);
|
final PlotPlayer<?> owner = PlotSquared.platform().playerManager().getPlayerIfExists(uuid);
|
||||||
if (owner != null && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) {
|
if (owner != null && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) {
|
||||||
@ -186,7 +198,7 @@ public class PlotListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final FlyFlag.FlyStatus flyStatus = plot.getFlag(FlyFlag.class);
|
final FlyFlag.FlyStatus flyStatus = plot.getFlag(FlyFlag.class);
|
||||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_FLIGHT)) {
|
if (!player.hasPermission(Permission.PERMISSION_ADMIN_FLIGHT)) {
|
||||||
if (flyStatus != FlyFlag.FlyStatus.DEFAULT) {
|
if (flyStatus != FlyFlag.FlyStatus.DEFAULT) {
|
||||||
boolean flight = player.getFlight();
|
boolean flight = player.getFlight();
|
||||||
GameMode gamemode = player.getGameMode();
|
GameMode gamemode = player.getGameMode();
|
||||||
@ -202,7 +214,7 @@ public class PlotListener {
|
|||||||
final GameMode gameMode = plot.getFlag(GamemodeFlag.class);
|
final GameMode gameMode = plot.getFlag(GamemodeFlag.class);
|
||||||
if (!gameMode.equals(GamemodeFlag.DEFAULT)) {
|
if (!gameMode.equals(GamemodeFlag.DEFAULT)) {
|
||||||
if (player.getGameMode() != gameMode) {
|
if (player.getGameMode() != gameMode) {
|
||||||
if (!Permissions.hasPermission(player, "plots.gamemode.bypass")) {
|
if (!player.hasPermission("plots.gamemode.bypass")) {
|
||||||
player.setGameMode(gameMode);
|
player.setGameMode(gameMode);
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
@ -217,7 +229,7 @@ public class PlotListener {
|
|||||||
final GameMode guestGameMode = plot.getFlag(GuestGamemodeFlag.class);
|
final GameMode guestGameMode = plot.getFlag(GuestGamemodeFlag.class);
|
||||||
if (!guestGameMode.equals(GamemodeFlag.DEFAULT)) {
|
if (!guestGameMode.equals(GamemodeFlag.DEFAULT)) {
|
||||||
if (player.getGameMode() != guestGameMode && !plot.isAdded(player.getUUID())) {
|
if (player.getGameMode() != guestGameMode && !plot.isAdded(player.getUUID())) {
|
||||||
if (!Permissions.hasPermission(player, "plots.gamemode.bypass")) {
|
if (!player.hasPermission("plots.gamemode.bypass")) {
|
||||||
player.setGameMode(guestGameMode);
|
player.setGameMode(guestGameMode);
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
@ -360,6 +372,17 @@ public class PlotListener {
|
|||||||
try (final MetaDataAccess<Plot> lastPlot = player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_LAST_PLOT)) {
|
try (final MetaDataAccess<Plot> lastPlot = player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_LAST_PLOT)) {
|
||||||
final Plot previous = lastPlot.remove();
|
final Plot previous = lastPlot.remove();
|
||||||
this.eventDispatcher.callLeave(player, plot);
|
this.eventDispatcher.callLeave(player, plot);
|
||||||
|
|
||||||
|
List<StatusEffect> effects = playerEffects.remove(player.getUUID());
|
||||||
|
if (effects != null) {
|
||||||
|
long currentTime = System.currentTimeMillis();
|
||||||
|
effects.forEach(effect -> {
|
||||||
|
if (currentTime <= effect.expiresAt) {
|
||||||
|
player.removeEffect(effect.name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (plot.hasOwner()) {
|
if (plot.hasOwner()) {
|
||||||
PlotArea pw = plot.getArea();
|
PlotArea pw = plot.getArea();
|
||||||
if (pw == null) {
|
if (pw == null) {
|
||||||
@ -367,8 +390,7 @@ public class PlotListener {
|
|||||||
}
|
}
|
||||||
try (final MetaDataAccess<Boolean> kickAccess =
|
try (final MetaDataAccess<Boolean> kickAccess =
|
||||||
player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_KICK)) {
|
player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_KICK)) {
|
||||||
if (plot.getFlag(DenyExitFlag.class) && !Permissions
|
if (plot.getFlag(DenyExitFlag.class) && !player.hasPermission(Permission.PERMISSION_ADMIN_EXIT_DENIED) &&
|
||||||
.hasPermission(player, Permission.PERMISSION_ADMIN_EXIT_DENIED) &&
|
|
||||||
!kickAccess.get().orElse(false)) {
|
!kickAccess.get().orElse(false)) {
|
||||||
if (previous != null) {
|
if (previous != null) {
|
||||||
lastPlot.set(previous);
|
lastPlot.set(previous);
|
||||||
@ -379,7 +401,7 @@ public class PlotListener {
|
|||||||
if (!plot.getFlag(GamemodeFlag.class).equals(GamemodeFlag.DEFAULT) || !plot
|
if (!plot.getFlag(GamemodeFlag.class).equals(GamemodeFlag.DEFAULT) || !plot
|
||||||
.getFlag(GuestGamemodeFlag.class).equals(GamemodeFlag.DEFAULT)) {
|
.getFlag(GuestGamemodeFlag.class).equals(GamemodeFlag.DEFAULT)) {
|
||||||
if (player.getGameMode() != pw.getGameMode()) {
|
if (player.getGameMode() != pw.getGameMode()) {
|
||||||
if (!Permissions.hasPermission(player, "plots.gamemode.bypass")) {
|
if (!player.hasPermission("plots.gamemode.bypass")) {
|
||||||
player.setGameMode(pw.getGameMode());
|
player.setGameMode(pw.getGameMode());
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
@ -401,7 +423,7 @@ public class PlotListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (plot.getFlag(NotifyLeaveFlag.class)) {
|
if (plot.getFlag(NotifyLeaveFlag.class)) {
|
||||||
if (!Permissions.hasPermission(player, "plots.flag.notify-leave.bypass")) {
|
if (!player.hasPermission("plots.flag.notify-leave.bypass")) {
|
||||||
for (UUID uuid : plot.getOwners()) {
|
for (UUID uuid : plot.getOwners()) {
|
||||||
final PlotPlayer<?> owner = PlotSquared.platform().playerManager().getPlayerIfExists(uuid);
|
final PlotPlayer<?> owner = PlotSquared.platform().playerManager().getPlayerIfExists(uuid);
|
||||||
if ((owner != null) && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) {
|
if ((owner != null) && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) {
|
||||||
@ -468,6 +490,23 @@ public class PlotListener {
|
|||||||
public void logout(UUID uuid) {
|
public void logout(UUID uuid) {
|
||||||
feedRunnable.remove(uuid);
|
feedRunnable.remove(uuid);
|
||||||
healRunnable.remove(uuid);
|
healRunnable.remove(uuid);
|
||||||
|
playerEffects.remove(uuid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marks an effect as a status effect that will be removed on leaving a plot
|
||||||
|
* @param uuid The uuid of the player the effect belongs to
|
||||||
|
* @param name The name of the status effect
|
||||||
|
* @param expiresAt The time when the effect expires
|
||||||
|
* @since 6.10.0
|
||||||
|
*/
|
||||||
|
public void addEffect(@NonNull UUID uuid, @NonNull String name, long expiresAt) {
|
||||||
|
List<StatusEffect> effects = playerEffects.getOrDefault(uuid, new ArrayList<>());
|
||||||
|
effects.removeIf(effect -> effect.name.equals(name));
|
||||||
|
if (expiresAt != -1) {
|
||||||
|
effects.add(new StatusEffect(name, expiresAt));
|
||||||
|
}
|
||||||
|
playerEffects.put(uuid, effects);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Interval {
|
private static class Interval {
|
||||||
@ -485,4 +524,13 @@ public class PlotListener {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private record StatusEffect(@NonNull String name, long expiresAt) {
|
||||||
|
|
||||||
|
private StatusEffect(@NonNull String name, long expiresAt) {
|
||||||
|
this.name = name;
|
||||||
|
this.expiresAt = expiresAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,6 @@ import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.Permissions;
|
|
||||||
import com.plotsquared.core.util.WEManager;
|
import com.plotsquared.core.util.WEManager;
|
||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
import com.sk89q.worldedit.EditSession;
|
import com.sk89q.worldedit.EditSession;
|
||||||
@ -92,7 +91,7 @@ public class WESubscriber {
|
|||||||
} else {
|
} else {
|
||||||
mask = WEManager.getMask(plotPlayer);
|
mask = WEManager.getMask(plotPlayer);
|
||||||
if (mask.isEmpty()) {
|
if (mask.isEmpty()) {
|
||||||
if (Permissions.hasPermission(plotPlayer, "plots.worldedit.bypass")) {
|
if (plotPlayer.hasPermission("plots.worldedit.bypass")) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("worldedit.worldedit_bypass"),
|
TranslatableCaption.of("worldedit.worldedit_bypass"),
|
||||||
Template.of("command", "/plot toggle worldedit")
|
Template.of("command", "/plot toggle worldedit")
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user