├── .bzrignore
├── .gitignore
├── .project
├── .settings
├── org.eclipse.jdt.core.prefs
├── org.eclipse.jdt.ui.prefs
└── org.eclipse.ltk.core.refactoring.prefs
├── COPYING
├── CheckLegal.ps1
├── CodingStyle.xml
├── DEVELOPER-ENVIRONMENT-SETUP.TXT
├── HowToRelease.txt
├── LICENSE
├── Releases
├── NewBiospheresMod-1.7.10-0.7.jar
├── NewBiospheresMod-1.7.x-0.8.jar
└── NewBiospheresMod-1.7.x-0.85.jar
├── RestoreWorld.bat
├── Testing
└── NewBiospheresMod-Experimental-2015-04-16.jar
├── build.gradle
├── commit.bat
├── eclipse
└── .metadata
│ └── .plugins
│ └── org.eclipse.ui.workbench
│ ├── dialog_settings.xml
│ └── workingsets.xml
├── include.bat
├── lib
└── concurrentlinkedhashmap-lru-1.4.jar
├── logo.pdn
├── preferences.epf
├── publish.bat
├── pull.bat
├── push.bat
└── src
└── main
├── java
└── newBiospheresMod
│ ├── BiomeEntry.java
│ ├── BiosphereChunkManager.java
│ ├── BiosphereChunkProvider.java
│ ├── BiosphereMapGen.java
│ ├── BiosphereWorldProvider.java
│ ├── BiosphereWorldType.java
│ ├── BlockData.java
│ ├── BlockDome.java
│ ├── BlockEntry.java
│ ├── Configuration
│ ├── Categories.java
│ ├── ConfigScreens.java
│ ├── CustomWorldData.java
│ ├── GuiConfigTab.java
│ ├── GuiConfigTabEntry.java
│ ├── IGuiConfigTabProvider.java
│ ├── ModConfig.java
│ ├── ModConfigGuiFactory.java
│ └── ModGuiConfigTabProvider.java
│ ├── Helpers
│ ├── AvgCalc.java
│ ├── Blx.java
│ ├── Creator.java
│ ├── Func.java
│ ├── Func2.java
│ ├── IKeyProvider.java
│ ├── LruCacheList.java
│ ├── ModConsts.java
│ ├── Predicate.java
│ ├── TopDownBoundingBox.java
│ └── Utils.java
│ ├── Models
│ ├── NoiseChunk.java
│ ├── Sphere.java
│ └── SphereChunk.java
│ └── NewBiospheresMod.java
└── resources
├── MODINFO.TXT
├── logo.png
├── mcmod.info
├── screenshot1.png
└── screenshot2.png
/.bzrignore:
--------------------------------------------------------------------------------
1 | *.log
2 | *.class
3 | bin
4 | *.log.gz
5 | eclipse/config
6 | eclipse/saves
7 | *.snap
8 | .gradle
9 | MinecraftForge-Credits.txt
10 | MinecraftForge-License.txt
11 | build
12 | eclipse
13 | forge-1.7.10-10.13.1.1217-changelog.txt
14 | gradle
15 | gradlew
16 | gradlew.bat
17 | mcp
18 | CREDITS-fml.txt
19 | README.txt
20 | LICENSE-fml.txt
21 | .classpath
22 | TODO.txt
23 | conf
24 | config
25 | mods
26 | python27.dll
27 | mcedit.exe
28 | mcedit.ini
29 | mcedit.log
30 | screenshots
31 | ServerJarStorage
32 | resourcepacks
33 | options.txt
34 | logs
35 | crash-reports
36 | MCEdit-0.1.7.1.win-amd64
37 | MCEdit-schematics
38 | .lock
39 | .log
40 | .plugins
41 | version.ini
42 | org.eclipse.core.resources
43 | org.eclipse.core.runtime
44 | org.eclipse.debug.core
45 | org.eclipse.debug.ui
46 | org.eclipse.e4.workbench
47 | org.eclipse.jdt.core
48 | org.eclipse.jdt.debug.ui
49 | org.eclipse.jdt.launching
50 | org.eclipse.jdt.ui
51 | org.eclipse.ltk.core.refactoring
52 | org.eclipse.ltk.ui.refactoring
53 | org.eclipse.pde.api.tools
54 | org.eclipse.pde.core
55 | org.eclipse.search
56 | org.eclipse.ui.editors
57 | org.eclipse.ui.ide
58 | org.eclipse.ui.workbench
59 | org.eclipse.ui.workbench.texteditor
60 | org.eclipse.team.ui
61 | eclipse/.metadata/.plugins/org.eclipse.equinox.p2.ui
62 | eclipse/.metadata/.plugins/org.eclipse.jdt.junit.core
63 | forge-*.txt
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.log
2 | *.class
3 | bin
4 | *.log.gz
5 | eclipse/config
6 | eclipse/saves
7 | *.snap
8 | .gradle
9 | MinecraftForge-Credits.txt
10 | MinecraftForge-License.txt
11 | build
12 | eclipse
13 | forge-1.7.10-10.13.1.1217-changelog.txt
14 | gradle
15 | gradlew
16 | gradlew.bat
17 | mcp
18 | CREDITS-fml.txt
19 | README.txt
20 | LICENSE-fml.txt
21 | .classpath
22 | TODO.txt
23 | conf
24 | config
25 | mods
26 | python27.dll
27 | mcedit.exe
28 | mcedit.ini
29 | mcedit.log
30 | screenshots
31 | ServerJarStorage
32 | resourcepacks
33 | options.txt
34 | logs
35 | crash-reports
36 | MCEdit-0.1.7.1.win-amd64
37 | MCEdit-schematics
38 | .lock
39 | .log
40 | .plugins
41 | version.ini
42 | org.eclipse.core.resources
43 | org.eclipse.core.runtime
44 | org.eclipse.debug.core
45 | org.eclipse.debug.ui
46 | org.eclipse.e4.workbench
47 | org.eclipse.jdt.core
48 | org.eclipse.jdt.debug.ui
49 | org.eclipse.jdt.launching
50 | org.eclipse.jdt.ui
51 | org.eclipse.ltk.core.refactoring
52 | org.eclipse.ltk.ui.refactoring
53 | org.eclipse.pde.api.tools
54 | org.eclipse.pde.core
55 | org.eclipse.search
56 | org.eclipse.ui.editors
57 | org.eclipse.ui.ide
58 | org.eclipse.ui.workbench
59 | org.eclipse.ui.workbench.texteditor
60 | org.eclipse.team.ui
61 | eclipse/.metadata/.plugins/org.eclipse.equinox.p2.ui
62 | eclipse/.metadata/.plugins/org.eclipse.jdt.junit.core
63 | forge-*.txt
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | NewBiospheresMod
4 |
5 |
6 |
7 | org.eclipse.jdt.core.javanature
8 |
9 |
10 |
11 | org.eclipse.jdt.core.javabuilder
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5 | org.eclipse.jdt.core.compiler.compliance=1.6
6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11 | org.eclipse.jdt.core.compiler.source=1.6
12 | org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
13 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=20
14 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=52
15 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=0
16 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=20
17 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=20
18 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=20
19 | org.eclipse.jdt.core.formatter.alignment_for_assignment=20
20 | org.eclipse.jdt.core.formatter.alignment_for_binary_expression=20
21 | org.eclipse.jdt.core.formatter.alignment_for_compact_if=20
22 | org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=20
23 | org.eclipse.jdt.core.formatter.alignment_for_enum_constants=48
24 | org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=20
25 | org.eclipse.jdt.core.formatter.alignment_for_method_declaration=20
26 | org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
27 | org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=20
28 | org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=20
29 | org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=20
30 | org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=20
31 | org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=20
32 | org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=20
33 | org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=20
34 | org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=20
35 | org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=20
36 | org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=20
37 | org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
38 | org.eclipse.jdt.core.formatter.blank_lines_after_package=1
39 | org.eclipse.jdt.core.formatter.blank_lines_before_field=0
40 | org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
41 | org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
42 | org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
43 | org.eclipse.jdt.core.formatter.blank_lines_before_method=1
44 | org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
45 | org.eclipse.jdt.core.formatter.blank_lines_before_package=0
46 | org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
47 | org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
48 | org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line
49 | org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line
50 | org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=next_line
51 | org.eclipse.jdt.core.formatter.brace_position_for_block=next_line
52 | org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line
53 | org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line
54 | org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line
55 | org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line
56 | org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=next_line
57 | org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line
58 | org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line
59 | org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line
60 | org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
61 | org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
62 | org.eclipse.jdt.core.formatter.comment.format_block_comments=true
63 | org.eclipse.jdt.core.formatter.comment.format_header=true
64 | org.eclipse.jdt.core.formatter.comment.format_html=true
65 | org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
66 | org.eclipse.jdt.core.formatter.comment.format_line_comments=true
67 | org.eclipse.jdt.core.formatter.comment.format_source_code=true
68 | org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
69 | org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
70 | org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
71 | org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
72 | org.eclipse.jdt.core.formatter.comment.line_length=120
73 | org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
74 | org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
75 | org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=true
76 | org.eclipse.jdt.core.formatter.compact_else_if=true
77 | org.eclipse.jdt.core.formatter.continuation_indentation=1
78 | org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=0
79 | org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
80 | org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
81 | org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=true
82 | org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
83 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
84 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
85 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
86 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
87 | org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
88 | org.eclipse.jdt.core.formatter.indent_empty_lines=false
89 | org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
90 | org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
91 | org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
92 | org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
93 | org.eclipse.jdt.core.formatter.indentation.size=4
94 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
95 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
96 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
97 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
98 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
99 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
100 | org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
101 | org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
102 | org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
103 | org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
104 | org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
105 | org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
106 | org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
107 | org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
108 | org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
109 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=do not insert
110 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
111 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=do not insert
112 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert
113 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=do not insert
114 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=do not insert
115 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=do not insert
116 | org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
117 | org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
118 | org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
119 | org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
120 | org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
121 | org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
122 | org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
123 | org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
124 | org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert
125 | org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
126 | org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
127 | org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
128 | org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
129 | org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
130 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
131 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
132 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
133 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
134 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
135 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
136 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
137 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
138 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
139 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
140 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
141 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
142 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
143 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
144 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
145 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
146 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
147 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
148 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
149 | org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
150 | org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
151 | org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
152 | org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
153 | org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
154 | org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
155 | org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
156 | org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
157 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
158 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
159 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
160 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
161 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
162 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
163 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
164 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
165 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
166 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
167 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
168 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
169 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
170 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
171 | org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
172 | org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
173 | org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
174 | org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
175 | org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
176 | org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
177 | org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
178 | org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
179 | org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
180 | org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
181 | org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
182 | org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
183 | org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
184 | org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
185 | org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
186 | org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
187 | org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
188 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
189 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
190 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
191 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
192 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
193 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
194 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
195 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
196 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
197 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
198 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
199 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
200 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
201 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
202 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=do not insert
203 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
204 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
205 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
206 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=do not insert
207 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
208 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
209 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
210 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
211 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
212 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
213 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
214 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
215 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
216 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
217 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
218 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
219 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
220 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
221 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
222 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
223 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
224 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
225 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
226 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
227 | org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
228 | org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
229 | org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
230 | org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
231 | org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
232 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
233 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
234 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
235 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
236 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
237 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
238 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
239 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
240 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
241 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
242 | org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
243 | org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
244 | org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
245 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
246 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
247 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
248 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
249 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
250 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
251 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
252 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
253 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
254 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
255 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
256 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
257 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
258 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
259 | org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
260 | org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
261 | org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
262 | org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
263 | org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
264 | org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
265 | org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
266 | org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
267 | org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
268 | org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
269 | org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
270 | org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=insert
271 | org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
272 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
273 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
274 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
275 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
276 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
277 | org.eclipse.jdt.core.formatter.join_lines_in_comments=true
278 | org.eclipse.jdt.core.formatter.join_wrapped_lines=false
279 | org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true
280 | org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=true
281 | org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true
282 | org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true
283 | org.eclipse.jdt.core.formatter.lineSplit=100
284 | org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
285 | org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
286 | org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
287 | org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
288 | org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
289 | org.eclipse.jdt.core.formatter.tabulation.char=tab
290 | org.eclipse.jdt.core.formatter.tabulation.size=4
291 | org.eclipse.jdt.core.formatter.use_on_off_tags=false
292 | org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
293 | org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
294 | org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
295 | org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
296 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.ui.prefs:
--------------------------------------------------------------------------------
1 | cleanup.add_default_serial_version_id=true
2 | cleanup.add_generated_serial_version_id=false
3 | cleanup.add_missing_annotations=true
4 | cleanup.add_missing_deprecated_annotations=false
5 | cleanup.add_missing_methods=false
6 | cleanup.add_missing_nls_tags=false
7 | cleanup.add_missing_override_annotations=true
8 | cleanup.add_missing_override_annotations_interface_methods=true
9 | cleanup.add_serial_version_id=false
10 | cleanup.always_use_blocks=true
11 | cleanup.always_use_parentheses_in_expressions=true
12 | cleanup.always_use_this_for_non_static_field_access=true
13 | cleanup.always_use_this_for_non_static_method_access=true
14 | cleanup.convert_functional_interfaces=false
15 | cleanup.convert_to_enhanced_for_loop=false
16 | cleanup.correct_indentation=true
17 | cleanup.format_source_code=true
18 | cleanup.format_source_code_changes_only=false
19 | cleanup.insert_inferred_type_arguments=false
20 | cleanup.make_local_variable_final=true
21 | cleanup.make_parameters_final=true
22 | cleanup.make_private_fields_final=true
23 | cleanup.make_type_abstract_if_missing_method=false
24 | cleanup.make_variable_declarations_final=true
25 | cleanup.never_use_blocks=false
26 | cleanup.never_use_parentheses_in_expressions=false
27 | cleanup.organize_imports=true
28 | cleanup.qualify_static_field_accesses_with_declaring_class=true
29 | cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
30 | cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
31 | cleanup.qualify_static_member_accesses_with_declaring_class=true
32 | cleanup.qualify_static_method_accesses_with_declaring_class=true
33 | cleanup.remove_private_constructors=true
34 | cleanup.remove_redundant_type_arguments=true
35 | cleanup.remove_trailing_whitespaces=true
36 | cleanup.remove_trailing_whitespaces_all=true
37 | cleanup.remove_trailing_whitespaces_ignore_empty=false
38 | cleanup.remove_unnecessary_casts=true
39 | cleanup.remove_unnecessary_nls_tags=true
40 | cleanup.remove_unused_imports=true
41 | cleanup.remove_unused_local_variables=false
42 | cleanup.remove_unused_private_fields=true
43 | cleanup.remove_unused_private_members=false
44 | cleanup.remove_unused_private_methods=true
45 | cleanup.remove_unused_private_types=true
46 | cleanup.sort_members=false
47 | cleanup.sort_members_all=false
48 | cleanup.use_anonymous_class_creation=false
49 | cleanup.use_blocks=false
50 | cleanup.use_blocks_only_for_return_and_throw=false
51 | cleanup.use_lambda=true
52 | cleanup.use_parentheses_in_expressions=true
53 | cleanup.use_this_for_non_static_field_access=true
54 | cleanup.use_this_for_non_static_field_access_only_if_necessary=false
55 | cleanup.use_this_for_non_static_method_access=true
56 | cleanup.use_this_for_non_static_method_access_only_if_necessary=false
57 | cleanup.use_type_arguments=false
58 | cleanup_profile=_CLEAN-IT\!
59 | cleanup_settings_version=2
60 | eclipse.preferences.version=1
61 | formatter_profile=_Mikey
62 | formatter_settings_version=12
63 | org.eclipse.jdt.ui.ignorelowercasenames=true
64 | org.eclipse.jdt.ui.importorder=java;javax;org;com;
65 | org.eclipse.jdt.ui.ondemandthreshold=99
66 | org.eclipse.jdt.ui.staticondemandthreshold=99
67 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.ltk.core.refactoring.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
3 |
--------------------------------------------------------------------------------
/COPYING:
--------------------------------------------------------------------------------
1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2 | Version 2, December 2004
3 |
4 | Copyright (C) 2004 Sam Hocevar
5 |
6 | Everyone is permitted to copy and distribute verbatim or modified
7 | copies of this license document, and changing it is allowed as long
8 | as the name is changed.
9 |
10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12 |
13 | 0. You just DO WHAT THE FUCK YOU WANT TO.
14 |
--------------------------------------------------------------------------------
/CheckLegal.ps1:
--------------------------------------------------------------------------------
1 | try
2 | {
3 | cd src
4 | gci -recu -inc "*.java" | ? { -not ([string]::Concat((Get-Content $_)).Contains("Sam Hocevar")); }
5 | }
6 | finally
7 | {
8 | cd ..
9 | }
--------------------------------------------------------------------------------
/CodingStyle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
--------------------------------------------------------------------------------
/DEVELOPER-ENVIRONMENT-SETUP.TXT:
--------------------------------------------------------------------------------
1 | 1.) Install the following, for command line utilities, please make sure they're in your path:
2 |
3 | + JDK 1.7 64-bit
4 | (do not install the 32-bit version, do not install the 32-bit JRE, do not install the JDK 1.8,
5 | if any versions of the Java JRE or JDK are installed that are either 32-bit bit, or 1.8,
6 | UNINSTALL them and reboot before proceeding. Then install the correct version: the latest
7 | 1.7 64-bit JDK, and nothing else.)
8 |
9 | + Info-Zip
10 | Zip.exe: 3.0 http://gnuwin32.sourceforge.net/packages/zip.htm
11 | Unzip.exe 5.5 http://gnuwin32.sourceforge.net/packages/unzip.htm
12 |
13 | Just grab the binaries in both cases and unzip the .exes to your path somewhere.
14 | Alternately, I've found bins here as well: http://www.willus.com/archive/zip64/
15 |
16 | + GIT (or another utility that can pull down code from github).
17 |
18 | + Eclipse (Luna at the time of this writing)
19 |
20 | + A legal, licensed, paid for, etc. version of Minecraft.
21 |
22 | 2.) Install and run the latest version of Minecraft, configure it to run version 1.7.10, and launch
23 | it at least once. Then install Forge for that version of Minecraft.
24 |
25 | 3.) Build and Configure the Forge Workspace:
26 |
27 | + Head on over to: http://files.minecraftforge.net/
28 | + Download the latest version of Forge for Minecraft 1.7.10.
29 | (At the time of this writing that's: forge-1.7.10-10.13.1.1224-src.zip)
30 |
31 | + Create a new folder for the project, copy the archive in there, and unzip it.
32 |
33 | c:\biz\baz\> cd /d x:\foo\bar\
34 |
35 | x:\foo\bar\> md NewBiospheresMod
36 |
37 | x:\foo\bar\NewBiospheresMod\> copy c:\foo\bar\downloads\forge-1.7.10-10.13.1.1224-src.zip
38 |
39 | x:\foo\bar\NewBiospheresMod\> unzip forge-1.7.10-10.13.1.1224-src.zip
40 |
41 | x:\foo\bar\NewBiospheresMod\> del forge-1.7.10-10.13.1.1224-src.zip
42 |
43 | + Follow the instructions in the "README.TXT" to setup a new environment:
44 |
45 | x:\foo\bar\NewBiospheresMod\> gradlew clean
46 | x:\foo\bar\NewBiospheresMod\> gradlew cleanCache
47 | x:\foo\bar\NewBiospheresMod\> gradlew setupDecompWorkspace --refresh-dependencies
48 | x:\foo\bar\NewBiospheresMod\> gradlew eclipse
49 |
50 | -- OR --
51 | gradlew clean && gradlew cleanCache && gradlew setupDecompWorkspace --refresh-dependencies && gradlew eclipse
52 |
53 | + Delete the "src" folder.
54 |
55 | x:\foo\bar\NewBiospheresMod\> rd /s /q src
56 |
57 | + Pull down the code from the git repo!
58 | Now, usually this isn't allowed, so you'll have to do some hackery.
59 | Essentially clone the repro somewhere, and move in the ".git" folder and then perform a hard
60 | reset to the latest version. Like so:
61 |
62 | x:\foo\bar\NewBiospheresMod\> git clone --no-checkout https://github.com/BrainSlugs83/NewBiospheresMod.git temp
63 | x:\foo\bar\NewBiospheresMod\> mv temp/.git .
64 | x:\foo\bar\NewBiospheresMod\> rd /s /q temp
65 | x:\foo\bar\NewBiospheresMod\> git reset --hard HEAD
66 |
67 | + Manually edit the .classpath file, add the following tag:
68 |
69 |
70 |
71 | + You can now work with the project in eclipse, either by using the workspace in the
72 | "NewBiospheresMod\Eclipse" folder, or by importing it into an existing workspace, to create a
73 | deployable .jar file, run the publish.bat command, if all goes well, both should work without
74 | error.
75 |
--------------------------------------------------------------------------------
/HowToRelease.txt:
--------------------------------------------------------------------------------
1 | Update Version # in src/main/resources/mcmod.info
2 | Update Version # in src/main/java/newBiospheresMod/Helpers/ModConsts.java
3 | Update Version # in build.gradle
4 | Run Publish.bat
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | ======================== NEW BIOSPHERES MOD =========================
2 | Copyright (c) 2014 Michael Jensen
3 | This work is free. You can redistribute it and/or modify it under the
4 | terms of the Do What The Fuck You Want To Public License, Version 2,
5 | as published by Sam Hocevar. See the COPYING file for more details.
6 |
7 | This program is free software. It comes without any warranty, to
8 | the extent permitted by applicable law. You can redistribute it
9 | and/or modify it under the terms of the Do What The Fuck You Want
10 | To Public License, Version 2, as published by Sam Hocevar. See
11 | http://www.wtfpl.net/ for more details.
12 |
13 | ===================== Concurrent Linked Hashmap =====================
14 | Applies to: lib\concurrentlinkedhashmap-lru-1.4.jar
15 | Project Page: https://code.google.com/p/concurrentlinkedhashmap/
16 | License: Apache 2.0
17 |
18 | ========================== Minecraft Forge ==========================
19 | Applies to: build.gradle
20 | Project Page: http://www.minecraftforge.net/
21 | License: GPL 2.1
22 |
23 | =====================================================================
24 |
--------------------------------------------------------------------------------
/Releases/NewBiospheresMod-1.7.10-0.7.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BrainSlugs83/NewBiospheresMod/1493b5219d7a71db13a0e027da293324f1018821/Releases/NewBiospheresMod-1.7.10-0.7.jar
--------------------------------------------------------------------------------
/Releases/NewBiospheresMod-1.7.x-0.8.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BrainSlugs83/NewBiospheresMod/1493b5219d7a71db13a0e027da293324f1018821/Releases/NewBiospheresMod-1.7.x-0.8.jar
--------------------------------------------------------------------------------
/Releases/NewBiospheresMod-1.7.x-0.85.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BrainSlugs83/NewBiospheresMod/1493b5219d7a71db13a0e027da293324f1018821/Releases/NewBiospheresMod-1.7.x-0.85.jar
--------------------------------------------------------------------------------
/RestoreWorld.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | setlocal
3 | cd .\eclipse\saves
4 | call RestoreWorld.bat
--------------------------------------------------------------------------------
/Testing/NewBiospheresMod-Experimental-2015-04-16.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BrainSlugs83/NewBiospheresMod/1493b5219d7a71db13a0e027da293324f1018821/Testing/NewBiospheresMod-Experimental-2015-04-16.jar
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | maven {
5 | name = "forge"
6 | url = "http://files.minecraftforge.net/maven"
7 | }
8 | maven {
9 | name = "sonatype"
10 | url = "https://oss.sonatype.org/content/repositories/snapshots/"
11 | }
12 | }
13 | dependencies {
14 | classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
15 | }
16 | }
17 |
18 | apply plugin: 'forge'
19 |
20 | version = "0.85"
21 | group = "com.brainslugs83.newBiospheresMod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
22 | archivesBaseName = "NewBiospheresMod"
23 |
24 | minecraft {
25 | version = "1.7.10-10.13.1.1217"
26 | runDir = "eclipse"
27 | }
28 |
29 | dependencies {
30 | // you may put jars on which you depend on in ./libs
31 | // or you may define them like so..
32 | //compile "some.group:artifact:version:classifier"
33 | //compile "some.group:artifact:version"
34 |
35 | // real examples
36 | //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
37 | //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
38 |
39 | // for more info...
40 | // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
41 | // http://www.gradle.org/docs/current/userguide/dependency_management.html
42 |
43 | compile files {
44 | "lib/concurrentlinkedhashmap-lru-1.4.jar"
45 | }
46 |
47 | }
48 |
49 | processResources
50 | {
51 | // this will ensure that this task is redone when the versions change.
52 | inputs.property "version", project.version
53 | inputs.property "mcversion", project.minecraft.version
54 |
55 | // replace stuff in mcmod.info, nothing else
56 | from(sourceSets.main.resources.srcDirs) {
57 | include 'mcmod.info'
58 |
59 | // replace version and mcversion
60 | expand 'version':project.version, 'mcversion':project.minecraft.version
61 | }
62 |
63 | // copy everything else, thats not the mcmod.info
64 | from(sourceSets.main.resources.srcDirs) {
65 | exclude 'mcmod.info'
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/commit.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | git commit -a
--------------------------------------------------------------------------------
/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/include.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | SET ERRORLEVEL=
3 | VERIFY OTHER 2>nul
4 | SETLOCAL ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
5 | IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
6 |
7 | REM FOR DEBUGGING ONLY (DO NOT UNCOMMENT)
8 | REM if "%1" == "" include NewBiospheresMod-0.7.jar lib\concurrentlinkedhashmap-lru-1.4.jar
9 | REM if "%2" == "" include "%~1" lib\concurrentlinkedhashmap-lru-1.4.jar
10 |
11 | cd /d "%~dp2"
12 | if ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
13 |
14 | rd /s /q temp 2>nul 1>nul
15 |
16 | md temp
17 | if ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
18 |
19 | copy "%~nx2" temp
20 | if ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
21 |
22 | cd temp
23 | if ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
24 |
25 | unzip -o "%~nx2"
26 | if ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
27 |
28 | rd /s /q META-INF
29 | del "%~nx2"
30 | if ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
31 |
32 | for /R %%f in (*.*) do (
33 |
34 | set file=%%f
35 | set file=!file:%cd%\=!
36 |
37 | if NOT "%%~nxf" == "dirFile.txt" (
38 |
39 | echo !file! >> dirFile.txt
40 | )
41 | )
42 |
43 | zip -9 -m -@ "..\..\%~nx1" < dirFile.txt
44 | if ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
45 |
46 | cd ..
47 | rd /s /q temp
48 | if ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
49 |
--------------------------------------------------------------------------------
/lib/concurrentlinkedhashmap-lru-1.4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BrainSlugs83/NewBiospheresMod/1493b5219d7a71db13a0e027da293324f1018821/lib/concurrentlinkedhashmap-lru-1.4.jar
--------------------------------------------------------------------------------
/logo.pdn:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BrainSlugs83/NewBiospheresMod/1493b5219d7a71db13a0e027da293324f1018821/logo.pdn
--------------------------------------------------------------------------------
/publish.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | SET ERRORLEVEL=
3 | VERIFY OTHER 2>nul
4 | SETLOCAL ENABLEDELAYEDEXPANSION
5 | IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
6 |
7 | set /A startedAt=(%time:~0,2% * 3600) + (%time:~3,2% * 60) + (%time:~6,2%)
8 |
9 | del *.jar 2>nul 1>nul
10 | call gradlew build
11 | if ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
12 |
13 | set datestamp=%date:~10,4%-%date:~4,2%-%date:~7,2%
14 | set /A timestamp=(%time:~0,2% * 3600) + (%time:~3,2% * 60) + (%time:~6,2%)
15 | set outputFolder=.\build\libs\
16 | set zipName="Source (%datestamp%-%timestamp%).zip"
17 |
18 | for /F %%f in ('dir "%outputFolder%*.jar" /b') do (
19 |
20 | rem copy "%outputFolder%%%f" . /y
21 | move /y "%outputFolder%%%f" .
22 | if ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
23 |
24 | rem zip -9 -r %zipName% src
25 | rem if ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
26 |
27 | rem zip -9 -m "%%f" %zipName%
28 | rem if ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
29 |
30 | rem zip -9 "%%f" MODINFO.TXT
31 | rem if ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
32 |
33 | call include.bat "%%f" "lib\concurrentlinkedhashmap-lru-1.4.jar"
34 | if ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
35 |
36 | rem this improves the compression slightly:
37 | rd /s /q temp 2>nul 1>nul
38 | md temp
39 | copy "%%f" temp
40 | cd temp
41 | unzip "%%~nxf"
42 | del "%%~nxf"
43 | jar cvf "%%~nxf" *
44 | copy /y "%%~nxf" ..
45 | cd ..
46 | rd /s /q temp
47 | )
48 |
49 | set /A endedAt=(%time:~0,2% * 3600) + (%time:~3,2% * 60) + (%time:~6,2%)
50 | set /A elapsed=(%endedAt% - %startedAt%)
51 | if "%elapsed:~0,1%" == "-" set /a elapsed=%elapsed% + (24 * 3600)
52 |
53 | echo.
54 | echo SUCCESS!
55 | echo Total Time Elapsed: %elapsed% second(s).
56 | echo.
57 | dir *.jar
58 | echo.
59 |
--------------------------------------------------------------------------------
/pull.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | SETLOCAL
3 |
4 | echo ARE YOU SURE YOU WANT TO GET THE LATEST CODEBASE?
5 | echo (ALL PENDING CHANGES IN THIS BRANCH WILL BE LOST!)
6 | set /p ans=^>
7 | if /i NOT "%ans:~0,1%" == "y" EXIT /B 1
8 |
9 | :: bzr pull https://github.com/BrainSlugs83/NewBiospheresMod.git/,branch=master
10 |
11 | echo.
12 | echo ===== Pulling =====
13 | git pull
14 |
15 | echo.
16 | echo ===== Resetting to Latest =====
17 | git reset --hard HEAD
18 |
19 |
--------------------------------------------------------------------------------
/push.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | :: bzr dpush https://github.com/BrainSlugs83/NewBiospheresMod.git/,branch=master
3 | git push origin master
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/BiomeEntry.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod;
8 |
9 | import net.minecraft.util.WeightedRandom;
10 | import net.minecraft.world.biome.BiomeGenBase;
11 |
12 | public class BiomeEntry extends WeightedRandom.Item
13 | {
14 | public final BiomeGenBase biome;
15 |
16 | public BiomeEntry(BiomeGenBase biomegenbase, int i)
17 | {
18 | super(i);
19 | this.biome = biomegenbase;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/BiosphereChunkManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod;
8 |
9 | import java.util.List;
10 | import java.util.Random;
11 | import java.util.UUID;
12 |
13 | import net.minecraft.util.WeightedRandom;
14 | import net.minecraft.world.World;
15 | import net.minecraft.world.WorldType;
16 | import net.minecraft.world.biome.BiomeGenBase;
17 | import net.minecraft.world.biome.WorldChunkManager;
18 | import newBiospheresMod.Configuration.ModConfig;
19 |
20 | public class BiosphereChunkManager extends WorldChunkManager
21 | {
22 | private final World world;
23 | private final ModConfig config;
24 |
25 | private final long seed;
26 | private static long lastSeed = 0;
27 |
28 | //private final Random rnd;
29 |
30 | // private static long getNewSeed()
31 | // {
32 | // long uuid = UUID.randomUUID().hashCode()
33 | // return uuid | (uuid << 32);
34 | // }
35 | //
36 | public BiosphereChunkManager()
37 | {
38 | this(lastSeed, NewBiospheresMod.biosphereWorldType);
39 | }
40 |
41 | public BiosphereChunkManager(World world)
42 | {
43 | this(world, world.getSeed(), NewBiospheresMod.biosphereWorldType);
44 | }
45 |
46 | public BiosphereChunkManager(long worldSeed, WorldType worldType)
47 | {
48 | this(null, worldSeed, worldType);
49 | }
50 |
51 | public BiosphereChunkManager(World world, long worldSeed, WorldType worldType)
52 | {
53 | super(worldSeed, worldType);
54 |
55 | this.world = world;
56 | this.seed = worldSeed;
57 | this.lastSeed = worldSeed;
58 | //this.rnd = new Random(this.seed);
59 | this.config = ModConfig.get(world);
60 | }
61 |
62 | /**
63 | * checks given Chunk's Biomes against List of allowed ones
64 | */
65 | @Override
66 | public boolean areBiomesViable(int i, int j, int k, List list)
67 | {
68 | return true;
69 | }
70 |
71 | // public float getHumid(int i, int j)
72 | // {
73 | // float f = this.getBiomeGenAt(i, j).rainfall;
74 | // return f <= 1.0F ? f : 1.0F;
75 | // }
76 |
77 | // /**
78 | // * Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length.
79 | // */
80 | // @Override
81 | // public float[] getRainfall(float[] listToReuse, int x, int z, int width, int length)
82 | // {
83 | // IntCache.resetIntCache();
84 | //
85 | // if (listToReuse == null || listToReuse.length < width * length)
86 | // {
87 | // listToReuse = new float[width * length];
88 | // }
89 | //
90 | // float f = this.getHumid(x, z);
91 | // int i1 = 0;
92 | //
93 | // for (int j1 = 0; j1 < width; ++j1)
94 | // {
95 | // for (int k1 = 0; k1 < length; ++k1)
96 | // {
97 | // listToReuse[i1] = f;
98 | // ++i1;
99 | // }
100 | // }
101 | //
102 | // return listToReuse;
103 | // }
104 |
105 | // public float getTemp(int i, int j)
106 | // {
107 | // float f = this.getBiomeGenAt(i, j).temperature;
108 | // return f <= 1.0F ? f : 1.0F;
109 | // }
110 |
111 | // /**
112 | // * Returns a list of temperatures to use for the specified blocks. Args: listToReuse, x, z, width, length
113 | // */
114 | // public float[] getTemperatures(float[] listToReuse, int x, int z, int width, int length)
115 | // {
116 | // IntCache.resetIntCache();
117 | //
118 | // if (listToReuse == null || listToReuse.length < width * length)
119 | // {
120 | // listToReuse = new float[width * length];
121 | // }
122 | //
123 | // float f = this.getTemp(x, z);
124 | // int i1 = 0;
125 | //
126 | // for (int j1 = 0; j1 < width; ++j1)
127 | // {
128 | // for (int k1 = 0; k1 < length; ++k1)
129 | // {
130 | // listToReuse[i1] = f;
131 | // ++i1;
132 | // }
133 | // }
134 | //
135 | // return listToReuse;
136 | // }
137 |
138 | /**
139 | * Returns the BiomeGenBase related to the x, z position on the world.
140 | */
141 |
142 | @Override
143 | public BiomeGenBase getBiomeGenAt(int x, int z)
144 | {
145 | int k = x >> 4;
146 | int l = z >> 4;
147 | int i1 = (k - (int)Math.floor(Math.IEEEremainder(k, config.getScaledGridSize())) << 4) + 8;
148 | int j1 = (l - (int)Math.floor(Math.IEEEremainder(l, config.getScaledGridSize())) << 4) + 8;
149 |
150 | Random rnd = new Random(this.seed);
151 | long l1 = rnd.nextLong() / 2L * 2L + 1L;
152 | long l2 = rnd.nextLong() / 2L * 2L + 1L;
153 | rnd .setSeed((i1 * l1 + j1 * l2) * 7215145L ^ this.seed);
154 | return ((BiomeEntry)WeightedRandom.getRandomItem(rnd, config.AllBiomes)).biome;
155 | }
156 |
157 | // /**
158 | // * Returns an array of biomes for the location input.
159 | // */
160 | // @Override
161 | // public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] biomes, int i, int j, int k, int l)
162 | // {
163 | // return this.getBiomeGenAt(biomes, i, j, k, l, false);
164 | // }
165 |
166 | // /**
167 | // * Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false,
168 | // * don't check biomeCache to avoid infinite loop in BiomeCacheBlock)
169 | // */
170 | // @Override
171 | // public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] biomes, int x, int z, int width, int length, boolean
172 | // cacheFlag)
173 | // {
174 | // IntCache.resetIntCache();
175 | //
176 | // final int size = width * length;
177 | //
178 | // if (biomes == null || biomes.length < size)
179 | // {
180 | // biomes = new BiomeGenBase[size];
181 | // }
182 | //
183 | // BiomeGenBase biomegenbase = this.getBiomeGenAt(x, z);
184 | //
185 | // for (int i = 0; i < size; i++)
186 | // {
187 | // biomes[i] = biomegenbase;
188 | // }
189 | //
190 | // return biomes;
191 | // }
192 |
193 | // /**
194 | // * Finds a valid position within a range, that is in one of the listed biomes. Searches {par1,par2} +-par3 blocks.
195 | // * Strongly favors positive y positions.
196 | // */
197 | // @Override
198 | // public ChunkPosition findBiomePosition(int i, int j, int k, List list, Random random)
199 | // {
200 | // return new ChunkPosition(0, 64, 0);
201 | // }
202 |
203 | }
204 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/BiosphereChunkProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod;
8 |
9 | import java.util.Arrays;
10 | import java.util.List;
11 | import java.util.Random;
12 |
13 | import scala.Array;
14 | import net.minecraft.block.Block;
15 | import net.minecraft.block.BlockFlower;
16 | import net.minecraft.block.BlockSand;
17 | import net.minecraft.block.material.Material;
18 | import net.minecraft.entity.EnumCreatureType;
19 | import net.minecraft.init.Blocks;
20 | import net.minecraft.util.IProgressUpdate;
21 | import net.minecraft.util.WeightedRandom;
22 | import net.minecraft.world.ChunkPosition;
23 | import net.minecraft.world.SpawnerAnimals;
24 | import net.minecraft.world.World;
25 | import net.minecraft.world.biome.BiomeGenBase;
26 | import net.minecraft.world.chunk.Chunk;
27 | import net.minecraft.world.chunk.IChunkProvider;
28 | import net.minecraft.world.gen.MapGenBase;
29 | import net.minecraft.world.gen.NoiseGeneratorOctaves;
30 | import net.minecraft.world.gen.feature.WorldGenBigMushroom;
31 | import net.minecraft.world.gen.feature.WorldGenCactus;
32 | import net.minecraft.world.gen.feature.WorldGenClay;
33 | import net.minecraft.world.gen.feature.WorldGenDeadBush;
34 | import net.minecraft.world.gen.feature.WorldGenFire;
35 | import net.minecraft.world.gen.feature.WorldGenFlowers;
36 | import net.minecraft.world.gen.feature.WorldGenMinable;
37 | import net.minecraft.world.gen.feature.WorldGenPumpkin;
38 | import net.minecraft.world.gen.feature.WorldGenReed;
39 | import net.minecraft.world.gen.feature.WorldGenTallGrass;
40 | import net.minecraft.world.gen.feature.WorldGenWaterlily;
41 | import net.minecraft.world.gen.feature.WorldGenerator;
42 | import newBiospheresMod.Configuration.ModConfig;
43 | import newBiospheresMod.Helpers.AvgCalc;
44 | import newBiospheresMod.Helpers.Blx;
45 | import newBiospheresMod.Helpers.Creator;
46 | import newBiospheresMod.Helpers.IKeyProvider;
47 | import newBiospheresMod.Helpers.LruCacheList;
48 | import newBiospheresMod.Helpers.ModConsts;
49 | import newBiospheresMod.Helpers.Predicate;
50 | import newBiospheresMod.Helpers.TopDownBoundingBox;
51 | import newBiospheresMod.Helpers.Utils;
52 | import newBiospheresMod.Models.Sphere;
53 | import newBiospheresMod.Models.SphereChunk;
54 |
55 | public class BiosphereChunkProvider implements IChunkProvider
56 | {
57 | // #region Caching
58 |
59 | private static LruCacheList chunkProviders = new LruCacheList(3,
60 | new IKeyProvider()
61 | {
62 | @Override
63 | public Object provideKey(BiosphereChunkProvider item)
64 | {
65 | if (item == null) { return null; }
66 | return item.world;
67 | }
68 | });
69 |
70 | public static BiosphereChunkProvider get(final World world)
71 | {
72 | return chunkProviders.FindOrAdd(world, new Creator()
73 | {
74 | @Override
75 | public BiosphereChunkProvider create()
76 | {
77 | return new BiosphereChunkProvider(world);
78 | }
79 | });
80 | }
81 |
82 | // #endregion
83 |
84 | // #region Chunk Caching
85 |
86 | private static class ChunkCacheKey
87 | {
88 | public final int x;
89 | public final int z;
90 | public final World world;
91 |
92 | public ChunkCacheKey(final World world, final int x, final int z)
93 | {
94 | this.world = world;
95 | this.x = x;
96 | this.z = z;
97 | }
98 |
99 | @Override
100 | public boolean equals(Object obj)
101 | {
102 | if (obj == null) { return false; }
103 | if (this == obj) { return true; }
104 | if (!(obj instanceof ChunkCacheKey)) { return false; }
105 | ChunkCacheKey other = (ChunkCacheKey)obj;
106 |
107 | return this.x == other.x && this.z == other.z && this.world == other.world;
108 | }
109 |
110 | @Override
111 | public int hashCode()
112 | {
113 | int worldHash = (world == null) ? 0 : world.hashCode();
114 | return ((x & 0xFFFF) | ((z & 0xFFFF) << 16)) ^ worldHash ^ 319023957;
115 | }
116 | }
117 |
118 | LruCacheList ChunksCache = new LruCacheList(15, new IKeyProvider()
119 | {
120 | @Override
121 | public Object provideKey(Chunk item)
122 | {
123 | if (item == null) { return 0; }
124 | if (!item.isChunkLoaded) { return 0; }
125 | return new ChunkCacheKey(item.worldObj, item.xPosition, item.zPosition);
126 | }
127 | });
128 |
129 | // #endregion
130 |
131 | // #region Fields
132 |
133 | public final World world;
134 | public final ModConfig config;
135 | public final NoiseGeneratorOctaves noiseGenerator;
136 | public final long worldSeed;
137 | private final MapGenBase caveGen = new BiosphereMapGen();
138 |
139 | // #endregion
140 |
141 | // /**
142 | // * Get whether the map features (e.g. strongholds) generation is enabled or disabled.
143 | // */
144 | // public boolean getMapFeaturesEnabled()
145 | // {
146 | // return world.getWorldInfo().isMapFeaturesEnabled();
147 | // }
148 |
149 | private BiosphereChunkProvider(World world)
150 | {
151 | this.world = world;
152 | this.worldSeed = world.getSeed();
153 | this.config = ModConfig.get(world);
154 | this.config.update();
155 |
156 | if (this.config.isNoiseEnabled())
157 | {
158 | noiseGenerator = new NoiseGeneratorOctaves(new Random(this.worldSeed), 4);
159 | }
160 | else
161 | {
162 | noiseGenerator = null;
163 | }
164 | }
165 |
166 | private SphereChunk GenerateChunk(int chunkX, int chunkZ, BlockData[] blocks)
167 | {
168 | Arrays.fill(blocks, config.getOutsideFillerBlock());
169 |
170 | SphereChunk chunk = SphereChunk.get(this, chunkX, chunkZ);
171 |
172 | if (chunk != null && chunk.masterSphere != null)
173 | {
174 | Sphere sphere = chunk.masterSphere;
175 |
176 | final TopDownBoundingBox chunkBox = TopDownBoundingBox.FromChunk(chunkX, chunkZ);
177 |
178 | if (Utils.Any(Utils.Where(sphere.getBoundingBoxes(), new Predicate()
179 | {
180 | @Override
181 | public boolean test(TopDownBoundingBox box)
182 | {
183 | return chunkBox.CollidesWith(box);
184 | }
185 | })))
186 | {
187 | // we collided with something like a sphere, ore orb, bridge, or other feature.
188 | GenerateChunkInner(chunkX, chunkZ, blocks, chunk);
189 | }
190 | }
191 |
192 | return chunk;
193 | }
194 |
195 | private void GenerateChunkInner(int chunkX, int chunkZ, BlockData[] blocks, SphereChunk chunk)
196 | {
197 | final int baseX = chunkX << 4;
198 | final int baseZ = chunkZ << 4;
199 | final int bridgeWidth = config.getBridgeWidth();
200 | final BlockData outsideFillerBlock = config.getOutsideFillerBlock();
201 |
202 | Sphere sphere = chunk.masterSphere;
203 | Random rnd = chunk.GetPhaseRandom("GenerateChunk");
204 |
205 | for (int zo = 0; zo < 16; ++zo)
206 | {
207 | for (int xo = 0; xo < 16; ++xo)
208 | {
209 | int midY = chunk.getChunkBoundSurfaceLevel(xo, zo);
210 |
211 | for (int rawY = ModConsts.WORLD_MAX_Y; rawY >= ModConsts.WORLD_MIN_Y; rawY--)
212 | {
213 | int idx = ModConsts.GetChunkArrayIndex(xo, rawY, zo);
214 | BlockData block = BlockData.Empty;
215 |
216 | int rawX = baseX + xo;
217 | int rawZ = baseZ + zo;
218 |
219 | int sphereDistance = sphere.getMainDistance(rawX, rawY, rawZ);
220 | int orbDistance = sphere.getOrbDistance(rawX, rawY, rawZ);
221 | int lakeDistance = sphere.getLakeDistance(rawX, rawY, rawZ);
222 |
223 | if (sphereDistance > sphere.scaledSphereRadius)
224 | {
225 | BlockData stairwayBlock = sphere.getOrbStairwayBlock(rawX, rawY, rawZ);
226 |
227 | if (stairwayBlock != null)
228 | {
229 | block = stairwayBlock;
230 | }
231 | }
232 |
233 | if (rawY > midY)
234 | {
235 | if (sphere.scaledSphereRadius == sphereDistance)
236 | {
237 | if (rawY >= midY + 4 || Math.abs(rawX - sphere.sphereLocation.posX) > bridgeWidth
238 | && Math.abs(rawZ - sphere.sphereLocation.posZ) > bridgeWidth)
239 | {
240 | block = sphere.getDomeBlock(rawX, rawY, rawZ);
241 | }
242 | }
243 | else if (sphere.hasLake && config.isNoiseEnabled() && sphere.isDesert
244 | && (lakeDistance > sphere.scaledLakeRadius && lakeDistance <= sphere.scaledLakeEdgeRadius))
245 | {
246 | if (rawY == sphere.lakeLocation.posY)
247 | {
248 | block = new BlockData(sphere.biome.topBlock);
249 | }
250 | else if (rawY < sphere.lakeLocation.posY)
251 | {
252 | block = new BlockData(sphere.biome.fillerBlock);
253 | }
254 | }
255 | else if (sphere.hasLake && config.isNoiseEnabled() && sphere.isDesert
256 | && lakeDistance <= sphere.scaledLakeRadius)
257 | {
258 | if (rawY == sphere.lakeLocation.posY && sphere.biome == BiomeGenBase.icePlains)
259 | {
260 | block = new BlockData(Blx.ice);
261 | }
262 | else if (rawY <= sphere.lakeLocation.posY)
263 | {
264 | block = sphere.GetLakeBlock();
265 | }
266 | }
267 | else if (config.doesNeedProtectionGlass()
268 | && rawY <= midY + 4
269 | && sphereDistance > sphere.scaledSphereRadius
270 | && (Math.abs(rawX - sphere.sphereLocation.posX) == bridgeWidth || Math.abs(rawZ
271 | - sphere.sphereLocation.posZ) == bridgeWidth))
272 | {
273 | block = sphere.getDomeBlock(rawX, rawY, rawZ);
274 | }
275 | else if (config.doesNeedProtectionGlass()
276 | && rawY == midY + 4
277 | && sphereDistance > sphere.scaledSphereRadius
278 | && (Math.abs(rawX - sphere.sphereLocation.posX) < bridgeWidth || Math.abs(rawZ
279 | - sphere.sphereLocation.posZ) < bridgeWidth))
280 | {
281 | block = sphere.getDomeBlock(rawX, rawY, rawZ);
282 | }
283 | else if (config.doesNeedProtectionGlass()
284 | && rawY < midY + 4
285 | && sphereDistance > sphere.scaledSphereRadius
286 | && (Math.abs(rawX - sphere.sphereLocation.posX) < bridgeWidth || Math.abs(rawZ
287 | - sphere.sphereLocation.posZ) < bridgeWidth))
288 | {
289 | block = BlockData.Empty;
290 | }
291 | else if (config.doesNeedProtectionGlass() && sphereDistance > sphere.scaledSphereRadius)
292 | {
293 | block = outsideFillerBlock;
294 | }
295 | else if (rawY == midY + 1
296 | && sphereDistance > sphere.scaledSphereRadius
297 | && (Math.abs(rawX - sphere.sphereLocation.posX) == bridgeWidth || Math.abs(rawZ
298 | - sphere.sphereLocation.posZ) == bridgeWidth))
299 | {
300 | block = config.getBridgeRailBlock();
301 | }
302 | }
303 | else if (sphere.scaledSphereRadius == sphereDistance)
304 | {
305 | block = new BlockData(Blx.stone);
306 | }
307 | else if (sphere.hasLake && sphere.isDesert
308 | && lakeDistance <= sphere.scaledLakeRadius)
309 | {
310 | if (rawY == sphere.lakeLocation.posY && sphere.biome == BiomeGenBase.icePlains)
311 | {
312 | block = new BlockData(Blx.ice);
313 | }
314 | else if (rawY <= sphere.lakeLocation.posY)
315 | {
316 | block = sphere.GetLakeBlock();
317 | }
318 | }
319 | else if (sphere.hasLake && rawY < sphere.lakeLocation.posY - 1
320 | && sphere.isDesert && lakeDistance <= sphere.scaledLakeEdgeRadius)
321 | {
322 | if (ModConsts.DEBUG)
323 | {
324 | block = new BlockData(Blx.glowstone);
325 | }
326 | else
327 | {
328 | block = new BlockData(sphere.lavaLake ? Blx.gravel : Blx.sand);
329 | }
330 | }
331 | else if (sphereDistance < sphere.scaledSphereRadius)
332 | {
333 | if (rawY == midY)
334 | {
335 | block = new BlockData(sphere.biome.topBlock);
336 | }
337 | else if (rawY == midY - 1)
338 | {
339 | block = new BlockData(sphere.biome.fillerBlock);
340 | }
341 | else
342 | {
343 | block = new BlockData(Blx.stone);
344 | }
345 | }
346 | else if (rawY == midY
347 | && sphereDistance > sphere.scaledSphereRadius
348 | && (Math.abs(rawX - sphere.sphereLocation.posX) < bridgeWidth + 1 || Math.abs(rawZ
349 | - sphere.sphereLocation.posZ) < bridgeWidth + 1))
350 | {
351 | block = config.getBridgeSupportBlock();
352 | }
353 | else if (config.doesNeedProtectionGlass() && sphereDistance > sphere.scaledSphereRadius)
354 | {
355 | block = outsideFillerBlock;
356 | }
357 |
358 | if (sphere.scaledOrbRadius == orbDistance)
359 | {
360 | block = config.getOrbBlock();
361 | }
362 | else if (orbDistance < sphere.scaledOrbRadius)
363 | {
364 | block = ((BlockEntry)WeightedRandom.getRandomItem(rnd, config.OreOrbBlocks)).Block;
365 | }
366 |
367 | blocks[idx] = block;
368 | }
369 | }
370 | }
371 | }
372 |
373 | /**
374 | * loads or generates the chunk at the chunk location specified
375 | */
376 | @Override
377 | public Chunk loadChunk(int x, int z)
378 | {
379 | return this.provideChunk(x, z);
380 | }
381 |
382 | /**
383 | * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
384 | * specified chunk from the map seed and chunk seed
385 | */
386 | @Override
387 | public Chunk provideChunk(final int x, final int z)
388 | {
389 | return ChunksCache.FindOrAdd(new ChunkCacheKey(this.world, x, z), new Creator()
390 | {
391 | @Override
392 | public Chunk create()
393 | {
394 | return GenerateNewChunk(x, z);
395 | }
396 | });
397 | }
398 |
399 | private static final AvgCalc avg = new AvgCalc();
400 | private static long lastPrintedAt = Long.MIN_VALUE;
401 |
402 | private Chunk GenerateNewChunk(int x, int z)
403 | {
404 | long startedAt = System.currentTimeMillis();
405 |
406 | BlockData[] blockData = new BlockData[ModConsts.GetChunkArraySize()];
407 | SphereChunk sphereChunk = this.GenerateChunk(x, z, blockData);
408 |
409 | Block[] blocks = BlockData.getBlockArray(blockData);
410 | byte[] metadata = BlockData.getMetadataArray(blockData);
411 |
412 | this.caveGen.func_151539_a(this, this.world, x, z, blocks); // func_151539_a == generate
413 |
414 | Chunk chunk = new Chunk(this.world, blocks, metadata, x, z);
415 | chunk.generateSkylightMap();
416 |
417 | // Fix for Issue #24:
418 | if (sphereChunk != null)
419 | {
420 | if (sphereChunk.masterSphere != null)
421 | {
422 | if (sphereChunk.masterSphere.biome != null)
423 | {
424 | // System.out.println("Biome at " + sphereChunk.chunkX + ", " + sphereChunk.chunkZ + ": " +
425 | // sphereChunk.masterSphere.biome.biomeName);
426 |
427 | byte[] biomes = new byte[256];
428 | Arrays.fill(biomes, (byte)(sphereChunk.masterSphere.biome.biomeID & 0xFF));
429 | chunk.setBiomeArray(biomes);
430 | }
431 | }
432 | }
433 |
434 | // It's normal to see performance warnings for a few chunks at start-up and maybe every once in a while after
435 | // that, but the average should drop down to less than a millisecond within a minute or so.
436 |
437 | long now = System.currentTimeMillis();
438 | long elapsed = now - startedAt;
439 | avg.addValue(elapsed / 1000d);
440 | if (elapsed >= 100)
441 | {
442 | System.out.printf("WARNING: BIOSPHERE GENERATE NEW CHUNK @ [%d, %d] TOOK %.3f SECONDS!%n", x, z,
443 | (elapsed / 1000d));
444 | }
445 |
446 | if (lastPrintedAt == Long.MIN_VALUE || (now - lastPrintedAt) > 2500)
447 | {
448 | lastPrintedAt = now;
449 | if (avg.getCount() >= 5)
450 | {
451 | double av = avg.getAverage();
452 | if (av >= .02D)
453 | {
454 | System.out.printf("INFO: BIOSPHERE GENERATE NEW CHUNK ON AVERAGE TAKES %.3f SECONDS.%n", av);
455 | }
456 | }
457 | }
458 |
459 | return chunk;
460 | }
461 |
462 | /**
463 | * Checks to see if a chunk exists at x, z
464 | */
465 | @Override
466 | public boolean chunkExists(int x, int z)
467 | {
468 | return true;
469 | }
470 |
471 | /**
472 | * Populates chunk with ores etc etc
473 | */
474 | @Override
475 | public void populate(IChunkProvider chunkProvider, int chunkX, int chunkZ)
476 | {
477 | SphereChunk chunk = SphereChunk.get(this, chunkX, chunkZ);
478 | Sphere sphere = chunk.masterSphere;
479 | Random rnd = chunk.GetPhaseRandom("populate");
480 |
481 | BlockSand.fallInstantly = true;
482 | int absX = chunkX << 4;
483 | int absZ = chunkZ << 4;
484 |
485 | for (int i = 0; i < 20; i++)
486 | {
487 | int x = absX + rnd.nextInt(16);
488 | int y = rnd.nextInt(ModConsts.WORLD_HEIGHT);
489 | int z = absZ + rnd.nextInt(16);
490 |
491 | (new WorldGenMinable(Blx.coal_ore, 16)).generate(this.world, rnd, x, y, z);
492 | }
493 |
494 | for (int i = 0; i < 20; i++)
495 | {
496 | int x = absX + rnd.nextInt(16);
497 | int y = rnd.nextInt(ModConsts.WORLD_HEIGHT);
498 | int z = absZ + rnd.nextInt(16);
499 |
500 | (new WorldGenMinable(Blx.iron_ore, 8)).generate(this.world, rnd, x, y, z);
501 | }
502 |
503 | for (int i = 0; i < 2; i++)
504 | {
505 | int x = absX + rnd.nextInt(16);
506 | int y = rnd.nextInt(ModConsts.WORLD_HEIGHT);
507 | int z = absZ + rnd.nextInt(16);
508 |
509 | (new WorldGenMinable(Blx.gold_ore, 8)).generate(this.world, rnd, x, y, z);
510 | }
511 |
512 | for (int i = 0; i < 8; i++)
513 | {
514 | int x = absX + rnd.nextInt(16);
515 | int y = rnd.nextInt(ModConsts.WORLD_HEIGHT);
516 | int z = absZ + rnd.nextInt(16);
517 |
518 | (new WorldGenMinable(Blx.redstone_ore, 7)).generate(this.world, rnd, x, y, z);
519 | }
520 |
521 | for (int i = 0; i < sphere.biome.theBiomeDecorator.sandPerChunk2; i++)
522 | {
523 | int x = absX + rnd.nextInt(16) + 8;
524 | int z = absZ + rnd.nextInt(16) + 8;
525 | int y = getBioTopSolidOrLiquidBlock(x, z);
526 |
527 | sphere.biome.theBiomeDecorator.sandGen.generate(this.world, rnd, x, y, z);
528 | }
529 |
530 | for (int i = 0; i < sphere.biome.theBiomeDecorator.clayPerChunk; i++)
531 | {
532 | int x = absX + rnd.nextInt(16) + 8;
533 | int z = absZ + rnd.nextInt(16) + 8;
534 | int y = getBioTopSolidOrLiquidBlock(x, z);
535 |
536 | if (y > 0)
537 | {
538 | sphere.biome.theBiomeDecorator.clayGen.generate(this.world, rnd, x, y, z);
539 | }
540 | }
541 |
542 | for (int i = 0; i < sphere.biome.theBiomeDecorator.sandPerChunk; i++)
543 | {
544 | int x = absX + rnd.nextInt(16) + 8;
545 | int z = absZ + rnd.nextInt(16) + 8;
546 | int y = getBioTopSolidOrLiquidBlock(x, z);
547 |
548 | if (y > 0)
549 | {
550 | sphere.biome.theBiomeDecorator.gravelAsSandGen.generate(this.world, rnd, x, y, z);
551 | }
552 | }
553 |
554 | int treesPerChunk = sphere.biome.theBiomeDecorator.treesPerChunk;
555 |
556 | if (rnd.nextInt(10) == 0)
557 | {
558 | treesPerChunk++;
559 | }
560 |
561 | for (int i = 0; i < treesPerChunk; i++)
562 | {
563 | int x = absX + rnd.nextInt(16) + 8;
564 | int z = absZ + rnd.nextInt(16) + 8;
565 | int y = this.world.getHeightValue(x, z);
566 |
567 | if (y > 0)
568 | {
569 | // func_150567_a == getRandomWorldGenForTrees
570 | WorldGenerator gen = sphere.biome.func_150567_a(rnd);
571 |
572 | gen.setScale(config.getScale(), config.getScale(), config.getScale());
573 | gen.generate(this.world, rnd, x, y, z);
574 | }
575 | }
576 |
577 | for (int i = 0; i < sphere.biome.theBiomeDecorator.bigMushroomsPerChunk; i++)
578 | {
579 | int x = absX + rnd.nextInt(16) + 8;
580 | int z = absZ + rnd.nextInt(16) + 8;
581 | int y = getBioHeightValue(x, z);
582 |
583 | if (y > 0)
584 | {
585 | sphere.biome.theBiomeDecorator.bigMushroomGen.generate(this.world, rnd, x, y, z);
586 | }
587 | }
588 |
589 | for (int i = 0; i < sphere.biome.theBiomeDecorator.flowersPerChunk; i++)
590 | {
591 | int x = absX + rnd.nextInt(16) + 8;
592 | int z = absZ + rnd.nextInt(16) + 8;
593 | int y = getBioHeightValue(x, z);
594 |
595 | if (y > 0)
596 | {
597 | y = rnd.nextInt(y + 32);
598 | String s = sphere.biome.func_150572_a(rnd, x, y, z);
599 |
600 | BlockFlower f = BlockFlower.func_149857_e(s);
601 | if (f.getMaterial() != Material.air)
602 | {
603 | (new WorldGenFlowers(f)).generate(this.world, rnd, x, y, z);
604 | }
605 | }
606 | }
607 |
608 | for (int i = 0; i <= sphere.biome.theBiomeDecorator.mushroomsPerChunk; i++)
609 | {
610 | int x = absX + rnd.nextInt(16) + 8;
611 | int z = absZ + rnd.nextInt(16) + 8;
612 | int y = getBioHeightValue(x, z);
613 |
614 | if (y > 0)
615 | {
616 | if (i == 0)
617 | { y = rnd.nextInt(y * 2); }
618 |
619 | if (rnd.nextInt(4) == 0)
620 | {
621 | sphere.biome.theBiomeDecorator.mushroomBrownGen.generate(world, rnd, x, y, z);
622 | }
623 |
624 | if (rnd.nextInt(8) == 0)
625 | {
626 | if (i != 0)
627 | { y = rnd.nextInt(y * 2); }
628 |
629 | sphere.biome.theBiomeDecorator.mushroomRedGen.generate(world, rnd, x, y, z);
630 | }
631 | }
632 | }
633 |
634 | for (int i = 0; i < sphere.biome.theBiomeDecorator.deadBushPerChunk; i++)
635 | {
636 | int x = absX + rnd.nextInt(16) + 8;
637 | int z = absZ + rnd.nextInt(16) + 8;
638 | int y = getBioHeightValue(x, z);
639 |
640 | if (y > 0)
641 | {
642 | y = rnd.nextInt(y * 2);
643 | (new WorldGenDeadBush(Blx.deadbush)).generate(this.world, rnd, x, y, z);
644 | }
645 | }
646 |
647 | if (config.isTallGrassEnabled())
648 | {
649 | int grassPerChunk = sphere.biome.theBiomeDecorator.grassPerChunk;
650 | for (int i = 0; i < grassPerChunk; i++)
651 | {
652 | int x = absX + rnd.nextInt(16) + 8;
653 | int z = absZ + rnd.nextInt(16) + 8;
654 | int y = getBioHeightValue(x, z);
655 |
656 | if (y > 0)
657 | {
658 | y = rnd.nextInt(y * 2);
659 | WorldGenerator worldgenerator = sphere.biome.getRandomWorldGenForGrass(rnd);
660 | worldgenerator.generate(world, rnd, x, y, z);
661 | }
662 | }
663 | }
664 |
665 | for (int i = 0; i < sphere.biome.theBiomeDecorator.reedsPerChunk + 10; i++)
666 | {
667 | int x = absX + rnd.nextInt(16) + 8;
668 | int z = absZ + rnd.nextInt(16) + 8;
669 | int y = getBioHeightValue(x, z);
670 |
671 | if (y > 0)
672 | {
673 | y = rnd.nextInt(y * 2);
674 | (new WorldGenReed()).generate(this.world, rnd, x, y, z);
675 | }
676 | }
677 |
678 | if (rnd.nextInt(32) == 0)
679 | {
680 | int x = absX + rnd.nextInt(16) + 8;
681 | int z = absZ + rnd.nextInt(16) + 8;
682 | int y = getBioHeightValue(x, z);
683 | if (y > 0)
684 | {
685 | y = rnd.nextInt(y);
686 | (new WorldGenPumpkin()).generate(this.world, rnd, x, y, z);
687 | }
688 | }
689 |
690 | for (int i = 0; i < sphere.biome.theBiomeDecorator.cactiPerChunk; i++)
691 | {
692 | int x = absX + rnd.nextInt(16) + 8;
693 | int z = absZ + rnd.nextInt(16) + 8;
694 | int y = getBioHeightValue(x, z);
695 |
696 | if (y > 0)
697 | {
698 | y = rnd.nextInt(y * 2);
699 | (new WorldGenCactus()).generate(this.world, rnd, x, y, z);
700 | }
701 | }
702 |
703 | if (sphere.biome == BiomeGenBase.hell)
704 | {
705 | if (rnd.nextBoolean())
706 | {
707 | int x = absX + rnd.nextInt(16) + 8;
708 | int z = absZ + rnd.nextInt(16) + 8;
709 | int y = this.world.getHeightValue(x, z);
710 | if (y > 0)
711 | {
712 | (new WorldGenFire()).generate(this.world, rnd, x, y, z);
713 | }
714 | }
715 |
716 | if (rnd.nextBoolean())
717 | {
718 | int x = absX + rnd.nextInt(16) + 8;
719 | int z = absZ + rnd.nextInt(16) + 8;
720 | int y = this.world.getHeightValue(x, z);
721 | if (y > 0)
722 | {
723 | (new WorldGenFlowers(Blx.brown_mushroom)).generate(world, rnd, x, y, z);
724 | }
725 | }
726 |
727 | if (rnd.nextBoolean())
728 | {
729 | int x = absX + rnd.nextInt(16) + 8;
730 | int z = absZ + rnd.nextInt(16) + 8;
731 | int y = this.world.getHeightValue(x, z);
732 | if (y > 0)
733 | {
734 | (new WorldGenFlowers(Blx.red_mushroom)).generate(world, rnd, x, y, z);
735 | }
736 | }
737 | }
738 | else if (sphere.biome.getEnableSnow())
739 | {
740 | for (int zo = 0; zo < 16; zo++)
741 | {
742 | for (int xo = 0; xo < 16; xo++)
743 | {
744 | int x = xo + absX;
745 | int z = zo + absZ;
746 | int y = this.world.getHeightValue(x, z) + 16;
747 | while (y > 0 && (world.isAirBlock(x, --y, z) || (world.getBlock(x, y, z) instanceof BlockDome)))
748 | { /* do nothing */}
749 |
750 | if (y > 0)
751 | {
752 | if (world.isBlockFreezable(x, y, z))
753 | {
754 | world.setBlock(x, y, z, Blx.ice);
755 | }
756 | else if (world.func_147478_e(x, y, z, false) &&
757 | Blx.snow_layer.canPlaceBlockAt(world, x, y + 1, z))
758 | {
759 | if (!(world.getBlock(x, y + 1, z) instanceof BlockDome))
760 | {
761 | world.setBlock(x, y + 1, z, Blx.snow_layer, 0, 2);
762 | }
763 | }
764 | }
765 | }
766 | }
767 | }
768 |
769 | for (int i = 0; i < sphere.biome.theBiomeDecorator.waterlilyPerChunk; i++)
770 | {
771 | int x = absX + rnd.nextInt(16) + 8;
772 | int z = absZ + rnd.nextInt(16) + 8;
773 | int y = this.world.getHeightValue(x, z);
774 |
775 | if (y > 0)
776 | {
777 | while (y < world.getActualHeight() && !world.isAirBlock(x, ++y, z))
778 | { /* do nothing */ }
779 |
780 | while (y > 0 && (world.isAirBlock(x, --y - 1, z) || world.getBlock(x, y, z) instanceof BlockDome))
781 | { /* do nothing */ }
782 |
783 | (new WorldGenWaterlily()).generate(this.world, rnd, x, y + 1, z);
784 | }
785 | }
786 |
787 | SpawnerAnimals.performWorldGenSpawning(this.world, sphere.biome, absX + 8, absZ + 8, 16, 16, rnd);
788 | BlockSand.fallInstantly = false;
789 | }
790 |
791 | private int getBioHeightValue(int x, int z)
792 | {
793 | return world.getHeightValue(x, z);
794 | }
795 |
796 | private int getBioTopSolidOrLiquidBlock(int x, int z)
797 | {
798 | for (int y = world.getHeightValue(x, z); y > 0; y--)
799 | {
800 | Block b = world.getBlock(x, y, z);
801 | if (!(b instanceof BlockDome) && b.getMaterial().blocksMovement()
802 | && b.getMaterial() != Material.leaves && !b.isFoliage(world, x, y, z))
803 | {
804 | return y + 1;
805 | }
806 | }
807 |
808 | return -1;
809 | }
810 |
811 | /**
812 | * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return
813 | * true if all chunks have been saved.
814 | */
815 | @Override
816 | public boolean saveChunks(boolean flag, IProgressUpdate iprogressupdate)
817 | {
818 | return true;
819 | }
820 |
821 | /**
822 | * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk.
823 | */
824 | @Override
825 | public boolean unloadQueuedChunks()
826 | {
827 | return false;
828 | }
829 |
830 | /**
831 | * Returns if the IChunkProvider supports saving.
832 | */
833 | @Override
834 | public boolean canSave()
835 | {
836 | return true;
837 | }
838 |
839 | /**
840 | * Converts the instance data to a readable string.
841 | */
842 | @Override
843 | public String makeString()
844 | {
845 | return "RandomLevelSource";
846 | }
847 |
848 | /**
849 | * Returns a list of creatures of the specified type that can spawn at the given location.
850 | */
851 | @Override
852 | public List getPossibleCreatures(EnumCreatureType enumcreaturetype, int i, int j, int k)
853 | {
854 | BiomeGenBase biomegenbase = this.world.getBiomeGenForCoords(i, k);
855 | return biomegenbase == null ? null : biomegenbase.getSpawnableList(enumcreaturetype);
856 | }
857 |
858 | /**
859 | * Returns the location of the closest structure of the specified type. If not found returns null.
860 | */
861 | public ChunkPosition findClosestStructure(World world1, String s, int i, int j, int k)
862 | {
863 | return null;
864 | }
865 |
866 | @Override
867 | public int getLoadedChunkCount()
868 | {
869 | return 0;
870 | }
871 |
872 | @Override
873 | public void recreateStructures(int var1, int var2)
874 | {
875 | /* do nothing */
876 | }
877 |
878 | @Override
879 | public void saveExtraData()
880 | {
881 | /* do nothing */
882 | }
883 |
884 | @Override
885 | public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_,
886 | int p_147416_5_)
887 | {
888 | return null;
889 | }
890 | }
891 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/BiosphereMapGen.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod;
8 |
9 | import java.util.Random;
10 |
11 | import net.minecraft.block.Block;
12 | import net.minecraft.util.MathHelper;
13 | import net.minecraft.world.World;
14 | import net.minecraft.world.chunk.IChunkProvider;
15 | import net.minecraft.world.gen.MapGenBase;
16 | import newBiospheresMod.Helpers.Blx;
17 | import newBiospheresMod.Helpers.ModConsts;
18 | import newBiospheresMod.Models.Sphere;
19 | import newBiospheresMod.Models.SphereChunk;
20 |
21 | public class BiosphereMapGen extends MapGenBase
22 | {
23 | BiosphereChunkProvider chunkProvider = null;
24 |
25 | @Override
26 | public void func_151539_a(IChunkProvider chunkProvider, World world, int x, int z, Block[] blocks)
27 | {
28 | if (this.chunkProvider == null && chunkProvider instanceof BiosphereChunkProvider)
29 | {
30 | this.chunkProvider = (BiosphereChunkProvider)chunkProvider;
31 | }
32 |
33 | super.func_151539_a(chunkProvider, world, x, z, blocks);
34 | }
35 |
36 | protected void a(int i, int j, Block[] blocks, double d, double d1, double d2)
37 | {
38 | this.a(i, j, blocks, d, d1, d2, 10.0F + this.rand.nextFloat() * 20.0F, 0.0F, 0.0F, -1, -1, 0.5D);
39 | }
40 |
41 | protected void a(int chunkX, int chunkZ, Block[] blocks, double d, double d1, double d2, float f, float f1,
42 | float f2, int k, int l, double d3)
43 | {
44 | int chunkHeight = blocks.length / (16 * 16);
45 |
46 | SphereChunk chunk = null;
47 | Sphere sphere = null;
48 |
49 | if (this.chunkProvider != null)
50 | {
51 | chunk = SphereChunk.get(chunkProvider, chunkX, chunkZ);
52 | if (chunk != null)
53 | {
54 | sphere = chunk.masterSphere;
55 | }
56 | }
57 |
58 | double ccx = chunkX * 16 + 8;
59 | double ccz = chunkZ * 16 + 8;
60 | float f3 = 0.0F;
61 | float f4 = 0.0F;
62 | Random random = new Random(this.rand.nextLong());
63 |
64 | if (l <= 0)
65 | {
66 | int flag = this.range * 16 - 16;
67 | l = flag - random.nextInt(flag / 4);
68 | }
69 |
70 | boolean var61 = false;
71 |
72 | if (k == -1)
73 | {
74 | k = l / 2;
75 | var61 = true;
76 | }
77 |
78 | int j1 = random.nextInt(l / 2) + l / 4;
79 |
80 | for (boolean flag1 = random.nextInt(6) == 0; k < l; ++k)
81 | {
82 | double d6 = 1.5D + MathHelper.sin(k * (float)Math.PI / l) * f * 1.0F;
83 | double d7 = d6 * d3;
84 | float f5 = MathHelper.cos(f2);
85 | float f6 = MathHelper.sin(f2);
86 | d += MathHelper.cos(f1) * f5;
87 | d1 += f6;
88 | d2 += MathHelper.sin(f1) * f5;
89 |
90 | if (flag1)
91 | {
92 | f2 *= 0.92F;
93 | }
94 | else
95 | {
96 | f2 *= 0.7F;
97 | }
98 |
99 | f2 += f4 * 0.1F;
100 | f1 += f3 * 0.1F;
101 | f4 *= 0.9F;
102 | f3 *= 0.75F;
103 | f4 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F;
104 | f3 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F;
105 |
106 | if (!var61 && k == j1 && f > 1.0F)
107 | {
108 | this.a(chunkX, chunkZ, blocks, d, d1, d2, random.nextFloat() * 0.5F + 0.5F, f1 - ((float)Math.PI / 2F),
109 | f2 / 3.0F, k, l, 1.0D);
110 | this.a(chunkX, chunkZ, blocks, d, d1, d2, random.nextFloat() * 0.5F + 0.5F, f1 + ((float)Math.PI / 2F),
111 | f2 / 3.0F, k, l, 1.0D);
112 | return;
113 | }
114 |
115 | if (var61 || random.nextInt(4) != 0)
116 | {
117 | double d8 = d - ccx;
118 | double d9 = d2 - ccz;
119 | double d10 = l - k;
120 | double d11 = f + 2.0F + 16.0F;
121 |
122 | if (d8 * d8 + d9 * d9 - d10 * d10 > d11 * d11) { return; }
123 |
124 | if (d >= ccx - 16.0D - d6 * 2.0D && d2 >= ccz - 16.0D - d6 * 2.0D && d <= ccx + 16.0D + d6 * 2.0D
125 | && d2 <= ccz + 16.0D + d6 * 2.0D)
126 | {
127 | int k1 = MathHelper.truncateDoubleToInt(d - d6) - chunkX * 16 - 1;
128 | int l1 = MathHelper.truncateDoubleToInt(d + d6) - chunkX * 16 + 1;
129 | int i2 = MathHelper.truncateDoubleToInt(d1 - d7) - 1;
130 | int j2 = MathHelper.truncateDoubleToInt(d1 + d7) + 1;
131 | int k2 = MathHelper.truncateDoubleToInt(d2 - d6) - chunkZ * 16 - 1;
132 | int l2 = MathHelper.truncateDoubleToInt(d2 + d6) - chunkZ * 16 + 1;
133 |
134 | if (k1 < 0)
135 | {
136 | k1 = 0;
137 | }
138 |
139 | if (l1 > 16)
140 | {
141 | l1 = 16;
142 | }
143 |
144 | if (i2 < 1)
145 | {
146 | i2 = 1;
147 | }
148 |
149 | if (j2 > 120)
150 | {
151 | j2 = 120;
152 | }
153 |
154 | if (k2 < 0)
155 | {
156 | k2 = 0;
157 | }
158 |
159 | if (l2 > 16)
160 | {
161 | l2 = 16;
162 | }
163 |
164 | boolean flag2 = false;
165 | int j3;
166 | int l3;
167 |
168 | for (l3 = k1; !flag2 && l3 < l1; ++l3)
169 | {
170 | for (int d12 = k2; !flag2 && d12 < l2; ++d12)
171 | {
172 | for (int j4 = j2 + 1; !flag2 && j4 >= i2 - 1; --j4)
173 | {
174 | j3 = (l3 * 16 + d12) * chunkHeight + j4;
175 |
176 | if (j4 >= 0 && j4 < chunkHeight)
177 | {
178 | if (blocks[j3] == Blx.flowing_water || blocks[j3] == Blx.water
179 | || blocks[j3] == Blx.flowing_lava || blocks[j3] == Blx.lava)
180 | {
181 | flag2 = true;
182 | }
183 |
184 | if (j4 != i2 - 1 && l3 != k1 && l3 != l1 - 1 && d12 != k2 && d12 != l2 - 1)
185 | {
186 | j4 = i2;
187 | }
188 | }
189 | }
190 | }
191 | }
192 |
193 | if (!flag2)
194 | {
195 | for (l3 = k1; l3 < l1; ++l3)
196 | {
197 | double var62 = (l3 + chunkX * 16 + 0.5D - d) / d6;
198 |
199 | for (j3 = k2; j3 < l2; ++j3)
200 | {
201 | int midY = chunk.getChunkBoundSurfaceLevel(l3, j3);
202 | double d13 = (j3 + chunkZ * 16 + 0.5D - d2) / d6;
203 | int k4 = (l3 * 16 + j3) * chunkHeight + j2;
204 |
205 | for (int l4 = j2 - 1; l4 >= i2; --l4)
206 | {
207 | double d14 = (l4 + 0.5D - d1) / d7;
208 |
209 | if (d14 > -0.7D && var62 * var62 + d14 * d14 + d13 * d13 < 1.0D)
210 | {
211 | Block block = blocks[k4];
212 |
213 | if (block == Blx.stone || block == Blx.sand || block == Blx.gravel
214 | || block == Blx.diamond_ore || block == Blx.lapis_ore
215 | || block == Blx.emerald_ore)
216 | {
217 | if (l4 < ModConsts.LAVA_LEVEL)
218 | {
219 | if (this.chunkProvider != null)
220 | {
221 | double d15 = sphere.getMainDistance(
222 | (int)Math.round(ccx + l3 - 8.0D), l4 - 1, (int)Math.round(ccz
223 | + j3 - 8.0D));
224 |
225 | if (d15 >= sphere.scaledSphereRadius
226 | && d15 < (sphere.scaledSphereRadius + 5d))
227 |
228 | {
229 | blocks[k4] = Blx.obsidian;
230 | }
231 | else if (d15 < sphere.scaledSphereRadius)
232 | {
233 | blocks[k4] = Blx.flowing_lava;
234 | }
235 | }
236 | else
237 | {
238 | blocks[k4] = Blx.flowing_lava;
239 | }
240 | }
241 | else if (l4 < midY - 2 || l4 > midY - 1)
242 | {
243 | blocks[k4] = Blx.air;
244 | }
245 | }
246 | }
247 |
248 | --k4;
249 | }
250 | }
251 | }
252 |
253 | if (var61)
254 | {
255 | break;
256 | }
257 | }
258 | }
259 | }
260 | }
261 | }
262 |
263 | /**
264 | * Recursively called by generate() (generate) and optionally by itself.
265 | */
266 | protected void recursiveGenerate(World world, int chunkX, int chunkZ, int k, int l, Block[] blocks)
267 | {
268 | int i1 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(10) + 1) + 1);
269 |
270 | if (this.rand.nextInt(5) != 0)
271 | {
272 | i1 = 0;
273 | }
274 |
275 | for (int j1 = 0; j1 < i1; ++j1)
276 | {
277 | double x = chunkX * 16 + this.rand.nextInt(16);
278 | double y = this.rand.nextInt(ModConsts.WORLD_HEIGHT);
279 | double z = chunkZ * 16 + this.rand.nextInt(16);
280 | int k1 = 1;
281 |
282 | if (this.rand.nextInt(4) == 0)
283 | {
284 | this.a(k, l, blocks, x, y, z);
285 | k1 += this.rand.nextInt(4);
286 | }
287 |
288 | for (int l1 = 0; l1 < k1; ++l1)
289 | {
290 | float f = this.rand.nextFloat() * (float)Math.PI * 2.0F;
291 | float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F;
292 | float f2 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat();
293 | this.a(k, l, blocks, x, y, z, f2 * 5.0F, f, f1, 0, 0, 0.5D);
294 | }
295 | }
296 | }
297 | }
298 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/BiosphereWorldProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod;
8 |
9 | import net.minecraft.block.Block;
10 | import net.minecraft.util.ChunkCoordinates;
11 | import net.minecraft.world.World;
12 | import net.minecraft.world.WorldProviderSurface;
13 | import newBiospheresMod.Configuration.ModConfig;
14 | import newBiospheresMod.Helpers.AvgCalc;
15 | import newBiospheresMod.Helpers.Blx;
16 | import newBiospheresMod.Helpers.ModConsts;
17 | import newBiospheresMod.Helpers.Utils;
18 | import newBiospheresMod.Models.Sphere;
19 |
20 | public class BiosphereWorldProvider extends WorldProviderSurface
21 | {
22 | private ModConfig config;
23 |
24 | @Override
25 | public ChunkCoordinates getRandomizedSpawnPoint()
26 | {
27 | ChunkCoordinates coords = super.getSpawnPoint();
28 |
29 | FixSpawnLocation(coords); //, true);
30 |
31 | return coords;
32 | }
33 |
34 | @Override
35 | public ChunkCoordinates getSpawnPoint()
36 | {
37 | ChunkCoordinates coords = super.getSpawnPoint();
38 |
39 | FixSpawnLocation(coords); //, false);
40 |
41 | return coords;
42 | }
43 |
44 | private boolean ValidSpawnLocation(ChunkCoordinates coords)
45 | {
46 | if (coords == null) { return true; }
47 |
48 | World world = this.worldObj;
49 | if (world == null) { return true; }
50 |
51 | int x = coords.posX;
52 | int z = coords.posZ;
53 |
54 | for (int y = 0; y < ModConsts.WORLD_HEIGHT; y++)
55 | {
56 | Block block = world.getBlock(x, y, z);
57 | if (block != Blx.air && !block.isAir(world, x, y, z))
58 | {
59 | return true;
60 | }
61 | }
62 |
63 | // no solid ground at this location!
64 | return false;
65 | }
66 |
67 | private static final double searchGridSize = 2.5d;
68 | private static final double searchGridAngles = 12;
69 | private static final double toRadians = Math.PI / (searchGridAngles / 2);
70 |
71 | private static final AvgCalc avg = new AvgCalc();
72 | private static long lastPrintedAt = Long.MIN_VALUE;
73 |
74 | public void FixSpawnLocation(ChunkCoordinates coords)
75 | {
76 | ChunkCoordinates orgCoords = Utils.GetCoords(coords);
77 |
78 | double angle = 0;
79 | double power = 1;
80 |
81 | while (!ValidSpawnLocation(coords))
82 | {
83 | angle++;
84 | if (angle >= searchGridAngles)
85 | {
86 | angle -= searchGridAngles;
87 | power++;
88 | }
89 |
90 | if (power >= 50)
91 | {
92 | coords.posX = orgCoords.posX;
93 | coords.posZ = orgCoords.posZ;
94 |
95 | if (ModConsts.DEBUG)
96 | {
97 | System.out.println("WARNING: BIOSPHERE FIX SPAWN LOCATION FAILED!!");
98 | }
99 |
100 | break;
101 | }
102 |
103 | double x = Math.cos(angle * toRadians) * (power * searchGridSize);
104 | double z = Math.sin(angle * toRadians) * (power * searchGridSize);
105 |
106 | coords.posX = orgCoords.posX + (int)Math.round(x);
107 | coords.posZ = orgCoords.posZ + (int)Math.round(z);
108 | }
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/BiosphereWorldType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod;
8 |
9 | import net.minecraft.world.World;
10 | import net.minecraft.world.WorldType;
11 | import net.minecraft.world.biome.BiomeGenBase;
12 | import net.minecraft.world.biome.WorldChunkManager;
13 | import net.minecraft.world.chunk.IChunkProvider;
14 | import newBiospheresMod.Configuration.CustomWorldData;
15 | import newBiospheresMod.Configuration.ModConfig;
16 | import newBiospheresMod.Helpers.Blx;
17 | import newBiospheresMod.Helpers.IKeyProvider;
18 | import newBiospheresMod.Helpers.LruCacheList;
19 |
20 | public class BiosphereWorldType extends WorldType
21 | {
22 | // #region Ownership Tracking
23 |
24 | private static final LruCacheList BiosphereWorlds = new LruCacheList(3, new IKeyProvider()
25 | {
26 | @Override
27 | public Object provideKey(World item)
28 | {
29 | return item;
30 | }
31 | });
32 |
33 | public static final String IsBiosphereWorldKey = "IsBiosphereWorld";
34 |
35 | public static boolean IsBiosphereWorld(World world)
36 | {
37 | if (world != null)
38 | {
39 | if (BiosphereWorlds.Contains(world)) { return true; }
40 |
41 | CustomWorldData data = CustomWorldData.FromWorld(world);
42 | if (data != null)
43 | {
44 | if (data.getBool(IsBiosphereWorldKey))
45 | {
46 | EnsureWorldIsTracked(world);
47 | return true;
48 | }
49 | }
50 | }
51 |
52 | return false;
53 | }
54 |
55 | // #endregion
56 |
57 | public BiosphereWorldType(String s)
58 | {
59 | super(s);
60 | }
61 |
62 | @Override
63 | public WorldChunkManager getChunkManager(World world)
64 | {
65 | // TODO: FIND A WAY TO UNREGISTER THIS IF THE PLAYER LOADS ANOTHER WORLD.
66 | BiomeGenBase.hell.topBlock = BiomeGenBase.hell.fillerBlock = Blx.netherrack;
67 | BiomeGenBase.sky.topBlock = BiomeGenBase.sky.fillerBlock = Blx.end_stone;
68 |
69 | Blx.water.setLightOpacity(0);
70 | Blx.flowing_water.setLightOpacity(0);
71 |
72 | Blx.lava.setLightOpacity(0);
73 | Blx.flowing_lava.setLightOpacity(0);
74 |
75 | BiosphereWorlds.Push(world);
76 | return new BiosphereChunkManager(world);
77 | }
78 |
79 | @Override
80 | public IChunkProvider getChunkGenerator(World world, String params)
81 | {
82 | BiosphereWorlds.Push(world);
83 | return BiosphereChunkProvider.get(world);
84 | }
85 |
86 | @Override
87 | public boolean hasVoidParticles(boolean flag)
88 | {
89 | return false;
90 | }
91 |
92 | public int getSeaLevel(World world)
93 | {
94 | BiosphereWorlds.Push(world);
95 | return ModConfig.get(world).getSeaLevel() + 1;
96 | }
97 |
98 | @Override
99 | public double voidFadeMagnitude()
100 | {
101 | return 1.0D;
102 | }
103 |
104 | private static void EnsureWorldIsTracked(World world)
105 | {
106 | if (world != null)
107 | {
108 | BiosphereWorlds.Push(world);
109 |
110 | CustomWorldData data = CustomWorldData.FromWorld(world);
111 | if (data != null)
112 | {
113 | data.put(IsBiosphereWorldKey, true);
114 | }
115 |
116 | ModConfig.get(world).update();
117 | }
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/BlockData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod;
8 |
9 | import net.minecraft.block.*;
10 | import newBiospheresMod.Helpers.Blx;
11 | import newBiospheresMod.Helpers.Utils;
12 |
13 | public final class BlockData
14 | {
15 | // #region Static Utilities
16 |
17 | public static final BlockData Empty = new BlockData(null, 0);
18 |
19 | public static boolean IsNullOrEmpty(BlockData input)
20 | {
21 | return (input == null) ? true : input.IsEmpty();
22 | }
23 |
24 | private static byte FixMetadata(int value)
25 | {
26 | // Detect Issues
27 | Utils.Assert(0 <= value && value < 16, "metadata out of range.", 1);
28 |
29 | // Clamp the Value
30 | return (byte)(value & 0x0F);
31 | }
32 |
33 | public static Block[] getBlockArray(BlockData[] input)
34 | {
35 | if (input == null) { return null; }
36 |
37 | Block[] output = new Block[input.length];
38 | for (int i = 0; i < input.length; i++)
39 | {
40 | if (input[i] != null)
41 | {
42 | output[i] = input[i].Block;
43 | }
44 | }
45 |
46 | return output;
47 | }
48 |
49 | public static byte[] getMetadataArray(BlockData[] input)
50 | {
51 | if (input == null) { return null; }
52 |
53 | byte[] output = new byte[input.length];
54 | for (int i = 0; i < input.length; i++)
55 | {
56 | if (input[i] != null)
57 | {
58 | output[i] = input[i].Metadata;
59 | }
60 | }
61 |
62 | return output;
63 | }
64 |
65 | // #endregion
66 |
67 | // #region Instance Data
68 |
69 | public final Block Block;
70 | public final byte Metadata;
71 |
72 | // #endregion
73 |
74 | // #region Properties
75 |
76 | public boolean IsEmpty()
77 | {
78 | return (this.Block == Blx.air || this.Block == null) && this.Metadata == 0;
79 | }
80 |
81 | // #endregion
82 |
83 | // #region Constructors
84 |
85 | public BlockData(Block block)
86 | {
87 | this(block, 0);
88 | }
89 |
90 | public BlockData(Block block, int metadata)
91 | {
92 | this(block, FixMetadata(metadata));
93 | }
94 |
95 | public BlockData(Block block, byte metadata)
96 | {
97 | if (block == null)
98 | {
99 | block = Blx.air;
100 | }
101 |
102 | this.Block = block;
103 | this.Metadata = FixMetadata(metadata);
104 | }
105 |
106 | // #endregion
107 |
108 | // #region Methods
109 |
110 | public BlockData setBlock(Block block)
111 | {
112 | return new BlockData(block, this.Metadata);
113 | }
114 |
115 | public BlockData setMetadata(int metadata)
116 | {
117 | return new BlockData(this.Block, metadata);
118 | }
119 |
120 | // #endregion
121 |
122 | // #region ToString Support
123 |
124 | @Override
125 | public String toString()
126 | {
127 | return toString(this.Block, this.Metadata);
128 | }
129 |
130 | public static String toString(Block block, int metadata)
131 | {
132 | String ret = null;
133 |
134 | try
135 | {
136 | ret = net.minecraft.block.Block.blockRegistry.getNameForObject(block);
137 | }
138 | catch (Exception ignore)
139 | { /* do nothing */}
140 |
141 | if (ret == null || ret.length() < 1)
142 | {
143 | ret = Integer.toString(net.minecraft.block.Block.getIdFromBlock(block));
144 | }
145 |
146 | if (ret != null && ret.toLowerCase().startsWith("minecraft:"))
147 | {
148 | ret = ret.substring(10);
149 | }
150 |
151 | metadata = FixMetadata(metadata);
152 |
153 | if (metadata != 0)
154 | {
155 | ret += ":" + metadata;
156 | }
157 |
158 | return ret;
159 | }
160 |
161 | @Override
162 | public int hashCode()
163 | {
164 | return toString().hashCode();
165 | }
166 |
167 | // #endregion
168 |
169 | // #region Parse Support
170 |
171 | public static BlockData Parse(String value)
172 | {
173 | return Parse(value, BlockData.Empty);
174 | }
175 |
176 | public static BlockData Parse(String value, BlockData fallbackBlock)
177 | {
178 | Block block = net.minecraft.block.Block.getBlockFromName(value);
179 |
180 | if (block != null)
181 | {
182 | // Block was parsable, it does not contain metadata.
183 | return new BlockData(block, 0);
184 | }
185 | else
186 | {
187 | int sIndex = value.lastIndexOf(':');
188 | if (sIndex >= 0)
189 | {
190 | try
191 | {
192 | String blockString = value.substring(0, sIndex);
193 | String metaString = value.substring(sIndex + 1);
194 |
195 | block = net.minecraft.block.Block.getBlockFromName(blockString);
196 | int metadata = Integer.parseInt(metaString);
197 |
198 | if (block != null)
199 | {
200 | return new BlockData(block, metadata);
201 | }
202 | }
203 | catch (Throwable ignore)
204 | { /* do nothing */ }
205 | }
206 |
207 | Utils.Assert(false, "Unable to parse BlockData: " + value, 1);
208 | return fallbackBlock;
209 | }
210 | }
211 |
212 | // #endregion
213 | }
214 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/BlockEntry.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod;
8 |
9 | import net.minecraft.block.Block;
10 | import net.minecraft.util.WeightedRandom;
11 | import newBiospheresMod.Helpers.Blx;
12 | import newBiospheresMod.Helpers.Utils;
13 |
14 | public class BlockEntry extends WeightedRandom.Item
15 | {
16 | public final BlockData Block;
17 |
18 | public BlockEntry(Block block, int metadata, int weight)
19 | {
20 | this(new BlockData(block, metadata), weight);
21 | }
22 |
23 | public BlockEntry(BlockData block, int weight)
24 | {
25 | super(weight);
26 |
27 | if (block == null)
28 | { block = BlockData.Empty; }
29 |
30 | this.Block = block;
31 | }
32 |
33 | @Override
34 | public String toString()
35 | {
36 | return this.Block + ", " + this.itemWeight;
37 | }
38 |
39 | public static BlockEntry Parse(String input)
40 | {
41 | if (input != null && input.length() > 0)
42 | {
43 | try
44 | {
45 | int idx = input.lastIndexOf(",");
46 |
47 | String blockName = null;
48 | String weight = null;
49 |
50 | if (idx > 0)
51 | {
52 | blockName = input.substring(0, idx).trim();
53 | weight = input.substring(idx + 1).trim();
54 | }
55 | else
56 | {
57 | blockName = input;
58 | }
59 |
60 | if (blockName == null || blockName.length() < 1)
61 | {
62 | blockName = "air";
63 | }
64 |
65 | if (weight == null || weight.length() < 1)
66 | {
67 | weight = "10";
68 | }
69 |
70 | int iWeight = Integer.parseInt(weight);
71 | if (iWeight < 0)
72 | {
73 | iWeight = 0;
74 | }
75 |
76 | return new BlockEntry(BlockData.Parse(blockName), iWeight);
77 | }
78 | catch (Throwable ignore)
79 | {
80 | // do nothing
81 | }
82 | }
83 |
84 | return new BlockEntry(BlockData.Empty, 0);
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/Configuration/Categories.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod.Configuration;
8 |
9 | public class Categories
10 | {
11 | public static final String General = "general";
12 | public static final String Biospheres = "biospheres";
13 | public static final String OreOrbs = "oreorbs";
14 | // public static final String OreOrbOreBlocks = "oreorboreblocks";
15 | public static final String BiomeWeights = "biomeweights";
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/Configuration/ConfigScreens.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod.Configuration;
8 |
9 | import net.minecraft.client.gui.GuiScreen;
10 | import net.minecraftforge.common.config.ConfigElement;
11 |
12 | public class ConfigScreens
13 | {
14 | public static class GeneralGuiConfigTab extends SimpleGuiConfigTab
15 | {
16 | private static final String Category = Categories.General;
17 |
18 | public GeneralGuiConfigTab(GuiScreen parent)
19 | {
20 | super(parent, Category);
21 | }
22 |
23 | public GeneralGuiConfigTab(GuiScreen parent, IGuiConfigTabProvider provider)
24 | {
25 | super(parent, provider, Category);
26 | }
27 | }
28 |
29 | public static class BiospheresGuiConfigTab extends SimpleGuiConfigTab
30 | {
31 | private static final String Category = Categories.Biospheres;
32 |
33 | public BiospheresGuiConfigTab(GuiScreen parent)
34 | {
35 | super(parent, Category);
36 | }
37 |
38 | public BiospheresGuiConfigTab(GuiScreen parent, IGuiConfigTabProvider provider)
39 | {
40 | super(parent, provider, Category);
41 | }
42 | }
43 |
44 | public static class OreOrbsGuiConfigTab extends SimpleGuiConfigTab
45 | {
46 | private static final String Category = Categories.OreOrbs;
47 |
48 | public OreOrbsGuiConfigTab(GuiScreen parent)
49 | {
50 | super(parent, Category);
51 | }
52 |
53 | public OreOrbsGuiConfigTab(GuiScreen parent, IGuiConfigTabProvider provider)
54 | {
55 | super(parent, provider, Category);
56 | }
57 | }
58 |
59 | // public static class OreOrbOreBlocksGuiConfigTab extends SimpleGuiConfigTab
60 | // {
61 | // private static final String Category = Categories.OreOrbOreBlocks;
62 | //
63 | // public OreOrbOreBlocksGuiConfigTab(GuiScreen parent)
64 | // {
65 | // super(parent, Category);
66 | // }
67 | //
68 | // public OreOrbOreBlocksGuiConfigTab(GuiScreen parent, IGuiConfigTabProvider provider)
69 | // {
70 | // super(parent, provider, Category);
71 | // }
72 | // }
73 |
74 | public static class BiomeWeightsGuiConfigTab extends SimpleGuiConfigTab
75 | {
76 | private static final String Category = Categories.BiomeWeights;
77 |
78 | public BiomeWeightsGuiConfigTab(GuiScreen parent)
79 | {
80 | super(parent, Category);
81 | }
82 |
83 | public BiomeWeightsGuiConfigTab(GuiScreen parent, IGuiConfigTabProvider provider)
84 | {
85 | super(parent, provider, Category);
86 | }
87 | }
88 |
89 | private static abstract class SimpleGuiConfigTab extends GuiConfigTab
90 | {
91 | public SimpleGuiConfigTab(GuiScreen parent, String category)
92 | {
93 | this(parent, ModGuiConfigTabProvider.SingletonInstance, category);
94 | }
95 |
96 | public SimpleGuiConfigTab(GuiScreen parent, IGuiConfigTabProvider provider, String category)
97 | {
98 | super(parent, provider, category,
99 | new ConfigElement(ModConfig.getConfigFile().getCategory(category)).getChildElements());
100 | }
101 | }
102 |
103 | }
104 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/Configuration/CustomWorldData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod.Configuration;
8 |
9 | import io.netty.util.internal.chmv8.ConcurrentHashMapV8;
10 |
11 | import java.util.ArrayList;
12 | import java.util.List;
13 | import java.util.Map;
14 | import java.util.Set;
15 |
16 | import net.minecraft.block.Block;
17 | import net.minecraft.nbt.NBTTagCompound;
18 | import net.minecraft.world.World;
19 | import net.minecraft.world.WorldSavedData;
20 | import net.minecraft.world.storage.MapStorage;
21 | import newBiospheresMod.BlockData;
22 | import newBiospheresMod.Helpers.Blx;
23 | import newBiospheresMod.Helpers.ModConsts;
24 | import newBiospheresMod.Helpers.Utils;
25 |
26 | public class CustomWorldData extends WorldSavedData
27 | {
28 | public final String ContainerName;
29 | private final Map Data = new ConcurrentHashMapV8();
30 |
31 | private boolean isNew = true;
32 | private boolean makeNotNewTriggered = false;
33 |
34 | public boolean getIsNew()
35 | {
36 | return isNew;
37 | }
38 |
39 | public void MakeNotNew()
40 | {
41 | makeNotNewTriggered = true;
42 | }
43 |
44 | public Set Keys()
45 | {
46 | return Data.keySet();
47 | }
48 |
49 | public boolean ContainsKey(String keyName)
50 | {
51 | return Data.containsKey(keyName);
52 | }
53 |
54 | public void put(String keyName, String value)
55 | {
56 | String prevValue = Data.put(keyName, value);
57 |
58 | if (prevValue == null ? value != null : !prevValue.equals(value))
59 | {
60 | markDirty();
61 | }
62 | }
63 |
64 | public String get(String keyName)
65 | {
66 | if (ContainsKey(keyName)) { return Data.get(keyName); }
67 |
68 | return null;
69 | }
70 |
71 | public String RemoveKey(String keyName)
72 | {
73 | String returnValue = Data.remove(keyName);
74 |
75 | if (returnValue != null)
76 | {
77 | markDirty();
78 | }
79 |
80 | return returnValue;
81 | }
82 |
83 | public CustomWorldData(String containerName)
84 | {
85 | super(containerName);
86 | this.ContainerName = containerName;
87 | }
88 |
89 | public static CustomWorldData FromWorld(World world)
90 | {
91 | return FromWorld(world, ModConsts.ModId.toLowerCase().replace(" ", ""));
92 | }
93 |
94 | public static CustomWorldData FromWorld(World world, String containerName)
95 | {
96 | // Retrieves the CustomWorldData instance for the given world, creating it if necessary
97 | MapStorage storage = world.mapStorage;
98 | CustomWorldData result = (CustomWorldData)storage.loadData(CustomWorldData.class, containerName);
99 | if (result == null)
100 | {
101 | result = new CustomWorldData(containerName);
102 | storage.setData(containerName, result);
103 | }
104 | else
105 | {
106 | // returned object is not new, it was loaded.
107 | result.MakeNotNew();
108 | }
109 |
110 | return result;
111 | }
112 |
113 | private static List GetNbtTagKeys(NBTTagCompound nbtTag)
114 | {
115 | List keys = new ArrayList();
116 |
117 | if (nbtTag != null)
118 | {
119 | for (Object _key: nbtTag.func_150296_c())
120 | {
121 | String key = null;
122 |
123 | if (_key != null)
124 | {
125 | if (_key instanceof String)
126 | {
127 | key = (String)_key;
128 | }
129 | else
130 | {
131 | key = _key.toString();
132 | }
133 | }
134 |
135 | if (key != null)
136 | {
137 | keys.add(key);
138 | }
139 | }
140 | }
141 |
142 | return keys;
143 | }
144 |
145 | @Override
146 | public void readFromNBT(NBTTagCompound nbtTag)
147 | {
148 | Data.clear();
149 |
150 | if (nbtTag != null)
151 | {
152 | for (String key: GetNbtTagKeys(nbtTag))
153 | {
154 | // System.out.println("LOADING: " + key);
155 | this.put(key, nbtTag.getString(key));
156 | }
157 | }
158 | }
159 |
160 | @Override
161 | public void writeToNBT(NBTTagCompound nbtTag)
162 | {
163 | if (nbtTag != null)
164 | {
165 | for (String key: GetNbtTagKeys(nbtTag))
166 | {
167 | nbtTag.removeTag(key);
168 | }
169 |
170 | for (String key: Keys())
171 | {
172 | // System.out.println("SAVING: " + key);
173 | nbtTag.setString(key, Data.get(key));
174 | }
175 |
176 | if (makeNotNewTriggered)
177 | {
178 | isNew = false;
179 | makeNotNewTriggered = false;
180 | }
181 | }
182 | }
183 |
184 | public void put(String key, boolean value)
185 | {
186 | put(key, Boolean.toString(value));
187 | }
188 |
189 | public void put(String key, int value)
190 | {
191 | put(key, Integer.toString(value));
192 | }
193 |
194 | public void put(String key, float value)
195 | {
196 | put(key, Float.toString(value));
197 | }
198 |
199 | public void put(String key, double value)
200 | {
201 | put(key, Double.toString(value));
202 | }
203 |
204 | public void put(String key, BlockData value)
205 | {
206 | put(key, value.toString());
207 | }
208 |
209 | public boolean getBool(String key)
210 | {
211 | return getBool(key, false);
212 | }
213 |
214 | public boolean getBool(String key, boolean defaultValue)
215 | {
216 | if (ContainsKey(key))
217 | {
218 | try
219 | {
220 | return Boolean.parseBoolean(get(key));
221 | }
222 | catch (Throwable ignore)
223 | { /* do nothing */}
224 | }
225 |
226 | return defaultValue;
227 | }
228 |
229 | public int getInt(String key)
230 | {
231 | return getInt(key, 0);
232 | }
233 |
234 | public int getInt(String key, int defaultValue)
235 | {
236 | if (ContainsKey(key))
237 | {
238 | try
239 | {
240 | return Integer.parseInt(get(key));
241 | }
242 | catch (Throwable ignore)
243 | { /* do nothing */}
244 | }
245 |
246 | return defaultValue;
247 | }
248 |
249 | public double getDouble(String key)
250 | {
251 | return getDouble(key, 0);
252 | }
253 |
254 | public double getDouble(String key, double defaultValue)
255 | {
256 | if (ContainsKey(key))
257 | {
258 | try
259 | {
260 | return Double.parseDouble(get(key));
261 | }
262 | catch (Throwable ignore)
263 | { /* do nothing */}
264 | }
265 |
266 | return defaultValue;
267 | }
268 |
269 | public float getFloat(String key)
270 | {
271 | return getFloat(key, 0);
272 | }
273 |
274 | public float getFloat(String key, float defaultValue)
275 | {
276 | if (ContainsKey(key))
277 | {
278 | try
279 | {
280 | return Float.parseFloat(get(key));
281 | }
282 | catch (Throwable ignore)
283 | { /* do nothing */}
284 | }
285 |
286 | return defaultValue;
287 | }
288 |
289 | public BlockData getBlock(String key)
290 | {
291 | return getBlock(key, BlockData.Empty);
292 | }
293 |
294 | public BlockData getBlock(String key, BlockData defaultValue)
295 | {
296 | if (ContainsKey(key))
297 | {
298 | try
299 | {
300 | return BlockData.Parse(get(key), defaultValue);
301 | }
302 | catch (Throwable ignore)
303 | { /* do nothing */}
304 | }
305 |
306 | return defaultValue;
307 | }
308 |
309 | }
310 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/Configuration/GuiConfigTab.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod.Configuration;
8 |
9 | import java.util.HashMap;
10 | import java.util.List;
11 | import java.util.Map;
12 | import java.util.Random;
13 |
14 | import net.minecraft.client.gui.GuiButton;
15 | import net.minecraft.client.gui.GuiScreen;
16 | import newBiospheresMod.Helpers.ModConsts;
17 | import cpw.mods.fml.client.config.GuiConfig;
18 | import cpw.mods.fml.client.config.IConfigElement;
19 |
20 | public class GuiConfigTab extends GuiConfig
21 | {
22 | private static final Random Rnd = new Random(System.currentTimeMillis());
23 |
24 | private final IGuiConfigTabProvider Provider;
25 | private final String Category;
26 | private Map TabMap;
27 |
28 | public GuiConfigTab(GuiScreen parent, IGuiConfigTabProvider provider, String category,
29 | List childElements)
30 | {
31 | super(
32 | parent,
33 | childElements,
34 | ModConsts.ModId, provider.getAllRequireWorldRestart(), provider.getAllRequireMcRestart(),
35 | provider.getTitle());
36 |
37 | this.Provider = provider;
38 | this.Category = category;
39 | }
40 |
41 | private int getUniqueButtonId()
42 | {
43 | int id = 0;
44 | boolean keepTrying = true;
45 | while (keepTrying)
46 | {
47 | id = 600000 + Math.abs(Rnd.nextInt(400000));
48 | keepTrying = false;
49 |
50 | if (this.buttonList != null)
51 | {
52 | for (Object btn: this.buttonList)
53 | {
54 | if (btn != null && btn instanceof GuiButton)
55 | {
56 | if (((GuiButton)btn).id == id)
57 | {
58 | keepTrying = true;
59 | break;
60 | }
61 | }
62 | }
63 | }
64 | }
65 | return id;
66 | }
67 |
68 | @Override
69 | public void initGui()
70 | {
71 | if (TabMap != null)
72 | {
73 | this.buttonList.removeAll(TabMap.keySet());
74 | TabMap.clear();
75 | }
76 | else
77 | {
78 | TabMap = new HashMap();
79 | }
80 |
81 | int x = 8;
82 | int y = 27;
83 | int height = 16;
84 |
85 | for (GuiConfigTabEntry tab: Provider.getTabs())
86 | {
87 | String text = tab.Title;
88 | int width = this.fontRendererObj.getStringWidth(text) + 16;
89 |
90 | GuiButton button = new GuiButton(getUniqueButtonId(), x, y, width, height, text);
91 | if (tab.Category.equals(this.Category))
92 | {
93 | button.packedFGColour = 255 << 8;
94 | }
95 |
96 | this.TabMap.put(button, tab);
97 | this.buttonList.add(button);
98 |
99 | x += (width + 8);
100 | }
101 |
102 | super.initGui();
103 | this.entryList.top = y + height;
104 | }
105 |
106 | @Override
107 | protected void actionPerformed(GuiButton guiButton)
108 | {
109 | super.actionPerformed(guiButton);
110 |
111 | if (guiButton != null)
112 | {
113 | if (TabMap.containsKey(guiButton))
114 | {
115 | NavigateTo(TabMap.get(guiButton));
116 | }
117 | }
118 | }
119 |
120 | public void NavigateTo(GuiConfigTabEntry entry)
121 | {
122 | if (entry != null && this.Provider != null)
123 | {
124 | if (!entry.Category.equals(this.Category))
125 | {
126 | this.entryList.saveConfigElements();
127 | mc.displayGuiScreen(entry.getScreen.func(this.parentScreen, this.Provider));
128 | }
129 | }
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/Configuration/GuiConfigTabEntry.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod.Configuration;
8 |
9 | import net.minecraft.client.gui.GuiScreen;
10 | import newBiospheresMod.Helpers.Func2;
11 |
12 | public class GuiConfigTabEntry
13 | {
14 | public final String Category;
15 | public final String Title;
16 |
17 | public final Func2 getScreen;
18 |
19 | public GuiConfigTabEntry(String category, String title, Func2 getScreen)
20 | {
21 | this.Category = category;
22 | this.Title = title;
23 | this.getScreen = getScreen;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/Configuration/IGuiConfigTabProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod.Configuration;
8 |
9 | public interface IGuiConfigTabProvider
10 | {
11 | String getTitle();
12 |
13 | boolean getAllRequireWorldRestart();
14 |
15 | boolean getAllRequireMcRestart();
16 |
17 | Iterable getTabs();
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/Configuration/ModConfigGuiFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod.Configuration;
8 |
9 | import java.util.Set;
10 |
11 | import net.minecraft.client.Minecraft;
12 | import net.minecraft.client.gui.GuiScreen;
13 | import cpw.mods.fml.client.IModGuiFactory;
14 |
15 | public class ModConfigGuiFactory implements IModGuiFactory
16 | {
17 | @Override
18 | public void initialize(Minecraft minecraftInstance)
19 | {
20 | /* do nothing */
21 | }
22 |
23 | @Override
24 | public Class extends GuiScreen> mainConfigGuiClass()
25 | {
26 | return ConfigScreens.GeneralGuiConfigTab.class;
27 | }
28 |
29 | @Override
30 | public Set runtimeGuiCategories()
31 | {
32 | return null;
33 | }
34 |
35 | @Override
36 | public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element)
37 | {
38 | return null;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/Configuration/ModGuiConfigTabProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod.Configuration;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | import net.minecraft.client.gui.GuiScreen;
13 | import newBiospheresMod.Helpers.Func2;
14 | import newBiospheresMod.Helpers.ModConsts;
15 |
16 | public class ModGuiConfigTabProvider implements IGuiConfigTabProvider
17 | {
18 | public static final ModGuiConfigTabProvider SingletonInstance = new ModGuiConfigTabProvider();
19 |
20 | private ModGuiConfigTabProvider()
21 | {
22 | // hidden
23 | }
24 |
25 | @Override
26 | public String getTitle()
27 | {
28 | return ModConsts.ModId;
29 | }
30 |
31 | @Override
32 | public boolean getAllRequireWorldRestart()
33 | {
34 | return false;
35 | }
36 |
37 | @Override
38 | public boolean getAllRequireMcRestart()
39 | {
40 | return false;
41 | }
42 |
43 | @Override
44 | public Iterable getTabs()
45 | {
46 | List tabs = new ArrayList();
47 |
48 | tabs.add(new GuiConfigTabEntry(Categories.General, "General",
49 | new Func2()
50 | {
51 | @Override
52 | public GuiScreen func(GuiScreen parent, IGuiConfigTabProvider provider)
53 | {
54 | return new ConfigScreens.GeneralGuiConfigTab(parent, provider);
55 | }
56 | }));
57 |
58 | tabs.add(new GuiConfigTabEntry(Categories.Biospheres, "Biospheres",
59 | new Func2()
60 | {
61 | @Override
62 | public GuiScreen func(GuiScreen parent, IGuiConfigTabProvider provider)
63 | {
64 | return new ConfigScreens.BiospheresGuiConfigTab(parent, provider);
65 | }
66 | }));
67 |
68 | tabs.add(new GuiConfigTabEntry(Categories.OreOrbs, "Ore Orbs",
69 | new Func2()
70 | {
71 | @Override
72 | public GuiScreen func(GuiScreen parent, IGuiConfigTabProvider provider)
73 | {
74 | return new ConfigScreens.OreOrbsGuiConfigTab(parent, provider);
75 | }
76 | }));
77 |
78 | // tabs.add(new GuiConfigTabEntry(Categories.OreOrbOreBlocks, "Ore Orbs 2",
79 | // new Func2()
80 | // {
81 | // @Override
82 | // public GuiScreen func(GuiScreen parent, IGuiConfigTabProvider provider)
83 | // {
84 | // return new ConfigScreens.OreOrbOreBlocksGuiConfigTab(parent, provider);
85 | // }
86 | // }));
87 |
88 | tabs.add(new GuiConfigTabEntry(Categories.BiomeWeights, "Biomes",
89 | new Func2()
90 | {
91 | @Override
92 | public GuiScreen func(GuiScreen parent, IGuiConfigTabProvider provider)
93 | {
94 | return new ConfigScreens.BiomeWeightsGuiConfigTab(parent, provider);
95 | }
96 | }));
97 |
98 | return tabs;
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/Helpers/AvgCalc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod.Helpers;
8 |
9 | public class AvgCalc
10 | {
11 | private double average = 0d;
12 | private double count = 0d;
13 |
14 | public int getCount()
15 | {
16 | return (int)count;
17 | }
18 |
19 | public double getAverage()
20 | {
21 | return average;
22 | }
23 |
24 | public void addValue(double amount)
25 | {
26 | double newAverage = average * count;
27 | average = (newAverage + amount) / (++count);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/Helpers/Creator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod.Helpers;
8 |
9 | public abstract class Creator
10 | {
11 | public abstract T create();
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/Helpers/Func.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod.Helpers;
8 |
9 | public abstract class Func
10 | {
11 | public abstract Toutput func(Tinput value);
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/Helpers/Func2.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod.Helpers;
8 |
9 | public abstract class Func2
10 | {
11 | public abstract Toutput func(Tinput1 value1, Tinput2 value2);
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/Helpers/IKeyProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod.Helpers;
8 |
9 | public interface IKeyProvider
10 | {
11 | Object provideKey(T item);
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/newBiospheresMod/Helpers/LruCacheList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
3 | * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
4 | * Sam Hocevar. See http://www.wtfpl.net/ for more details.
5 | */
6 |
7 | package newBiospheresMod.Helpers;
8 |
9 | import java.util.concurrent.ConcurrentMap;
10 |
11 | import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
12 |
13 | public class LruCacheList
14 | {
15 | // apparently this library doesn't like using "null" as a key, which is stupid. So, let's use this random object
16 | // instead.
17 | private static final Object nullKeySubstitute = new Object();
18 |
19 | public final int TotalItems;
20 | public final IKeyProvider KeyProvider;
21 |
22 | private final ConcurrentMap