Added code formatter
This commit is contained in:
parent
710f9c04e7
commit
b9448d5d90
444 changed files with 32383 additions and 26254 deletions
295
CodeFormatter.xml
Normal file
295
CodeFormatter.xml
Normal file
|
@ -0,0 +1,295 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="12">
|
||||
<profile kind="CodeFormatterProfile" name="TechReborn" version="12">
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||
</profile>
|
||||
</profiles>
|
|
@ -1,5 +1,7 @@
|
|||
package techreborn;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
|
||||
|
@ -14,7 +16,9 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.common.registry.EntityRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import org.apache.commons.lang3.time.StopWatch;
|
||||
|
||||
import reborncore.common.multiblock.MultiblockEventHandler;
|
||||
import reborncore.common.multiblock.MultiblockServerTickHandler;
|
||||
import reborncore.common.packets.AddDiscriminatorEvent;
|
||||
|
@ -33,19 +37,24 @@ import techreborn.dispenser.BehaviorDispenseScrapbox;
|
|||
import techreborn.entitys.EntityNukePrimed;
|
||||
import techreborn.events.OreUnifier;
|
||||
import techreborn.events.TRTickHandler;
|
||||
import techreborn.init.*;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModFluids;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.init.ModLoot;
|
||||
import techreborn.init.ModParts;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.ModSounds;
|
||||
import techreborn.init.RecipeCompact;
|
||||
import techreborn.lib.ModInfo;
|
||||
import techreborn.packets.PacketAesu;
|
||||
import techreborn.packets.PacketIdsu;
|
||||
import techreborn.proxies.CommonProxy;
|
||||
import techreborn.tiles.idsu.IDSUManager;
|
||||
import techreborn.utils.StackWIPHandler;
|
||||
import techreborn.world.TechRebornWorldGen;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@Mod(modid = ModInfo.MOD_ID, name = ModInfo.MOD_NAME, version = ModInfo.MOD_VERSION, dependencies = ModInfo.MOD_DEPENDENCUIES, guiFactory = ModInfo.GUI_FACTORY_CLASS, acceptedMinecraftVersions = "[1.9]")
|
||||
public class Core {
|
||||
public class Core
|
||||
{
|
||||
public static ConfigTechReborn config;
|
||||
|
||||
@SidedProxy(clientSide = ModInfo.CLIENT_PROXY_CLASS, serverSide = ModInfo.SERVER_PROXY_CLASS)
|
||||
|
@ -64,14 +73,16 @@ public class Core {
|
|||
public static TechRebornWorldGen worldGen;
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preinit(FMLPreInitializationEvent event) {
|
||||
public void preinit(FMLPreInitializationEvent event)
|
||||
{
|
||||
event.getModMetadata().version = ModInfo.MOD_VERSION;
|
||||
INSTANCE = this;
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
configDir = new File(event.getModConfigurationDirectory(), "techreborn");
|
||||
if(!configDir.exists()){
|
||||
if (!configDir.exists())
|
||||
{
|
||||
configDir.mkdir();
|
||||
}
|
||||
config = ConfigTechReborn.initialize(new File(configDir, "main.cfg"));
|
||||
|
@ -81,10 +92,11 @@ public class Core {
|
|||
recipeCompact = new RecipeCompact();
|
||||
TechRebornAPI.recipeCompact = recipeCompact;
|
||||
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules)
|
||||
{
|
||||
compatModule.preInit(event);
|
||||
}
|
||||
//Entitys
|
||||
// Entitys
|
||||
EntityRegistry.registerModEntity(EntityNukePrimed.class, "nuke", 0, INSTANCE, 160, 5, true);
|
||||
proxy.preInit(event);
|
||||
|
||||
|
@ -96,7 +108,8 @@ public class Core {
|
|||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event) throws IllegalAccessException, InstantiationException {
|
||||
public void init(FMLInitializationEvent event) throws IllegalAccessException, InstantiationException
|
||||
{
|
||||
// Register ModBlocks
|
||||
ModBlocks.init();
|
||||
// Register Fluids
|
||||
|
@ -107,10 +120,11 @@ public class Core {
|
|||
ModLoot.init();
|
||||
// Multiparts
|
||||
ModParts.init();
|
||||
//Sounds
|
||||
// Sounds
|
||||
ModSounds.init();
|
||||
// Compat
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules)
|
||||
{
|
||||
compatModule.init(event);
|
||||
}
|
||||
// Recipes
|
||||
|
@ -134,24 +148,27 @@ public class Core {
|
|||
MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler());
|
||||
// IDSU manager
|
||||
IDSUManager.INSTANCE = new IDSUManager();
|
||||
//Event busses
|
||||
// Event busses
|
||||
MinecraftForge.EVENT_BUS.register(IDSUManager.INSTANCE);
|
||||
MinecraftForge.EVENT_BUS.register(new MultiblockServerTickHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new TRTickHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new OreUnifier());
|
||||
MinecraftForge.EVENT_BUS.register(worldGen.retroGen);
|
||||
MinecraftForge.EVENT_BUS.register(new StackWIPHandler());
|
||||
//Scrapbox
|
||||
if (config.scrapboxDispenser) {
|
||||
// Scrapbox
|
||||
if (config.scrapboxDispenser)
|
||||
{
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.scrapBox, new BehaviorDispenseScrapbox());
|
||||
}
|
||||
logHelper.info("Initialization Complete");
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void postinit(FMLPostInitializationEvent event) throws Exception {
|
||||
public void postinit(FMLPostInitializationEvent event) throws Exception
|
||||
{
|
||||
// Has to be done here as Buildcraft registers their recipes late
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules)
|
||||
{
|
||||
compatModule.postInit(event);
|
||||
}
|
||||
proxy.postInit(event);
|
||||
|
@ -164,22 +181,27 @@ public class Core {
|
|||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
public void serverStarting(FMLServerStartingEvent event)
|
||||
{
|
||||
event.registerServerCommand(new TechRebornDevCommand());
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
|
||||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules)
|
||||
{
|
||||
compatModule.serverStarting(event);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent cfgChange) {
|
||||
if (cfgChange.modID.equals("TechReborn")) {
|
||||
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent cfgChange)
|
||||
{
|
||||
if (cfgChange.modID.equals("TechReborn"))
|
||||
{
|
||||
ConfigTechReborn.Configs();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void addDiscriminator(AddDiscriminatorEvent event) {
|
||||
public void addDiscriminator(AddDiscriminatorEvent event)
|
||||
{
|
||||
event.getPacketHandler().addDiscriminator(event.getPacketHandler().nextDiscriminator, PacketAesu.class);
|
||||
event.getPacketHandler().addDiscriminator(event.getPacketHandler().nextDiscriminator, PacketIdsu.class);
|
||||
}
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
package techreborn.achievement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
public class AchievementMod extends Achievement
|
||||
{
|
||||
|
||||
public class AchievementMod extends Achievement {
|
||||
public static List<Achievement> achievements = new ArrayList();
|
||||
|
||||
public static List<Achievement> achievements = new ArrayList();
|
||||
public AchievementMod(String name, int x, int y, ItemStack icon, Achievement parent)
|
||||
{
|
||||
super("achievement.techreborn:" + name, "TechReborn:" + name, x, y, icon, parent);
|
||||
achievements.add(this);
|
||||
registerStat();
|
||||
}
|
||||
|
||||
public AchievementMod(String name, int x, int y, ItemStack icon,
|
||||
Achievement parent) {
|
||||
super("achievement.techreborn:" + name, "TechReborn:" + name, x, y,
|
||||
icon, parent);
|
||||
achievements.add(this);
|
||||
registerStat();
|
||||
}
|
||||
public AchievementMod(String name, int x, int y, Item icon, Achievement parent)
|
||||
{
|
||||
this(name, x, y, new ItemStack(icon), parent);
|
||||
}
|
||||
|
||||
public AchievementMod(String name, int x, int y, Item icon,
|
||||
Achievement parent) {
|
||||
this(name, x, y, new ItemStack(icon), parent);
|
||||
}
|
||||
|
||||
public AchievementMod(String name, int x, int y, Block icon,
|
||||
Achievement parent) {
|
||||
this(name, x, y, new ItemStack(icon), parent);
|
||||
}
|
||||
public AchievementMod(String name, int x, int y, Block icon, Achievement parent)
|
||||
{
|
||||
this(name, x, y, new ItemStack(icon), parent);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,29 +8,32 @@ import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemPickupEvent;
|
|||
import reborncore.common.achievement.ICraftAchievement;
|
||||
import reborncore.common.achievement.IPickupAchievement;
|
||||
|
||||
public class AchievementTriggerer {
|
||||
public class AchievementTriggerer
|
||||
{
|
||||
|
||||
@SubscribeEvent
|
||||
public void onItemPickedUp(ItemPickupEvent event) {
|
||||
ItemStack stack = event.pickedUp.getEntityItem();
|
||||
if (stack != null && stack.getItem() instanceof IPickupAchievement) {
|
||||
Achievement achievement = ((IPickupAchievement) stack.getItem())
|
||||
.getAchievementOnPickup(stack, event.player, event.pickedUp);
|
||||
if (achievement != null)
|
||||
event.player.addStat(achievement, 1);
|
||||
}
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void onItemPickedUp(ItemPickupEvent event)
|
||||
{
|
||||
ItemStack stack = event.pickedUp.getEntityItem();
|
||||
if (stack != null && stack.getItem() instanceof IPickupAchievement)
|
||||
{
|
||||
Achievement achievement = ((IPickupAchievement) stack.getItem()).getAchievementOnPickup(stack, event.player,
|
||||
event.pickedUp);
|
||||
if (achievement != null)
|
||||
event.player.addStat(achievement, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onItemCrafted(ItemCraftedEvent event) {
|
||||
if (event.crafting != null
|
||||
&& event.crafting.getItem() instanceof ICraftAchievement) {
|
||||
Achievement achievement = ((ICraftAchievement) event.crafting
|
||||
.getItem()).getAchievementOnCraft(event.crafting,
|
||||
event.player, event.craftMatrix);
|
||||
if (achievement != null)
|
||||
event.player.addStat(achievement, 1);
|
||||
}
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void onItemCrafted(ItemCraftedEvent event)
|
||||
{
|
||||
if (event.crafting != null && event.crafting.getItem() instanceof ICraftAchievement)
|
||||
{
|
||||
Achievement achievement = ((ICraftAchievement) event.crafting.getItem())
|
||||
.getAchievementOnCraft(event.crafting, event.player, event.craftMatrix);
|
||||
if (achievement != null)
|
||||
event.player.addStat(achievement, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,32 +7,29 @@ import net.minecraftforge.fml.common.FMLCommonHandler;
|
|||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
public class TRAchievements {
|
||||
public class TRAchievements
|
||||
{
|
||||
|
||||
public static AchievementPage techrebornPage;
|
||||
public static int pageIndex;
|
||||
public static AchievementPage techrebornPage;
|
||||
public static int pageIndex;
|
||||
|
||||
public static Achievement ore_PickUp;
|
||||
public static Achievement thermalgen_Craft;
|
||||
public static Achievement centrifuge_Craft;
|
||||
public static Achievement ore_PickUp;
|
||||
public static Achievement thermalgen_Craft;
|
||||
public static Achievement centrifuge_Craft;
|
||||
|
||||
public static void init() {
|
||||
ore_PickUp = new AchievementMod("ore_PickUp", 0, 0, new ItemStack(
|
||||
ModBlocks.ore, 1, 0), null);
|
||||
centrifuge_Craft = new AchievementMod("centrifuge_Craft", 1, 1,
|
||||
ModBlocks.centrifuge, ore_PickUp);
|
||||
thermalgen_Craft = new AchievementMod("thermalgen_Craft", 2, 1,
|
||||
ModBlocks.thermalGenerator, ore_PickUp);
|
||||
public static void init()
|
||||
{
|
||||
ore_PickUp = new AchievementMod("ore_PickUp", 0, 0, new ItemStack(ModBlocks.ore, 1, 0), null);
|
||||
centrifuge_Craft = new AchievementMod("centrifuge_Craft", 1, 1, ModBlocks.centrifuge, ore_PickUp);
|
||||
thermalgen_Craft = new AchievementMod("thermalgen_Craft", 2, 1, ModBlocks.thermalGenerator, ore_PickUp);
|
||||
|
||||
pageIndex = AchievementPage.getAchievementPages().size();
|
||||
techrebornPage = new AchievementPage(ModInfo.MOD_NAME,
|
||||
AchievementMod.achievements
|
||||
.toArray(new Achievement[AchievementMod.achievements
|
||||
.size()]));
|
||||
AchievementPage.registerAchievementPage(techrebornPage);
|
||||
pageIndex = AchievementPage.getAchievementPages().size();
|
||||
techrebornPage = new AchievementPage(ModInfo.MOD_NAME,
|
||||
AchievementMod.achievements.toArray(new Achievement[AchievementMod.achievements.size()]));
|
||||
AchievementPage.registerAchievementPage(techrebornPage);
|
||||
|
||||
FMLCommonHandler.instance().bus().register(new AchievementTriggerer());
|
||||
FMLCommonHandler.instance().bus().register(new AchievementTriggerer());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package techreborn.api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -11,111 +15,128 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
public class RollingMachineRecipe
|
||||
{
|
||||
|
||||
public class RollingMachineRecipe {
|
||||
private final List<IRecipe> recipes = new ArrayList<IRecipe>();
|
||||
|
||||
private final List<IRecipe> recipes = new ArrayList<IRecipe>();
|
||||
public static final RollingMachineRecipe instance = new RollingMachineRecipe();
|
||||
|
||||
public static final RollingMachineRecipe instance = new RollingMachineRecipe();
|
||||
public void addShapedOreRecipe(ItemStack outputItemStack, Object... objectInputs)
|
||||
{
|
||||
recipes.add(new ShapedOreRecipe(outputItemStack, objectInputs));
|
||||
}
|
||||
|
||||
public void addShapedOreRecipe(ItemStack outputItemStack,
|
||||
Object... objectInputs) {
|
||||
recipes.add(new ShapedOreRecipe(outputItemStack, objectInputs));
|
||||
}
|
||||
public void addShapelessOreRecipe(ItemStack outputItemStack, Object... objectInputs)
|
||||
{
|
||||
recipes.add(new ShapelessOreRecipe(outputItemStack, objectInputs));
|
||||
}
|
||||
|
||||
public void addShapelessOreRecipe(ItemStack outputItemStack,
|
||||
Object... objectInputs) {
|
||||
recipes
|
||||
.add(new ShapelessOreRecipe(outputItemStack, objectInputs));
|
||||
}
|
||||
public void addRecipe(ItemStack output, Object... components)
|
||||
{
|
||||
String s = "";
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int k = 0;
|
||||
if (components[i] instanceof String[])
|
||||
{
|
||||
String as[] = (String[]) components[i++];
|
||||
for (int l = 0; l < as.length; l++)
|
||||
{
|
||||
String s2 = as[l];
|
||||
k++;
|
||||
j = s2.length();
|
||||
s = (new StringBuilder()).append(s).append(s2).toString();
|
||||
}
|
||||
} else
|
||||
{
|
||||
while (components[i] instanceof String)
|
||||
{
|
||||
String s1 = (String) components[i++];
|
||||
k++;
|
||||
j = s1.length();
|
||||
s = (new StringBuilder()).append(s).append(s1).toString();
|
||||
}
|
||||
}
|
||||
HashMap hashmap = new HashMap();
|
||||
for (; i < components.length; i += 2)
|
||||
{
|
||||
Character character = (Character) components[i];
|
||||
ItemStack itemstack1 = null;
|
||||
if (components[i + 1] instanceof Item)
|
||||
{
|
||||
itemstack1 = new ItemStack((Item) components[i + 1]);
|
||||
} else if (components[i + 1] instanceof Block)
|
||||
{
|
||||
itemstack1 = new ItemStack((Block) components[i + 1], 1, -1);
|
||||
} else if (components[i + 1] instanceof ItemStack)
|
||||
{
|
||||
itemstack1 = (ItemStack) components[i + 1];
|
||||
}
|
||||
hashmap.put(character, itemstack1);
|
||||
}
|
||||
|
||||
public void addRecipe(ItemStack output, Object... components) {
|
||||
String s = "";
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int k = 0;
|
||||
if (components[i] instanceof String[]) {
|
||||
String as[] = (String[]) components[i++];
|
||||
for (int l = 0; l < as.length; l++) {
|
||||
String s2 = as[l];
|
||||
k++;
|
||||
j = s2.length();
|
||||
s = (new StringBuilder()).append(s).append(s2).toString();
|
||||
}
|
||||
} else {
|
||||
while (components[i] instanceof String) {
|
||||
String s1 = (String) components[i++];
|
||||
k++;
|
||||
j = s1.length();
|
||||
s = (new StringBuilder()).append(s).append(s1).toString();
|
||||
}
|
||||
}
|
||||
HashMap hashmap = new HashMap();
|
||||
for (; i < components.length; i += 2) {
|
||||
Character character = (Character) components[i];
|
||||
ItemStack itemstack1 = null;
|
||||
if (components[i + 1] instanceof Item) {
|
||||
itemstack1 = new ItemStack((Item) components[i + 1]);
|
||||
} else if (components[i + 1] instanceof Block) {
|
||||
itemstack1 = new ItemStack((Block) components[i + 1], 1, -1);
|
||||
} else if (components[i + 1] instanceof ItemStack) {
|
||||
itemstack1 = (ItemStack) components[i + 1];
|
||||
}
|
||||
hashmap.put(character, itemstack1);
|
||||
}
|
||||
ItemStack recipeArray[] = new ItemStack[j * k];
|
||||
for (int i1 = 0; i1 < j * k; i1++)
|
||||
{
|
||||
char c = s.charAt(i1);
|
||||
if (hashmap.containsKey(Character.valueOf(c)))
|
||||
{
|
||||
recipeArray[i1] = ((ItemStack) hashmap.get(Character.valueOf(c))).copy();
|
||||
} else
|
||||
{
|
||||
recipeArray[i1] = null;
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack recipeArray[] = new ItemStack[j * k];
|
||||
for (int i1 = 0; i1 < j * k; i1++) {
|
||||
char c = s.charAt(i1);
|
||||
if (hashmap.containsKey(Character.valueOf(c))) {
|
||||
recipeArray[i1] = ((ItemStack) hashmap
|
||||
.get(Character.valueOf(c))).copy();
|
||||
} else {
|
||||
recipeArray[i1] = null;
|
||||
}
|
||||
}
|
||||
recipes.add(new ShapedRecipes(j, k, recipeArray, output));
|
||||
}
|
||||
|
||||
recipes.add(new ShapedRecipes(j, k, recipeArray, output));
|
||||
}
|
||||
public void addShapelessRecipe(ItemStack output, Object... components)
|
||||
{
|
||||
List<ItemStack> ingredients = new ArrayList<ItemStack>();
|
||||
for (int j = 0; j < components.length; j++)
|
||||
{
|
||||
Object obj = components[j];
|
||||
if (obj instanceof ItemStack)
|
||||
{
|
||||
ingredients.add(((ItemStack) obj).copy());
|
||||
continue;
|
||||
}
|
||||
if (obj instanceof Item)
|
||||
{
|
||||
ingredients.add(new ItemStack((Item) obj));
|
||||
continue;
|
||||
}
|
||||
if (obj instanceof Block)
|
||||
{
|
||||
ingredients.add(new ItemStack((Block) obj));
|
||||
} else
|
||||
{
|
||||
throw new RuntimeException("Invalid shapeless recipe!");
|
||||
}
|
||||
}
|
||||
|
||||
public void addShapelessRecipe(ItemStack output, Object... components) {
|
||||
List<ItemStack> ingredients = new ArrayList<ItemStack>();
|
||||
for (int j = 0; j < components.length; j++) {
|
||||
Object obj = components[j];
|
||||
if (obj instanceof ItemStack) {
|
||||
ingredients.add(((ItemStack) obj).copy());
|
||||
continue;
|
||||
}
|
||||
if (obj instanceof Item) {
|
||||
ingredients.add(new ItemStack((Item) obj));
|
||||
continue;
|
||||
}
|
||||
if (obj instanceof Block) {
|
||||
ingredients.add(new ItemStack((Block) obj));
|
||||
} else {
|
||||
throw new RuntimeException("Invalid shapeless recipe!");
|
||||
}
|
||||
}
|
||||
recipes.add(new ShapelessRecipes(output, ingredients));
|
||||
}
|
||||
|
||||
recipes.add(new ShapelessRecipes(output, ingredients));
|
||||
}
|
||||
public ItemStack findMatchingRecipe(InventoryCrafting inv, World world)
|
||||
{
|
||||
for (int k = 0; k < recipes.size(); k++)
|
||||
{
|
||||
IRecipe irecipe = (IRecipe) recipes.get(k);
|
||||
if (irecipe.matches(inv, world))
|
||||
{
|
||||
return irecipe.getCraftingResult(inv);
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack findMatchingRecipe(InventoryCrafting inv, World world) {
|
||||
for (int k = 0; k < recipes.size(); k++) {
|
||||
IRecipe irecipe = (IRecipe) recipes.get(k);
|
||||
if (irecipe.matches(inv, world)) {
|
||||
return irecipe.getCraftingResult(inv);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<IRecipe> getRecipeList() {
|
||||
return recipes;
|
||||
}
|
||||
public List<IRecipe> getRecipeList()
|
||||
{
|
||||
return recipes;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
package techreborn.api;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ScrapboxList {
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ScrapboxList
|
||||
{
|
||||
|
||||
public static List<ItemStack> stacks = new ArrayList<ItemStack>();
|
||||
|
||||
public static void addItemStackToList(ItemStack stack){
|
||||
|
||||
public static void addItemStackToList(ItemStack stack)
|
||||
{
|
||||
stacks.add(stack);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,17 +5,21 @@ import net.minecraft.inventory.Slot;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.upgrade.IMachineUpgrade;
|
||||
|
||||
public class SlotUpgrade extends Slot{
|
||||
public class SlotUpgrade extends Slot
|
||||
{
|
||||
|
||||
public SlotUpgrade(IInventory inventoryIn, int index, int xPosition, int yPosition) {
|
||||
public SlotUpgrade(IInventory inventoryIn, int index, int xPosition, int yPosition)
|
||||
{
|
||||
super(inventoryIn, index, xPosition, yPosition);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack stack) {
|
||||
if(stack.getItem() instanceof IMachineUpgrade){
|
||||
public boolean isItemValid(ItemStack stack)
|
||||
{
|
||||
if (stack.getItem() instanceof IMachineUpgrade)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,34 +3,37 @@ package techreborn.api;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.IRecipeCompact;
|
||||
|
||||
public final class TechRebornAPI {
|
||||
public final class TechRebornAPI
|
||||
{
|
||||
|
||||
public static IRecipeCompact recipeCompact;
|
||||
public static IRecipeCompact recipeCompact;
|
||||
|
||||
public static void addRollingOreMachinceRecipe(ItemStack output,
|
||||
Object... components) {
|
||||
RollingMachineRecipe.instance.addShapedOreRecipe(output, components);
|
||||
}
|
||||
public static void addRollingOreMachinceRecipe(ItemStack output, Object... components)
|
||||
{
|
||||
RollingMachineRecipe.instance.addShapedOreRecipe(output, components);
|
||||
}
|
||||
|
||||
public static void addShapelessOreRollingMachinceRecipe(ItemStack output,
|
||||
Object... components) {
|
||||
RollingMachineRecipe.instance.addShapelessOreRecipe(output, components);
|
||||
}
|
||||
public static void addShapelessOreRollingMachinceRecipe(ItemStack output, Object... components)
|
||||
{
|
||||
RollingMachineRecipe.instance.addShapelessOreRecipe(output, components);
|
||||
}
|
||||
|
||||
public static void addRollingMachinceRecipe(ItemStack output,
|
||||
Object... components) {
|
||||
RollingMachineRecipe.instance.addRecipe(output, components);
|
||||
}
|
||||
public static void addRollingMachinceRecipe(ItemStack output, Object... components)
|
||||
{
|
||||
RollingMachineRecipe.instance.addRecipe(output, components);
|
||||
}
|
||||
|
||||
public static void addShapelessRollingMachinceRecipe(ItemStack output,
|
||||
Object... components) {
|
||||
RollingMachineRecipe.instance.addShapelessRecipe(output, components);
|
||||
}
|
||||
public static void addShapelessRollingMachinceRecipe(ItemStack output, Object... components)
|
||||
{
|
||||
RollingMachineRecipe.instance.addShapelessRecipe(output, components);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class RegisteredItemRecipe extends Exception {
|
||||
public RegisteredItemRecipe(String message) {
|
||||
super(message);
|
||||
}
|
||||
class RegisteredItemRecipe extends Exception
|
||||
{
|
||||
public RegisteredItemRecipe(String message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,82 +1,49 @@
|
|||
package techreborn.api;
|
||||
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class TechRebornBlocks {
|
||||
public class TechRebornBlocks
|
||||
{
|
||||
|
||||
public static Block getBlock(String name) {
|
||||
try {
|
||||
Object e = Class.forName("techreborn.init.ModBlocks").getField(name).get(null);
|
||||
return e instanceof Block ? (Block) e : null;
|
||||
} catch (NoSuchFieldException e1) {
|
||||
e1.printStackTrace();
|
||||
return null;
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public static Block getBlock(String name)
|
||||
{
|
||||
try
|
||||
{
|
||||
Object e = Class.forName("techreborn.init.ModBlocks").getField(name).get(null);
|
||||
return e instanceof Block ? (Block) e : null;
|
||||
} catch (NoSuchFieldException e1)
|
||||
{
|
||||
e1.printStackTrace();
|
||||
return null;
|
||||
} catch (IllegalAccessException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
} catch (ClassNotFoundException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Full list of blocks.
|
||||
|
||||
thermalGenerator
|
||||
quantumTank
|
||||
quantumChest
|
||||
digitalChest
|
||||
centrifuge
|
||||
RollingMachine
|
||||
MachineCasing
|
||||
BlastFurnace
|
||||
AlloySmelter
|
||||
Grinder
|
||||
ImplosionCompressor
|
||||
MatterFabricator
|
||||
ChunkLoader
|
||||
HighAdvancedMachineBlock
|
||||
Dragoneggenergysiphoner
|
||||
Magicenergeyconverter
|
||||
AssemblyMachine
|
||||
DieselGenerator
|
||||
IndustrialElectrolyzer
|
||||
MagicalAbsorber
|
||||
Semifluidgenerator
|
||||
Gasturbine
|
||||
AlloyFurnace
|
||||
ChemicalReactor
|
||||
lathe
|
||||
platecuttingmachine
|
||||
Idsu
|
||||
Aesu
|
||||
Lesu
|
||||
Supercondensator
|
||||
Woodenshelf
|
||||
Metalshelf
|
||||
LesuStorage
|
||||
Distillationtower
|
||||
ElectricCraftingTable
|
||||
VacuumFreezer
|
||||
PlasmaGenerator
|
||||
FusionControlComputer
|
||||
ComputerCube
|
||||
FusionCoil
|
||||
LightningRod
|
||||
heatGenerator
|
||||
industrialSawmill
|
||||
chargeBench
|
||||
farm
|
||||
|
||||
ore
|
||||
storage
|
||||
storage2
|
||||
machineframe
|
||||
|
||||
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* Full list of blocks.
|
||||
*
|
||||
* thermalGenerator quantumTank quantumChest digitalChest centrifuge
|
||||
* RollingMachine MachineCasing BlastFurnace AlloySmelter Grinder
|
||||
* ImplosionCompressor MatterFabricator ChunkLoader HighAdvancedMachineBlock
|
||||
* Dragoneggenergysiphoner Magicenergeyconverter AssemblyMachine
|
||||
* DieselGenerator IndustrialElectrolyzer MagicalAbsorber Semifluidgenerator
|
||||
* Gasturbine AlloyFurnace ChemicalReactor lathe platecuttingmachine Idsu
|
||||
* Aesu Lesu Supercondensator Woodenshelf Metalshelf LesuStorage
|
||||
* Distillationtower ElectricCraftingTable VacuumFreezer PlasmaGenerator
|
||||
* FusionControlComputer ComputerCube FusionCoil LightningRod heatGenerator
|
||||
* industrialSawmill chargeBench farm
|
||||
*
|
||||
* ore storage storage2 machineframe
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
}
|
||||
|
|
|
@ -2,79 +2,47 @@ package techreborn.api;
|
|||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class TechRebornItems {
|
||||
public class TechRebornItems
|
||||
{
|
||||
|
||||
public static Item getItem(String name) {
|
||||
try {
|
||||
Object e = Class.forName("techreborn.init.ModItems").getField(name).get(null);
|
||||
return e instanceof Item ? (Item) e : null;
|
||||
} catch (NoSuchFieldException e1) {
|
||||
e1.printStackTrace();
|
||||
return null;
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Items
|
||||
|
||||
gems
|
||||
ingots
|
||||
nuggets
|
||||
dusts
|
||||
smallDusts
|
||||
tinyDusts
|
||||
parts
|
||||
cells
|
||||
rockCutter
|
||||
lithiumBatpack
|
||||
lapotronpack
|
||||
omniTool
|
||||
advancedDrill
|
||||
lapotronicOrb
|
||||
manuel
|
||||
uuMatter
|
||||
plate
|
||||
rods
|
||||
crushedOre
|
||||
purifiedCrushedOre
|
||||
cloakingDevice
|
||||
public static Item getItem(String name)
|
||||
{
|
||||
try
|
||||
{
|
||||
Object e = Class.forName("techreborn.init.ModItems").getField(name).get(null);
|
||||
return e instanceof Item ? (Item) e : null;
|
||||
} catch (NoSuchFieldException e1)
|
||||
{
|
||||
e1.printStackTrace();
|
||||
return null;
|
||||
} catch (IllegalAccessException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
} catch (ClassNotFoundException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
bucketBerylium
|
||||
bucketcalcium
|
||||
bucketcalciumcarbonate
|
||||
bucketChlorite
|
||||
bucketDeuterium
|
||||
bucketGlyceryl
|
||||
bucketHelium
|
||||
bucketHelium3
|
||||
bucketHeliumplasma
|
||||
bucketHydrogen
|
||||
bucketLithium
|
||||
bucketMercury
|
||||
bucketMethane
|
||||
bucketNitrocoalfuel
|
||||
bucketNitrofuel
|
||||
bucketNitrogen
|
||||
bucketNitrogendioxide
|
||||
bucketPotassium
|
||||
bucketSilicon
|
||||
bucketSodium
|
||||
bucketSodiumpersulfate
|
||||
bucketTritium
|
||||
bucketWolframium
|
||||
|
||||
hammerIron
|
||||
hammerDiamond
|
||||
upgrades
|
||||
farmPatten
|
||||
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* Items
|
||||
*
|
||||
* gems ingots nuggets dusts smallDusts tinyDusts parts cells rockCutter
|
||||
* lithiumBatpack lapotronpack omniTool advancedDrill lapotronicOrb manuel
|
||||
* uuMatter plate rods crushedOre purifiedCrushedOre cloakingDevice
|
||||
*
|
||||
* bucketBerylium bucketcalcium bucketcalciumcarbonate bucketChlorite
|
||||
* bucketDeuterium bucketGlyceryl bucketHelium bucketHelium3
|
||||
* bucketHeliumplasma bucketHydrogen bucketLithium bucketMercury
|
||||
* bucketMethane bucketNitrocoalfuel bucketNitrofuel bucketNitrogen
|
||||
* bucketNitrogendioxide bucketPotassium bucketSilicon bucketSodium
|
||||
* bucketSodiumpersulfate bucketTritium bucketWolframium
|
||||
*
|
||||
* hammerIron hammerDiamond upgrades farmPatten
|
||||
*
|
||||
*/
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,2 @@
|
|||
@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") package techreborn.api;
|
||||
|
||||
import net.minecraftforge.fml.common.API;
|
||||
|
||||
@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI")
|
||||
package techreborn.api;
|
||||
|
|
|
@ -1,86 +1,100 @@
|
|||
package techreborn.api.reactor;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class FusionReactorRecipe {
|
||||
public class FusionReactorRecipe
|
||||
{
|
||||
|
||||
/**
|
||||
* This is the item stack that is required in the top slot
|
||||
*
|
||||
* This cannot be null
|
||||
*/
|
||||
ItemStack topInput;
|
||||
/**
|
||||
* This is the item stack that is required in the top slot
|
||||
*
|
||||
* This cannot be null
|
||||
*/
|
||||
ItemStack topInput;
|
||||
|
||||
/**
|
||||
* This is the item stack that is required in the bottom slot
|
||||
*
|
||||
* This can be null
|
||||
*/
|
||||
ItemStack bottomInput;
|
||||
/**
|
||||
* This is the item stack that is required in the bottom slot
|
||||
*
|
||||
* This can be null
|
||||
*/
|
||||
ItemStack bottomInput;
|
||||
|
||||
/**
|
||||
* This is the output stack
|
||||
*
|
||||
* This cannot be null
|
||||
*/
|
||||
ItemStack output;
|
||||
/**
|
||||
* This is the output stack
|
||||
*
|
||||
* This cannot be null
|
||||
*/
|
||||
ItemStack output;
|
||||
|
||||
/**
|
||||
* This is the required eu that has to be in the rector for the reaction to
|
||||
* start
|
||||
*/
|
||||
double startEU;
|
||||
/**
|
||||
* This is the eu that changes every tick, set as a minus number to use
|
||||
* power and a positive number to gen power.
|
||||
*/
|
||||
double euTick;
|
||||
|
||||
/**
|
||||
* This is the required eu that has to be in the rector for the reaction to start
|
||||
*/
|
||||
double startEU;
|
||||
/**
|
||||
* This is the eu that changes every tick, set as a minus number to use power and a positive number to gen power.
|
||||
*/
|
||||
double euTick;
|
||||
/**
|
||||
* This is the time in ticks that the reaction takes to complete
|
||||
*/
|
||||
int tickTime;
|
||||
|
||||
/**
|
||||
* This is the time in ticks that the reaction takes to complete
|
||||
*/
|
||||
int tickTime;
|
||||
/**
|
||||
*
|
||||
* @param topInput
|
||||
* This is the top slot stack
|
||||
* @param bottomInput
|
||||
* This is the bottom slot stack
|
||||
* @param output
|
||||
* This is the output stack
|
||||
* @param startEU
|
||||
* This is the inital EU amount
|
||||
* @param euTick
|
||||
* This is the eu that is transfured every tick
|
||||
* @param tickTime
|
||||
* This is the time the recipe takes to process
|
||||
*/
|
||||
public FusionReactorRecipe(ItemStack topInput, ItemStack bottomInput, ItemStack output, double startEU,
|
||||
double euTick, int tickTime)
|
||||
{
|
||||
this.topInput = topInput;
|
||||
this.bottomInput = bottomInput;
|
||||
this.output = output;
|
||||
this.startEU = startEU;
|
||||
this.euTick = euTick;
|
||||
this.tickTime = tickTime;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param topInput This is the top slot stack
|
||||
* @param bottomInput This is the bottom slot stack
|
||||
* @param output This is the output stack
|
||||
* @param startEU This is the inital EU amount
|
||||
* @param euTick This is the eu that is transfured every tick
|
||||
* @param tickTime This is the time the recipe takes to process
|
||||
*/
|
||||
public FusionReactorRecipe(ItemStack topInput, ItemStack bottomInput, ItemStack output, double startEU, double euTick, int tickTime) {
|
||||
this.topInput = topInput;
|
||||
this.bottomInput = bottomInput;
|
||||
this.output = output;
|
||||
this.startEU = startEU;
|
||||
this.euTick = euTick;
|
||||
this.tickTime = tickTime;
|
||||
}
|
||||
public ItemStack getTopInput()
|
||||
{
|
||||
return topInput;
|
||||
}
|
||||
|
||||
public ItemStack getBottomInput()
|
||||
{
|
||||
return bottomInput;
|
||||
}
|
||||
|
||||
public ItemStack getTopInput() {
|
||||
return topInput;
|
||||
}
|
||||
public ItemStack getOutput()
|
||||
{
|
||||
return output;
|
||||
}
|
||||
|
||||
public ItemStack getBottomInput() {
|
||||
return bottomInput;
|
||||
}
|
||||
public double getStartEU()
|
||||
{
|
||||
return startEU;
|
||||
}
|
||||
|
||||
public ItemStack getOutput() {
|
||||
return output;
|
||||
}
|
||||
public double getEuTick()
|
||||
{
|
||||
return euTick;
|
||||
}
|
||||
|
||||
public double getStartEU() {
|
||||
return startEU;
|
||||
}
|
||||
|
||||
public double getEuTick() {
|
||||
return euTick;
|
||||
}
|
||||
|
||||
public int getTickTime() {
|
||||
return tickTime;
|
||||
}
|
||||
public int getTickTime()
|
||||
{
|
||||
return tickTime;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,23 @@
|
|||
package techreborn.api.reactor;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class FusionReactorRecipeHelper {
|
||||
public class FusionReactorRecipeHelper
|
||||
{
|
||||
|
||||
/**
|
||||
* This is the list of all the recipes
|
||||
*/
|
||||
public static ArrayList<FusionReactorRecipe> reactorRecipes = new ArrayList<FusionReactorRecipe>();
|
||||
/**
|
||||
* This is the list of all the recipes
|
||||
*/
|
||||
public static ArrayList<FusionReactorRecipe> reactorRecipes = new ArrayList<FusionReactorRecipe>();
|
||||
|
||||
/**
|
||||
* Register your reactor recipe here
|
||||
*
|
||||
* @param reactorRecipe the recipe you want to add
|
||||
*/
|
||||
public static void registerRecipe(FusionReactorRecipe reactorRecipe){
|
||||
reactorRecipes.add(reactorRecipe);
|
||||
}
|
||||
/**
|
||||
* Register your reactor recipe here
|
||||
*
|
||||
* @param reactorRecipe
|
||||
* the recipe you want to add
|
||||
*/
|
||||
public static void registerRecipe(FusionReactorRecipe reactorRecipe)
|
||||
{
|
||||
reactorRecipes.add(reactorRecipe);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,2 @@
|
|||
@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") package techreborn.api.reactor;
|
||||
|
||||
import net.minecraftforge.fml.common.API;
|
||||
|
||||
@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI")
|
||||
package techreborn.api.reactor;
|
||||
|
|
|
@ -1,92 +1,105 @@
|
|||
package techreborn.api.recipe;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
/**
|
||||
* Extend this to add a recipe
|
||||
*/
|
||||
public abstract class BaseRecipe implements IBaseRecipeType, Cloneable {
|
||||
public abstract class BaseRecipe implements IBaseRecipeType, Cloneable
|
||||
{
|
||||
|
||||
public ArrayList<ItemStack> inputs;
|
||||
public ArrayList<ItemStack> inputs;
|
||||
|
||||
private ArrayList<ItemStack> outputs;
|
||||
private ArrayList<ItemStack> outputs;
|
||||
|
||||
public String name;
|
||||
public String name;
|
||||
|
||||
public int tickTime;
|
||||
public int tickTime;
|
||||
|
||||
public int euPerTick;
|
||||
public int euPerTick;
|
||||
|
||||
public BaseRecipe(String name, int tickTime, int euPerTick) {
|
||||
inputs = new ArrayList<ItemStack>();
|
||||
outputs = new ArrayList<ItemStack>();
|
||||
this.name = name;
|
||||
//This adds all new recipes
|
||||
this.tickTime = tickTime;
|
||||
this.euPerTick = euPerTick;
|
||||
}
|
||||
public BaseRecipe(String name, int tickTime, int euPerTick)
|
||||
{
|
||||
inputs = new ArrayList<ItemStack>();
|
||||
outputs = new ArrayList<ItemStack>();
|
||||
this.name = name;
|
||||
// This adds all new recipes
|
||||
this.tickTime = tickTime;
|
||||
this.euPerTick = euPerTick;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getOutput(int i) {
|
||||
return outputs.get(i).copy();
|
||||
}
|
||||
@Override
|
||||
public ItemStack getOutput(int i)
|
||||
{
|
||||
return outputs.get(i).copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOutputsSize() {
|
||||
return outputs.size();
|
||||
}
|
||||
@Override
|
||||
public int getOutputsSize()
|
||||
{
|
||||
return outputs.size();
|
||||
}
|
||||
|
||||
public void addOutput(ItemStack stack) {
|
||||
outputs.add(stack);
|
||||
}
|
||||
public void addOutput(ItemStack stack)
|
||||
{
|
||||
outputs.add(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getInputs()
|
||||
{
|
||||
return inputs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getInputs() {
|
||||
return inputs;
|
||||
}
|
||||
@Override
|
||||
public String getRecipeName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return name;
|
||||
}
|
||||
@Override
|
||||
public int tickTime()
|
||||
{
|
||||
return tickTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickTime() {
|
||||
return tickTime;
|
||||
}
|
||||
@Override
|
||||
public int euPerTick()
|
||||
{
|
||||
return euPerTick;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int euPerTick() {
|
||||
return euPerTick;
|
||||
}
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onCraft(TileEntity tile)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCraft(TileEntity tile) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public Object clone() throws CloneNotSupportedException
|
||||
{
|
||||
return super.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object clone() throws CloneNotSupportedException {
|
||||
return super.clone();
|
||||
}
|
||||
@Override
|
||||
public boolean useOreDic()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useOreDic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getOutputs() {
|
||||
return outputs;
|
||||
}
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return outputs;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,81 +1,87 @@
|
|||
package techreborn.api.recipe;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This is the base recipe class implement this to make a recipe handler
|
||||
*/
|
||||
public interface IBaseRecipeType {
|
||||
public interface IBaseRecipeType
|
||||
{
|
||||
|
||||
/**
|
||||
* Use this to get all of the inputs
|
||||
*
|
||||
* @return the List of inputs
|
||||
*/
|
||||
public List<ItemStack> getInputs();
|
||||
/**
|
||||
* Use this to get all of the inputs
|
||||
*
|
||||
* @return the List of inputs
|
||||
*/
|
||||
public List<ItemStack> getInputs();
|
||||
|
||||
/**
|
||||
* This gets the output form the array list
|
||||
* @param i get output form position in arraylist
|
||||
* @return the output
|
||||
*/
|
||||
public ItemStack getOutput(int i);
|
||||
/**
|
||||
* This gets the output form the array list
|
||||
*
|
||||
* @param i
|
||||
* get output form position in arraylist
|
||||
* @return the output
|
||||
*/
|
||||
public ItemStack getOutput(int i);
|
||||
|
||||
/**
|
||||
* @return The ammount of outputs
|
||||
*/
|
||||
public int getOutputsSize();
|
||||
/**
|
||||
* @return The ammount of outputs
|
||||
*/
|
||||
public int getOutputsSize();
|
||||
|
||||
/**
|
||||
* @return get outputs
|
||||
*/
|
||||
public List<ItemStack> getOutputs();
|
||||
/**
|
||||
* @return get outputs
|
||||
*/
|
||||
public List<ItemStack> getOutputs();
|
||||
|
||||
/**
|
||||
* This is the name to check that the recipe is the one that should be used in
|
||||
* the tile entity that is set up to process this recipe.
|
||||
*
|
||||
* @return The recipeName
|
||||
*/
|
||||
public String getRecipeName();
|
||||
/**
|
||||
* This is the name to check that the recipe is the one that should be used
|
||||
* in the tile entity that is set up to process this recipe.
|
||||
*
|
||||
* @return The recipeName
|
||||
*/
|
||||
public String getRecipeName();
|
||||
|
||||
/**
|
||||
* This should be a user friendly name
|
||||
*
|
||||
* @return The user friendly name of the recipe.
|
||||
*/
|
||||
public String getUserFreindlyName();
|
||||
/**
|
||||
* This should be a user friendly name
|
||||
*
|
||||
* @return The user friendly name of the recipe.
|
||||
*/
|
||||
public String getUserFreindlyName();
|
||||
|
||||
/**
|
||||
* This is how long the recipe needs to tick for the crafting operation to complete
|
||||
*
|
||||
* @return tick length
|
||||
*/
|
||||
public int tickTime();
|
||||
/**
|
||||
* This is how long the recipe needs to tick for the crafting operation to
|
||||
* complete
|
||||
*
|
||||
* @return tick length
|
||||
*/
|
||||
public int tickTime();
|
||||
|
||||
/**
|
||||
* This is how much eu Per tick the machine should use
|
||||
*
|
||||
* @return the amount of eu to be used per tick.
|
||||
*/
|
||||
public int euPerTick();
|
||||
/**
|
||||
* This is how much eu Per tick the machine should use
|
||||
*
|
||||
* @return the amount of eu to be used per tick.
|
||||
*/
|
||||
public int euPerTick();
|
||||
|
||||
/**
|
||||
* @param tile the tile that is doing the crafting
|
||||
* @return if true the recipe will craft, if false it will not
|
||||
*/
|
||||
public boolean canCraft(TileEntity tile);
|
||||
/**
|
||||
* @param tile
|
||||
* the tile that is doing the crafting
|
||||
* @return if true the recipe will craft, if false it will not
|
||||
*/
|
||||
public boolean canCraft(TileEntity tile);
|
||||
|
||||
/**
|
||||
* @param tile the tile that is doing the crafting
|
||||
* @return return true if fluid was taken and should craft
|
||||
*/
|
||||
public boolean onCraft(TileEntity tile);
|
||||
/**
|
||||
* @param tile
|
||||
* the tile that is doing the crafting
|
||||
* @return return true if fluid was taken and should craft
|
||||
*/
|
||||
public boolean onCraft(TileEntity tile);
|
||||
|
||||
public Object clone() throws CloneNotSupportedException;
|
||||
public Object clone() throws CloneNotSupportedException;
|
||||
|
||||
public boolean useOreDic();
|
||||
public boolean useOreDic();
|
||||
}
|
||||
|
|
|
@ -2,7 +2,8 @@ package techreborn.api.recipe;
|
|||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IRecipeCompact {
|
||||
public interface IRecipeCompact
|
||||
{
|
||||
|
||||
ItemStack getItem(String name);
|
||||
ItemStack getItem(String name);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package techreborn.api.recipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import reborncore.api.power.IEnergyInterfaceTile;
|
||||
|
@ -8,327 +10,421 @@ import reborncore.common.tile.TileMachineBase;
|
|||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Use this in your tile entity to craft things
|
||||
*/
|
||||
public class RecipeCrafter {
|
||||
public class RecipeCrafter
|
||||
{
|
||||
|
||||
/**
|
||||
* This is the recipe type to use
|
||||
*/
|
||||
public String recipeName;
|
||||
/**
|
||||
* This is the recipe type to use
|
||||
*/
|
||||
public String recipeName;
|
||||
|
||||
/**
|
||||
* This is the parent tile
|
||||
*/
|
||||
public TileMachineBase parentTile;
|
||||
/**
|
||||
* This is the parent tile
|
||||
*/
|
||||
public TileMachineBase parentTile;
|
||||
|
||||
/**
|
||||
* This is the place to use the power from
|
||||
*/
|
||||
public IEnergyInterfaceTile energy;
|
||||
/**
|
||||
* This is the place to use the power from
|
||||
*/
|
||||
public IEnergyInterfaceTile energy;
|
||||
|
||||
/**
|
||||
* This is the amount of inputs that the setRecipe has
|
||||
*/
|
||||
public int inputs;
|
||||
/**
|
||||
* This is the amount of inputs that the setRecipe has
|
||||
*/
|
||||
public int inputs;
|
||||
|
||||
/**
|
||||
* This is the amount of outputs that the recipe has
|
||||
*/
|
||||
public int outputs;
|
||||
/**
|
||||
* This is the amount of outputs that the recipe has
|
||||
*/
|
||||
public int outputs;
|
||||
|
||||
/**
|
||||
* This is the inventory to use for the crafting
|
||||
*/
|
||||
public Inventory inventory;
|
||||
/**
|
||||
* This is the inventory to use for the crafting
|
||||
*/
|
||||
public Inventory inventory;
|
||||
|
||||
/**
|
||||
* This is the list of the slots that the crafting logic should look for the input item stacks.
|
||||
*/
|
||||
public int[] inputSlots;
|
||||
/**
|
||||
* This is the list of the slots that the crafting logic should look for the
|
||||
* input item stacks.
|
||||
*/
|
||||
public int[] inputSlots;
|
||||
|
||||
/**
|
||||
* This is the list for the slots that the crafting logic should look fot the output item stacks.
|
||||
*/
|
||||
public int[] outputSlots;
|
||||
/**
|
||||
* This is the list for the slots that the crafting logic should look fot
|
||||
* the output item stacks.
|
||||
*/
|
||||
public int[] outputSlots;
|
||||
|
||||
/**
|
||||
* This is the constructor, not a lot to say here :P
|
||||
*
|
||||
* @param recipeName The recipe name that should be crafted
|
||||
* @param parentTile The tile that wil be using this recipe crafter
|
||||
* @param inputs The amount of input slots
|
||||
* @param outputs The amount of output slots
|
||||
* @param inventory The inventory of the machine
|
||||
* @param inputSlots A list of the input slot ids
|
||||
* @param outputSlots A list of output slot ids
|
||||
*/
|
||||
public RecipeCrafter(String recipeName, TileMachineBase parentTile, int inputs, int outputs, Inventory inventory, int[] inputSlots, int[] outputSlots) {
|
||||
this.recipeName = recipeName;
|
||||
this.parentTile = parentTile;
|
||||
if (parentTile instanceof IEnergyInterfaceTile) {
|
||||
energy = (IEnergyInterfaceTile) parentTile;
|
||||
}
|
||||
this.inputs = inputs;
|
||||
this.outputs = outputs;
|
||||
this.inventory = inventory;
|
||||
this.inputSlots = inputSlots;
|
||||
this.outputSlots = outputSlots;
|
||||
}
|
||||
/**
|
||||
* This is the constructor, not a lot to say here :P
|
||||
*
|
||||
* @param recipeName
|
||||
* The recipe name that should be crafted
|
||||
* @param parentTile
|
||||
* The tile that wil be using this recipe crafter
|
||||
* @param inputs
|
||||
* The amount of input slots
|
||||
* @param outputs
|
||||
* The amount of output slots
|
||||
* @param inventory
|
||||
* The inventory of the machine
|
||||
* @param inputSlots
|
||||
* A list of the input slot ids
|
||||
* @param outputSlots
|
||||
* A list of output slot ids
|
||||
*/
|
||||
public RecipeCrafter(String recipeName, TileMachineBase parentTile, int inputs, int outputs, Inventory inventory,
|
||||
int[] inputSlots, int[] outputSlots)
|
||||
{
|
||||
this.recipeName = recipeName;
|
||||
this.parentTile = parentTile;
|
||||
if (parentTile instanceof IEnergyInterfaceTile)
|
||||
{
|
||||
energy = (IEnergyInterfaceTile) parentTile;
|
||||
}
|
||||
this.inputs = inputs;
|
||||
this.outputs = outputs;
|
||||
this.inventory = inventory;
|
||||
this.inputSlots = inputSlots;
|
||||
this.outputSlots = outputSlots;
|
||||
}
|
||||
|
||||
public IBaseRecipeType currentRecipe;
|
||||
public int currentTickTime = 0;
|
||||
public int currentNeededTicks = 1;// Set to 1 to stop rare crashes
|
||||
double lastEnergy;
|
||||
|
||||
public IBaseRecipeType currentRecipe;
|
||||
public int currentTickTime = 0;
|
||||
public int currentNeededTicks = 1;//Set to 1 to stop rare crashes
|
||||
double lastEnergy;
|
||||
/**
|
||||
* This is used to change the speed of the crafting operation.
|
||||
* <p/>
|
||||
* 0 = none; 0.2 = 20% speed increase 0.75 = 75% increase
|
||||
*/
|
||||
double speedMultiplier = 0;
|
||||
|
||||
/**
|
||||
* This is used to change the speed of the crafting operation.
|
||||
* <p/>
|
||||
* 0 = none;
|
||||
* 0.2 = 20% speed increase
|
||||
* 0.75 = 75% increase
|
||||
*/
|
||||
double speedMultiplier = 0;
|
||||
/**
|
||||
* This is used to change the power of the crafting operation.
|
||||
* <p/>
|
||||
* 1 = none; 1.2 = 20% speed increase 1.75 = 75% increase 5 = uses 5 times
|
||||
* more power
|
||||
*/
|
||||
double powerMultiplier = 1;
|
||||
|
||||
/**
|
||||
* This is used to change the power of the crafting operation.
|
||||
* <p/>
|
||||
* 1 = none;
|
||||
* 1.2 = 20% speed increase
|
||||
* 1.75 = 75% increase
|
||||
* 5 = uses 5 times more power
|
||||
*/
|
||||
double powerMultiplier = 1;
|
||||
int ticksSinceLastChange;
|
||||
|
||||
int ticksSinceLastChange;
|
||||
/**
|
||||
* Call this on the tile tick
|
||||
*/
|
||||
public void updateEntity()
|
||||
{
|
||||
if (parentTile.getWorld().isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ticksSinceLastChange++;
|
||||
if (ticksSinceLastChange == 20)
|
||||
{// Force a has chanced every second
|
||||
inventory.hasChanged = true;
|
||||
ticksSinceLastChange = 0;
|
||||
}
|
||||
if (currentRecipe == null && inventory.hasChanged)
|
||||
{// It will now look for new recipes.
|
||||
currentTickTime = 0;
|
||||
for (IBaseRecipeType recipe : RecipeHandler.getRecipeClassFromName(recipeName))
|
||||
{
|
||||
if (recipe.canCraft(parentTile) && hasAllInputs(recipe))
|
||||
{// This checks to see if it has all of the inputs
|
||||
boolean canGiveInvAll = true;
|
||||
for (int i = 0; i < recipe.getOutputsSize(); i++)
|
||||
{// This checks to see if it can fit all of the outputs
|
||||
if (!canFitStack(recipe.getOutput(i), outputSlots[i], recipe.useOreDic()))
|
||||
{
|
||||
canGiveInvAll = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (canGiveInvAll)
|
||||
{
|
||||
setCurrentRecipe(recipe);// Sets the current recipe then
|
||||
// syncs
|
||||
this.currentNeededTicks = (int) (currentRecipe.tickTime() * (1.0 - speedMultiplier));
|
||||
this.currentTickTime = -1;
|
||||
setIsActive();
|
||||
} else
|
||||
{
|
||||
this.currentTickTime = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
if (inventory.hasChanged && !hasAllInputs())
|
||||
{// If it doesn't have all the inputs reset
|
||||
currentRecipe = null;
|
||||
currentTickTime = -1;
|
||||
setIsActive();
|
||||
}
|
||||
if (currentRecipe != null && currentTickTime >= currentNeededTicks)
|
||||
{// If it has reached the recipe tick time
|
||||
boolean canGiveInvAll = true;
|
||||
for (int i = 0; i < currentRecipe.getOutputsSize(); i++)
|
||||
{// Checks to see if it can fit the output
|
||||
if (!canFitStack(currentRecipe.getOutput(i), outputSlots[i], currentRecipe.useOreDic()))
|
||||
{
|
||||
canGiveInvAll = false;
|
||||
}
|
||||
}
|
||||
ArrayList<Integer> filledSlots = new ArrayList<Integer>();// The
|
||||
// slots
|
||||
// that
|
||||
// have
|
||||
// been
|
||||
// filled
|
||||
if (canGiveInvAll && currentRecipe.onCraft(parentTile))
|
||||
{
|
||||
for (int i = 0; i < currentRecipe.getOutputsSize(); i++)
|
||||
{
|
||||
if (!filledSlots.contains(outputSlots[i]))
|
||||
{// checks it has not been filled
|
||||
fitStack(currentRecipe.getOutput(i).copy(), outputSlots[i]);// fills
|
||||
// the
|
||||
// slot
|
||||
// with
|
||||
// the
|
||||
// output
|
||||
// stack
|
||||
filledSlots.add(outputSlots[i]);
|
||||
}
|
||||
}
|
||||
useAllInputs();// this uses all the inputs
|
||||
currentRecipe = null;// resets
|
||||
currentTickTime = -1;
|
||||
setIsActive();
|
||||
}
|
||||
} else if (currentRecipe != null && currentTickTime < currentNeededTicks)
|
||||
{
|
||||
if (energy.canUseEnergy(getEuPerTick()))
|
||||
{// This uses the power
|
||||
energy.useEnergy(getEuPerTick());
|
||||
currentTickTime++;// increase the ticktime
|
||||
}
|
||||
}
|
||||
}
|
||||
if (inventory.hasChanged)
|
||||
{
|
||||
inventory.hasChanged = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this on the tile tick
|
||||
*/
|
||||
public void updateEntity() {
|
||||
if (parentTile.getWorld().isRemote) {
|
||||
return;
|
||||
}
|
||||
ticksSinceLastChange++;
|
||||
if (ticksSinceLastChange == 20) {//Force a has chanced every second
|
||||
inventory.hasChanged = true;
|
||||
ticksSinceLastChange = 0;
|
||||
}
|
||||
if (currentRecipe == null && inventory.hasChanged) {//It will now look for new recipes.
|
||||
currentTickTime = 0;
|
||||
for (IBaseRecipeType recipe : RecipeHandler.getRecipeClassFromName(recipeName)) {
|
||||
if (recipe.canCraft(parentTile) && hasAllInputs(recipe)) {//This checks to see if it has all of the inputs
|
||||
boolean canGiveInvAll = true;
|
||||
for (int i = 0; i < recipe.getOutputsSize(); i++) {//This checks to see if it can fit all of the outputs
|
||||
if (!canFitStack(recipe.getOutput(i), outputSlots[i], recipe.useOreDic())) {
|
||||
canGiveInvAll = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (canGiveInvAll) {
|
||||
setCurrentRecipe(recipe);//Sets the current recipe then syncs
|
||||
this.currentNeededTicks = (int) (currentRecipe.tickTime() * (1.0 - speedMultiplier));
|
||||
this.currentTickTime = -1;
|
||||
setIsActive();
|
||||
} else {
|
||||
this.currentTickTime = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (inventory.hasChanged && !hasAllInputs()) {//If it doesn't have all the inputs reset
|
||||
currentRecipe = null;
|
||||
currentTickTime = -1;
|
||||
setIsActive();
|
||||
}
|
||||
if (currentRecipe != null && currentTickTime >= currentNeededTicks) {//If it has reached the recipe tick time
|
||||
boolean canGiveInvAll = true;
|
||||
for (int i = 0; i < currentRecipe.getOutputsSize(); i++) {//Checks to see if it can fit the output
|
||||
if (!canFitStack(currentRecipe.getOutput(i), outputSlots[i], currentRecipe.useOreDic())) {
|
||||
canGiveInvAll = false;
|
||||
}
|
||||
}
|
||||
ArrayList<Integer> filledSlots = new ArrayList<Integer>();//The slots that have been filled
|
||||
if (canGiveInvAll && currentRecipe.onCraft(parentTile)) {
|
||||
for (int i = 0; i < currentRecipe.getOutputsSize(); i++) {
|
||||
if (!filledSlots.contains(outputSlots[i])) {//checks it has not been filled
|
||||
fitStack(currentRecipe.getOutput(i).copy(), outputSlots[i]);//fills the slot with the output stack
|
||||
filledSlots.add(outputSlots[i]);
|
||||
}
|
||||
}
|
||||
useAllInputs();//this uses all the inputs
|
||||
currentRecipe = null;//resets
|
||||
currentTickTime = -1;
|
||||
setIsActive();
|
||||
}
|
||||
} else if (currentRecipe != null && currentTickTime < currentNeededTicks) {
|
||||
if (energy.canUseEnergy(getEuPerTick())) {//This uses the power
|
||||
energy.useEnergy(getEuPerTick());
|
||||
currentTickTime++;//increase the ticktime
|
||||
}
|
||||
}
|
||||
}
|
||||
if (inventory.hasChanged) {
|
||||
inventory.hasChanged = false;
|
||||
}
|
||||
}
|
||||
public boolean hasAllInputs()
|
||||
{
|
||||
if (currentRecipe == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for (ItemStack input : currentRecipe.getInputs())
|
||||
{
|
||||
Boolean hasItem = false;
|
||||
for (int inputSlot : inputSlots)
|
||||
{// Checks to see if it can find the input
|
||||
if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputSlot), true, true,
|
||||
currentRecipe.useOreDic()) && inventory.getStackInSlot(inputSlot).stackSize >= input.stackSize)
|
||||
{
|
||||
hasItem = true;
|
||||
}
|
||||
}
|
||||
if (!hasItem)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasAllInputs() {
|
||||
if (currentRecipe == null) {
|
||||
return false;
|
||||
}
|
||||
for (ItemStack input : currentRecipe.getInputs()) {
|
||||
Boolean hasItem = false;
|
||||
for (int inputSlot : inputSlots) {//Checks to see if it can find the input
|
||||
if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputSlot), true, true, currentRecipe.useOreDic()) && inventory.getStackInSlot(inputSlot).stackSize >= input.stackSize) {
|
||||
hasItem = true;
|
||||
}
|
||||
}
|
||||
if (!hasItem)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public boolean hasAllInputs(IBaseRecipeType recipeType)
|
||||
{
|
||||
if (recipeType == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for (ItemStack input : recipeType.getInputs())
|
||||
{
|
||||
Boolean hasItem = false;
|
||||
for (int inputslot : inputSlots)
|
||||
{
|
||||
if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputslot), true, true,
|
||||
recipeType.useOreDic()) && inventory.getStackInSlot(inputslot).stackSize >= input.stackSize)
|
||||
{
|
||||
hasItem = true;
|
||||
}
|
||||
}
|
||||
if (!hasItem)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasAllInputs(IBaseRecipeType recipeType) {
|
||||
if (recipeType == null) {
|
||||
return false;
|
||||
}
|
||||
for (ItemStack input : recipeType.getInputs()) {
|
||||
Boolean hasItem = false;
|
||||
for (int inputslot : inputSlots) {
|
||||
if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputslot), true, true, recipeType.useOreDic()) && inventory.getStackInSlot(inputslot).stackSize >= input.stackSize) {
|
||||
hasItem = true;
|
||||
}
|
||||
}
|
||||
if (!hasItem)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public void useAllInputs()
|
||||
{
|
||||
if (currentRecipe == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (ItemStack input : currentRecipe.getInputs())
|
||||
{
|
||||
for (int inputSlot : inputSlots)
|
||||
{// Uses all of the inputs
|
||||
if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputSlot), true, true,
|
||||
currentRecipe.useOreDic()))
|
||||
{
|
||||
inventory.decrStackSize(inputSlot, input.stackSize);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void useAllInputs() {
|
||||
if (currentRecipe == null) {
|
||||
return;
|
||||
}
|
||||
for (ItemStack input : currentRecipe.getInputs()) {
|
||||
for (int inputSlot : inputSlots) {//Uses all of the inputs
|
||||
if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputSlot), true, true, currentRecipe.useOreDic())) {
|
||||
inventory.decrStackSize(inputSlot, input.stackSize);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public boolean canFitStack(ItemStack stack, int slot, boolean oreDic)
|
||||
{// Checks to see if it can fit the stack
|
||||
if (stack == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (inventory.getStackInSlot(slot) == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, oreDic))
|
||||
{
|
||||
if (stack.stackSize + inventory.getStackInSlot(slot).stackSize <= stack.getMaxStackSize())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean canFitStack(ItemStack stack, int slot, boolean oreDic) {//Checks to see if it can fit the stack
|
||||
if (stack == null) {
|
||||
return true;
|
||||
}
|
||||
if (inventory.getStackInSlot(slot) == null) {
|
||||
return true;
|
||||
}
|
||||
if (ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, oreDic)) {
|
||||
if (stack.stackSize + inventory.getStackInSlot(slot).stackSize <= stack.getMaxStackSize()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public void fitStack(ItemStack stack, int slot)
|
||||
{// This fits a stack into a slot
|
||||
if (stack == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (inventory.getStackInSlot(slot) == null)
|
||||
{// If the slot is empty set the contents
|
||||
inventory.setInventorySlotContents(slot, stack);
|
||||
return;
|
||||
}
|
||||
if (ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, currentRecipe.useOreDic()))
|
||||
{// If the slot has stuff in
|
||||
if (stack.stackSize + inventory.getStackInSlot(slot).stackSize <= stack.getMaxStackSize())
|
||||
{// Check to see if it fits
|
||||
ItemStack newStack = stack.copy();
|
||||
newStack.stackSize = inventory.getStackInSlot(slot).stackSize + stack.stackSize;// Sets
|
||||
// the
|
||||
// new
|
||||
// stack
|
||||
// size
|
||||
inventory.setInventorySlotContents(slot, newStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void fitStack(ItemStack stack, int slot) {//This fits a stack into a slot
|
||||
if (stack == null) {
|
||||
return;
|
||||
}
|
||||
if (inventory.getStackInSlot(slot) == null) {//If the slot is empty set the contents
|
||||
inventory.setInventorySlotContents(slot, stack);
|
||||
return;
|
||||
}
|
||||
if (ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, currentRecipe.useOreDic())) {//If the slot has stuff in
|
||||
if (stack.stackSize + inventory.getStackInSlot(slot).stackSize <= stack.getMaxStackSize()) {//Check to see if it fits
|
||||
ItemStack newStack = stack.copy();
|
||||
newStack.stackSize = inventory.getStackInSlot(slot).stackSize + stack.stackSize;//Sets the new stack size
|
||||
inventory.setInventorySlotContents(slot, newStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void readFromNBT(NBTTagCompound tag)
|
||||
{
|
||||
NBTTagCompound data = tag.getCompoundTag("Crater");
|
||||
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
NBTTagCompound data = tag.getCompoundTag("Crater");
|
||||
if (data.hasKey("currentTickTime"))
|
||||
currentTickTime = data.getInteger("currentTickTime");
|
||||
|
||||
if (data.hasKey("currentTickTime"))
|
||||
currentTickTime = data.getInteger("currentTickTime");
|
||||
if (parentTile != null && parentTile.getWorld() != null && parentTile.getWorld().isRemote)
|
||||
{
|
||||
parentTile.getWorld().notifyBlockUpdate(parentTile.getPos(),
|
||||
parentTile.getWorld().getBlockState(parentTile.getPos()),
|
||||
parentTile.getWorld().getBlockState(parentTile.getPos()), 3);
|
||||
parentTile.getWorld().markBlockRangeForRenderUpdate(parentTile.getPos().getX(), parentTile.getPos().getY(),
|
||||
parentTile.getPos().getZ(), parentTile.getPos().getX(), parentTile.getPos().getY(),
|
||||
parentTile.getPos().getZ());
|
||||
}
|
||||
}
|
||||
|
||||
if (parentTile != null && parentTile.getWorld() != null && parentTile.getWorld().isRemote) {
|
||||
parentTile.getWorld().notifyBlockUpdate(parentTile.getPos(), parentTile.getWorld().getBlockState(parentTile.getPos()), parentTile.getWorld().getBlockState(parentTile.getPos()), 3);
|
||||
parentTile.getWorld().markBlockRangeForRenderUpdate(parentTile.getPos().getX(), parentTile.getPos().getY(), parentTile.getPos().getZ(), parentTile.getPos().getX(), parentTile.getPos().getY(), parentTile.getPos().getZ());
|
||||
}
|
||||
}
|
||||
public void writeToNBT(NBTTagCompound tag)
|
||||
{
|
||||
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setDouble("currentTickTime", currentTickTime);
|
||||
|
||||
data.setDouble("currentTickTime", currentTickTime);
|
||||
tag.setTag("Crater", data);
|
||||
}
|
||||
|
||||
tag.setTag("Crater", data);
|
||||
}
|
||||
private boolean isActive()
|
||||
{
|
||||
return currentRecipe != null && energy.getEnergy() >= currentRecipe.euPerTick();
|
||||
}
|
||||
|
||||
public void addSpeedMulti(double amount)
|
||||
{
|
||||
if (speedMultiplier + amount <= 0.99)
|
||||
{
|
||||
speedMultiplier += amount;
|
||||
} else
|
||||
{
|
||||
speedMultiplier = 0.99;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isActive() {
|
||||
return currentRecipe != null && energy.getEnergy() >= currentRecipe.euPerTick();
|
||||
}
|
||||
public void resetSpeedMulti()
|
||||
{
|
||||
speedMultiplier = 0;
|
||||
}
|
||||
|
||||
public void addSpeedMulti(double amount) {
|
||||
if (speedMultiplier + amount <= 0.99) {
|
||||
speedMultiplier += amount;
|
||||
} else {
|
||||
speedMultiplier = 0.99;
|
||||
}
|
||||
}
|
||||
public double getSpeedMultiplier()
|
||||
{
|
||||
return speedMultiplier;
|
||||
}
|
||||
|
||||
public void resetSpeedMulti() {
|
||||
speedMultiplier = 0;
|
||||
}
|
||||
public void addPowerMulti(double amount)
|
||||
{
|
||||
powerMultiplier += amount;
|
||||
}
|
||||
|
||||
public double getSpeedMultiplier() {
|
||||
return speedMultiplier;
|
||||
}
|
||||
public void resetPowerMulti()
|
||||
{
|
||||
powerMultiplier = 1;
|
||||
}
|
||||
|
||||
public void addPowerMulti(double amount) {
|
||||
powerMultiplier += amount;
|
||||
}
|
||||
public double getPowerMultiplier()
|
||||
{
|
||||
return powerMultiplier;
|
||||
}
|
||||
|
||||
public void resetPowerMulti() {
|
||||
powerMultiplier = 1;
|
||||
}
|
||||
public double getEuPerTick()
|
||||
{
|
||||
return currentRecipe.euPerTick() * powerMultiplier;
|
||||
}
|
||||
|
||||
public double getPowerMultiplier() {
|
||||
return powerMultiplier;
|
||||
}
|
||||
public void setIsActive()
|
||||
{
|
||||
if (parentTile.getWorld().getBlockState(parentTile.getPos()).getBlock() instanceof BlockMachineBase)
|
||||
{
|
||||
BlockMachineBase blockMachineBase = (BlockMachineBase) parentTile.getWorld()
|
||||
.getBlockState(parentTile.getPos()).getBlock();
|
||||
blockMachineBase.setActive(isActive(), parentTile.getWorld(), parentTile.getPos());
|
||||
}
|
||||
parentTile.getWorld().notifyBlockUpdate(parentTile.getPos(),
|
||||
parentTile.getWorld().getBlockState(parentTile.getPos()),
|
||||
parentTile.getWorld().getBlockState(parentTile.getPos()), 3);
|
||||
}
|
||||
|
||||
public double getEuPerTick() {
|
||||
return currentRecipe.euPerTick() * powerMultiplier;
|
||||
}
|
||||
|
||||
|
||||
public void setIsActive() {
|
||||
if(parentTile.getWorld().getBlockState(parentTile.getPos()).getBlock() instanceof BlockMachineBase){
|
||||
BlockMachineBase blockMachineBase = (BlockMachineBase) parentTile.getWorld().getBlockState(parentTile.getPos()).getBlock();
|
||||
blockMachineBase.setActive(isActive(), parentTile.getWorld(), parentTile.getPos());
|
||||
}
|
||||
parentTile.getWorld().notifyBlockUpdate(parentTile.getPos(), parentTile.getWorld().getBlockState(parentTile.getPos()), parentTile.getWorld().getBlockState(parentTile.getPos()), 3);
|
||||
}
|
||||
|
||||
public void setCurrentRecipe(IBaseRecipeType recipe) {
|
||||
try {
|
||||
this.currentRecipe = (IBaseRecipeType) recipe.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
public void setCurrentRecipe(IBaseRecipeType recipe)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.currentRecipe = (IBaseRecipeType) recipe.clone();
|
||||
} catch (CloneNotSupportedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,103 +1,127 @@
|
|||
package techreborn.api.recipe;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.apache.commons.lang3.time.StopWatch;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.Core;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class RecipeHandler {
|
||||
import org.apache.commons.lang3.time.StopWatch;
|
||||
|
||||
/**
|
||||
* This is the array list of all of the recipes for all of the machines
|
||||
*/
|
||||
public static final ArrayList<IBaseRecipeType> recipeList = new ArrayList<IBaseRecipeType>();
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.Core;
|
||||
|
||||
public class RecipeHandler
|
||||
{
|
||||
|
||||
public static HashMap<IBaseRecipeType, String> stackMap = new HashMap<IBaseRecipeType, String>();
|
||||
/**
|
||||
* This is a list of all the registered machine names.
|
||||
*/
|
||||
public static ArrayList<String> machineNames = new ArrayList<String>();
|
||||
/**
|
||||
* This is the array list of all of the recipes for all of the machines
|
||||
*/
|
||||
public static final ArrayList<IBaseRecipeType> recipeList = new ArrayList<IBaseRecipeType>();
|
||||
|
||||
/**
|
||||
* Use this to get all of the recipes form a recipe name
|
||||
*
|
||||
* @param name the name that the recipe was resisted as.
|
||||
* @return A list of all the recipes of a given name.
|
||||
*/
|
||||
public static List<IBaseRecipeType> getRecipeClassFromName(String name) {
|
||||
List<IBaseRecipeType> baseRecipeList = new ArrayList<IBaseRecipeType>();
|
||||
for (IBaseRecipeType baseRecipe : recipeList) {
|
||||
if (baseRecipe.getRecipeName().equals(name)) {
|
||||
baseRecipeList.add(baseRecipe);
|
||||
}
|
||||
}
|
||||
return baseRecipeList;
|
||||
}
|
||||
public static HashMap<IBaseRecipeType, String> stackMap = new HashMap<IBaseRecipeType, String>();
|
||||
/**
|
||||
* This is a list of all the registered machine names.
|
||||
*/
|
||||
public static ArrayList<String> machineNames = new ArrayList<String>();
|
||||
|
||||
public static String getUserFreindlyName(String name) {
|
||||
for (IBaseRecipeType baseRecipe : recipeList) {
|
||||
if (baseRecipe.getRecipeName().equals(name)) {
|
||||
return baseRecipe.getUserFreindlyName();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
/**
|
||||
* Use this to get all of the recipes form a recipe name
|
||||
*
|
||||
* @param name
|
||||
* the name that the recipe was resisted as.
|
||||
* @return A list of all the recipes of a given name.
|
||||
*/
|
||||
public static List<IBaseRecipeType> getRecipeClassFromName(String name)
|
||||
{
|
||||
List<IBaseRecipeType> baseRecipeList = new ArrayList<IBaseRecipeType>();
|
||||
for (IBaseRecipeType baseRecipe : recipeList)
|
||||
{
|
||||
if (baseRecipe.getRecipeName().equals(name))
|
||||
{
|
||||
baseRecipeList.add(baseRecipe);
|
||||
}
|
||||
}
|
||||
return baseRecipeList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a recipe to the system
|
||||
*
|
||||
* @param recipe The recipe to add to the system.
|
||||
*/
|
||||
public static void addRecipe(IBaseRecipeType recipe) {
|
||||
if (recipe == null) {
|
||||
return;
|
||||
}
|
||||
if (recipeList.contains(recipe)) {
|
||||
return;
|
||||
}
|
||||
// if (!RecipeConfigManager.canLoadRecipe(recipe)) {
|
||||
// return;
|
||||
// }
|
||||
if (!machineNames.contains(recipe.getRecipeName())) {
|
||||
machineNames.add(recipe.getRecipeName());
|
||||
}
|
||||
recipeList.add(recipe);
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
for (StackTraceElement ste : Thread.currentThread().getStackTrace()) {
|
||||
buffer.append(ste);
|
||||
}
|
||||
stackMap.put(recipe, buffer.toString());
|
||||
}
|
||||
public static String getUserFreindlyName(String name)
|
||||
{
|
||||
for (IBaseRecipeType baseRecipe : recipeList)
|
||||
{
|
||||
if (baseRecipe.getRecipeName().equals(name))
|
||||
{
|
||||
return baseRecipe.getUserFreindlyName();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a recipe to the system
|
||||
*
|
||||
* @param recipe
|
||||
* The recipe to add to the system.
|
||||
*/
|
||||
public static void addRecipe(IBaseRecipeType recipe)
|
||||
{
|
||||
if (recipe == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (recipeList.contains(recipe))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// if (!RecipeConfigManager.canLoadRecipe(recipe)) {
|
||||
// return;
|
||||
// }
|
||||
if (!machineNames.contains(recipe.getRecipeName()))
|
||||
{
|
||||
machineNames.add(recipe.getRecipeName());
|
||||
}
|
||||
recipeList.add(recipe);
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
for (StackTraceElement ste : Thread.currentThread().getStackTrace())
|
||||
{
|
||||
buffer.append(ste);
|
||||
}
|
||||
stackMap.put(recipe, buffer.toString());
|
||||
}
|
||||
|
||||
public static void scanForDupeRecipes() throws Exception {
|
||||
StopWatch watch = new StopWatch();
|
||||
watch.start();
|
||||
for (IBaseRecipeType baseRecipeType : recipeList) {
|
||||
for (IBaseRecipeType recipe : recipeList) {
|
||||
if (baseRecipeType != recipe && baseRecipeType.getRecipeName().equals(recipe.getRecipeName())) {
|
||||
for (int i = 0; i < baseRecipeType.getInputs().size(); i++) {
|
||||
if (ItemUtils.isItemEqual(baseRecipeType.getInputs().get(i), recipe.getInputs().get(i), true, false, false)) {
|
||||
StringBuffer itemInfo = new StringBuffer();
|
||||
for (ItemStack inputs : baseRecipeType.getInputs()) {
|
||||
itemInfo.append(":" + inputs.getItem().getUnlocalizedName() + "," + inputs.getDisplayName() + "," + inputs.stackSize);
|
||||
}
|
||||
Core.logHelper.all(stackMap.get(baseRecipeType));
|
||||
// throw new Exception("Found a duplicate recipe for " + baseRecipeType.getRecipeName() + " with inputs " + itemInfo.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Core.logHelper.all(watch + " : Scanning dupe recipes");
|
||||
watch.stop();
|
||||
public static void scanForDupeRecipes() throws Exception
|
||||
{
|
||||
StopWatch watch = new StopWatch();
|
||||
watch.start();
|
||||
for (IBaseRecipeType baseRecipeType : recipeList)
|
||||
{
|
||||
for (IBaseRecipeType recipe : recipeList)
|
||||
{
|
||||
if (baseRecipeType != recipe && baseRecipeType.getRecipeName().equals(recipe.getRecipeName()))
|
||||
{
|
||||
for (int i = 0; i < baseRecipeType.getInputs().size(); i++)
|
||||
{
|
||||
if (ItemUtils.isItemEqual(baseRecipeType.getInputs().get(i), recipe.getInputs().get(i), true,
|
||||
false, false))
|
||||
{
|
||||
StringBuffer itemInfo = new StringBuffer();
|
||||
for (ItemStack inputs : baseRecipeType.getInputs())
|
||||
{
|
||||
itemInfo.append(":" + inputs.getItem().getUnlocalizedName() + ","
|
||||
+ inputs.getDisplayName() + "," + inputs.stackSize);
|
||||
}
|
||||
Core.logHelper.all(stackMap.get(baseRecipeType));
|
||||
// throw new Exception("Found a duplicate recipe for
|
||||
// " + baseRecipeType.getRecipeName() + " with
|
||||
// inputs " + itemInfo.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Core.logHelper.all(watch + " : Scanning dupe recipes");
|
||||
watch.stop();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -3,17 +3,21 @@ package techreborn.api.recipe;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.items.ItemParts;
|
||||
import techreborn.lib.Reference;
|
||||
//THIS is only here to trick JEI into showing recipes for the recycler
|
||||
public class RecyclerRecipe extends BaseRecipe {
|
||||
|
||||
public RecyclerRecipe(ItemStack input) {
|
||||
//THIS is only here to trick JEI into showing recipes for the recycler
|
||||
public class RecyclerRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public RecyclerRecipe(ItemStack input)
|
||||
{
|
||||
super(Reference.recyclerRecipe, 0, 0);
|
||||
inputs.add(input);
|
||||
addOutput(ItemParts.getPartByName("scrap"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "Recycler";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,16 +4,19 @@ import net.minecraft.item.ItemStack;
|
|||
import techreborn.init.ModItems;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
public class ScrapboxRecipe extends BaseRecipe {
|
||||
public class ScrapboxRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public ScrapboxRecipe(ItemStack output) {
|
||||
public ScrapboxRecipe(ItemStack output)
|
||||
{
|
||||
super(Reference.scrapboxRecipe, 0, 0);
|
||||
inputs.add(new ItemStack(ModItems.scrapBox));
|
||||
addOutput(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "Scrapbox";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,20 +4,23 @@ import net.minecraft.item.ItemStack;
|
|||
import techreborn.api.recipe.BaseRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
public class AlloySmelterRecipe extends BaseRecipe {
|
||||
public class AlloySmelterRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public AlloySmelterRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick) {
|
||||
super(Reference.alloySmelteRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
}
|
||||
public AlloySmelterRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick)
|
||||
{
|
||||
super(Reference.alloySmelteRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
return "Alloy Smelter";
|
||||
}
|
||||
@Override
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "Alloy Smelter";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,20 +4,23 @@ import net.minecraft.item.ItemStack;
|
|||
import techreborn.api.recipe.BaseRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
public class AssemblingMachineRecipe extends BaseRecipe {
|
||||
public class AssemblingMachineRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public AssemblingMachineRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick) {
|
||||
super(Reference.assemblingMachineRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
}
|
||||
public AssemblingMachineRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick)
|
||||
{
|
||||
super(Reference.assemblingMachineRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
return "Assembling Machine";
|
||||
}
|
||||
@Override
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "Assembling Machine";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,41 +6,47 @@ import techreborn.api.recipe.BaseRecipe;
|
|||
import techreborn.lib.Reference;
|
||||
import techreborn.tiles.TileBlastFurnace;
|
||||
|
||||
public class BlastFurnaceRecipe extends BaseRecipe {
|
||||
public class BlastFurnaceRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public int neededHeat;
|
||||
|
||||
public int neededHeat;
|
||||
public BlastFurnaceRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, int tickTime,
|
||||
int euPerTick, int neededHeat)
|
||||
{
|
||||
super(Reference.blastFurnaceRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
|
||||
public BlastFurnaceRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, int tickTime, int euPerTick, int neededHeat) {
|
||||
super(Reference.blastFurnaceRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
this.neededHeat = neededHeat;
|
||||
}
|
||||
|
||||
this.neededHeat = neededHeat;
|
||||
}
|
||||
@Override
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "Blast Furnace";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
return "Blast Furnace";
|
||||
}
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile)
|
||||
{
|
||||
if (tile instanceof TileBlastFurnace)
|
||||
{
|
||||
TileBlastFurnace blastFurnace = (TileBlastFurnace) tile;
|
||||
return blastFurnace.getHeat() >= neededHeat;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile) {
|
||||
if (tile instanceof TileBlastFurnace) {
|
||||
TileBlastFurnace blastFurnace = (TileBlastFurnace) tile;
|
||||
return blastFurnace.getHeat() >= neededHeat;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCraft(TileEntity tile) {
|
||||
return super.onCraft(tile);
|
||||
}
|
||||
@Override
|
||||
public boolean onCraft(TileEntity tile)
|
||||
{
|
||||
return super.onCraft(tile);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,26 +4,30 @@ import net.minecraft.item.ItemStack;
|
|||
import techreborn.api.recipe.BaseRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
public class CentrifugeRecipe extends BaseRecipe {
|
||||
public class CentrifugeRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public CentrifugeRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, ItemStack output3, ItemStack output4, int tickTime, int euPerTick) {
|
||||
super(Reference.centrifugeRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
if (output3 != null)
|
||||
addOutput(output3);
|
||||
if (output4 != null)
|
||||
addOutput(output4);
|
||||
}
|
||||
public CentrifugeRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, ItemStack output3,
|
||||
ItemStack output4, int tickTime, int euPerTick)
|
||||
{
|
||||
super(Reference.centrifugeRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
if (output3 != null)
|
||||
addOutput(output3);
|
||||
if (output4 != null)
|
||||
addOutput(output4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
return "Centrifuge";
|
||||
}
|
||||
@Override
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "Centrifuge";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,20 +4,23 @@ import net.minecraft.item.ItemStack;
|
|||
import techreborn.api.recipe.BaseRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
public class ChemicalReactorRecipe extends BaseRecipe {
|
||||
public class ChemicalReactorRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public ChemicalReactorRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick) {
|
||||
super(Reference.chemicalReactorRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
}
|
||||
public ChemicalReactorRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick)
|
||||
{
|
||||
super(Reference.chemicalReactorRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
return "Chemical Reactor";
|
||||
}
|
||||
@Override
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "Chemical Reactor";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,24 @@
|
|||
package techreborn.api.recipe.machines;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
public class CompressorRecipe extends BaseRecipe {
|
||||
public class CompressorRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public CompressorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) {
|
||||
super(Reference.compressorRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
}
|
||||
public CompressorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick)
|
||||
{
|
||||
super(Reference.compressorRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
return "Compressor";
|
||||
}
|
||||
@Override
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "Compressor";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,24 @@
|
|||
package techreborn.api.recipe.machines;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
public class ExtractorRecipe extends BaseRecipe {
|
||||
public class ExtractorRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public ExtractorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) {
|
||||
super(Reference.extractorRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
}
|
||||
public ExtractorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick)
|
||||
{
|
||||
super(Reference.extractorRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
return "Extractor";
|
||||
}
|
||||
@Override
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "Extractor";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,24 @@
|
|||
package techreborn.api.recipe.machines;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
public class GrinderRecipe extends BaseRecipe {
|
||||
public class GrinderRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public GrinderRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) {
|
||||
super(Reference.grinderRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
}
|
||||
public GrinderRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick)
|
||||
{
|
||||
super(Reference.grinderRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
return "Grinder";
|
||||
}
|
||||
@Override
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "Grinder";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,22 +4,26 @@ import net.minecraft.item.ItemStack;
|
|||
import techreborn.api.recipe.BaseRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
public class ImplosionCompressorRecipe extends BaseRecipe {
|
||||
public class ImplosionCompressorRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public ImplosionCompressorRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, int tickTime, int euPerTick) {
|
||||
super(Reference.implosionCompressorRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
}
|
||||
public ImplosionCompressorRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2,
|
||||
int tickTime, int euPerTick)
|
||||
{
|
||||
super(Reference.implosionCompressorRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
return "Implosion Compressor";
|
||||
}
|
||||
@Override
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "Implosion Compressor";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,33 +4,38 @@ import net.minecraft.item.ItemStack;
|
|||
import techreborn.api.recipe.BaseRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
public class IndustrialElectrolyzerRecipe extends BaseRecipe {
|
||||
public class IndustrialElectrolyzerRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public IndustrialElectrolyzerRecipe(ItemStack inputCells, ItemStack input2, ItemStack output1, ItemStack output2, ItemStack output3, ItemStack output4, int tickTime, int euPerTick) {
|
||||
super(Reference.industrialElectrolyzerRecipe, tickTime, euPerTick);
|
||||
if (inputCells != null)
|
||||
inputs.add(inputCells);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
if (output3 != null)
|
||||
addOutput(output3);
|
||||
if (output4 != null)
|
||||
addOutput(output4);
|
||||
}
|
||||
public IndustrialElectrolyzerRecipe(ItemStack inputCells, ItemStack input2, ItemStack output1, ItemStack output2,
|
||||
ItemStack output3, ItemStack output4, int tickTime, int euPerTick)
|
||||
{
|
||||
super(Reference.industrialElectrolyzerRecipe, tickTime, euPerTick);
|
||||
if (inputCells != null)
|
||||
inputs.add(inputCells);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
if (output3 != null)
|
||||
addOutput(output3);
|
||||
if (output4 != null)
|
||||
addOutput(output4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
return "Industrial Electrolyzer";
|
||||
}
|
||||
@Override
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "Industrial Electrolyzer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useOreDic() {
|
||||
return useOreDictionary;
|
||||
}
|
||||
@Override
|
||||
public boolean useOreDic()
|
||||
{
|
||||
return useOreDictionary;
|
||||
}
|
||||
|
||||
private boolean useOreDictionary = true;
|
||||
private boolean useOreDictionary = true;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package techreborn.api.recipe.machines;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
@ -8,72 +7,91 @@ import techreborn.api.recipe.BaseRecipe;
|
|||
import techreborn.lib.Reference;
|
||||
import techreborn.tiles.TileIndustrialGrinder;
|
||||
|
||||
public class IndustrialGrinderRecipe extends BaseRecipe {
|
||||
public class IndustrialGrinderRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public FluidStack fluidStack;
|
||||
public FluidStack fluidStack;
|
||||
|
||||
public IndustrialGrinderRecipe(ItemStack input1, ItemStack input2, FluidStack fluidStack, ItemStack output1, ItemStack output2, ItemStack output3, ItemStack output4, int tickTime, int euPerTick) {
|
||||
super(Reference.industrialGrinderRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
if (output3 != null)
|
||||
addOutput(output3);
|
||||
if (output4 != null)
|
||||
addOutput(output4);
|
||||
this.fluidStack = fluidStack;
|
||||
}
|
||||
public IndustrialGrinderRecipe(ItemStack input1, ItemStack input2, FluidStack fluidStack, ItemStack output1,
|
||||
ItemStack output2, ItemStack output3, ItemStack output4, int tickTime, int euPerTick)
|
||||
{
|
||||
super(Reference.industrialGrinderRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
if (output3 != null)
|
||||
addOutput(output3);
|
||||
if (output4 != null)
|
||||
addOutput(output4);
|
||||
this.fluidStack = fluidStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
return "IndustrialGrinder";
|
||||
}
|
||||
@Override
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "IndustrialGrinder";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile) {
|
||||
if (fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
if (tile instanceof TileIndustrialGrinder) {
|
||||
TileIndustrialGrinder grinder = (TileIndustrialGrinder) tile;
|
||||
if (grinder.tank.getFluid() == null) {
|
||||
return false;
|
||||
}
|
||||
if (grinder.tank.getFluid() == fluidStack) {
|
||||
if (grinder.tank.getFluidAmount() >= fluidStack.amount) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile)
|
||||
{
|
||||
if (fluidStack == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (tile instanceof TileIndustrialGrinder)
|
||||
{
|
||||
TileIndustrialGrinder grinder = (TileIndustrialGrinder) tile;
|
||||
if (grinder.tank.getFluid() == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (grinder.tank.getFluid() == fluidStack)
|
||||
{
|
||||
if (grinder.tank.getFluidAmount() >= fluidStack.amount)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCraft(TileEntity tile) {
|
||||
if (fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
if (tile instanceof TileIndustrialGrinder) {
|
||||
TileIndustrialGrinder grinder = (TileIndustrialGrinder) tile;
|
||||
if (grinder.tank.getFluid() == null) {
|
||||
return false;
|
||||
}
|
||||
if (grinder.tank.getFluid() == fluidStack) {
|
||||
if (grinder.tank.getFluidAmount() >= fluidStack.amount) {
|
||||
if (grinder.tank.getFluidAmount() > 0) {
|
||||
grinder.tank.setFluid(new FluidStack(fluidStack.getFluid(), grinder.tank.getFluidAmount() - fluidStack.amount));
|
||||
} else {
|
||||
grinder.tank.setFluid(null);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean onCraft(TileEntity tile)
|
||||
{
|
||||
if (fluidStack == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (tile instanceof TileIndustrialGrinder)
|
||||
{
|
||||
TileIndustrialGrinder grinder = (TileIndustrialGrinder) tile;
|
||||
if (grinder.tank.getFluid() == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (grinder.tank.getFluid() == fluidStack)
|
||||
{
|
||||
if (grinder.tank.getFluidAmount() >= fluidStack.amount)
|
||||
{
|
||||
if (grinder.tank.getFluidAmount() > 0)
|
||||
{
|
||||
grinder.tank.setFluid(new FluidStack(fluidStack.getFluid(),
|
||||
grinder.tank.getFluidAmount() - fluidStack.amount));
|
||||
} else
|
||||
{
|
||||
grinder.tank.setFluid(null);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,93 +7,115 @@ import techreborn.api.recipe.BaseRecipe;
|
|||
import techreborn.lib.Reference;
|
||||
import techreborn.tiles.TileIndustrialSawmill;
|
||||
|
||||
public class IndustrialSawmillRecipe extends BaseRecipe {
|
||||
public class IndustrialSawmillRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public FluidStack fluidStack;
|
||||
public FluidStack fluidStack;
|
||||
|
||||
public boolean canUseOreDict = false;
|
||||
public boolean canUseOreDict = false;
|
||||
|
||||
public IndustrialSawmillRecipe(ItemStack input1, ItemStack input2, FluidStack fluidStack, ItemStack output1, ItemStack output2, ItemStack output3, int tickTime, int euPerTick) {
|
||||
super(Reference.industrialSawmillRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
if (output3 != null)
|
||||
addOutput(output3);
|
||||
this.fluidStack = fluidStack;
|
||||
}
|
||||
public IndustrialSawmillRecipe(ItemStack input1, ItemStack input2, FluidStack fluidStack, ItemStack output1,
|
||||
ItemStack output2, ItemStack output3, int tickTime, int euPerTick)
|
||||
{
|
||||
super(Reference.industrialSawmillRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
if (output3 != null)
|
||||
addOutput(output3);
|
||||
this.fluidStack = fluidStack;
|
||||
}
|
||||
|
||||
public IndustrialSawmillRecipe(ItemStack input1, ItemStack input2, FluidStack fluidStack, ItemStack output1, ItemStack output2, ItemStack output3, int tickTime, int euPerTick, boolean canUseOreDict) {
|
||||
super(Reference.industrialSawmillRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
if (output3 != null)
|
||||
addOutput(output3);
|
||||
this.fluidStack = fluidStack;
|
||||
this.canUseOreDict = canUseOreDict;
|
||||
}
|
||||
public IndustrialSawmillRecipe(ItemStack input1, ItemStack input2, FluidStack fluidStack, ItemStack output1,
|
||||
ItemStack output2, ItemStack output3, int tickTime, int euPerTick, boolean canUseOreDict)
|
||||
{
|
||||
super(Reference.industrialSawmillRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (input2 != null)
|
||||
inputs.add(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
if (output3 != null)
|
||||
addOutput(output3);
|
||||
this.fluidStack = fluidStack;
|
||||
this.canUseOreDict = canUseOreDict;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
return "Industrial Sawmill";
|
||||
}
|
||||
@Override
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "Industrial Sawmill";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile) {
|
||||
if (fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
if (tile instanceof TileIndustrialSawmill) {
|
||||
TileIndustrialSawmill sawmill = (TileIndustrialSawmill) tile;
|
||||
if (sawmill.tank.getFluid() == null) {
|
||||
return false;
|
||||
}
|
||||
if (sawmill.tank.getFluid()== fluidStack) {
|
||||
if (sawmill.tank.getFluidAmount() >= fluidStack.amount) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile)
|
||||
{
|
||||
if (fluidStack == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (tile instanceof TileIndustrialSawmill)
|
||||
{
|
||||
TileIndustrialSawmill sawmill = (TileIndustrialSawmill) tile;
|
||||
if (sawmill.tank.getFluid() == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (sawmill.tank.getFluid() == fluidStack)
|
||||
{
|
||||
if (sawmill.tank.getFluidAmount() >= fluidStack.amount)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCraft(TileEntity tile) {
|
||||
if (fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
if (tile instanceof TileIndustrialSawmill) {
|
||||
TileIndustrialSawmill sawmill = (TileIndustrialSawmill) tile;
|
||||
if (sawmill.tank.getFluid() == null) {
|
||||
return false;
|
||||
}
|
||||
if (sawmill.tank.getFluid() == fluidStack) {
|
||||
if (sawmill.tank.getFluidAmount() >= fluidStack.amount) {
|
||||
if (sawmill.tank.getFluidAmount() > 0) {
|
||||
sawmill.tank.setFluid(new FluidStack(fluidStack.getFluid(), sawmill.tank.getFluidAmount() - fluidStack.amount));
|
||||
} else {
|
||||
sawmill.tank.setFluid(null);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean onCraft(TileEntity tile)
|
||||
{
|
||||
if (fluidStack == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (tile instanceof TileIndustrialSawmill)
|
||||
{
|
||||
TileIndustrialSawmill sawmill = (TileIndustrialSawmill) tile;
|
||||
if (sawmill.tank.getFluid() == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (sawmill.tank.getFluid() == fluidStack)
|
||||
{
|
||||
if (sawmill.tank.getFluidAmount() >= fluidStack.amount)
|
||||
{
|
||||
if (sawmill.tank.getFluidAmount() > 0)
|
||||
{
|
||||
sawmill.tank.setFluid(new FluidStack(fluidStack.getFluid(),
|
||||
sawmill.tank.getFluidAmount() - fluidStack.amount));
|
||||
} else
|
||||
{
|
||||
sawmill.tank.setFluid(null);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useOreDic() {
|
||||
return canUseOreDict;
|
||||
}
|
||||
@Override
|
||||
public boolean useOreDic()
|
||||
{
|
||||
return canUseOreDict;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,18 +4,21 @@ import net.minecraft.item.ItemStack;
|
|||
import techreborn.api.recipe.BaseRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
public class PlateCuttingMachineRecipe extends BaseRecipe {
|
||||
public class PlateCuttingMachineRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public PlateCuttingMachineRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) {
|
||||
super(Reference.plateCuttingMachineRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
}
|
||||
public PlateCuttingMachineRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick)
|
||||
{
|
||||
super(Reference.plateCuttingMachineRecipe, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
inputs.add(input1);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
return "Plate Cutting Machine";
|
||||
}
|
||||
@Override
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "Plate Cutting Machine";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,28 +6,34 @@ import techreborn.api.recipe.BaseRecipe;
|
|||
import techreborn.lib.Reference;
|
||||
import techreborn.tiles.TileVacuumFreezer;
|
||||
|
||||
public class VacuumFreezerRecipe extends BaseRecipe {
|
||||
public class VacuumFreezerRecipe extends BaseRecipe
|
||||
{
|
||||
|
||||
public VacuumFreezerRecipe(ItemStack input, ItemStack output, int tickTime, int euPerTick) {
|
||||
super(Reference.vacuumFreezerRecipe, tickTime, euPerTick);
|
||||
if (input != null)
|
||||
inputs.add(input);
|
||||
if (output != null)
|
||||
addOutput(output);
|
||||
}
|
||||
public VacuumFreezerRecipe(ItemStack input, ItemStack output, int tickTime, int euPerTick)
|
||||
{
|
||||
super(Reference.vacuumFreezerRecipe, tickTime, euPerTick);
|
||||
if (input != null)
|
||||
inputs.add(input);
|
||||
if (output != null)
|
||||
addOutput(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
return "Vacuum Freezer";
|
||||
}
|
||||
@Override
|
||||
public String getUserFreindlyName()
|
||||
{
|
||||
return "Vacuum Freezer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile) {
|
||||
if(tile instanceof TileVacuumFreezer){
|
||||
if(((TileVacuumFreezer) tile).multiBlockStatus == 1){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile)
|
||||
{
|
||||
if (tile instanceof TileVacuumFreezer)
|
||||
{
|
||||
if (((TileVacuumFreezer) tile).multiBlockStatus == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,4 +1,3 @@
|
|||
@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") package techreborn.api.recipe.machines;
|
||||
|
||||
import net.minecraftforge.fml.common.API;
|
||||
@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI")
|
||||
package techreborn.api.recipe.machines;
|
||||
|
||||
|
|
|
@ -1,4 +1,2 @@
|
|||
@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") package techreborn.api.recipe;
|
||||
|
||||
import net.minecraftforge.fml.common.API;
|
||||
|
||||
@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI")
|
||||
package techreborn.api.recipe;
|
||||
|
|
|
@ -1,46 +1,53 @@
|
|||
package techreborn.api.recipe.recipeConfig;
|
||||
|
||||
public class ConfigItem
|
||||
{
|
||||
|
||||
public class ConfigItem {
|
||||
String localName;
|
||||
|
||||
String localName;
|
||||
String itemName;
|
||||
|
||||
String itemName;
|
||||
int meta;
|
||||
|
||||
int meta;
|
||||
int stackSize;
|
||||
|
||||
int stackSize;
|
||||
public String getItemName()
|
||||
{
|
||||
return itemName;
|
||||
}
|
||||
|
||||
public void setItemName(String itemName)
|
||||
{
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
public String getItemName() {
|
||||
return itemName;
|
||||
}
|
||||
public int getMeta()
|
||||
{
|
||||
return meta;
|
||||
}
|
||||
|
||||
public void setItemName(String itemName) {
|
||||
this.itemName = itemName;
|
||||
}
|
||||
public void setMeta(int meta)
|
||||
{
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
public int getMeta() {
|
||||
return meta;
|
||||
}
|
||||
public int getStackSize()
|
||||
{
|
||||
return stackSize;
|
||||
}
|
||||
|
||||
public void setMeta(int meta) {
|
||||
this.meta = meta;
|
||||
}
|
||||
public void setStackSize(int stackSize)
|
||||
{
|
||||
this.stackSize = stackSize;
|
||||
}
|
||||
|
||||
public int getStackSize() {
|
||||
return stackSize;
|
||||
}
|
||||
public String getLocalName()
|
||||
{
|
||||
return localName;
|
||||
}
|
||||
|
||||
public void setStackSize(int stackSize) {
|
||||
this.stackSize = stackSize;
|
||||
}
|
||||
|
||||
public String getLocalName() {
|
||||
return localName;
|
||||
}
|
||||
|
||||
public void setLocalName(String localName) {
|
||||
this.localName = localName;
|
||||
}
|
||||
public void setLocalName(String localName)
|
||||
{
|
||||
this.localName = localName;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,59 +2,72 @@ package techreborn.api.recipe.recipeConfig;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class RecipeConfig {
|
||||
public class RecipeConfig
|
||||
{
|
||||
|
||||
ArrayList<ConfigItem> inputs;
|
||||
ArrayList<ConfigItem> inputs;
|
||||
|
||||
ArrayList<ConfigItem> outputs;
|
||||
ArrayList<ConfigItem> outputs;
|
||||
|
||||
Boolean enabled;
|
||||
Boolean enabled;
|
||||
|
||||
String machine;
|
||||
String machine;
|
||||
|
||||
public ArrayList<ConfigItem> getInputs() {
|
||||
return inputs;
|
||||
}
|
||||
public ArrayList<ConfigItem> getInputs()
|
||||
{
|
||||
return inputs;
|
||||
}
|
||||
|
||||
public void setInputs(ArrayList<ConfigItem> inputs) {
|
||||
this.inputs = inputs;
|
||||
}
|
||||
public void setInputs(ArrayList<ConfigItem> inputs)
|
||||
{
|
||||
this.inputs = inputs;
|
||||
}
|
||||
|
||||
public ArrayList<ConfigItem> getOutputs() {
|
||||
return outputs;
|
||||
}
|
||||
public ArrayList<ConfigItem> getOutputs()
|
||||
{
|
||||
return outputs;
|
||||
}
|
||||
|
||||
public void setOutputs(ArrayList<ConfigItem> outputs) {
|
||||
this.outputs = outputs;
|
||||
}
|
||||
public void setOutputs(ArrayList<ConfigItem> outputs)
|
||||
{
|
||||
this.outputs = outputs;
|
||||
}
|
||||
|
||||
public Boolean getEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
public Boolean getEnabled()
|
||||
{
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(Boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
public void setEnabled(Boolean enabled)
|
||||
{
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public String getMachine() {
|
||||
return machine;
|
||||
}
|
||||
public String getMachine()
|
||||
{
|
||||
return machine;
|
||||
}
|
||||
|
||||
public void setMachine(String machine) {
|
||||
this.machine = machine;
|
||||
}
|
||||
public void setMachine(String machine)
|
||||
{
|
||||
this.machine = machine;
|
||||
}
|
||||
|
||||
public void addInputs(ConfigItem item) {
|
||||
if (inputs == null) {
|
||||
inputs = new ArrayList<ConfigItem>();
|
||||
}
|
||||
inputs.add(item);
|
||||
}
|
||||
public void addInputs(ConfigItem item)
|
||||
{
|
||||
if (inputs == null)
|
||||
{
|
||||
inputs = new ArrayList<ConfigItem>();
|
||||
}
|
||||
inputs.add(item);
|
||||
}
|
||||
|
||||
public void addOutputs(ConfigItem item) {
|
||||
if (outputs == null) {
|
||||
outputs = new ArrayList<ConfigItem>();
|
||||
}
|
||||
outputs.add(item);
|
||||
}
|
||||
public void addOutputs(ConfigItem item)
|
||||
{
|
||||
if (outputs == null)
|
||||
{
|
||||
outputs = new ArrayList<ConfigItem>();
|
||||
}
|
||||
outputs.add(item);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,65 +1,75 @@
|
|||
package techreborn.api.recipe.recipeConfig;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class RecipeConfigManager {
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
|
||||
public static ArrayList<RecipeConfig> configs = new ArrayList<RecipeConfig>();
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
static File configFile = null;
|
||||
public class RecipeConfigManager
|
||||
{
|
||||
|
||||
public static void load(File configDir) {
|
||||
if (configFile == null) {
|
||||
configFile = new File(configDir, "techRebornRecipes.json");
|
||||
}
|
||||
}
|
||||
public static ArrayList<RecipeConfig> configs = new ArrayList<RecipeConfig>();
|
||||
|
||||
public static void save() {
|
||||
if (configFile.exists()) {
|
||||
configFile.delete();
|
||||
}
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String json = gson.toJson(configs);
|
||||
try {
|
||||
FileWriter writer = new FileWriter(configFile);
|
||||
writer.write(json);
|
||||
writer.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
static File configFile = null;
|
||||
|
||||
public static void load(File configDir)
|
||||
{
|
||||
if (configFile == null)
|
||||
{
|
||||
configFile = new File(configDir, "techRebornRecipes.json");
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean canLoadRecipe(IBaseRecipeType recipeType) {
|
||||
RecipeConfig config = new RecipeConfig();
|
||||
for (ItemStack stack : recipeType.getInputs()) {
|
||||
config.addInputs(itemToConfig(stack));
|
||||
}
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
config.addOutputs(itemToConfig(stack));
|
||||
}
|
||||
config.enabled = true;
|
||||
config.setMachine(recipeType.getRecipeName());
|
||||
configs.add(config);
|
||||
return config.enabled;
|
||||
}
|
||||
public static void save()
|
||||
{
|
||||
if (configFile.exists())
|
||||
{
|
||||
configFile.delete();
|
||||
}
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String json = gson.toJson(configs);
|
||||
try
|
||||
{
|
||||
FileWriter writer = new FileWriter(configFile);
|
||||
writer.write(json);
|
||||
writer.close();
|
||||
} catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean canLoadRecipe(IBaseRecipeType recipeType)
|
||||
{
|
||||
RecipeConfig config = new RecipeConfig();
|
||||
for (ItemStack stack : recipeType.getInputs())
|
||||
{
|
||||
config.addInputs(itemToConfig(stack));
|
||||
}
|
||||
for (ItemStack stack : recipeType.getOutputs())
|
||||
{
|
||||
config.addOutputs(itemToConfig(stack));
|
||||
}
|
||||
config.enabled = true;
|
||||
config.setMachine(recipeType.getRecipeName());
|
||||
configs.add(config);
|
||||
return config.enabled;
|
||||
}
|
||||
|
||||
public static ConfigItem itemToConfig(ItemStack stack) {
|
||||
ConfigItem newItem = new ConfigItem();
|
||||
newItem.setItemName(stack.getItem().getUnlocalizedName());
|
||||
newItem.setMeta(stack.getItemDamage());
|
||||
newItem.setStackSize(stack.stackSize);
|
||||
newItem.setLocalName(stack.getDisplayName());
|
||||
return newItem;
|
||||
}
|
||||
public static ConfigItem itemToConfig(ItemStack stack)
|
||||
{
|
||||
ConfigItem newItem = new ConfigItem();
|
||||
newItem.setItemName(stack.getItem().getUnlocalizedName());
|
||||
newItem.setMeta(stack.getItemDamage());
|
||||
newItem.setStackSize(stack.stackSize);
|
||||
newItem.setLocalName(stack.getDisplayName());
|
||||
return newItem;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,8 @@ package techreborn.api.upgrade;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.RecipeCrafter;
|
||||
|
||||
public interface IMachineUpgrade {
|
||||
public interface IMachineUpgrade
|
||||
{
|
||||
|
||||
public void processUpgrade(RecipeCrafter crafter, ItemStack stack);
|
||||
public void processUpgrade(RecipeCrafter crafter, ItemStack stack);
|
||||
}
|
||||
|
|
|
@ -1,39 +1,46 @@
|
|||
package techreborn.api.upgrade;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.recipe.RecipeCrafter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
public class UpgradeHandler
|
||||
{
|
||||
|
||||
public class UpgradeHandler {
|
||||
RecipeCrafter crafter;
|
||||
|
||||
RecipeCrafter crafter;
|
||||
Inventory inventory;
|
||||
|
||||
Inventory inventory;
|
||||
ArrayList<Integer> slots = new ArrayList<Integer>();
|
||||
|
||||
ArrayList<Integer> slots = new ArrayList<Integer>();
|
||||
public UpgradeHandler(RecipeCrafter crafter, Inventory inventory, int... slots)
|
||||
{
|
||||
this.crafter = crafter;
|
||||
this.inventory = inventory;
|
||||
for (int slot : slots)
|
||||
{
|
||||
this.slots.add(slot);
|
||||
}
|
||||
}
|
||||
|
||||
public UpgradeHandler(RecipeCrafter crafter, Inventory inventory, int... slots) {
|
||||
this.crafter = crafter;
|
||||
this.inventory = inventory;
|
||||
for (int slot : slots) {
|
||||
this.slots.add(slot);
|
||||
}
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
if (crafter.parentTile.getWorld().isRemote)
|
||||
return;
|
||||
crafter.resetPowerMulti();
|
||||
crafter.resetSpeedMulti();
|
||||
for (int slot : this.slots) {
|
||||
ItemStack stack = inventory.getStackInSlot(slot);
|
||||
if (stack != null && stack.getItem() instanceof IMachineUpgrade) {
|
||||
((IMachineUpgrade) stack.getItem()).processUpgrade(crafter, stack);
|
||||
}
|
||||
}
|
||||
if (crafter.currentRecipe != null)
|
||||
crafter.currentNeededTicks = (int) (crafter.currentRecipe.tickTime() * (1.0 - crafter.getSpeedMultiplier()));
|
||||
}
|
||||
public void tick()
|
||||
{
|
||||
if (crafter.parentTile.getWorld().isRemote)
|
||||
return;
|
||||
crafter.resetPowerMulti();
|
||||
crafter.resetSpeedMulti();
|
||||
for (int slot : this.slots)
|
||||
{
|
||||
ItemStack stack = inventory.getStackInSlot(slot);
|
||||
if (stack != null && stack.getItem() instanceof IMachineUpgrade)
|
||||
{
|
||||
((IMachineUpgrade) stack.getItem()).processUpgrade(crafter, stack);
|
||||
}
|
||||
}
|
||||
if (crafter.currentRecipe != null)
|
||||
crafter.currentNeededTicks = (int) (crafter.currentRecipe.tickTime()
|
||||
* (1.0 - crafter.getSpeedMultiplier()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,2 @@
|
|||
@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") package techreborn.api.upgrade;
|
||||
|
||||
import net.minecraftforge.fml.common.API;
|
||||
|
||||
@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI")
|
||||
package techreborn.api.upgrade;
|
||||
|
|
|
@ -9,44 +9,49 @@ import techreborn.Core;
|
|||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
||||
public class BlockComputerCube extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockComputerCube extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockComputerCube(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.computercube");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
public BlockComputerCube(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.computercube");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.manuelID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z,
|
||||
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.manuelID, world, x,
|
||||
y, z);
|
||||
return true;
|
||||
}
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "computer_cube";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "computer_cube";
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "computer_cube";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "computer_cube" ;
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "computer_cube";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "computer_cube";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "computer_cube";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "computer_cube";
|
||||
}
|
||||
|
||||
}
|
|
@ -10,48 +10,55 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileDigitalChest;
|
||||
|
||||
public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockDigitalChest() {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.digitalChest");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockDigitalChest()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.digitalChest");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileDigitalChest();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
|
||||
{
|
||||
return new TileDigitalChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z,
|
||||
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.digitalChestID, world, x,
|
||||
y, z);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.digitalChestID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "quantum_chest";
|
||||
}
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "quantum_chest";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "qchest_side" ;
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "qchest_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "quantum_top";
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "quantum_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,36 +5,40 @@ import reborncore.common.blocks.BlockMachineBase;
|
|||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
||||
public class BlockElectricCraftingTable extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public class BlockElectricCraftingTable extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public BlockElectricCraftingTable(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.electriccraftingtable");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
public BlockElectricCraftingTable(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.electriccraftingtable");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "electric_crafting_table_front";
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "electric_crafting_table_front";
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "electric_crafting_table_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "machine_side" ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "electric_crafting_table_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,20 +6,21 @@ import net.minecraft.util.EnumFacing;
|
|||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
||||
public class BlockFusionCoil extends BlockMachineBase {
|
||||
public class BlockFusionCoil extends BlockMachineBase
|
||||
{
|
||||
|
||||
public BlockFusionCoil(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.fusioncoil");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
public BlockFusionCoil(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.fusioncoil");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) {
|
||||
return prefix + "fusion_coil";
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing)
|
||||
{
|
||||
return prefix + "fusion_coil";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,59 +14,71 @@ import techreborn.client.TechRebornCreativeTab;
|
|||
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
||||
import techreborn.utils.damageSources.FusionDamageSource;
|
||||
|
||||
public class BlockFusionControlComputer extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockFusionControlComputer extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockFusionControlComputer(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.fusioncontrolcomputer");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockFusionControlComputer(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.fusioncontrolcomputer");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z,
|
||||
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
TileEntityFusionController tileEntityFusionController = (TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z));
|
||||
tileEntityFusionController.checkCoils();
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.fusionID, world, x, y,
|
||||
z);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
TileEntityFusionController tileEntityFusionController = (TileEntityFusionController) world
|
||||
.getTileEntity(new BlockPos(x, y, z));
|
||||
tileEntityFusionController.checkCoils();
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.fusionID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, Entity entityIn) {
|
||||
super.onEntityCollidedWithBlock(worldIn, pos, entityIn);
|
||||
if(worldIn.getTileEntity(pos) instanceof TileEntityFusionController){
|
||||
if(((TileEntityFusionController) worldIn.getTileEntity(pos)).crafingTickTime != 0 && ((TileEntityFusionController) worldIn.getTileEntity(pos)).checkCoils()){
|
||||
entityIn.attackEntityFrom(new FusionDamageSource(), 200F);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, Entity entityIn)
|
||||
{
|
||||
super.onEntityCollidedWithBlock(worldIn, pos, entityIn);
|
||||
if (worldIn.getTileEntity(pos) instanceof TileEntityFusionController)
|
||||
{
|
||||
if (((TileEntityFusionController) worldIn.getTileEntity(pos)).crafingTickTime != 0
|
||||
&& ((TileEntityFusionController) worldIn.getTileEntity(pos)).checkCoils())
|
||||
{
|
||||
entityIn.attackEntityFrom(new FusionDamageSource(), 200F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityFusionController();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TileEntityFusionController();
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "fusion_control_computer_front";
|
||||
}
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "fusion_control_computer_front";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "machine_side" ;
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,20 +6,22 @@ import net.minecraft.util.EnumFacing;
|
|||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
||||
public class BlockHighlyAdvancedMachine extends BlockMachineBase {
|
||||
public class BlockHighlyAdvancedMachine extends BlockMachineBase
|
||||
{
|
||||
|
||||
public BlockHighlyAdvancedMachine(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.highlyAdvancedMachine");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockHighlyAdvancedMachine(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.highlyAdvancedMachine");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/machine_blocks/";
|
||||
private final String prefix = "techreborn:blocks/machine/machine_blocks/";
|
||||
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) {
|
||||
return prefix + "highlyadvancedmachine";
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing)
|
||||
{
|
||||
return prefix + "highlyadvancedmachine";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,14 +5,16 @@ import net.minecraft.block.BlockPlanks;
|
|||
import net.minecraft.block.material.Material;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
|
||||
public class BlockIronFence extends BlockFence {
|
||||
public class BlockIronFence extends BlockFence
|
||||
{
|
||||
|
||||
public BlockIronFence() {
|
||||
public BlockIronFence()
|
||||
{
|
||||
super(Material.iron, BlockPlanks.EnumType.OAK.getMapColor());
|
||||
setUnlocalizedName("techreborn.ironfence");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setHardness(2.0F);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
setUnlocalizedName("techreborn.ironfence");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setHardness(2.0F);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package techreborn.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -20,93 +23,105 @@ import reborncore.common.multiblock.BlockMultiblockBase;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileMachineCasing;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
public class BlockMachineCasing extends BlockMultiblockBase implements ITexturedBlock
|
||||
{
|
||||
|
||||
public class BlockMachineCasing extends BlockMultiblockBase implements ITexturedBlock {
|
||||
public static final String[] types = new String[] { "standard", "reinforced", "advanced" };
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{"standard", "reinforced", "advanced"};
|
||||
public BlockMachineCasing(Material material)
|
||||
{
|
||||
super(material);
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setUnlocalizedName("techreborn.machineCasing");
|
||||
setHardness(2F);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
|
||||
}
|
||||
|
||||
public BlockMachineCasing(Material material) {
|
||||
super(material);
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setUnlocalizedName("techreborn.machineCasing");
|
||||
setHardness(2F);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
|
||||
}
|
||||
public PropertyInteger METADATA;
|
||||
|
||||
public PropertyInteger METADATA;
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return (Integer) state.getValue(METADATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return (Integer) state.getValue(METADATA);
|
||||
}
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
|
||||
protected BlockStateContainer createBlockState() {
|
||||
METADATA = PropertyInteger.create("type", 0, types.length);
|
||||
return new BlockStateContainer(this, METADATA);
|
||||
}
|
||||
|
||||
METADATA = PropertyInteger.create("type", 0, types.length);
|
||||
return new BlockStateContainer(this, METADATA);
|
||||
}
|
||||
public int getHeatFromState(IBlockState state)
|
||||
{
|
||||
switch (getMetaFromState(state))
|
||||
{
|
||||
case 0:
|
||||
return 1020 / 25;
|
||||
case 1:
|
||||
return 1700 / 25;
|
||||
case 2:
|
||||
return 2380 / 25;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getHeatFromState(IBlockState state) {
|
||||
switch (getMetaFromState(state)) {
|
||||
case 0:
|
||||
return 1020 / 25;
|
||||
case 1:
|
||||
return 1700 / 25;
|
||||
case 2:
|
||||
return 2380 / 25;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune)
|
||||
{
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list)
|
||||
{
|
||||
for (int meta = 0; meta < types.length; meta++)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
|
||||
for (int meta = 0; meta < types.length; meta++) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int damageDropped(IBlockState state)
|
||||
{
|
||||
return super.damageDropped(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
return super.damageDropped(state);
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
|
||||
{
|
||||
return new TileMachineCasing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileMachineCasing();
|
||||
}
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess worldIn, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
Block b = worldIn.getBlockState(pos).getBlock();
|
||||
return b == (Block) this ? false : super.shouldSideBeRendered(blockState, worldIn, pos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess worldIn, BlockPos pos, EnumFacing side) {
|
||||
Block b = worldIn.getBlockState(pos).getBlock();
|
||||
return b == (Block) this ? false : super.shouldSideBeRendered(blockState, worldIn, pos, side);
|
||||
}
|
||||
public boolean shouldConnectToBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta)
|
||||
{
|
||||
return block == (Block) this;
|
||||
}
|
||||
|
||||
public boolean shouldConnectToBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta) {
|
||||
return block == (Block) this;
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing)
|
||||
{
|
||||
return "techreborn:blocks/machine/machine_blocks/casing" + types[getMetaFromState(blockState)] + "_full";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) {
|
||||
return "techreborn:blocks/machine/machine_blocks/casing" + types[getMetaFromState(blockState)] + "_full";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
return types.length;
|
||||
}
|
||||
@Override
|
||||
public int amountOfStates()
|
||||
{
|
||||
return types.length;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package techreborn.blocks;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
|
@ -15,70 +18,78 @@ import reborncore.common.BaseBlock;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
public class BlockMachineFrame extends BaseBlock implements ITexturedBlock
|
||||
{
|
||||
public PropertyInteger METADATA;
|
||||
|
||||
public class BlockMachineFrame extends BaseBlock implements ITexturedBlock {
|
||||
public PropertyInteger METADATA;
|
||||
public static ItemStack getFrameByName(String name, int count)
|
||||
{
|
||||
for (int i = 0; i < types.length; i++)
|
||||
{
|
||||
if (types[i].equalsIgnoreCase(name))
|
||||
{
|
||||
return new ItemStack(ModBlocks.machineframe, count, i);
|
||||
}
|
||||
}
|
||||
throw new InvalidParameterException("The part " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getFrameByName(String name, int count) {
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equalsIgnoreCase(name)) {
|
||||
return new ItemStack(ModBlocks.machineframe, count, i);
|
||||
}
|
||||
}
|
||||
throw new InvalidParameterException("The part " + name + " could not be found.");
|
||||
}
|
||||
public static final String[] types = new String[] { "aluminum", "iron", "bronze", "brass", "steel", "titanium",
|
||||
"machine", "advancedMachine" };
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{"aluminum", "iron", "bronze", "brass", "steel", "titanium", "machine", "advancedMachine"};
|
||||
public BlockMachineFrame(Material material)
|
||||
{
|
||||
super(material);
|
||||
setUnlocalizedName("techreborn.machineFrame");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setHardness(1f);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list)
|
||||
{
|
||||
for (int meta = 0; meta < types.length; meta++)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
public BlockMachineFrame(Material material) {
|
||||
super(material);
|
||||
setUnlocalizedName("techreborn.machineFrame");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setHardness(1f);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
|
||||
}
|
||||
@Override
|
||||
public int damageDropped(IBlockState state)
|
||||
{
|
||||
return super.damageDropped(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
|
||||
for (int meta = 0; meta < types.length; meta++) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing)
|
||||
{
|
||||
return "techreborn:blocks/machine/machine_blocks/" + types[getMetaFromState(blockState)] + "_machine_block";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int amountOfStates()
|
||||
{
|
||||
return types.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
return super.damageDropped(state);
|
||||
}
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return state.getValue(METADATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) {
|
||||
return "techreborn:blocks/machine/machine_blocks/" + types[getMetaFromState(blockState)] + "_machine_block";
|
||||
}
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
return types.length;
|
||||
}
|
||||
METADATA = PropertyInteger.create("type", 0, types.length - 1);
|
||||
return new BlockStateContainer(this, METADATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(METADATA);
|
||||
}
|
||||
|
||||
protected BlockStateContainer createBlockState() {
|
||||
|
||||
METADATA = PropertyInteger.create("type", 0, types.length -1);
|
||||
return new BlockStateContainer(this, METADATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ import net.minecraft.block.state.IBlockState;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
@ -24,92 +24,116 @@ import techreborn.entitys.EntityNukePrimed;
|
|||
/**
|
||||
* Created by Mark on 13/03/2016.
|
||||
*/
|
||||
public class BlockNuke extends BaseBlock implements ITexturedBlock {
|
||||
public static final PropertyBool OVERLAY = PropertyBool.create("overlay");
|
||||
public class BlockNuke extends BaseBlock implements ITexturedBlock
|
||||
{
|
||||
public static final PropertyBool OVERLAY = PropertyBool.create("overlay");
|
||||
|
||||
public BlockNuke() {
|
||||
super(Material.tnt);
|
||||
setUnlocalizedName("techreborn.nuke");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(OVERLAY, false));
|
||||
}
|
||||
public BlockNuke()
|
||||
{
|
||||
super(Material.tnt);
|
||||
setUnlocalizedName("techreborn.nuke");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(OVERLAY, false));
|
||||
}
|
||||
|
||||
public void explode(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase igniter) {
|
||||
if (!worldIn.isRemote) {
|
||||
EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F), (double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), igniter);
|
||||
worldIn.spawnEntityInWorld(entitynukeprimed);
|
||||
// worldIn.playSoundAtEntity(entitynukeprimed, "game.tnt.primed", 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
public void explode(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase igniter)
|
||||
{
|
||||
if (!worldIn.isRemote)
|
||||
{
|
||||
EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F),
|
||||
(double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), igniter);
|
||||
worldIn.spawnEntityInWorld(entitynukeprimed);
|
||||
// worldIn.playSoundAtEntity(entitynukeprimed, "game.tnt.primed",
|
||||
// 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) {
|
||||
if (!worldIn.isRemote) {
|
||||
EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F), (double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), explosionIn.getExplosivePlacedBy());
|
||||
entitynukeprimed.fuse = worldIn.rand.nextInt(entitynukeprimed.fuse / 4) + entitynukeprimed.fuse / 8;
|
||||
worldIn.spawnEntityInWorld(entitynukeprimed);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn)
|
||||
{
|
||||
if (!worldIn.isRemote)
|
||||
{
|
||||
EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F),
|
||||
(double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), explosionIn.getExplosivePlacedBy());
|
||||
entitynukeprimed.fuse = worldIn.rand.nextInt(entitynukeprimed.fuse / 4) + entitynukeprimed.fuse / 8;
|
||||
worldIn.spawnEntityInWorld(entitynukeprimed);
|
||||
}
|
||||
}
|
||||
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
|
||||
if (!worldIn.isRemote && entityIn instanceof EntityArrow) {
|
||||
EntityArrow entityarrow = (EntityArrow) entityIn;
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)
|
||||
{
|
||||
if (!worldIn.isRemote && entityIn instanceof EntityArrow)
|
||||
{
|
||||
EntityArrow entityarrow = (EntityArrow) entityIn;
|
||||
|
||||
if (entityarrow.isBurning()) {
|
||||
this.explode(worldIn, pos, state, entityarrow.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase) entityarrow.shootingEntity : null);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (entityarrow.isBurning())
|
||||
{
|
||||
this.explode(worldIn, pos, state, entityarrow.shootingEntity instanceof EntityLivingBase
|
||||
? (EntityLivingBase) entityarrow.shootingEntity : null);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) {
|
||||
super.onBlockAdded(worldIn, pos, state);
|
||||
if (worldIn.isBlockPowered(pos)) {
|
||||
this.explode(worldIn, pos, state, null);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
|
||||
{
|
||||
super.onBlockAdded(worldIn, pos, state);
|
||||
if (worldIn.isBlockPowered(pos))
|
||||
{
|
||||
this.explode(worldIn, pos, state, null);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) {
|
||||
if (worldIn.isBlockPowered(pos)) {
|
||||
this.explode(worldIn, pos, state, null);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock)
|
||||
{
|
||||
if (worldIn.isBlockPowered(pos))
|
||||
{
|
||||
this.explode(worldIn, pos, state, null);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn,
|
||||
EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState iBlockState, EnumFacing enumFacing) {
|
||||
if (iBlockState.getValue(OVERLAY)) {
|
||||
return "techreborn:blocks/nuke_overlay";
|
||||
}
|
||||
return "techreborn:blocks/nuke";
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState iBlockState, EnumFacing enumFacing)
|
||||
{
|
||||
if (iBlockState.getValue(OVERLAY))
|
||||
{
|
||||
return "techreborn:blocks/nuke_overlay";
|
||||
}
|
||||
return "techreborn:blocks/nuke";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
return 2;
|
||||
}
|
||||
@Override
|
||||
public int amountOfStates()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(OVERLAY) ? 1 : 0;
|
||||
}
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return state.getValue(OVERLAY) ? 1 : 0;
|
||||
}
|
||||
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(OVERLAY, Boolean.valueOf((meta & 1) > 0));
|
||||
}
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(OVERLAY, Boolean.valueOf((meta & 1) > 0));
|
||||
}
|
||||
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, OVERLAY);
|
||||
}
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateContainer(this, OVERLAY);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package techreborn.blocks;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
|
@ -27,173 +32,203 @@ import techreborn.items.ItemDusts;
|
|||
import techreborn.items.ItemGems;
|
||||
import techreborn.world.config.IOreNameProvider;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
public class BlockOre extends BaseBlock implements ITexturedBlock, IOreNameProvider
|
||||
{
|
||||
|
||||
public class BlockOre extends BaseBlock implements ITexturedBlock, IOreNameProvider {
|
||||
public static ItemStack getOreByName(String name, int count)
|
||||
{
|
||||
for (int i = 0; i < types.length; i++)
|
||||
{
|
||||
if (types[i].equalsIgnoreCase(name))
|
||||
{
|
||||
return new ItemStack(ModBlocks.ore, count, i);
|
||||
}
|
||||
}
|
||||
throw new InvalidParameterException("The ore block " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getOreByName(String name, int count) {
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equalsIgnoreCase(name)) {
|
||||
return new ItemStack(ModBlocks.ore, count, i);
|
||||
}
|
||||
}
|
||||
throw new InvalidParameterException("The ore block " + name + " could not be found.");
|
||||
}
|
||||
public static ItemStack getOreByName(String name)
|
||||
{
|
||||
return getOreByName(name, 1);
|
||||
}
|
||||
|
||||
public static ItemStack getOreByName(String name) {
|
||||
return getOreByName(name, 1);
|
||||
}
|
||||
public IBlockState getBlockStateFromName(String name)
|
||||
{
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++)
|
||||
{
|
||||
if (types[i].equalsIgnoreCase(name))
|
||||
{
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (index == -1)
|
||||
{
|
||||
return ModBlocks.ore2.getBlockStateFromName(name);
|
||||
}
|
||||
return getStateFromMeta(index);
|
||||
}
|
||||
|
||||
public IBlockState getBlockStateFromName(String name){
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equalsIgnoreCase(name)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(index == -1){
|
||||
return ModBlocks.ore2.getBlockStateFromName(name);
|
||||
}
|
||||
return getStateFromMeta(index);
|
||||
}
|
||||
public static final String[] types = new String[] { "Galena", "Iridium", "Ruby", "Sapphire", "Bauxite", "Pyrite",
|
||||
"Cinnabar", "Sphalerite", "Tungston", "Sheldonite", "Peridot", "Sodalite", "Tetrahedrite", "Cassiterite",
|
||||
"Lead", "Silver" };
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{"Galena", "Iridium", "Ruby", "Sapphire", "Bauxite", "Pyrite", "Cinnabar",
|
||||
"Sphalerite", "Tungston", "Sheldonite", "Peridot", "Sodalite",
|
||||
"Tetrahedrite", "Cassiterite", "Lead", "Silver"};
|
||||
public PropertyInteger METADATA;
|
||||
|
||||
public PropertyInteger METADATA;
|
||||
public BlockOre(Material material)
|
||||
{
|
||||
super(material);
|
||||
setUnlocalizedName("techreborn.ore");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setHardness(2.0f);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
|
||||
}
|
||||
|
||||
public BlockOre(Material material) {
|
||||
super(material);
|
||||
setUnlocalizedName("techreborn.ore");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setHardness(2.0f);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
|
||||
}
|
||||
@Deprecated
|
||||
public ArrayList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
{
|
||||
int metadata = getMetaFromState(state);
|
||||
Random random = new Random();
|
||||
// Ruby
|
||||
if (metadata == 2)
|
||||
{
|
||||
OreDrop ruby = new OreDrop(ItemGems.getGemByName("ruby"),
|
||||
ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
OreDrop redGarnet = new OreDrop(ItemGems.getGemByName("redGarnet"), 0.02);
|
||||
OreDropSet set = new OreDropSet(ruby, redGarnet);
|
||||
return set.drop(fortune, random);
|
||||
}
|
||||
|
||||
// Sapphire
|
||||
if (metadata == 3)
|
||||
{
|
||||
OreDrop sapphire = new OreDrop(ItemGems.getGemByName("sapphire"),
|
||||
ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
OreDrop peridot = new OreDrop(ItemGems.getGemByName("peridot"), 0.03);
|
||||
OreDropSet set = new OreDropSet(sapphire, peridot);
|
||||
return set.drop(fortune, random);
|
||||
}
|
||||
|
||||
// Pyrite
|
||||
if (metadata == 5)
|
||||
{
|
||||
OreDrop pyriteDust = new OreDrop(ItemDusts.getDustByName("pyrite"),
|
||||
ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
OreDropSet set = new OreDropSet(pyriteDust);
|
||||
return set.drop(fortune, random);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public ArrayList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
int metadata = getMetaFromState(state);
|
||||
Random random = new Random();
|
||||
//Ruby
|
||||
if (metadata == 2) {
|
||||
OreDrop ruby = new OreDrop(ItemGems.getGemByName("ruby"), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
OreDrop redGarnet = new OreDrop(ItemGems.getGemByName("redGarnet"), 0.02);
|
||||
OreDropSet set = new OreDropSet(ruby, redGarnet);
|
||||
return set.drop(fortune, random);
|
||||
}
|
||||
// Sodolite
|
||||
if (metadata == 11)
|
||||
{
|
||||
OreDrop sodalite = new OreDrop(ItemDusts.getDustByName("sodalite", 6),
|
||||
ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
OreDrop aluminum = new OreDrop(ItemDusts.getDustByName("aluminum"), 0.50);
|
||||
OreDropSet set = new OreDropSet(sodalite, aluminum);
|
||||
return set.drop(fortune, random);
|
||||
}
|
||||
|
||||
//Sapphire
|
||||
if (metadata == 3) {
|
||||
OreDrop sapphire = new OreDrop(ItemGems.getGemByName("sapphire"), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
OreDrop peridot = new OreDrop(ItemGems.getGemByName("peridot"), 0.03);
|
||||
OreDropSet set = new OreDropSet(sapphire, peridot);
|
||||
return set.drop(fortune, random);
|
||||
}
|
||||
// Cinnabar
|
||||
if (metadata == 6)
|
||||
{
|
||||
OreDrop cinnabar = new OreDrop(ItemDusts.getDustByName("cinnabar"),
|
||||
ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
OreDrop redstone = new OreDrop(new ItemStack(Items.redstone), 0.25);
|
||||
OreDropSet set = new OreDropSet(cinnabar, redstone);
|
||||
return set.drop(fortune, random);
|
||||
}
|
||||
|
||||
//Pyrite
|
||||
if (metadata == 5) {
|
||||
OreDrop pyriteDust = new OreDrop(ItemDusts.getDustByName("pyrite"), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
OreDropSet set = new OreDropSet(pyriteDust);
|
||||
return set.drop(fortune, random);
|
||||
}
|
||||
// Sphalerite 1, 1/8 yellow garnet
|
||||
if (metadata == 7)
|
||||
{
|
||||
OreDrop sphalerite = new OreDrop(ItemDusts.getDustByName("sphalerite"),
|
||||
ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
OreDrop yellowGarnet = new OreDrop(ItemGems.getGemByName("yellowGarnet"), 0.125);
|
||||
OreDropSet set = new OreDropSet(sphalerite, yellowGarnet);
|
||||
return set.drop(fortune, random);
|
||||
}
|
||||
|
||||
//Sodolite
|
||||
if (metadata == 11) {
|
||||
OreDrop sodalite = new OreDrop(ItemDusts.getDustByName("sodalite", 6), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
OreDrop aluminum = new OreDrop(ItemDusts.getDustByName("aluminum"), 0.50);
|
||||
OreDropSet set = new OreDropSet(sodalite, aluminum);
|
||||
return set.drop(fortune, random);
|
||||
}
|
||||
ArrayList<ItemStack> block = new ArrayList<ItemStack>();
|
||||
block.add(new ItemStack(Item.getItemFromBlock(this), 1, metadata));
|
||||
return block;
|
||||
}
|
||||
|
||||
//Cinnabar
|
||||
if (metadata == 6) {
|
||||
OreDrop cinnabar = new OreDrop(ItemDusts.getDustByName("cinnabar"), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
OreDrop redstone = new OreDrop(new ItemStack(Items.redstone), 0.25);
|
||||
OreDropSet set = new OreDropSet(cinnabar, redstone);
|
||||
return set.drop(fortune, random);
|
||||
}
|
||||
@Override
|
||||
protected boolean canSilkHarvest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//Sphalerite 1, 1/8 yellow garnet
|
||||
if (metadata == 7) {
|
||||
OreDrop sphalerite = new OreDrop(ItemDusts.getDustByName("sphalerite"), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
OreDrop yellowGarnet = new OreDrop(ItemGems.getGemByName("yellowGarnet"), 0.125);
|
||||
OreDropSet set = new OreDropSet(sphalerite, yellowGarnet);
|
||||
return set.drop(fortune, random);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list)
|
||||
{
|
||||
for (int meta = 0; meta < types.length; meta++)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList<ItemStack> block = new ArrayList<ItemStack>();
|
||||
block.add(new ItemStack(Item.getItemFromBlock(this), 1, metadata));
|
||||
return block;
|
||||
}
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos,
|
||||
EntityPlayer player)
|
||||
{
|
||||
return super.getPickBlock(state, target, world, pos, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public int damageDropped(IBlockState state)
|
||||
{
|
||||
int meta = getMetaFromState(state);
|
||||
if (meta == 2)
|
||||
{
|
||||
return 0;
|
||||
} else if (meta == 3)
|
||||
{
|
||||
return 1;
|
||||
} else if (meta == 5)
|
||||
{
|
||||
return 60;
|
||||
}
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
|
||||
for (int meta = 0; meta < types.length; meta++) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing)
|
||||
{
|
||||
return "techreborn:blocks/ore/ore" + types[getMetaFromState(BlockStateContainer)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return super.getPickBlock(state, target, world, pos, player);
|
||||
}
|
||||
@Override
|
||||
public int amountOfStates()
|
||||
{
|
||||
return types.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
int meta = getMetaFromState(state);
|
||||
if (meta == 2) {
|
||||
return 0;
|
||||
} else if (meta == 3) {
|
||||
return 1;
|
||||
} else if (meta == 5) {
|
||||
return 60;
|
||||
}
|
||||
return meta;
|
||||
}
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) {
|
||||
return "techreborn:blocks/ore/ore" + types[getMetaFromState(BlockStateContainer)];
|
||||
}
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return state.getValue(METADATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
return types.length;
|
||||
}
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
METADATA = PropertyInteger.create("type", 0, types.length - 1);
|
||||
return new BlockStateContainer(this, METADATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(METADATA);
|
||||
}
|
||||
|
||||
protected BlockStateContainer createBlockState() {
|
||||
|
||||
METADATA = PropertyInteger.create("type", 0, types.length -1);
|
||||
return new BlockStateContainer(this, METADATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserLoclisedName(IBlockState state) {
|
||||
return types[state.getValue(METADATA)];
|
||||
}
|
||||
@Override
|
||||
public String getUserLoclisedName(IBlockState state)
|
||||
{
|
||||
return types[state.getValue(METADATA)];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package techreborn.blocks;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
|
@ -20,104 +23,122 @@ import techreborn.client.TechRebornCreativeTabMisc;
|
|||
import techreborn.init.ModBlocks;
|
||||
import techreborn.world.config.IOreNameProvider;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
public class BlockOre2 extends BaseBlock implements ITexturedBlock, IOreNameProvider
|
||||
{
|
||||
|
||||
public class BlockOre2 extends BaseBlock implements ITexturedBlock, IOreNameProvider {
|
||||
public static ItemStack getOreByName(String name, int count)
|
||||
{
|
||||
for (int i = 0; i < types.length; i++)
|
||||
{
|
||||
if (types[i].equalsIgnoreCase(name))
|
||||
{
|
||||
return new ItemStack(ModBlocks.ore2, count, i);
|
||||
}
|
||||
}
|
||||
throw new InvalidParameterException("The ore block " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getOreByName(String name, int count) {
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equalsIgnoreCase(name)) {
|
||||
return new ItemStack(ModBlocks.ore2, count, i);
|
||||
}
|
||||
}
|
||||
throw new InvalidParameterException("The ore block " + name + " could not be found.");
|
||||
}
|
||||
public static ItemStack getOreByName(String name)
|
||||
{
|
||||
return getOreByName(name, 1);
|
||||
}
|
||||
|
||||
public static ItemStack getOreByName(String name) {
|
||||
return getOreByName(name, 1);
|
||||
}
|
||||
public IBlockState getBlockStateFromName(String name)
|
||||
{
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++)
|
||||
{
|
||||
if (types[i].equalsIgnoreCase(name))
|
||||
{
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (index == -1)
|
||||
{
|
||||
throw new InvalidParameterException("The ore block " + name + " could not be found.");
|
||||
}
|
||||
return getStateFromMeta(index);
|
||||
}
|
||||
|
||||
public IBlockState getBlockStateFromName(String name){
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equalsIgnoreCase(name)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(index == -1){
|
||||
throw new InvalidParameterException("The ore block " + name + " could not be found.");
|
||||
}
|
||||
return getStateFromMeta(index);
|
||||
}
|
||||
public static final String[] types = new String[] { "Copper", "Tin" };
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{"Copper", "Tin"};
|
||||
public PropertyInteger METADATA;
|
||||
|
||||
public PropertyInteger METADATA;
|
||||
public BlockOre2(Material material)
|
||||
{
|
||||
super(material);
|
||||
setUnlocalizedName("techreborn.ore2");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setHardness(2.0f);
|
||||
setHarvestLevel("pickaxe", 1);
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(METADATA, 0));
|
||||
}
|
||||
|
||||
public BlockOre2(Material material) {
|
||||
super(material);
|
||||
setUnlocalizedName("techreborn.ore2");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setHardness(2.0f);
|
||||
setHarvestLevel("pickaxe", 1);
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(METADATA, 0));
|
||||
}
|
||||
@Override
|
||||
protected boolean canSilkHarvest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list)
|
||||
{
|
||||
for (int meta = 0; meta < types.length; meta++)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
|
||||
for (int meta = 0; meta < types.length; meta++) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos,
|
||||
EntityPlayer player)
|
||||
{
|
||||
return super.getPickBlock(state, target, world, pos, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return super.getPickBlock(state, target, world, pos, player);
|
||||
}
|
||||
@Override
|
||||
public int damageDropped(IBlockState state)
|
||||
{
|
||||
int meta = getMetaFromState(state);
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
int meta = getMetaFromState(state);
|
||||
return meta;
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing)
|
||||
{
|
||||
return "techreborn:blocks/ore/ore" + types[getMetaFromState(BlockStateContainer)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) {
|
||||
return "techreborn:blocks/ore/ore" + types[getMetaFromState(BlockStateContainer)];
|
||||
}
|
||||
@Override
|
||||
public int amountOfStates()
|
||||
{
|
||||
return types.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
return types.length;
|
||||
}
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return state.getValue(METADATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(METADATA);
|
||||
}
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
|
||||
protected BlockStateContainer createBlockState() {
|
||||
METADATA = PropertyInteger.create("type", 0, types.length - 1);
|
||||
return new BlockStateContainer(this, METADATA);
|
||||
}
|
||||
|
||||
METADATA = PropertyInteger.create("type", 0, types.length -1);
|
||||
return new BlockStateContainer(this, METADATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserLoclisedName(IBlockState state) {
|
||||
return types[state.getValue(METADATA)];
|
||||
}
|
||||
@Override
|
||||
public String getUserLoclisedName(IBlockState state)
|
||||
{
|
||||
return types[state.getValue(METADATA)];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package techreborn.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
|
@ -23,132 +24,150 @@ import net.minecraft.world.IBlockAccess;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.common.BaseTileBlock;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TilePlayerDectector;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
public class BlockPlayerDetector extends BlockMachineBase implements ITexturedBlock
|
||||
{
|
||||
|
||||
public class BlockPlayerDetector extends BlockMachineBase implements ITexturedBlock {
|
||||
public PropertyInteger METADATA;
|
||||
|
||||
public PropertyInteger METADATA;
|
||||
public BlockPlayerDetector()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.playerDetector");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setHardness(2f);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0).withProperty(FACING, EnumFacing.NORTH)
|
||||
.withProperty(ACTIVE, false));
|
||||
}
|
||||
|
||||
public BlockPlayerDetector() {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.playerDetector");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setHardness(2f);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0).withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, false));
|
||||
}
|
||||
public static final String[] types = new String[] { "all", "others", "you" };
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{"all", "others", "you"};
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune)
|
||||
{
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list)
|
||||
{
|
||||
for (int meta = 0; meta < types.length; meta++)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
|
||||
{
|
||||
return new TilePlayerDectector();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
|
||||
for (int meta = 0; meta < types.length; meta++) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower(IBlockState state)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TilePlayerDectector();
|
||||
}
|
||||
@Override
|
||||
public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
TileEntity entity = blockAccess.getTileEntity(pos);
|
||||
if (entity instanceof TilePlayerDectector)
|
||||
{
|
||||
return ((TilePlayerDectector) entity).isProvidingPower() ? 15 : 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
TileEntity entity = blockAccess.getTileEntity(pos);
|
||||
if (entity instanceof TilePlayerDectector)
|
||||
{
|
||||
return ((TilePlayerDectector) entity).isProvidingPower() ? 15 : 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer,
|
||||
ItemStack stack)
|
||||
{
|
||||
super.onBlockPlacedBy(worldIn, pos, state, placer, stack);
|
||||
TileEntity tile = worldIn.getTileEntity(pos);
|
||||
if (tile instanceof TilePlayerDectector)
|
||||
{
|
||||
((TilePlayerDectector) tile).owenerUdid = placer.getUniqueID().toString();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
|
||||
TileEntity entity = blockAccess.getTileEntity(pos);
|
||||
if (entity instanceof TilePlayerDectector) {
|
||||
return ((TilePlayerDectector) entity).isProvidingPower() ? 15 : 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityPlayer,
|
||||
EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
// int newMeta = (world.getBlockMetadata(x, y, z) + 1) % 3;
|
||||
int newMeta = getMetaFromState(state);
|
||||
String message = "";
|
||||
switch (newMeta)
|
||||
{
|
||||
case 0:
|
||||
message = TextFormatting.GREEN + "Detects all Players";
|
||||
break;
|
||||
case 1:
|
||||
message = TextFormatting.RED + "Detects only other Players";
|
||||
break;
|
||||
case 2:
|
||||
message = TextFormatting.BLUE + "Detects only you";
|
||||
}
|
||||
if (!world.isRemote)
|
||||
{
|
||||
entityPlayer.addChatComponentMessage(new TextComponentString(message));
|
||||
// world.setBlockMetadataWithNotify(x, y, z, newMeta, 2);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
|
||||
TileEntity entity = blockAccess.getTileEntity(pos);
|
||||
if (entity instanceof TilePlayerDectector) {
|
||||
return ((TilePlayerDectector) entity).isProvidingPower() ? 15 : 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing)
|
||||
{
|
||||
return "techreborn:blocks/machine/greg_machines/player_detector_" + types[getMetaFromState(blockState)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
|
||||
super.onBlockPlacedBy(worldIn, pos, state, placer, stack);
|
||||
TileEntity tile = worldIn.getTileEntity(pos);
|
||||
if (tile instanceof TilePlayerDectector) {
|
||||
((TilePlayerDectector) tile).owenerUdid = placer.getUniqueID().toString();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int amountOfStates()
|
||||
{
|
||||
return types.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityPlayer, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
// int newMeta = (world.getBlockMetadata(x, y, z) + 1) % 3;
|
||||
int newMeta = getMetaFromState(state);
|
||||
String message = "";
|
||||
switch (newMeta) {
|
||||
case 0:
|
||||
message = TextFormatting.GREEN + "Detects all Players";
|
||||
break;
|
||||
case 1:
|
||||
message = TextFormatting.RED + "Detects only other Players";
|
||||
break;
|
||||
case 2:
|
||||
message = TextFormatting.BLUE + "Detects only you";
|
||||
}
|
||||
if(!world.isRemote){
|
||||
entityPlayer.addChatComponentMessage(new TextComponentString(message));
|
||||
//world.setBlockMetadataWithNotify(x, y, z, newMeta, 2);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return (Integer) state.getValue(METADATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) {
|
||||
return "techreborn:blocks/machine/greg_machines/player_detector_" + types[getMetaFromState(blockState)];
|
||||
}
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
|
||||
ACTIVE = PropertyBool.create("active");
|
||||
METADATA = PropertyInteger.create("type", 0, types.length - 1);
|
||||
return new BlockStateContainer(this, METADATA, FACING, ACTIVE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
return types.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return (Integer) state.getValue(METADATA);
|
||||
}
|
||||
|
||||
protected BlockStateContainer createBlockState() {
|
||||
FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
|
||||
ACTIVE = PropertyBool.create("active");
|
||||
METADATA = PropertyInteger.create("type", 0, types.length -1);
|
||||
return new BlockStateContainer(this, METADATA, FACING, ACTIVE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,48 +15,55 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileQuantumChest;
|
||||
|
||||
public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockQuantumChest() {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.quantumChest");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setHardness(2.0F);
|
||||
}
|
||||
public BlockQuantumChest()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.quantumChest");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setHardness(2.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileQuantumChest();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
|
||||
{
|
||||
return new TileQuantumChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
if (!playerIn.isSneaking())
|
||||
playerIn.openGui(Core.INSTANCE, GuiHandler.quantumChestID, worldIn, pos.getX(),
|
||||
pos.getY(), pos.getZ());
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn,
|
||||
EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (!playerIn.isSneaking())
|
||||
playerIn.openGui(Core.INSTANCE, GuiHandler.quantumChestID, worldIn, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "quantum_chest";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "quantum_chest";
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "qchest_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "qchest_side";
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "quantum_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "quantum_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,50 +11,61 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileQuantumTank;
|
||||
|
||||
public class BlockQuantumTank extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockQuantumTank extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockQuantumTank() {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.quantumTank");
|
||||
setHardness(2.0F);
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockQuantumTank()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.quantumTank");
|
||||
setHardness(2.0F);
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileQuantumTank();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
|
||||
{
|
||||
return new TileQuantumTank();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, GuiHandler.quantumTankID, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
{
|
||||
player.openGui(Core.INSTANCE, GuiHandler.quantumTankID, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return "techreborn:blocks/machine/generators/thermal_generator_side_off";
|
||||
}
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return "techreborn:blocks/machine/generators/thermal_generator_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return "techreborn:blocks/machine/generators/thermal_generator_side_off";
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return "techreborn:blocks/machine/generators/thermal_generator_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "quantum_top";
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "quantum_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return "techreborn:blocks/machine/generators/thermal_generator_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return "techreborn:blocks/machine/generators/thermal_generator_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,9 +10,11 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
import reborncore.common.BaseBlock;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
|
||||
public class BlockReinforcedGlass extends BaseBlock implements ITexturedBlock {
|
||||
|
||||
public BlockReinforcedGlass(Material materialIn) {
|
||||
public class BlockReinforcedGlass extends BaseBlock implements ITexturedBlock
|
||||
{
|
||||
|
||||
public BlockReinforcedGlass(Material materialIn)
|
||||
{
|
||||
super(materialIn);
|
||||
setUnlocalizedName("techreborn.reinforcedglass");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
|
@ -20,7 +22,8 @@ public class BlockReinforcedGlass extends BaseBlock implements ITexturedBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state) {
|
||||
public boolean isOpaqueCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -34,17 +37,19 @@ public class BlockReinforcedGlass extends BaseBlock implements ITexturedBlock {
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/";
|
||||
|
||||
private final String prefix = "techreborn:blocks/";
|
||||
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
public int amountOfStates()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState arg0, EnumFacing arg1) {
|
||||
public String getTextureNameFromState(IBlockState arg0, EnumFacing arg1)
|
||||
{
|
||||
return prefix + "reinforcedglass";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package techreborn.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import me.modmuss50.jsonDestroyer.api.IOpaqueBlock;
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
|
||||
import net.minecraft.block.BlockLeaves;
|
||||
|
@ -20,29 +23,31 @@ import reborncore.RebornCore;
|
|||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 20/02/2016.
|
||||
*/
|
||||
public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock, IOpaqueBlock {
|
||||
public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock, IOpaqueBlock
|
||||
{
|
||||
|
||||
public BlockRubberLeaves() {
|
||||
public BlockRubberLeaves()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.rubberleaves");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(CHECK_DECAY, Boolean.valueOf(true)).withProperty(DECAYABLE, Boolean.valueOf(true)));
|
||||
this.setDefaultState(this.getDefaultState().withProperty(CHECK_DECAY, Boolean.valueOf(true))
|
||||
.withProperty(DECAYABLE, Boolean.valueOf(true)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPlanks.EnumType getWoodType(int meta) {
|
||||
public BlockPlanks.EnumType getWoodType(int meta)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) {
|
||||
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
|
||||
{
|
||||
List<ItemStack> list = new java.util.ArrayList<ItemStack>();
|
||||
list.add(new ItemStack(this, 1, 0));
|
||||
return list;
|
||||
|
@ -65,46 +70,49 @@ public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock, IO
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected ItemStack createStackedBlock(IBlockState state)
|
||||
{
|
||||
IBlockState newState = state.withProperty(CHECK_DECAY, Boolean.valueOf(false)).withProperty(DECAYABLE, Boolean.valueOf(false));
|
||||
IBlockState newState = state.withProperty(CHECK_DECAY, Boolean.valueOf(false)).withProperty(DECAYABLE,
|
||||
Boolean.valueOf(false));
|
||||
|
||||
return super.createStackedBlock(newState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState IBlockState, EnumFacing enumFacing) {
|
||||
public String getTextureNameFromState(IBlockState IBlockState, EnumFacing enumFacing)
|
||||
{
|
||||
return "techreborn:blocks/rubber_leaves";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
public int amountOfStates()
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateContainer(this, new IProperty[] { CHECK_DECAY, DECAYABLE});
|
||||
return new BlockStateContainer(this, new IProperty[] { CHECK_DECAY, DECAYABLE });
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(DECAYABLE, Boolean.valueOf((meta & 1) == 0)).withProperty(CHECK_DECAY, Boolean.valueOf((meta & 2) > 0));
|
||||
return this.getDefaultState().withProperty(DECAYABLE, Boolean.valueOf((meta & 1) == 0))
|
||||
.withProperty(CHECK_DECAY, Boolean.valueOf((meta & 2) > 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
int meta = 0;
|
||||
if (!((Boolean)state.getValue(DECAYABLE)).booleanValue())
|
||||
if (!((Boolean) state.getValue(DECAYABLE)).booleanValue())
|
||||
{
|
||||
meta |= 1;
|
||||
}
|
||||
if (((Boolean)state.getValue(CHECK_DECAY)).booleanValue())
|
||||
if (((Boolean) state.getValue(CHECK_DECAY)).booleanValue())
|
||||
{
|
||||
meta |= 2;
|
||||
}
|
||||
|
@ -130,7 +138,8 @@ public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock, IO
|
|||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune)
|
||||
{
|
||||
return Item.getItemFromBlock(ModBlocks.rubberSapling);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package techreborn.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -20,37 +24,39 @@ import techreborn.client.TechRebornCreativeTabMisc;
|
|||
import techreborn.items.ItemParts;
|
||||
import techreborn.items.tools.ItemTreeTap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 19/02/2016.
|
||||
*/
|
||||
public class BlockRubberLog extends Block implements ITexturedBlock {
|
||||
public class BlockRubberLog extends Block implements ITexturedBlock
|
||||
{
|
||||
|
||||
public static PropertyDirection SAP_SIDE = PropertyDirection.create("sapside", EnumFacing.Plane.HORIZONTAL);
|
||||
public static PropertyBool HAS_SAP = PropertyBool.create("hassap");
|
||||
|
||||
public BlockRubberLog() {
|
||||
public BlockRubberLog()
|
||||
{
|
||||
super(Material.wood);
|
||||
setUnlocalizedName("techreborn.rubberlog");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
this.setHardness(2.0F);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(SAP_SIDE, EnumFacing.NORTH).withProperty(HAS_SAP, false));
|
||||
this.setDefaultState(
|
||||
this.getDefaultState().withProperty(SAP_SIDE, EnumFacing.NORTH).withProperty(HAS_SAP, false));
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
protected BlockStateContainer createBlockState() {
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateContainer(this, SAP_SIDE, HAS_SAP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
boolean hasSap = false;
|
||||
int tempMeta = meta;
|
||||
if(meta > 3){
|
||||
if (meta > 3)
|
||||
{
|
||||
hasSap = true;
|
||||
tempMeta -= 3;
|
||||
}
|
||||
|
@ -59,10 +65,12 @@ public class BlockRubberLog extends Block implements ITexturedBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
int tempMeta = 0;
|
||||
EnumFacing facing = state.getValue(SAP_SIDE);
|
||||
switch (facing){
|
||||
switch (facing)
|
||||
{
|
||||
case SOUTH:
|
||||
tempMeta = 0;
|
||||
break;
|
||||
|
@ -75,19 +83,24 @@ public class BlockRubberLog extends Block implements ITexturedBlock {
|
|||
case EAST:
|
||||
tempMeta = 3;
|
||||
}
|
||||
if(state.getValue(HAS_SAP)){
|
||||
if (state.getValue(HAS_SAP))
|
||||
{
|
||||
tempMeta += 3;
|
||||
}
|
||||
return tempMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState IBlockState, EnumFacing enumFacing) {
|
||||
if(enumFacing == EnumFacing.DOWN || enumFacing == EnumFacing.UP){
|
||||
return "techreborn:blocks/rubber_log_top";
|
||||
public String getTextureNameFromState(IBlockState IBlockState, EnumFacing enumFacing)
|
||||
{
|
||||
if (enumFacing == EnumFacing.DOWN || enumFacing == EnumFacing.UP)
|
||||
{
|
||||
return "techreborn:blocks/rubber_log_top";
|
||||
}
|
||||
if(IBlockState.getValue(HAS_SAP)){
|
||||
if(IBlockState.getValue(SAP_SIDE) == enumFacing){
|
||||
if (IBlockState.getValue(HAS_SAP))
|
||||
{
|
||||
if (IBlockState.getValue(SAP_SIDE) == enumFacing)
|
||||
{
|
||||
return "techreborn:blocks/rubber_log_sap";
|
||||
}
|
||||
}
|
||||
|
@ -95,40 +108,52 @@ public class BlockRubberLog extends Block implements ITexturedBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
public int amountOfStates()
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainLeaves(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
public boolean canSustainLeaves(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos) {
|
||||
public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
|
||||
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
|
||||
{
|
||||
int i = 4;
|
||||
int j = i + 1;
|
||||
if (worldIn.isAreaLoaded(pos.add(-j, -j, -j), pos.add(j, j, j))) {
|
||||
for (BlockPos blockpos : BlockPos.getAllInBox(pos.add(-i, -i, -i), pos.add(i, i, i))) {
|
||||
if (worldIn.isAreaLoaded(pos.add(-j, -j, -j), pos.add(j, j, j)))
|
||||
{
|
||||
for (BlockPos blockpos : BlockPos.getAllInBox(pos.add(-i, -i, -i), pos.add(i, i, i)))
|
||||
{
|
||||
IBlockState state1 = worldIn.getBlockState(blockpos);
|
||||
if (state1.getBlock().isLeaves(state1, worldIn, blockpos)) {
|
||||
state1.getBlock().beginLeavesDecay(state1,worldIn, blockpos);
|
||||
if (state1.getBlock().isLeaves(state1, worldIn, blockpos))
|
||||
{
|
||||
state1.getBlock().beginLeavesDecay(state1, worldIn, blockpos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
|
||||
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
|
||||
{
|
||||
super.updateTick(worldIn, pos, state, rand);
|
||||
if(!state.getValue(HAS_SAP)){
|
||||
if(rand.nextInt(50) == 0){
|
||||
if (!state.getValue(HAS_SAP))
|
||||
{
|
||||
if (rand.nextInt(50) == 0)
|
||||
{
|
||||
EnumFacing facing = EnumFacing.getHorizontal(rand.nextInt(4));
|
||||
if(worldIn.getBlockState(pos.down()).getBlock() == this && worldIn.getBlockState(pos.up()).getBlock() == this){
|
||||
if (worldIn.getBlockState(pos.down()).getBlock() == this
|
||||
&& worldIn.getBlockState(pos.up()).getBlock() == this)
|
||||
{
|
||||
worldIn.setBlockState(pos, state.withProperty(HAS_SAP, true).withProperty(SAP_SIDE, facing));
|
||||
}
|
||||
}
|
||||
|
@ -136,18 +161,27 @@ public class BlockRubberLog extends Block implements ITexturedBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn,
|
||||
EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ);
|
||||
if(playerIn.getHeldItem(EnumHand.MAIN_HAND) != null && playerIn.getHeldItem(EnumHand.MAIN_HAND).getItem() instanceof ItemTreeTap)
|
||||
if(state.getValue(HAS_SAP)){
|
||||
if(state.getValue(SAP_SIDE) == side){
|
||||
worldIn.setBlockState(pos, state.withProperty(HAS_SAP, false).withProperty(SAP_SIDE, EnumFacing.getHorizontal(0)));
|
||||
//TODO 1.9 sounds
|
||||
//worldIn.playSoundAtEntity(playerIn, "techreborn:sap_extract", 0.8F, 1F);
|
||||
if(!worldIn.isRemote){
|
||||
if (playerIn.getHeldItem(EnumHand.MAIN_HAND) != null
|
||||
&& playerIn.getHeldItem(EnumHand.MAIN_HAND).getItem() instanceof ItemTreeTap)
|
||||
if (state.getValue(HAS_SAP))
|
||||
{
|
||||
if (state.getValue(SAP_SIDE) == side)
|
||||
{
|
||||
worldIn.setBlockState(pos,
|
||||
state.withProperty(HAS_SAP, false).withProperty(SAP_SIDE, EnumFacing.getHorizontal(0)));
|
||||
// TODO 1.9 sounds
|
||||
// worldIn.playSoundAtEntity(playerIn,
|
||||
// "techreborn:sap_extract", 0.8F, 1F);
|
||||
if (!worldIn.isRemote)
|
||||
{
|
||||
Random rand = new Random();
|
||||
BlockPos itemPos = pos.offset(side);
|
||||
EntityItem item = new EntityItem(worldIn, itemPos.getX(), itemPos.getY(), itemPos.getZ(), ItemParts.getPartByName("rubberSap").copy());
|
||||
EntityItem item = new EntityItem(worldIn, itemPos.getX(), itemPos.getY(), itemPos.getZ(),
|
||||
ItemParts.getPartByName("rubberSap").copy());
|
||||
float factor = 0.05F;
|
||||
playerIn.getHeldItem(EnumHand.MAIN_HAND).damageItem(1, playerIn);
|
||||
item.motionX = rand.nextGaussian() * factor;
|
||||
|
@ -162,16 +196,20 @@ public class BlockRubberLog extends Block implements ITexturedBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
public int damageDropped(IBlockState state)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
{
|
||||
List<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
drops.add(new ItemStack(this));
|
||||
if(state.getValue(HAS_SAP)){
|
||||
if(new Random().nextInt(4) == 0){
|
||||
if (state.getValue(HAS_SAP))
|
||||
{
|
||||
if (new Random().nextInt(4) == 0)
|
||||
{
|
||||
drops.add(ItemParts.getPartByName("rubberSap"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,23 +11,27 @@ import techreborn.client.TechRebornCreativeTabMisc;
|
|||
/**
|
||||
* Created by modmuss50 on 20/02/2016.
|
||||
*/
|
||||
public class BlockRubberPlank extends Block implements ITexturedBlock {
|
||||
public class BlockRubberPlank extends Block implements ITexturedBlock
|
||||
{
|
||||
|
||||
public BlockRubberPlank() {
|
||||
super(Material.wood);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
setUnlocalizedName("techreborn.rubberplank");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
this.setHardness(2.0F);
|
||||
}
|
||||
public BlockRubberPlank()
|
||||
{
|
||||
super(Material.wood);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
setUnlocalizedName("techreborn.rubberplank");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
this.setHardness(2.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState state, EnumFacing side) {
|
||||
return "techreborn:blocks/rubber_planks";
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState state, EnumFacing side)
|
||||
{
|
||||
return "techreborn:blocks/rubber_planks";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
public int amountOfStates()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package techreborn.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockSapling;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
@ -10,33 +13,37 @@ import net.minecraft.world.World;
|
|||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.world.RubberTreeGenerator;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 20/02/2016.
|
||||
*/
|
||||
public class BlockRubberSapling extends BlockSapling {
|
||||
public class BlockRubberSapling extends BlockSapling
|
||||
{
|
||||
|
||||
public BlockRubberSapling() {
|
||||
setUnlocalizedName("techreborn.rubbersapling");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(STAGE, Integer.valueOf(0)));
|
||||
}
|
||||
public BlockRubberSapling()
|
||||
{
|
||||
setUnlocalizedName("techreborn.rubbersapling");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(STAGE, Integer.valueOf(0)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateTree(World worldIn, BlockPos pos, IBlockState state, Random rand) {
|
||||
if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(worldIn, rand, pos)) {
|
||||
return;
|
||||
}
|
||||
worldIn.setBlockToAir(pos);
|
||||
if(!new RubberTreeGenerator(false).generate(worldIn, rand, pos)){
|
||||
worldIn.setBlockState(pos, state); //Re-add the sapling if the tree failed to grow
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void generateTree(World worldIn, BlockPos pos, IBlockState state, Random rand)
|
||||
{
|
||||
if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(worldIn, rand, pos))
|
||||
{
|
||||
return;
|
||||
}
|
||||
worldIn.setBlockToAir(pos);
|
||||
if (!new RubberTreeGenerator(false).generate(worldIn, rand, pos))
|
||||
{
|
||||
worldIn.setBlockState(pos, state); // Re-add the sapling if the tree
|
||||
// failed to grow
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) {
|
||||
list.add(new ItemStack(itemIn, 1, 0));
|
||||
}
|
||||
@Override
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list)
|
||||
{
|
||||
list.add(new ItemStack(itemIn, 1, 0));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package techreborn.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
|
@ -15,81 +18,91 @@ import reborncore.common.BaseBlock;
|
|||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
public class BlockStorage extends BaseBlock implements ITexturedBlock
|
||||
{
|
||||
|
||||
public class BlockStorage extends BaseBlock implements ITexturedBlock {
|
||||
public static ItemStack getStorageBlockByName(String name, int count)
|
||||
{
|
||||
for (int i = 0; i < types.length; i++)
|
||||
{
|
||||
if (types[i].equals(name))
|
||||
{
|
||||
return new ItemStack(ModBlocks.storage, count, i);
|
||||
}
|
||||
}
|
||||
return BlockStorage2.getStorageBlockByName(name, count);
|
||||
}
|
||||
|
||||
public static ItemStack getStorageBlockByName(String name, int count) {
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
return new ItemStack(ModBlocks.storage, count, i);
|
||||
}
|
||||
}
|
||||
return BlockStorage2.getStorageBlockByName(name, count);
|
||||
}
|
||||
public static ItemStack getStorageBlockByName(String name)
|
||||
{
|
||||
return getStorageBlockByName(name, 1);
|
||||
}
|
||||
|
||||
public static ItemStack getStorageBlockByName(String name) {
|
||||
return getStorageBlockByName(name, 1);
|
||||
}
|
||||
public static final String[] types = new String[] { "silver", "aluminum", "titanium", "chrome", "steel", "brass",
|
||||
"lead", "electrum", "zinc", "platinum", "tungsten", "nickel", "invar", "osmium", "iridium" };
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{"silver", "aluminum", "titanium", "chrome", "steel", "brass", "lead",
|
||||
"electrum", "zinc", "platinum", "tungsten", "nickel", "invar", "osmium",
|
||||
"iridium"};
|
||||
public PropertyInteger METADATA;
|
||||
|
||||
public PropertyInteger METADATA;
|
||||
public BlockStorage(Material material)
|
||||
{
|
||||
super(material);
|
||||
setUnlocalizedName("techreborn.storage");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setHardness(2f);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune)
|
||||
{
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
|
||||
public BlockStorage(Material material) {
|
||||
super(material);
|
||||
setUnlocalizedName("techreborn.storage");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setHardness(2f);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list)
|
||||
{
|
||||
for (int meta = 0; meta < types.length; meta++)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
@Override
|
||||
public int damageDropped(IBlockState state)
|
||||
{
|
||||
return getMetaFromState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
|
||||
for (int meta = 0; meta < types.length; meta++) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing)
|
||||
{
|
||||
return "techreborn:blocks/storage/" + types[getMetaFromState(BlockStateContainer)] + "_block";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
return getMetaFromState(state);
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) {
|
||||
return "techreborn:blocks/storage/" + types[getMetaFromState(BlockStateContainer)] + "_block";
|
||||
}
|
||||
@Override
|
||||
public int amountOfStates()
|
||||
{
|
||||
return types.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
return types.length;
|
||||
}
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return state.getValue(METADATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(METADATA);
|
||||
}
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
|
||||
protected BlockStateContainer createBlockState() {
|
||||
|
||||
METADATA = PropertyInteger.create("type", 0, types.length -1);
|
||||
return new BlockStateContainer(this, METADATA);
|
||||
}
|
||||
METADATA = PropertyInteger.create("type", 0, types.length - 1);
|
||||
return new BlockStateContainer(this, METADATA);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package techreborn.blocks;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
|
@ -15,79 +19,87 @@ import reborncore.common.BaseBlock;
|
|||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
public class BlockStorage2 extends BaseBlock implements ITexturedBlock
|
||||
{
|
||||
|
||||
public class BlockStorage2 extends BaseBlock implements ITexturedBlock {
|
||||
public static ItemStack getStorageBlockByName(String name, int count)
|
||||
{
|
||||
for (int i = 0; i < types.length; i++)
|
||||
{
|
||||
if (types[i].equals(name))
|
||||
{
|
||||
return new ItemStack(ModBlocks.storage2, count, i);
|
||||
}
|
||||
}
|
||||
throw new InvalidParameterException("The storage block " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getStorageBlockByName(String name, int count) {
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
return new ItemStack(ModBlocks.storage2, count, i);
|
||||
}
|
||||
}
|
||||
throw new InvalidParameterException("The storage block " + name + " could not be found.");
|
||||
}
|
||||
public static final String[] types = new String[] { "tungstensteel", "lodestone", "tellurium",
|
||||
"iridium_reinforced_tungstensteel", "iridium_reinforced_stone", "ruby", "sapphire", "peridot",
|
||||
"yellowGarnet", "redGarnet", "copper", "tin" };
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{"tungstensteel", "lodestone", "tellurium", "iridium_reinforced_tungstensteel",
|
||||
"iridium_reinforced_stone", "ruby", "sapphire", "peridot", "yellowGarnet", "redGarnet", "copper", "tin"};
|
||||
public BlockStorage2(Material material)
|
||||
{
|
||||
super(material);
|
||||
setUnlocalizedName("techreborn.storage2");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setHardness(2f);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
|
||||
}
|
||||
|
||||
public BlockStorage2(Material material) {
|
||||
super(material);
|
||||
setUnlocalizedName("techreborn.storage2");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setHardness(2f);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
|
||||
}
|
||||
public PropertyInteger METADATA;
|
||||
|
||||
public PropertyInteger METADATA;
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune)
|
||||
{
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list)
|
||||
{
|
||||
for (int meta = 0; meta < types.length; meta++)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state)
|
||||
{
|
||||
return getMetaFromState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing)
|
||||
{
|
||||
return "techreborn:blocks/storage/" + types[getMetaFromState(BlockStateContainer)] + "_block";
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
|
||||
for (int meta = 0; meta < types.length; meta++) {
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int amountOfStates()
|
||||
{
|
||||
return types.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
return getMetaFromState(state);
|
||||
}
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) {
|
||||
return "techreborn:blocks/storage/" + types[getMetaFromState(BlockStateContainer)] + "_block";
|
||||
}
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return (Integer) state.getValue(METADATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
return types.length;
|
||||
}
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(METADATA, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return (Integer) state.getValue(METADATA);
|
||||
}
|
||||
|
||||
protected BlockStateContainer createBlockState() {
|
||||
|
||||
METADATA = PropertyInteger.create("type", 0, types.length -1);
|
||||
return new BlockStateContainer(this, METADATA);
|
||||
}
|
||||
METADATA = PropertyInteger.create("type", 0, types.length - 1);
|
||||
return new BlockStateContainer(this, METADATA);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,35 +5,40 @@ import reborncore.common.blocks.BlockMachineBase;
|
|||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
||||
public class BlockSupercondensator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockSupercondensator extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockSupercondensator(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.supercondensator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
public BlockSupercondensator(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.supercondensator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "supercondensator_front";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "supercondensator_front";
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "supercondensator_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "supercondensator_side" ;
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "supercondensator_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "supercondensator_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,55 +11,66 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileBlastFurnace;
|
||||
|
||||
public class BlockBlastFurnace extends BlockMachineBase implements IRotationTexture {
|
||||
public class BlockBlastFurnace extends BlockMachineBase implements IRotationTexture
|
||||
{
|
||||
|
||||
public BlockBlastFurnace(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.blastfurnace");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockBlastFurnace(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.blastfurnace");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileBlastFurnace();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileBlastFurnace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.blastFurnaceID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.blastFurnaceID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAdvanced() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isAdvanced()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "industrial_blast_furnace_front_off";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOff()
|
||||
{
|
||||
return prefix + "industrial_blast_furnace_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "industrial_blast_furnace_front_on";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOn()
|
||||
{
|
||||
return prefix + "industrial_blast_furnace_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "advanced_machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getSide()
|
||||
{
|
||||
return prefix + "advanced_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "advanced_machine_top";
|
||||
}
|
||||
@Override
|
||||
public String getTop()
|
||||
{
|
||||
return prefix + "advanced_machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "advanced_machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom()
|
||||
{
|
||||
return prefix + "advanced_machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,51 +10,62 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileCentrifuge;
|
||||
|
||||
public class BlockCentrifuge extends BlockMachineBase implements IRotationTexture {
|
||||
public class BlockCentrifuge extends BlockMachineBase implements IRotationTexture
|
||||
{
|
||||
|
||||
public BlockCentrifuge() {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.centrifuge");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockCentrifuge()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.centrifuge");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileCentrifuge();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
|
||||
{
|
||||
return new TileCentrifuge();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, GuiHandler.centrifugeID, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
{
|
||||
player.openGui(Core.INSTANCE, GuiHandler.centrifugeID, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "industrial_centrifuge_side_off";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOff()
|
||||
{
|
||||
return prefix + "industrial_centrifuge_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "industrial_centrifuge_side_on";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOn()
|
||||
{
|
||||
return prefix + "industrial_centrifuge_side_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return getFrontOff();
|
||||
}
|
||||
@Override
|
||||
public String getSide()
|
||||
{
|
||||
return getFrontOff();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "industrial_centrifuge_top_off";
|
||||
}
|
||||
@Override
|
||||
public String getTop()
|
||||
{
|
||||
return prefix + "industrial_centrifuge_top_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "industrial_centrifuge_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom()
|
||||
{
|
||||
return prefix + "industrial_centrifuge_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,38 +5,45 @@ import reborncore.common.blocks.BlockMachineBase;
|
|||
import reborncore.common.blocks.IRotationTexture;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
||||
public class BlockDistillationTower extends BlockMachineBase implements IRotationTexture {
|
||||
public class BlockDistillationTower extends BlockMachineBase implements IRotationTexture
|
||||
{
|
||||
|
||||
public BlockDistillationTower(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.distillationtower");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockDistillationTower(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.distillationtower");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "distillation_tower_front_off";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOff()
|
||||
{
|
||||
return prefix + "distillation_tower_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "distillation_tower_front_off";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOn()
|
||||
{
|
||||
return prefix + "distillation_tower_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "advanced_machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getSide()
|
||||
{
|
||||
return prefix + "advanced_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "industrial_centrifuge_top_off";
|
||||
}
|
||||
@Override
|
||||
public String getTop()
|
||||
{
|
||||
return prefix + "industrial_centrifuge_top_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "industrial_centrifuge_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom()
|
||||
{
|
||||
return prefix + "industrial_centrifuge_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,50 +11,60 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileImplosionCompressor;
|
||||
|
||||
public class BlockImplosionCompressor extends BlockMachineBase implements IRotationTexture {
|
||||
public class BlockImplosionCompressor extends BlockMachineBase implements IRotationTexture
|
||||
{
|
||||
|
||||
public BlockImplosionCompressor(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.implosioncompressor");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockImplosionCompressor(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.implosioncompressor");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileImplosionCompressor();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
|
||||
{
|
||||
return new TileImplosionCompressor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.implosionCompresserID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.implosionCompresserID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "implosion_compressor_front_off";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOff()
|
||||
{
|
||||
return prefix + "implosion_compressor_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "implosion_compressor_front_on";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOn()
|
||||
{
|
||||
return prefix + "implosion_compressor_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "advanced_machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getSide()
|
||||
{
|
||||
return prefix + "advanced_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "industrial_centrifuge_top_off";
|
||||
}
|
||||
@Override
|
||||
public String getTop()
|
||||
{
|
||||
return prefix + "industrial_centrifuge_top_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "implosion_compressor_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom()
|
||||
{
|
||||
return prefix + "implosion_compressor_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,50 +11,60 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileIndustrialElectrolyzer;
|
||||
|
||||
public class BlockIndustrialElectrolyzer extends BlockMachineBase implements IRotationTexture {
|
||||
public class BlockIndustrialElectrolyzer extends BlockMachineBase implements IRotationTexture
|
||||
{
|
||||
|
||||
public BlockIndustrialElectrolyzer(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.industrialelectrolyzer");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockIndustrialElectrolyzer(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.industrialelectrolyzer");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileIndustrialElectrolyzer();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileIndustrialElectrolyzer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.industrialElectrolyzerID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.industrialElectrolyzerID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "industrial_electrolyzer_front_off";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOff()
|
||||
{
|
||||
return prefix + "industrial_electrolyzer_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "industrial_electrolyzer_front_on";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOn()
|
||||
{
|
||||
return prefix + "industrial_electrolyzer_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "industrial_electrolyzer_front_off";
|
||||
}
|
||||
@Override
|
||||
public String getSide()
|
||||
{
|
||||
return prefix + "industrial_electrolyzer_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "machine_top";
|
||||
}
|
||||
@Override
|
||||
public String getTop()
|
||||
{
|
||||
return prefix + "machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom()
|
||||
{
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,53 +12,64 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileIndustrialGrinder;
|
||||
|
||||
public class BlockIndustrialGrinder extends BlockMachineBase implements IRotationTexture {
|
||||
public class BlockIndustrialGrinder extends BlockMachineBase implements IRotationTexture
|
||||
{
|
||||
|
||||
public BlockIndustrialGrinder(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.industrialgrinder");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockIndustrialGrinder(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.industrialgrinder");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileIndustrialGrinder();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
|
||||
{
|
||||
return new TileIndustrialGrinder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(fillBlockWithFluid(world, new BlockPos(x, y, z), player)){
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.industrialGrinderID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.industrialGrinderID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "industrial_grinder_front_off";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOff()
|
||||
{
|
||||
return prefix + "industrial_grinder_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "industrial_grinder_front_on";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOn()
|
||||
{
|
||||
return prefix + "industrial_grinder_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getSide()
|
||||
{
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "industrial_grinder_top_off";
|
||||
}
|
||||
@Override
|
||||
public String getTop()
|
||||
{
|
||||
return prefix + "industrial_grinder_top_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "industrial_centrifuge_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom()
|
||||
{
|
||||
return prefix + "industrial_centrifuge_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,53 +12,64 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileIndustrialSawmill;
|
||||
|
||||
public class BlockIndustrialSawmill extends BlockMachineBase implements IRotationTexture {
|
||||
public class BlockIndustrialSawmill extends BlockMachineBase implements IRotationTexture
|
||||
{
|
||||
|
||||
public BlockIndustrialSawmill(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.industrialsawmill");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockIndustrialSawmill(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.industrialsawmill");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileIndustrialSawmill();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileIndustrialSawmill();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(fillBlockWithFluid(world, new BlockPos(x, y, z), player)){
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.sawMillID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.sawMillID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "industrial_sawmill_front_off";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOff()
|
||||
{
|
||||
return prefix + "industrial_sawmill_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "industrial_sawmill_front_on";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOn()
|
||||
{
|
||||
return prefix + "industrial_sawmill_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "advanced_machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getSide()
|
||||
{
|
||||
return prefix + "advanced_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "advanced_machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getTop()
|
||||
{
|
||||
return prefix + "advanced_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "advanced_machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getBottom()
|
||||
{
|
||||
return prefix + "advanced_machine_side";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,26 +8,29 @@ import net.minecraftforge.fluids.BlockFluidClassic;
|
|||
import net.minecraftforge.fluids.Fluid;
|
||||
import reborncore.RebornCore;
|
||||
|
||||
public class BlockFluidBase extends BlockFluidClassic {
|
||||
public class BlockFluidBase extends BlockFluidClassic
|
||||
{
|
||||
|
||||
public BlockFluidBase(Fluid fluid, Material material) {
|
||||
super(fluid, material);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
}
|
||||
public BlockFluidBase(Fluid fluid, Material material)
|
||||
{
|
||||
super(fluid, material);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDisplace(IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
if (world.getBlockState(pos).getBlock().getMaterial(world.getBlockState(pos)).isLiquid())
|
||||
return false;
|
||||
return super.canDisplace(world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDisplace(IBlockAccess world, BlockPos pos) {
|
||||
if(world.getBlockState(pos).getBlock().getMaterial(world.getBlockState(pos)).isLiquid())
|
||||
return false;
|
||||
return super.canDisplace(world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean displaceIfPossible(World world, BlockPos pos) {
|
||||
if(world.getBlockState(pos).getBlock().getMaterial(world.getBlockState(pos)).isLiquid())
|
||||
return false;
|
||||
return super.displaceIfPossible(world, pos);
|
||||
}
|
||||
@Override
|
||||
public boolean displaceIfPossible(World world, BlockPos pos)
|
||||
{
|
||||
if (world.getBlockState(pos).getBlock().getMaterial(world.getBlockState(pos)).isLiquid())
|
||||
return false;
|
||||
return super.displaceIfPossible(world, pos);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,18 +4,21 @@ import me.modmuss50.jsonDestroyer.api.ITexturedFluid;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
public class BlockFluidTechReborn extends BlockFluidBase implements ITexturedFluid {
|
||||
public class BlockFluidTechReborn extends BlockFluidBase implements ITexturedFluid
|
||||
{
|
||||
|
||||
String name;
|
||||
String name;
|
||||
|
||||
public BlockFluidTechReborn(Fluid fluid, Material material, String name) {
|
||||
super(fluid, material);
|
||||
setUnlocalizedName(name);
|
||||
this.name = name;
|
||||
}
|
||||
public BlockFluidTechReborn(Fluid fluid, Material material, String name)
|
||||
{
|
||||
super(fluid, material);
|
||||
setUnlocalizedName(name);
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureName() {
|
||||
return "techreborn:blocks/fluids/" + name.replaceAll("techreborn.", "") + "_flowing";
|
||||
}
|
||||
@Override
|
||||
public String getTextureName()
|
||||
{
|
||||
return "techreborn:blocks/fluids/" + name.replaceAll("techreborn.", "") + "_flowing";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,12 @@ package techreborn.blocks.fluid;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
public class TechRebornFluid extends Fluid {
|
||||
public TechRebornFluid(String fluidName) {
|
||||
super(fluidName, new ResourceLocation("techreborn:blocks/fluids/" + fluidName.replaceFirst("fluid", "") + "_flowing"), new ResourceLocation("techreborn:blocks/fluids/" + fluidName.replaceFirst("fluid", "") + "_flowing"));
|
||||
}
|
||||
public class TechRebornFluid extends Fluid
|
||||
{
|
||||
public TechRebornFluid(String fluidName)
|
||||
{
|
||||
super(fluidName,
|
||||
new ResourceLocation("techreborn:blocks/fluids/" + fluidName.replaceFirst("fluid", "") + "_flowing"),
|
||||
new ResourceLocation("techreborn:blocks/fluids/" + fluidName.replaceFirst("fluid", "") + "_flowing"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,54 +12,59 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.generator.TileDieselGenerator;
|
||||
|
||||
public class BlockDieselGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockDieselGenerator extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockDieselGenerator(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.dieselgenerator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
public BlockDieselGenerator(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.dieselgenerator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileDieselGenerator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.dieselGeneratorID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileDieselGenerator();
|
||||
}
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z,
|
||||
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(fillBlockWithFluid(world, new BlockPos(x, y, z), player)){
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.dieselGeneratorID, world, x, y,
|
||||
z);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "generator_machine_side";
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "generator_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "generator_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "generator_machine_side" ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "diesel_generator_top_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "diesel_generator_top_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,42 +8,46 @@ import reborncore.common.blocks.IAdvancedRotationTexture;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.generator.TileDragonEggSiphoner;
|
||||
|
||||
public class BlockDragonEggSiphoner extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockDragonEggSiphoner extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockDragonEggSiphoner(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.dragoneggsiphoner");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileDragonEggSiphoner();
|
||||
}
|
||||
|
||||
public BlockDragonEggSiphoner(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.dragoneggsiphoner");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "dragon_egg_energy_siphon_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileDragonEggSiphoner();
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "dragon_egg_energy_siphon_side_off";
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "dragon_egg_energy_siphon_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "dragon_egg_energy_siphon_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "dragon_egg_energy_siphon_side_off" ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "dragon_egg_energy_siphon_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,52 +12,59 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.generator.TileGasTurbine;
|
||||
|
||||
public class BlockGasTurbine extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockGasTurbine extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockGasTurbine(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.gasTurbine");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
public BlockGasTurbine(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.gasTurbine");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileGasTurbine();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileGasTurbine();
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.gasTurbineID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z,
|
||||
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(fillBlockWithFluid(world, new BlockPos(x, y, z), player)){
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.gasTurbineID, world, x, y,
|
||||
z);
|
||||
return true;
|
||||
}
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "generator_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "generator_machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "generator_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "generator_machine_side" ;
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "gas_generator_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "gas_generator_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "gas_generator_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "gas_generator_bottom";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,58 +17,70 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.generator.TileGenerator;
|
||||
|
||||
public class BlockGenerator extends BlockMachineBase implements IRotationTexture {
|
||||
public class BlockGenerator extends BlockMachineBase implements IRotationTexture
|
||||
{
|
||||
|
||||
public BlockGenerator() {
|
||||
public BlockGenerator()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.generator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileGenerator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking()){
|
||||
player.openGui(Core.INSTANCE, GuiHandler.generatorID, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
items.add(new ItemStack(this));
|
||||
return items;
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileGenerator();
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
{
|
||||
player.openGui(Core.INSTANCE, GuiHandler.generatorID, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "generator_front_off";
|
||||
}
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
{
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
items.add(new ItemStack(this));
|
||||
return items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "generator_front_on";
|
||||
}
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "generator_machine_side" ;
|
||||
}
|
||||
@Override
|
||||
public String getFrontOff()
|
||||
{
|
||||
return prefix + "generator_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "generator_machine_top";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOn()
|
||||
{
|
||||
return prefix + "generator_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getSide()
|
||||
{
|
||||
return prefix + "generator_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop()
|
||||
{
|
||||
return prefix + "generator_machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom()
|
||||
{
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,42 +8,46 @@ import reborncore.common.blocks.IAdvancedRotationTexture;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.generator.TileHeatGenerator;
|
||||
|
||||
public class BlockHeatGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockHeatGenerator extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockHeatGenerator(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.heatgenerator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
public BlockHeatGenerator(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.heatgenerator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileHeatGenerator();
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "heat_generator_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileHeatGenerator();
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "heat_generator_side";
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "heat_generator_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "heat_generator_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "heat_generator_side" ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "heat_generator_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "heat_generator_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "heat_generator_bottom";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,33 +5,39 @@ import reborncore.common.blocks.BlockMachineBase;
|
|||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
||||
public class BlockLightningRod extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockLightningRod extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockLightningRod(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.lightningrod");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockLightningRod(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.lightningrod");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "plasma_generator_side_off";
|
||||
}
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "plasma_generator_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "plasma_generator_side_off" ;
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "plasma_generator_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "plasma_generator_side_off";
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "plasma_generator_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "plasma_generator_side_off";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "plasma_generator_side_off";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,35 +5,40 @@ import reborncore.common.blocks.BlockMachineBase;
|
|||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
||||
public class BlockMagicEnergyAbsorber extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockMagicEnergyAbsorber extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockMagicEnergyAbsorber(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.magicenergyabsorber");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockMagicEnergyAbsorber(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.magicenergyabsorber");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "magic_energy_absorber_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "magic_energy_absorber_side";
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "magic_energy_absorber_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "magic_energy_absorber_side" ;
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "magic_energy_absorber_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "magic_energy_absorber_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "magic_energy_absorber_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "magic_energy_absorber_bottom";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,36 +5,40 @@ import reborncore.common.blocks.BlockMachineBase;
|
|||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
||||
public class BlockMagicEnergyConverter extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockMagicEnergyConverter extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockMagicEnergyConverter(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.magicenergyconverter");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockMagicEnergyConverter(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.magicenergyconverter");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "magic_energy_converter_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "magic_energy_converter_front_off";
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "magic_energy_converter_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "magic_energy_converter_side" ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "magic_energy_converter_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "magic_energy_converter_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "magic_energy_converter_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "magic_energy_converter_bottom";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,33 +5,39 @@ import reborncore.common.blocks.BlockMachineBase;
|
|||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
||||
public class BlockPlasmaGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockPlasmaGenerator extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockPlasmaGenerator(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.plasmagenerator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockPlasmaGenerator(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.plasmagenerator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "plasma_generator_front";
|
||||
}
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "plasma_generator_front";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "plasma_generator_side_off" ;
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "plasma_generator_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "plasma_generator_side_off";
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "plasma_generator_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "plasma_generator_side_off";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "plasma_generator_side_off";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,53 +12,59 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.generator.TileSemifluidGenerator;
|
||||
|
||||
public class BlockSemiFluidGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockSemiFluidGenerator extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockSemiFluidGenerator(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.semifluidgenerator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileSemifluidGenerator();
|
||||
}
|
||||
|
||||
public BlockSemiFluidGenerator(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.semifluidgenerator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.semifluidGeneratorID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileSemifluidGenerator();
|
||||
}
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z,
|
||||
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(fillBlockWithFluid(world, new BlockPos(x, y, z), player)){
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.semifluidGeneratorID, world, x, y,
|
||||
z);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "semifluid_generator_side";
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "semifluid_generator_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "semifluid_generator_side";
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "generator_machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "semifluid_generator_side" ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "generator_machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,52 +15,62 @@ import techreborn.tiles.generator.TileSolarPanel;
|
|||
/**
|
||||
* Created by modmuss50 on 25/02/2016.
|
||||
*/
|
||||
public class BlockSolarPanel extends BaseTileBlock implements ITexturedBlock {
|
||||
public class BlockSolarPanel extends BaseTileBlock implements ITexturedBlock
|
||||
{
|
||||
|
||||
public static PropertyBool ACTIVE = PropertyBool.create("active");
|
||||
public static PropertyBool ACTIVE = PropertyBool.create("active");
|
||||
|
||||
public BlockSolarPanel() {
|
||||
super(Material.iron);
|
||||
setUnlocalizedName("techreborn.solarpanel");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(ACTIVE, false));
|
||||
}
|
||||
public BlockSolarPanel()
|
||||
{
|
||||
super(Material.iron);
|
||||
setUnlocalizedName("techreborn.solarpanel");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(ACTIVE, false));
|
||||
}
|
||||
|
||||
protected BlockStateContainer createBlockState() {
|
||||
ACTIVE = PropertyBool.create("active");
|
||||
return new BlockStateContainer(this, ACTIVE);
|
||||
}
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
ACTIVE = PropertyBool.create("active");
|
||||
return new BlockStateContainer(this, ACTIVE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(ACTIVE, meta == 0 ? false : true);
|
||||
}
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return getDefaultState().withProperty(ACTIVE, meta == 0 ? false : true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(ACTIVE) == true ? 1 : 0;
|
||||
}
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return state.getValue(ACTIVE) == true ? 1 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||
return new TileSolarPanel();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
return new TileSolarPanel();
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState state, EnumFacing side) {
|
||||
boolean isActive = state.getValue(ACTIVE);
|
||||
if(side == EnumFacing.UP){
|
||||
return prefix + "solar_panel_top_" + (isActive ? "on" : "off");
|
||||
} else if(side==EnumFacing.DOWN){
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
return prefix + "solar_panel_side_" + (isActive ? "on" : "off");
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState state, EnumFacing side)
|
||||
{
|
||||
boolean isActive = state.getValue(ACTIVE);
|
||||
if (side == EnumFacing.UP)
|
||||
{
|
||||
return prefix + "solar_panel_top_" + (isActive ? "on" : "off");
|
||||
} else if (side == EnumFacing.DOWN)
|
||||
{
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
return prefix + "solar_panel_side_" + (isActive ? "on" : "off");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
return 2;
|
||||
}
|
||||
@Override
|
||||
public int amountOfStates()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,53 +11,58 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.generator.TileThermalGenerator;
|
||||
|
||||
public class BlockThermalGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockThermalGenerator extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockThermalGenerator()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.thermalGenerator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileThermalGenerator();
|
||||
}
|
||||
|
||||
public BlockThermalGenerator() {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.thermalGenerator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.thermalGeneratorID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileThermalGenerator();
|
||||
}
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z,
|
||||
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(fillBlockWithFluid(world, new BlockPos(x, y, z), player)){
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.thermalGeneratorID, world, x, y,
|
||||
z);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return isActive ? prefix + "thermal_generator_side_on" : prefix + "thermal_generator_side_off";
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return isActive ? prefix + "thermal_generator_side_on" : prefix + "thermal_generator_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return isActive ? prefix + "thermal_generator_top_on" : prefix + "thermal_generator_top_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return isActive ? prefix + "thermal_generator_side_on" : prefix + "thermal_generator_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return isActive ? prefix + "thermal_generator_side_on" : prefix + "thermal_generator_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return isActive ? prefix + "thermal_generator_top_on" : prefix + "thermal_generator_top_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,35 +14,43 @@ import techreborn.tiles.generator.TileWaterMill;
|
|||
/**
|
||||
* Created by modmuss50 on 25/02/2016.
|
||||
*/
|
||||
public class BlockWaterMill extends BaseTileBlock implements ITexturedBlock{
|
||||
public class BlockWaterMill extends BaseTileBlock implements ITexturedBlock
|
||||
{
|
||||
|
||||
public BlockWaterMill() {
|
||||
super(Material.iron);
|
||||
setUnlocalizedName("techreborn.watermill");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
}
|
||||
public BlockWaterMill()
|
||||
{
|
||||
super(Material.iron);
|
||||
setUnlocalizedName("techreborn.watermill");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||
return new TileWaterMill();
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
return new TileWaterMill();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState state, EnumFacing side) {
|
||||
boolean isActive = false;
|
||||
if(side == EnumFacing.UP){
|
||||
return prefix + "generator_machine_bottom";// + (isActive ? "on" : "off");
|
||||
} else if(side==EnumFacing.DOWN){
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
return prefix + "solar_panel_side_" + (isActive ? "on" : "off");
|
||||
}
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
return 2;
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState state, EnumFacing side)
|
||||
{
|
||||
boolean isActive = false;
|
||||
if (side == EnumFacing.UP)
|
||||
{
|
||||
return prefix + "generator_machine_bottom";// + (isActive ? "on" :
|
||||
// "off");
|
||||
} else if (side == EnumFacing.DOWN)
|
||||
{
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
return prefix + "solar_panel_side_" + (isActive ? "on" : "off");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int amountOfStates()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
|
@ -8,42 +8,49 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.world.World;
|
||||
import reborncore.RebornCore;
|
||||
import reborncore.common.BaseTileBlock;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.generator.TileWindMill;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 25/02/2016.
|
||||
*/
|
||||
public class BlockWindMill extends BaseTileBlock implements ITexturedBlock {
|
||||
public class BlockWindMill extends BaseTileBlock implements ITexturedBlock
|
||||
{
|
||||
|
||||
public BlockWindMill() {
|
||||
super(Material.iron);
|
||||
setUnlocalizedName("techreborn.windmill");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
}
|
||||
public BlockWindMill()
|
||||
{
|
||||
super(Material.iron);
|
||||
setUnlocalizedName("techreborn.windmill");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
RebornCore.jsonDestroyer.registerObject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||
return new TileWindMill();
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
return new TileWindMill();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState state, EnumFacing side) {
|
||||
boolean isActive = false;
|
||||
if(side == EnumFacing.UP){
|
||||
return prefix + "generator_machine_bottom";// + (isActive ? "on" : "off");
|
||||
} else if(side==EnumFacing.DOWN){
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
return prefix + "solar_panel_side_" + (isActive ? "on" : "off");
|
||||
}
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
@Override
|
||||
public int amountOfStates() {
|
||||
return 2;
|
||||
}
|
||||
@Override
|
||||
public String getTextureNameFromState(IBlockState state, EnumFacing side)
|
||||
{
|
||||
boolean isActive = false;
|
||||
if (side == EnumFacing.UP)
|
||||
{
|
||||
return prefix + "generator_machine_bottom";// + (isActive ? "on" :
|
||||
// "off");
|
||||
} else if (side == EnumFacing.DOWN)
|
||||
{
|
||||
return prefix + "generator_machine_bottom";
|
||||
}
|
||||
return prefix + "solar_panel_side_" + (isActive ? "on" : "off");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int amountOfStates()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package techreborn.blocks.iron_machines;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -15,60 +18,68 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileAlloyFurnace;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
public class BlockAlloyFurnace extends BlockMachineBase implements IRotationTexture
|
||||
{
|
||||
|
||||
public class BlockAlloyFurnace extends BlockMachineBase implements IRotationTexture {
|
||||
public BlockAlloyFurnace(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.alloyfurnace");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
public BlockAlloyFurnace(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.alloyfurnace");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileAlloyFurnace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileAlloyFurnace();
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.alloyFurnaceID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.alloyFurnaceID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
items.add(new ItemStack(this));
|
||||
return items;
|
||||
}
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
{
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
items.add(new ItemStack(this));
|
||||
return items;
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/iron_machines/";
|
||||
private final String prefix = "techreborn:blocks/machine/iron_machines/";
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "alloy_furnace_front_off";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOff()
|
||||
{
|
||||
return prefix + "alloy_furnace_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "alloy_furnace_front_on";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOn()
|
||||
{
|
||||
return prefix + "alloy_furnace_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "iron_machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getSide()
|
||||
{
|
||||
return prefix + "iron_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "iron_machine_top";
|
||||
}
|
||||
@Override
|
||||
public String getTop()
|
||||
{
|
||||
return prefix + "iron_machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "iron_machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom()
|
||||
{
|
||||
return prefix + "iron_machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package techreborn.blocks.iron_machines;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -18,95 +22,106 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileIronFurnace;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
public class BlockIronFurnace extends BlockMachineBase implements IRotationTexture
|
||||
{
|
||||
|
||||
public class BlockIronFurnace extends BlockMachineBase implements IRotationTexture {
|
||||
|
||||
public BlockIronFurnace() {
|
||||
public BlockIronFurnace()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.ironfurnace");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileIronFurnace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.ironFurnace, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
items.add(new ItemStack(this));
|
||||
return items;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("incomplete-switch")
|
||||
public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
|
||||
{
|
||||
if (this.isActive(state))
|
||||
{
|
||||
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
|
||||
double d0 = (double)pos.getX() + 0.5D;
|
||||
double d1 = (double)pos.getY() + rand.nextDouble() * 6.0D / 16.0D;
|
||||
double d2 = (double)pos.getZ() + 0.5D;
|
||||
double d3 = 0.52D;
|
||||
double d4 = rand.nextDouble() * 0.6D - 0.3D;
|
||||
|
||||
switch (enumfacing)
|
||||
{
|
||||
case WEST:
|
||||
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
break;
|
||||
case EAST:
|
||||
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
break;
|
||||
case NORTH:
|
||||
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
break;
|
||||
case SOUTH:
|
||||
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileIronFurnace();
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/iron_machines/";
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.ironFurnace, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "iron_furnace_front_off";
|
||||
}
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
{
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
items.add(new ItemStack(this));
|
||||
return items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "iron_furnace_front_on";
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("incomplete-switch")
|
||||
public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
|
||||
{
|
||||
if (this.isActive(state))
|
||||
{
|
||||
EnumFacing enumfacing = (EnumFacing) state.getValue(FACING);
|
||||
double d0 = (double) pos.getX() + 0.5D;
|
||||
double d1 = (double) pos.getY() + rand.nextDouble() * 6.0D / 16.0D;
|
||||
double d2 = (double) pos.getZ() + 0.5D;
|
||||
double d3 = 0.52D;
|
||||
double d4 = rand.nextDouble() * 0.6D - 0.3D;
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "iron_machine_side";
|
||||
}
|
||||
switch (enumfacing)
|
||||
{
|
||||
case WEST:
|
||||
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D,
|
||||
new int[0]);
|
||||
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
break;
|
||||
case EAST:
|
||||
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D,
|
||||
new int[0]);
|
||||
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
break;
|
||||
case NORTH:
|
||||
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D,
|
||||
new int[0]);
|
||||
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
break;
|
||||
case SOUTH:
|
||||
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D,
|
||||
new int[0]);
|
||||
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "iron_machine_top";
|
||||
}
|
||||
private final String prefix = "techreborn:blocks/machine/iron_machines/";
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "iron_machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOff()
|
||||
{
|
||||
return prefix + "iron_furnace_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn()
|
||||
{
|
||||
return prefix + "iron_furnace_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide()
|
||||
{
|
||||
return prefix + "iron_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop()
|
||||
{
|
||||
return prefix + "iron_machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom()
|
||||
{
|
||||
return prefix + "iron_machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,51 +11,60 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileAssemblingMachine;
|
||||
|
||||
public class BlockAssemblingMachine extends BlockMachineBase implements IRotationTexture {
|
||||
public class BlockAssemblingMachine extends BlockMachineBase implements IRotationTexture
|
||||
{
|
||||
|
||||
public BlockAssemblingMachine(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.assemblingmachine");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockAssemblingMachine(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.assemblingmachine");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileAssemblingMachine();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileAssemblingMachine();
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.assemblingmachineID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.assemblingmachineID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
@Override
|
||||
public String getFrontOff()
|
||||
{
|
||||
return prefix + "assembling_machine_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "assembling_machine_front_off";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOn()
|
||||
{
|
||||
return prefix + "assembling_machine_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "assembling_machine_front_on";
|
||||
}
|
||||
@Override
|
||||
public String getSide()
|
||||
{
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getTop()
|
||||
{
|
||||
return prefix + "machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "assembling_machine_top";
|
||||
}
|
||||
@Override
|
||||
public String getBottom()
|
||||
{
|
||||
return prefix + "assembling_machine_top";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,50 +11,60 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileChargeBench;
|
||||
|
||||
public class BlockChargeBench extends BlockMachineBase implements IRotationTexture {
|
||||
public class BlockChargeBench extends BlockMachineBase implements IRotationTexture
|
||||
{
|
||||
|
||||
public BlockChargeBench(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.chargebench");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockChargeBench(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.chargebench");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileChargeBench();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileChargeBench();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.chargeBench, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.chargeBench, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "chargeBench_side";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOff()
|
||||
{
|
||||
return prefix + "chargeBench_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "chargeBench_side";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOn()
|
||||
{
|
||||
return prefix + "chargeBench_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "chargeBench_side";
|
||||
}
|
||||
@Override
|
||||
public String getSide()
|
||||
{
|
||||
return prefix + "chargeBench_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "chargeBench_side";
|
||||
}
|
||||
@Override
|
||||
public String getTop()
|
||||
{
|
||||
return prefix + "chargeBench_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "chargeBench_side";
|
||||
}
|
||||
@Override
|
||||
public String getBottom()
|
||||
{
|
||||
return prefix + "chargeBench_side";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,51 +11,60 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileChemicalReactor;
|
||||
|
||||
public class BlockChemicalReactor extends BlockMachineBase implements IRotationTexture {
|
||||
public class BlockChemicalReactor extends BlockMachineBase implements IRotationTexture
|
||||
{
|
||||
|
||||
public BlockChemicalReactor(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.chemicalreactor");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockChemicalReactor(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.chemicalreactor");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileChemicalReactor();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileChemicalReactor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z,
|
||||
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.chemicalReactorID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.chemicalReactorID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "chemical_reactor_side_off";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOff()
|
||||
{
|
||||
return prefix + "chemical_reactor_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "chemical_reactor_side_on";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOn()
|
||||
{
|
||||
return prefix + "chemical_reactor_side_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getSide()
|
||||
{
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "machine_top";
|
||||
}
|
||||
@Override
|
||||
public String getTop()
|
||||
{
|
||||
return prefix + "machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "chemical_reactor_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom()
|
||||
{
|
||||
return prefix + "chemical_reactor_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,48 +11,54 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileChunkLoader;
|
||||
|
||||
public class BlockChunkLoader extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockChunkLoader extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockChunkLoader(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.chunkloader");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
public BlockChunkLoader(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.chunkloader");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_)
|
||||
{
|
||||
return new TileChunkLoader();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileChunkLoader();
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.chunkloaderID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z,
|
||||
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.chunkloaderID, world, x, y,
|
||||
z);
|
||||
return true;
|
||||
}
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return prefix + "industrial_chunk_loader_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "industrial_chunk_loader_side";
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "industrial_chunk_loader_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "industrial_chunk_loader_side" ;
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,50 +11,60 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileMatterFabricator;
|
||||
|
||||
public class BlockMatterFabricator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockMatterFabricator extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockMatterFabricator(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.matterfabricator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockMatterFabricator(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.matterfabricator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileMatterFabricator();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
|
||||
{
|
||||
return new TileMatterFabricator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.matterfabID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.matterfabID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
@Override
|
||||
public boolean isAdvanced() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isAdvanced()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off";
|
||||
}
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off";
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off";
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,45 +11,54 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileRollingMachine;
|
||||
|
||||
public class BlockRollingMachine extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||
public class BlockRollingMachine extends BlockMachineBase implements IAdvancedRotationTexture
|
||||
{
|
||||
|
||||
public BlockRollingMachine(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.rollingmachine");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
public BlockRollingMachine(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.rollingmachine");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileRollingMachine();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
|
||||
{
|
||||
return new TileRollingMachine();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.rollingMachineID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.rollingMachineID, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return isActive ? prefix + "rolling_machine_side_on" : prefix + "rolling_machine_side_off";
|
||||
}
|
||||
@Override
|
||||
public String getFront(boolean isActive)
|
||||
{
|
||||
return isActive ? prefix + "rolling_machine_side_on" : prefix + "rolling_machine_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getSide(boolean isActive)
|
||||
{
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "machine_top";
|
||||
}
|
||||
@Override
|
||||
public String getTop(boolean isActive)
|
||||
{
|
||||
return prefix + "machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getBottom(boolean isActive)
|
||||
{
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,51 +11,62 @@ import techreborn.client.GuiHandler;
|
|||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.TileScrapboxinator;
|
||||
|
||||
public class BlockScrapboxinator extends BlockMachineBase implements IRotationTexture{
|
||||
public class BlockScrapboxinator extends BlockMachineBase implements IRotationTexture
|
||||
{
|
||||
|
||||
public BlockScrapboxinator(Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.scrapboxinator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
public BlockScrapboxinator(Material material)
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("techreborn.scrapboxinator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileScrapboxinator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!player.isSneaking()){
|
||||
player.openGui(Core.INSTANCE, GuiHandler.scrapboxinatorID, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
|
||||
{
|
||||
return new TileScrapboxinator();
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
{
|
||||
player.openGui(Core.INSTANCE, GuiHandler.scrapboxinatorID, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "scrapboxinator_front_off";
|
||||
}
|
||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "scrapboxinator_front_on";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOff()
|
||||
{
|
||||
return prefix + "scrapboxinator_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
@Override
|
||||
public String getFrontOn()
|
||||
{
|
||||
return prefix + "scrapboxinator_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "machine_top";
|
||||
}
|
||||
@Override
|
||||
public String getSide()
|
||||
{
|
||||
return prefix + "machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
@Override
|
||||
public String getTop()
|
||||
{
|
||||
return prefix + "machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom()
|
||||
{
|
||||
return prefix + "machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue