Fixed stuff that I edited remotely.

This commit is contained in:
Norbi Peti 2016-04-08 22:13:32 +02:00
parent 06811735e9
commit 72798b8b7c
5 changed files with 801 additions and 500 deletions

View file

@ -1,11 +1,295 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block=next_line
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
org.eclipse.jdt.core.formatter.comment.line_length=80
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_empty_lines=false
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.lineSplit=80
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true

View file

@ -1,8 +1,8 @@
name: VirtualComputer name: VirtualComputer
main: sznp.virtualcomputer.PluginMain main: sznp.virtualcomputer.PluginMain
version: 1.0 version: 1.1
commands: commands:
computer: computer:
usage: Use /computer start|stop usage: Use /computer start|stop
alias: c alias: c
softdepend: [Movecraft] softdepend: [Movecraft]

View file

@ -1,193 +1,201 @@
package sznp.virtualcomputer; package sznp.virtualcomputer;
import net.countercraft.movecraft.craft.Craft; import net.countercraft.movecraft.craft.Craft;
import net.countercraft.movecraft.craft.CraftManager; import net.countercraft.movecraft.craft.CraftManager;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
public class Commands implements CommandExecutor public class Commands implements CommandExecutor
{ {
@Override @Override
public boolean onCommand(CommandSender sender, Command cmd, String label, public boolean onCommand(CommandSender sender, Command cmd, String label,
String[] args) String[] args)
{ {
switch (cmd.getName().toLowerCase()) switch (cmd.getName().toLowerCase())
{ {
case "computer": case "computer":
{ {
if (args.length == 0) if (args.length == 0)
return false; return false;
switch (args[0].toLowerCase()) switch (args[0].toLowerCase())
{ {
case "start": case "start":
PluginMain.getPlugin(PluginMain.class).Start(sender); PluginMain.getPlugin(PluginMain.class).Start(sender);
break; break;
case "stop": case "stop":
PluginMain.getPlugin(PluginMain.class).Stop(sender); PluginMain.getPlugin(PluginMain.class).Stop(sender);
break; break;
case "debug": case "debug":
World w = Bukkit.getWorlds().get(0); World w = Bukkit.getWorlds().get(0);
Craft[] crafts = CraftManager.getInstance().getCraftsInWorld(w); Craft[] crafts = CraftManager.getInstance().getCraftsInWorld(w);
sender.sendMessage("World: " + w); sender.sendMessage("World: " + w);
sender.sendMessage("Crafts: " + crafts); sender.sendMessage("Crafts: " + crafts);
sender.sendMessage("Craft type: " sender.sendMessage("Craft type: "
+ crafts[0].getType().getCraftName()); + crafts[0].getType().getCraftName());
sender.sendMessage("DX: " + crafts[0].getLastDX()); sender.sendMessage("DX: " + crafts[0].getLastDX());
sender.sendMessage("DY: " + crafts[0].getLastDY()); sender.sendMessage("DY: " + crafts[0].getLastDY());
sender.sendMessage("DZ: " + crafts[0].getLastDZ()); sender.sendMessage("DZ: " + crafts[0].getLastDZ());
sender.sendMessage("MouseSpeed: " + PluginMain.MouseSpeed); sender.sendMessage("MouseSpeed: " + PluginMain.MouseSpeed);
sender.sendMessage("Block: " sender.sendMessage("Block: "
+ Bukkit.getWorlds() + Bukkit.getWorlds()
.get(0) .get(0)
.getBlockAt(crafts[0].getMinX(), .getBlockAt(crafts[0].getMinX(),
crafts[0].getMinY() - 1, crafts[0].getMinY() - 1,
crafts[0].getMinZ()).getType()); //Block: AIR crafts[0].getMinZ()).getType()); // Block:
break; // AIR
case "powerbutton": break;
PluginMain.getPlugin(PluginMain.class).PowerButton(sender); case "powerbutton":
break; PluginMain.getPlugin(PluginMain.class).PowerButton(sender);
case "reset": break;
PluginMain.getPlugin(PluginMain.class).Reset(sender); case "reset":
break; PluginMain.getPlugin(PluginMain.class).Reset(sender);
case "fix": break;
PluginMain.getPlugin(PluginMain.class).FixScreen(sender); case "fix":
break; PluginMain.getPlugin(PluginMain.class).FixScreen(sender);
case "key": break;
if (args.length < 2) case "key":
{ if (args.length < 2)
sender.sendMessage("§cUsage: /computer key <key> [down/up|interval]"); {
return true; sender.sendMessage("§cUsage: /computer key <key> [down/up|interval]");
} return true;
if (args.length < 3) }
PluginMain.getPlugin(PluginMain.class).PressKey(sender, if (args.length < 3)
args[1], ""); PluginMain.getPlugin(PluginMain.class).PressKey(sender,
else args[1], "");
PluginMain.getPlugin(PluginMain.class).PressKey(sender, else
args[1], args[2]); PluginMain.getPlugin(PluginMain.class).PressKey(sender,
break; args[1], args[2]);
case "mouse": break;
boolean showusage = true; case "mouse":
if (args.length < 6) boolean showusage = true;
{ if (args.length < 6)
//Command overloading, because I can :P {
if (args.length > 4) // 4<x<6 // Command overloading, because I can :P
{ if (args.length > 4) // 4<x<6
PluginMain.getPlugin(PluginMain.class).UpdateMouse( {
sender, Integer.parseInt(args[1]), PluginMain.getPlugin(PluginMain.class).UpdateMouse(
Integer.parseInt(args[2]), sender, Integer.parseInt(args[1]),
Integer.parseInt(args[3]), Integer.parseInt(args[2]),
Integer.parseInt(args[4]), "", false); Integer.parseInt(args[3]),
showusage = false; Integer.parseInt(args[4]), "", false);
} else showusage = false;
{ } else
if (args.length == 3) {
{ if (args.length == 3)
PluginMain.getPlugin(PluginMain.class).UpdateMouse( {
sender, 0, 0, 0, 0, PluginMain.getPlugin(PluginMain.class).UpdateMouse(
args[1], (args[2].equals("down"))); sender, 0, 0, 0, 0, args[1],
showusage = false; (args[2].equals("down")));
} else if (args.length == 2) showusage = false;
{ } else if (args.length == 2)
PluginMain.getPlugin(PluginMain.class).UpdateMouse( {
sender, 0, 0, 0, 0, PluginMain.getPlugin(PluginMain.class).UpdateMouse(
args[1]); sender, 0, 0, 0, 0, args[1]);
showusage = false; showusage = false;
} }
} }
} }
if (showusage) if (showusage)
{ {
sender.sendMessage("§cUsage: /computer mouse <relx> <rely> <relz> <relw>"); sender.sendMessage("§cUsage: /computer mouse <relx> <rely> <relz> <relw>");
sender.sendMessage("§cOr: /computer mouse <button> [up/down]"); sender.sendMessage("§cOr: /computer mouse <button> [up/down]");
} }
break; break;
case "mspeed": case "mspeed":
if (args.length < 2) if (args.length < 2)
{ {
sender.sendMessage("§cUsage: /computer mspeed <speed>"); sender.sendMessage("§cUsage: /computer mspeed <speed>");
return true; return true;
} }
PluginMain.MouseSpeed = Integer.parseInt(args[1]); PluginMain.MouseSpeed = Integer.parseInt(args[1]);
sender.sendMessage("Mouse speed set to " + args[1]); sender.sendMessage("Mouse speed set to " + args[1]);
break; break;
case "input": case "input":
{ {
if (!(sender instanceof Player)) if (!(sender instanceof Player))
{ {
sender.sendMessage("§cError: Only players can use this command."); sender.sendMessage("§cError: Only players can use this command.");
return true; return true;
} }
if (args.length < 2) if (args.length < 2)
{ {
sender.sendMessage("§cUsage: /computer input <key|mouse>"); sender.sendMessage("§cUsage: /computer input <key|mouse>");
return true; return true;
} }
if (args[1].equalsIgnoreCase("key")) if (args[1].equalsIgnoreCase("key"))
{ {
Bukkit.getServer() Bukkit.getServer()
.dispatchCommand( .dispatchCommand(
Bukkit.getConsoleSender(), Bukkit.getConsoleSender(),
"tellraw " "tellraw "
+ sender.getName() + sender.getName()
+ " [\"\",{\"text\":\" [0]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D0\"}},{\"text\":\" [1]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D1\"}},{\"text\":\" [2]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D2\"}},{\"text\":\" [3]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D3\"}},{\"text\":\" [4]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D4\"}},{\"text\":\" [5]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D5\"}},{\"text\":\" [6]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D6\"}},{\"text\":\" [7]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D7\"}},{\"text\":\" [8]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D8\"}},{\"text\":\" [9]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D9\"}}]"); + " [\"\",{\"text\":\" [0]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D0\"}},{\"text\":\" [1]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D1\"}},{\"text\":\" [2]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D2\"}},{\"text\":\" [3]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D3\"}},{\"text\":\" [4]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D4\"}},{\"text\":\" [5]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D5\"}},{\"text\":\" [6]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D6\"}},{\"text\":\" [7]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D7\"}},{\"text\":\" [8]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D8\"}},{\"text\":\" [9]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D9\"}}]");
Bukkit.getServer() Bukkit.getServer()
.dispatchCommand( .dispatchCommand(
Bukkit.getConsoleSender(), Bukkit.getConsoleSender(),
"tellraw " "tellraw "
+ sender.getName() + sender.getName()
+ " [\"\",{\"text\":\" [Tab]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key Tab\"}},{\"text\":\" [Q]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key Q\"}},{\"text\":\" [W]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key W\"}},{\"text\":\" [E]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key E\"}},{\"text\":\" [R]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key R\"}},{\"text\":\" [T]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key T\"}},{\"text\":\" [Y]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key Y\"}},{\"text\":\" [U]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key U\"}},{\"text\":\" [I]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key I\"}},{\"text\":\" [O]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key O\"}},{\"text\":\" [P]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key P\"}}]"); + " [\"\",{\"text\":\" [Tab]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key Tab\"}},{\"text\":\" [Q]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key Q\"}},{\"text\":\" [W]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key W\"}},{\"text\":\" [E]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key E\"}},{\"text\":\" [R]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key R\"}},{\"text\":\" [T]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key T\"}},{\"text\":\" [Y]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key Y\"}},{\"text\":\" [U]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key U\"}},{\"text\":\" [I]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key I\"}},{\"text\":\" [O]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key O\"}},{\"text\":\" [P]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key P\"}}]");
Bukkit.getServer() Bukkit.getServer()
.dispatchCommand( .dispatchCommand(
Bukkit.getConsoleSender(), Bukkit.getConsoleSender(),
"tellraw " "tellraw "
+ sender.getName() + sender.getName()
+ " [\"\",{\"text\":\" [CapsLock]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key CapsLock\"}},{\"text\":\" [A]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key A\"}},{\"text\":\" [S]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key S\"}},{\"text\":\" [D]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D\"}},{\"text\":\" [F]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key F\"}},{\"text\":\" [G]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key G\"}},{\"text\":\" [H]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key H\"}},{\"text\":\" [J]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key J\"}},{\"text\":\" [K]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key K\"}},{\"text\":\" [L]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key L\"}},{\"text\":\" [Return]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key Return\"}}]"); + " [\"\",{\"text\":\" [CapsLock]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key CapsLock\"}},{\"text\":\" [A]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key A\"}},{\"text\":\" [S]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key S\"}},{\"text\":\" [D]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key D\"}},{\"text\":\" [F]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key F\"}},{\"text\":\" [G]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key G\"}},{\"text\":\" [H]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key H\"}},{\"text\":\" [J]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key J\"}},{\"text\":\" [K]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key K\"}},{\"text\":\" [L]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key L\"}},{\"text\":\" [Return]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key Return\"}}]");
Bukkit.getServer() Bukkit.getServer()
.dispatchCommand( .dispatchCommand(
Bukkit.getConsoleSender(), Bukkit.getConsoleSender(),
"tellraw " "tellraw "
+ sender.getName() + sender.getName()
+ " [\"\",{\"text\":\" [Z]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key Z\"}},{\"text\":\" [X]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key X\"}},{\"text\":\" [C]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key C\"}},{\"text\":\" [V]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key V\"}},{\"text\":\" [B]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key B\"}},{\"text\":\" [N]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key N\"}},{\"text\":\" [M]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key M\"}}]"); + " [\"\",{\"text\":\" [Z]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key Z\"}},{\"text\":\" [X]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key X\"}},{\"text\":\" [C]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key C\"}},{\"text\":\" [V]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key V\"}},{\"text\":\" [B]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key B\"}},{\"text\":\" [N]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key N\"}},{\"text\":\" [M]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key M\"}}]");
Bukkit.getServer() Bukkit.getServer()
.dispatchCommand( .dispatchCommand(
Bukkit.getConsoleSender(), Bukkit.getConsoleSender(),
"tellraw " "tellraw "
+ sender.getName() + sender.getName()
+ " [\"\",{\"text\":\" [Ctrl]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key ControlLeft\"}},{\"text\":\" [Alt]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key AltLeft\"}},{\"text\":\" [Space]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key Space\"}},{\"text\":\" [AltGr]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key AltRight\"}},{\"text\":\" [Ctrl]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key ControlRight\"}}]"); + " [\"\",{\"text\":\" [Ctrl]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key ControlLeft\"}},{\"text\":\" [Alt]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key AltLeft\"}},{\"text\":\" [Space]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key Space\"}},{\"text\":\" [AltGr]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key AltRight\"}},{\"text\":\" [Ctrl]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/computer key ControlRight\"}}]");
} else if (args[1].equalsIgnoreCase("mouse")) } else if (args[1].equalsIgnoreCase("mouse"))
{ {
if (!MouseLockerPlayerListener.LockedPlayers.contains(e.getPlayer())) if (!(sender instanceof Player))
{ {
MouseLockerPlayerListener.LockedPlayers.add(e.getPlayer()); sender.sendMessage("§cOnly ingame players can use this command.");
sender.sendMessage("§aMouse locked."); return true;
} }
else if (!MouseLockerPlayerListener.LockedPlayers
{ .contains(sender))
MouseLockedPlayerListener.LockedPlayers.remove(e.getPlayer()); {
sender.sendMessage("§bMouse unlocked."); MouseLockerPlayerListener.LockedPlayers
} .add((Player) sender);
} else if (args[1].equalsIgnoreCase("mspeed")) sender.sendMessage("§aMouse locked.");
{ } else
if(args.length<3) {
{ MouseLockerPlayerListener.LockedPlayers.remove(sender);
sender.sendMessage("§cUsage: /computer input mspeed <integer>"); sender.sendMessage("§bMouse unlocked.");
return; }
} } else if (args[1].equalsIgnoreCase("mspeed"))
MouseLockerPlayerListener.LockedSpeed=Integer.parseInt(args[2]); {
sender.sendMessage("§aMouse speed set to "+MouseLockerPlayerListener.LockedSpeed); if (args.length < 3)
} {
break; sender.sendMessage("§cUsage: /computer input mspeed <integer>");
} return true;
} }
return true; MouseLockerPlayerListener.LockedSpeed = Float
} .parseFloat(args[2]);
} sender.sendMessage("§aMouse speed set to "
return false; + MouseLockerPlayerListener.LockedSpeed);
} }
} break;
}
}
return true;
}
}
return false;
}
}

View file

@ -1,27 +1,34 @@
package sznp.virtualcomputer; package sznp.virtualcomputer;
import org.bukkit.event.EventHandler; import java.util.ArrayList;
import org.bukkit.event.Listener; import java.util.List;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.entity.Player;
public class MouseLockerPlayerListener implements Listener import org.bukkit.event.EventHandler;
{ import org.bukkit.event.Listener;
public static List<Player> LockedPlayers = new List<Player>(); import org.bukkit.event.player.PlayerMoveEvent;
public static int LockedSpeed=1;
public class MouseLockerPlayerListener implements Listener
@EventHandler {
public void onPlayerMoveMouse(PlayerMoveEvent e) public static List<Player> LockedPlayers = new ArrayList<Player>();
{ public static float LockedSpeed = 1;
if (!LockedPlayers.contains(e.getPlayer())
return; @EventHandler
float yaw1 = e.getFrom().getYaw(); public void onPlayerMoveMouse(PlayerMoveEvent e)
float pitch1 = e.getFrom().getPitch(); {
float yaw2 = e.getTo().getYaw(); if (!LockedPlayers.contains(e.getPlayer()))
float pitch2 = e.getTo().getPitch(); return;
float yaw1 = e.getFrom().getYaw();
PluginMain.Instance.UpdateMouse(null, (int) ((yaw2 - yaw1)*LockedSpeed), float pitch1 = e.getFrom().getPitch();
(int) ((pitch2 - pitch1)*LockedSpeed), 0, 0, ""); float yaw2 = e.getTo().getYaw();
float pitch2 = e.getTo().getPitch();
e.setTo(e.getFrom()); if (yaw2 - yaw1 == 0 || pitch2 - pitch1 == 0)
} return;
}
PluginMain.Instance.UpdateMouse(null,
(int) ((yaw2 - yaw1) * LockedSpeed),
(int) ((pitch2 - pitch1) * LockedSpeed), 0, 0, "");
e.setTo(e.getFrom());
}
}

View file

@ -1,261 +1,263 @@
package sznp.virtualcomputer; package sznp.virtualcomputer;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.awt.image.DataBufferInt; import java.awt.image.DataBufferInt;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.net.URL; import java.net.URL;
import java.net.URLClassLoader; import java.net.URLClassLoader;
import java.util.HashMap; import java.util.HashMap;
import net.countercraft.movecraft.craft.Craft; import net.countercraft.movecraft.craft.Craft;
import net.countercraft.movecraft.craft.CraftManager; import net.countercraft.movecraft.craft.CraftManager;
import net.sf.jni4net.Bridge; import net.sf.jni4net.Bridge;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender; import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import virtualcomputersender.Computer; import virtualcomputersender.Computer;
import com.mcplugindev.slipswhitley.sketchmap.map.RelativeLocation; import com.mcplugindev.slipswhitley.sketchmap.map.RelativeLocation;
import com.mcplugindev.slipswhitley.sketchmap.map.SketchMap; import com.mcplugindev.slipswhitley.sketchmap.map.SketchMap;
public class PluginMain extends JavaPlugin public class PluginMain extends JavaPlugin
{ {
private Computer computer; private Computer computer;
private SketchMap smap; private SketchMap smap;
public static PluginMain Instance; public static PluginMain Instance;
// Fired when plugin is first enabled // Fired when plugin is first enabled
@Override @Override
public void onEnable() public void onEnable()
{ {
Instance = this; Instance = this;
try try
{ {
ConsoleCommandSender ccs = getServer().getConsoleSender(); ConsoleCommandSender ccs = getServer().getConsoleSender();
this.getCommand("computer").setExecutor(new Commands()); this.getCommand("computer").setExecutor(new Commands());
ccs.sendMessage("§bExtracting necessary libraries..."); ccs.sendMessage("§bExtracting necessary libraries...");
final File[] libs = new File[] { // added to class path final File[] libs = new File[] { // added to class path
new File(getDataFolder(), "jni4net.j-0.8.8.0.jar"), new File(getDataFolder(), "jni4net.j-0.8.8.0.jar"),
new File(getDataFolder(), "VirtualComputerSender.j4n.jar") }; new File(getDataFolder(), "VirtualComputerSender.j4n.jar") };
- final File[] libs2 = new File[] { final File[] libs2 = new File[] {
new File(getDataFolder(), "jni4net.j-0.8.8.0.jar"), new File(getDataFolder(), "jni4net.j-0.8.8.0.jar"),
- new File(getDataFolder(), "jni4net.n-0.8.8.0.dll"), new File(getDataFolder(), "jni4net.n-0.8.8.0.dll"),
- new File(getDataFolder(), "jni4net.n.w64.v40-0.8.8.0.dll") }; new File(getDataFolder(), "jni4net.n.w64.v40-0.8.8.0.dll") };
- for (final File lib : libs2) for (final File lib : libs2)
- { {
- if (!lib.exists()) if (!lib.exists())
- { {
- JarUtils.extractFromJar(lib.getName(), JarUtils.extractFromJar(lib.getName(),
- lib.getAbsolutePath()); lib.getAbsolutePath());
- } }
- } }
for (final File lib : libs) for (final File lib : libs)
{ {
if (!lib.exists()) if (!lib.exists())
{ {
getLogger().warning( getLogger().warning(
"Failed to load plugin! Could not find lib: " "Failed to load plugin! Could not find lib: "
+ lib.getName()); + lib.getName());
Bukkit.getServer().getPluginManager().disablePlugin(this); Bukkit.getServer().getPluginManager().disablePlugin(this);
return; return;
} }
addClassPath(JarUtils.getJarUrl(lib)); addClassPath(JarUtils.getJarUrl(lib));
} }
ccs.sendMessage("§bInitializing bridge..."); ccs.sendMessage("§bInitializing bridge...");
// Bridge.setVerbose(true); // Bridge.setVerbose(true);
// Bridge.setDebug(true); // Bridge.setDebug(true);
Bridge.init(new File(getDataFolder(), Bridge.init(new File(getDataFolder(),
"jni4net.n.w64.v40-0.8.8.0.dll").getAbsoluteFile()); "jni4net.n.w64.v40-0.8.8.0.dll").getAbsoluteFile());
Bridge.LoadAndRegisterAssemblyFrom(new File(getDataFolder(), Bridge.LoadAndRegisterAssemblyFrom(new File(getDataFolder(),
"VirtualComputerSender.j4n.dll")); "VirtualComputerSender.j4n.dll"));
ccs.sendMessage("§bInititalizing VirtualBox interface..."); ccs.sendMessage("§bInititalizing VirtualBox interface...");
computer = new Computer(); computer = new Computer();
ccs.sendMessage("§bLoading SketchMap..."); ccs.sendMessage("§bLoading SketchMap...");
img = new BufferedImage(640, 480, BufferedImage.TYPE_INT_ARGB); img = new BufferedImage(640, 480, BufferedImage.TYPE_INT_ARGB);
HashMap<Short, RelativeLocation> map = new HashMap<>(); HashMap<Short, RelativeLocation> map = new HashMap<>();
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
for (int j = 0; j < 4; j++) for (int j = 0; j < 4; j++)
map.put((short) (i * 4 + j), new RelativeLocation(i, j)); map.put((short) (i * 4 + j), new RelativeLocation(i, j));
smap = new SketchMap(img, "Screen", 5, 4, false, map); smap = new SketchMap(img, "Screen", 5, 4, false, map);
ccs.sendMessage("§bLoaded!"); ccs.sendMessage("§bLoaded!");
DoStart(); DoStart();
} catch (final Exception e) } catch (final Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
} }
} }
// Fired when plugin is disabled // Fired when plugin is disabled
@Override @Override
public void onDisable() public void onDisable()
{ {
ConsoleCommandSender ccs = getServer().getConsoleSender(); ConsoleCommandSender ccs = getServer().getConsoleSender();
ccs.sendMessage("§aHuh."); ccs.sendMessage("§aHuh.");
saveConfig(); saveConfig();
} }
private volatile BufferedImage img; private volatile BufferedImage img;
private volatile int taskid = -1; private volatile int taskid = -1;
public void Start(CommandSender sender) public void Start(CommandSender sender)
{ {
sender.sendMessage("§eStarting computer..."); sender.sendMessage("§eStarting computer...");
computer.Start(); computer.Start();
sender.sendMessage("§eComputer started."); sender.sendMessage("§eComputer started.");
DoStart(); DoStart();
} }
public static int MouseSpeed = 1; public static int MouseSpeed = 1;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
private void DoStart() private void DoStart()
{ {
if (taskid == -1) if (taskid == -1)
taskid = this.getServer().getScheduler() taskid = this.getServer().getScheduler()
.scheduleAsyncRepeatingTask(this, new Runnable() .scheduleAsyncRepeatingTask(this, new Runnable()
{ {
public void run() public void run()
{ {
final int[] a = ((DataBufferInt) smap.image final int[] a = ((DataBufferInt) smap.image
.getRaster().getDataBuffer()).getData(); .getRaster().getDataBuffer()).getData();
final int[] data = computer.GetScreenPixelColors(); final int[] data = computer.GetScreenPixelColors();
System.arraycopy(data, 0, a, 0, data.length); System.arraycopy(data, 0, a, 0, data.length);
} }
}, 1, 10); }, 1, 10);
if (getServer().getPluginManager().isPluginEnabled("Movecraft")) { if (getServer().getPluginManager().isPluginEnabled("Movecraft"))
this.getServer().getScheduler() {
.scheduleSyncRepeatingTask(this, new Runnable() this.getServer().getScheduler()
{ .scheduleSyncRepeatingTask(this, new Runnable()
public void run() {
{ public void run()
Craft[] crafts = CraftManager.getInstance() {
.getCraftsInWorld(Bukkit.getWorlds().get(0)); Craft[] crafts = CraftManager
if (crafts == null) .getInstance()
return; .getCraftsInWorld(Bukkit.getWorlds().get(0));
for (Craft c : crafts) if (crafts == null)
{ return;
if (c.getType().getCraftName() for (Craft c : crafts)
.equalsIgnoreCase("mouse")) {
{ if (c.getType().getCraftName()
int dx = c.getLastDX(); .equalsIgnoreCase("mouse"))
//int dy = c.getLastDY(); {
int dz = c.getLastDZ(); int dx = c.getLastDX();
if (Bukkit // int dy = c.getLastDY();
.getWorlds() int dz = c.getLastDZ();
.get(0) if (Bukkit
.getBlockAt(c.getMinX(), .getWorlds()
c.getMinY() - 1, c.getMinZ()) .get(0)
.getType() != Material.AIR .getBlockAt(c.getMinX(),
&& (dx != 0 || dz != 0)) c.getMinY() - 1,
UpdateMouse(null, dx * MouseSpeed, dz c.getMinZ()).getType() != Material.AIR
* MouseSpeed, 0, 0, ""); && (dx != 0 || dz != 0))
c.setLastDX(0); UpdateMouse(null, dx * MouseSpeed, dz
c.setLastDZ(0); * MouseSpeed, 0, 0, "");
} c.setLastDX(0);
} c.setLastDZ(0);
} }
}, 1, 1); }
} }
}, 1, 1);
getServer().getPluginManager().registerEvents( }
new MouseLockerPlayerListener(), this);
} getServer().getPluginManager().registerEvents(
new MouseLockerPlayerListener(), this);
public void Stop(CommandSender sender) }
{
sender.sendMessage("§eStopping computer..."); public void Stop(CommandSender sender)
computer.PowerOff(); {
sender.sendMessage("§eComputer stopped."); sender.sendMessage("§eStopping computer...");
} computer.PowerOff();
sender.sendMessage("§eComputer stopped.");
@SuppressWarnings("deprecation") }
public void PowerButton(CommandSender sender)
{ @SuppressWarnings("deprecation")
sender.sendMessage("§eStarting/stoppping computer..."); public void PowerButton(CommandSender sender)
final CommandSender s = sender; {
getServer().getScheduler().scheduleAsyncDelayedTask(this, sender.sendMessage("§eStarting/stoppping computer...");
new Runnable() final CommandSender s = sender;
{ getServer().getScheduler().scheduleAsyncDelayedTask(this,
@Override new Runnable()
public void run() {
{ @Override
if (computer.PowerButton()) public void run()
{ {
DoStart(); if (computer.PowerButton())
s.sendMessage("§eComputer started."); {
} else DoStart();
s.sendMessage("§ePowerbutton pressed."); s.sendMessage("§eComputer started.");
} } else
}); s.sendMessage("§ePowerbutton pressed.");
} }
});
public void Reset(CommandSender sender) }
{
sender.sendMessage("§eResetting computer..."); public void Reset(CommandSender sender)
computer.Reset(); {
sender.sendMessage("§eComputer reset."); sender.sendMessage("§eResetting computer...");
} computer.Reset();
sender.sendMessage("§eComputer reset.");
public void FixScreen(CommandSender sender) }
{
sender.sendMessage("§eFixing screen..."); public void FixScreen(CommandSender sender)
computer.FixScreen(); {
sender.sendMessage("§eScreen fixed."); sender.sendMessage("§eFixing screen...");
} computer.FixScreen();
sender.sendMessage("§eScreen fixed.");
public void PressKey(CommandSender sender, String key, }
String stateorduration)
{ public void PressKey(CommandSender sender, String key,
if (stateorduration.length() == 0) String stateorduration)
computer.PressKey(key, (short) 0); {
else if (stateorduration.equalsIgnoreCase("down")) if (stateorduration.length() == 0)
computer.PressKey(key, (short) -1); computer.PressKey(key, (short) 0);
else if (stateorduration.equalsIgnoreCase("up")) else if (stateorduration.equalsIgnoreCase("down"))
computer.PressKey(key, (short) -2); computer.PressKey(key, (short) -1);
else else if (stateorduration.equalsIgnoreCase("up"))
computer.PressKey(key, Short.parseShort(stateorduration)); computer.PressKey(key, (short) -2);
} else
computer.PressKey(key, Short.parseShort(stateorduration));
public void UpdateMouse(CommandSender sender, int x, int y, int z, int w, }
String mbs, boolean down)
{ public void UpdateMouse(CommandSender sender, int x, int y, int z, int w,
if (down) String mbs, boolean down)
computer.UpdateMouse(x, y, z, w, mbs); {
else if (down)
computer.UpdateMouse(x, y, z, w, ""); computer.UpdateMouse(x, y, z, w, mbs);
} else
computer.UpdateMouse(x, y, z, w, "");
public void UpdateMouse(CommandSender sender, int x, int y, int z, int w, }
String mbs)
{ public void UpdateMouse(CommandSender sender, int x, int y, int z, int w,
UpdateMouse(sender, x, y, z, w, mbs, true); String mbs)
UpdateMouse(sender, x, y, z, w, mbs, false); {
} UpdateMouse(sender, x, y, z, w, mbs, true);
UpdateMouse(sender, x, y, z, w, mbs, false);
private void addClassPath(final URL url) throws IOException }
{
final URLClassLoader sysloader = (URLClassLoader) ClassLoader private void addClassPath(final URL url) throws IOException
.getSystemClassLoader(); {
final Class<URLClassLoader> sysclass = URLClassLoader.class; final URLClassLoader sysloader = (URLClassLoader) ClassLoader
try .getSystemClassLoader();
{ final Class<URLClassLoader> sysclass = URLClassLoader.class;
final Method method = sysclass.getDeclaredMethod("addURL", try
new Class[] { URL.class }); {
method.setAccessible(true); final Method method = sysclass.getDeclaredMethod("addURL",
method.invoke(sysloader, new Object[] { url }); new Class[] { URL.class });
} catch (final Throwable t) method.setAccessible(true);
{ method.invoke(sysloader, new Object[] { url });
t.printStackTrace(); } catch (final Throwable t)
throw new IOException("Error adding " + url {
+ " to system classloader"); t.printStackTrace();
} throw new IOException("Error adding " + url
} + " to system classloader");
} }
}
}