Skip to content

Commit b099e92

Browse files
committed
Merge remote-tracking branch 'origin/re/1.21-with-love' into re/1.21-with-love
2 parents f017522 + 6312f92 commit b099e92

File tree

3 files changed

+17
-25
lines changed

3 files changed

+17
-25
lines changed

src/main/java/com/gregtechceu/gtceu/data/recipe/misc/WoodMachineRecipes.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,14 @@ private static List<WoodTypeEntry> getDefaultEntries() {
311311
.build());
312312
}
313313
if (CUSTOM_ENTRIES == null) {
314-
CUSTOM_ENTRIES = new ArrayList<WoodTypeEntry>();
315-
var evt = new RegisterWoodsKubeEvent();
316-
GTCEuStartupEvents.REGISTER_WOODS.post(evt);
317-
CUSTOM_ENTRIES = new ArrayList<WoodTypeEntry>(evt.woods);
314+
if (GTCEu.Mods.isKubeJSLoaded()) {
315+
CUSTOM_ENTRIES = new ArrayList<WoodTypeEntry>();
316+
var evt = new RegisterWoodsKubeEvent();
317+
GTCEuStartupEvents.REGISTER_WOODS.post(evt);
318+
CUSTOM_ENTRIES = new ArrayList<WoodTypeEntry>(evt.woods);
319+
} else {
320+
CUSTOM_ENTRIES = List.of();
321+
}
318322
}
319323

320324
List<WoodTypeEntry> entries = new ArrayList<WoodTypeEntry>();

src/main/java/com/gregtechceu/gtceu/integration/kjs/events/RegisterWoodsKubeEvent.java

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,6 @@ public class Wrapped {
3636
this.woodName = woodName;
3737
}
3838

39-
// public Wrapped id(KubeResourceLocation _id) {
40-
// String namespace = id.wrapped().getNamespace();
41-
// // if (namespace.equals("kubejs")) {
42-
// // namespace = this.type.id.getNamespace();
43-
// // }
44-
// var idWithoutType = ResourceLocation.fromNamespaceAndPath(namespace,
45-
// _id.wrapped().getPath());
46-
// var id = idWithoutType.withPrefix(this.type.id.getPath() + "/");
47-
// return this;
48-
// }
49-
5039
private String _recipeId;
5140
private Item _plank;
5241
private Item _strippedLog;
@@ -236,7 +225,7 @@ public WoodTypeEntry toEntry() throws IllegalArgumentException {
236225
throw new IllegalArgumentException("Need a pressurePlate");
237226
}
238227

239-
var builder = new WoodTypeEntry.Builder(this.modId, this.woodName)
228+
return new WoodTypeEntry.Builder(this.modId, this.woodName)
240229
.planks(this._plank, this._recipeId + "_planks")
241230
.log(Items.OAK_LOG).removeCharcoalRecipe()
242231
.strippedLog(this._strippedLog)
@@ -256,14 +245,14 @@ public WoodTypeEntry toEntry() throws IllegalArgumentException {
256245
.pressurePlate(this._pressurePlate, this._recipeId + "_pressure_plate")
257246
.registerAllMaterialInfo()
258247
.build();
259-
return builder;
260248
}
261249

262-
boolean wasRegisted = false;
250+
boolean wasRegistered = false;
263251

264252
@HideFromJS
265253
public void register() {
266-
if (!this.wasRegisted) {
254+
if (!this.wasRegistered) {
255+
this.wasRegistered = true;
267256
try {
268257
woods.add(this.toEntry());
269258
} catch (Exception e) {
@@ -273,7 +262,7 @@ public void register() {
273262
} else
274263
GTCEu.LOGGER.warn("Tried registering a wood type twice!");
275264
}
276-
};
265+
}
277266

278267
public Wrapped register(String modId, String woodName) {
279268
var wrap = new Wrapped(modId, woodName);

src/test/java/com/gregtechceu/gtceu/api/recipe/ingredient/IntProviderIngredientTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import net.minecraft.world.item.Items;
2626
import net.minecraft.world.level.block.entity.BlockEntity;
2727
import net.neoforged.neoforge.common.crafting.SizedIngredient;
28-
import net.neoforged.neoforge.gametest.GameTestHolder;
29-
import net.neoforged.neoforge.gametest.PrefixGameTestTemplate;
3028

3129
import lombok.Getter;
3230

@@ -39,8 +37,9 @@
3937
* Rolls of 0
4038
* Forced rolls of 0 breaking recipes
4139
*/
42-
@PrefixGameTestTemplate(false)
43-
@GameTestHolder(GTCEu.MOD_ID)
40+
// @PrefixGameTestTemplate(false)
41+
// @GameTestHolder(GTCEu.MOD_ID)
42+
// Gametests blocked until gtm#4326 is fixed
4443
public class IntProviderIngredientTest {
4544

4645
private static GTRecipeType CR_RECIPE_TYPE;
@@ -246,7 +245,7 @@ public static void rangedIngredientGetStacksTest(GameTestHelper helper) {
246245
// Test for singleblock machine with ranged item input.
247246
// Forcibly sabotages the first recipe run, setting its output amount to 0 to ensure that doesn't break the recipe.
248247
// This is specifically a test for #3593 / #3594
249-
@GameTest(template = "singleblock_charged_cr", batch = "RangedIngredients")
248+
@GameTest(template = "singleblock_charged_cr", batch = "RangedIngredients", required = false)
250249
public static void singleblockRangedItemOutputSabotaged(GameTestHelper helper) {
251250
SimpleTieredMachine machine = (SimpleTieredMachine) getMetaMachine(
252251
helper.getBlockEntity(new BlockPos(0, 1, 0)));

0 commit comments

Comments
 (0)