Skip to content

Commit 6f21ff4

Browse files
committed
Make the turbine validation require there to be at least one blade and vent (mekanism/Mekanism-Feature-Requests#668)
1 parent 29a5777 commit 6f21ff4

File tree

6 files changed

+16
-3
lines changed

6 files changed

+16
-3
lines changed

src/datagen/generated/mekanismgenerators/.cache/de34ee0556eec16c961269bcb7ec3070f0579cfd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datagen/generated/mekanismgenerators/assets/mekanismgenerators/lang/en_ud.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datagen/generated/mekanismgenerators/assets/mekanismgenerators/lang/en_us.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datagen/generators/java/mekanism/generators/client/GeneratorsLangProvider.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ private void addMisc() {
161161
add(GeneratorsLang.TURBINE_INVALID_BAD_COMPLEX, "Couldn't form, found improperly placed Rotational Complex at %1$s. Complex must be centered above Turbine Rotors.");
162162
add(GeneratorsLang.TURBINE_INVALID_BAD_ROTOR, "Couldn't form, found invalid Turbine Rotor at %1$s. Turbine Rotors must be centered below Rotational Complex.");
163163
add(GeneratorsLang.TURBINE_INVALID_BAD_ROTORS, "Couldn't form, invalid Turbine Rotor arrangement.");
164+
add(GeneratorsLang.TURBINE_INVALID_NO_BLADES, "Couldn't form, no blades are present on the Turbine Rotor.");
164165
add(GeneratorsLang.TURBINE_INVALID_CONDENSER_BELOW_COMPLEX, "Couldn't form, found improperly placed Saturating Condenser at %1$s. Saturating Condensers must be above Pressure Disperser layer.");
165166
add(GeneratorsLang.TURBINE_INVALID_EVEN_LENGTH, "Couldn't form, width and length of structure must be odd.");
166167
add(GeneratorsLang.TURBINE_INVALID_MALFORMED_COILS, "Couldn't form, Electromagnetic Coil arrangement is malformed. Coils must be connected to Rotational Complex and adjacently connected.");
@@ -170,6 +171,7 @@ private void addMisc() {
170171
add(GeneratorsLang.TURBINE_INVALID_ROTORS_NOT_CONTIGUOUS, "Couldn't form, rotors are invalid (non-contiguous).");
171172
add(GeneratorsLang.TURBINE_INVALID_TOO_NARROW, "Couldn't form, structure is too narrow to support turbine size.");
172173
add(GeneratorsLang.TURBINE_INVALID_VENT_BELOW_COMPLEX, "Couldn't form, found a Turbine Vent below Pressure Disperser layer. Vents must be at or above vertical position of disperser layer.");
174+
add(GeneratorsLang.TURBINE_INVALID_MISSING_VENTS, "Couldn't form, no Turbine Vents present.");
173175
add(GeneratorsLang.TURBINE_INVALID_MISSING_COILS, "Couldn't form, no Electromagnetic Coils present.");
174176
add(GeneratorsLang.TURBINE_INVALID_MISSING_DISPERSERS, "Couldn't form, no Pressure Dispersers present.");
175177

src/generators/java/mekanism/generators/common/GeneratorsLang.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public enum GeneratorsLang implements ILangEntry {
5252
TURBINE_INVALID_BAD_COMPLEX("turbine", "invalid_bad_complex"),
5353
TURBINE_INVALID_BAD_ROTOR("turbine", "invalid_bad_rotor"),
5454
TURBINE_INVALID_BAD_ROTORS("turbine", "invalid_bad_rotors"),
55+
TURBINE_INVALID_NO_BLADES("turbine", "invalid_missing_blades"),
5556
TURBINE_INVALID_CONDENSER_BELOW_COMPLEX("turbine", "invalid_condenser_below_complex"),
5657
TURBINE_INVALID_EVEN_LENGTH("turbine", "invalid_even_length"),
5758
TURBINE_INVALID_MALFORMED_COILS("turbine", "invalid_malformed_coils"),
@@ -61,6 +62,7 @@ public enum GeneratorsLang implements ILangEntry {
6162
TURBINE_INVALID_ROTORS_NOT_CONTIGUOUS("turbine", "invalid_rotors_not_contiguous"),
6263
TURBINE_INVALID_TOO_NARROW("turbine", "invalid_too_narrow"),
6364
TURBINE_INVALID_VENT_BELOW_COMPLEX("turbine", "invalid_vent_below_complex"),
65+
TURBINE_INVALID_MISSING_VENTS("turbine", "invalid_missing_vents"),
6466
TURBINE_INVALID_MISSING_COILS("turbine", "invalid_missing_coils"),
6567
TURBINE_INVALID_MISSING_DISPERSERS("turbine", "invalid_missing_dispersers"),
6668

src/generators/java/mekanism/generators/common/content/turbine/TurbineValidator.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ public FormationResult postcheck(TurbineMultiblockData structure, Long2ObjectMap
163163
// If there are any rotors left over, they are in the wrong place in the structure
164164
if (!turbines.isEmpty()) {
165165
return FormationResult.fail(GeneratorsLang.TURBINE_INVALID_BAD_ROTORS);
166+
} else if (blades == 0) {
167+
return FormationResult.fail(GeneratorsLang.TURBINE_INVALID_NO_BLADES);
166168
}
167169

168170
// Update the structure with number of blades found on rotors
@@ -185,6 +187,9 @@ public FormationResult postcheck(TurbineMultiblockData structure, Long2ObjectMap
185187
ventData.add(new VentData(coord, getSide(coord)));
186188
}
187189
}
190+
if (ventData.isEmpty()) {
191+
return FormationResult.fail(GeneratorsLang.TURBINE_INVALID_MISSING_VENTS);
192+
}
188193
structure.updateVentData(ventData);
189194
structure.lowerVolume = structure.length() * structure.width() * turbineHeight;
190195
structure.complex = complex;

0 commit comments

Comments
 (0)