Skip to content

Commit 984ca26

Browse files
committed
New recipe datagen, conditional WIP code, bump forge
- Implements new conditional recipe loading for vanilla recipes: change common config to enable/disable. Enabled by default. - Update compact crafting recipes to match alpha-2 format.
1 parent e36fc30 commit 984ca26

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+280
-236
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx3G
44
org.gradle.daemon=false
55

66
minecraft_version=1.16.4
7-
forge_version=35.0.18
7+
forge_version=35.1.13
88
mappings_version=20201028-1.16.3
99
mod_version=4.0.0-alpha.4
1010

recipepacks/compact-crafting/data/compactmachines/miniaturization/large_machine.json

Lines changed: 0 additions & 62 deletions
This file was deleted.

recipepacks/compact-crafting/data/compactmachines/miniaturization/giant_machine.json renamed to recipepacks/compact-crafting/data/compactmachines/recipes/giant_machine.json

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,15 @@
33
"recipeSize": 5,
44
"layers": [
55
{
6-
"type": "filled",
6+
"type": "compactcrafting:filled",
77
"component": "W"
88
},
99
{
10-
"type": "mixed",
11-
"pattern": [
12-
["W", "W", "W", "W", "W"],
13-
["W", "-", "-", "-", "W"],
14-
["W", "-", "-", "-", "W"],
15-
["W", "-", "-", "-", "W"],
16-
["W", "W", "W", "W", "W"]
17-
]
10+
"type": "compactcrafting:hollow",
11+
"wall": "W"
1812
},
1913
{
20-
"type": "mixed",
14+
"type": "compactcrafting:mixed",
2115
"pattern": [
2216
["W", "W", "W", "W", "W"],
2317
["W", "-", "-", "-", "W"],
@@ -27,17 +21,11 @@
2721
]
2822
},
2923
{
30-
"type": "mixed",
31-
"pattern": [
32-
["W", "W", "W", "W", "W"],
33-
["W", "-", "-", "-", "W"],
34-
["W", "-", "-", "-", "W"],
35-
["W", "-", "-", "-", "W"],
36-
["W", "W", "W", "W", "W"]
37-
]
24+
"type": "compactcrafting:hollow",
25+
"wall": "W"
3826
},
3927
{
40-
"type": "filled",
28+
"type": "compactcrafting:filled",
4129
"component": "W"
4230
}
4331
],
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"version": 1,
3+
"recipeSize": 5,
4+
"layers": [
5+
{
6+
"type": "compactcrafting:filled",
7+
"component": "W"
8+
},
9+
{
10+
"type": "compactcrafting:hollow",
11+
"wall": "W"
12+
},
13+
{
14+
"type": "compactcrafting:hollow",
15+
"wall": "W"
16+
},
17+
{
18+
"type": "compactcrafting:hollow",
19+
"wall": "W"
20+
},
21+
{
22+
"type": "compactcrafting:filled",
23+
"component": "W"
24+
}
25+
],
26+
27+
"catalyst": {
28+
"id": "minecraft:ender_pearl",
29+
"Count": 1
30+
},
31+
32+
"components": {
33+
"W": {
34+
"Name": "compactmachines:wall"
35+
}
36+
},
37+
38+
"outputs": [
39+
{
40+
"id": "compactmachines:machine_large",
41+
"Count": 1
42+
}
43+
]
44+
}

recipepacks/compact-crafting/data/compactmachines/miniaturization/maximum_machine.json renamed to recipepacks/compact-crafting/data/compactmachines/recipes/maximum_machine.json

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,15 @@
33
"recipeSize": 5,
44
"layers": [
55
{
6-
"type": "filled",
6+
"type": "compactcrafting:filled",
77
"component": "W"
88
},
99
{
10-
"type": "mixed",
11-
"pattern": [
12-
["W", "W", "W", "W", "W"],
13-
["W", "-", "-", "-", "W"],
14-
["W", "-", "-", "-", "W"],
15-
["W", "-", "-", "-", "W"],
16-
["W", "W", "W", "W", "W"]
17-
]
10+
"type": "compactcrafting:hollow",
11+
"wall": "W"
1812
},
1913
{
20-
"type": "mixed",
14+
"type": "compactcrafting:mixed",
2115
"pattern": [
2216
["W", "W", "W", "W", "W"],
2317
["W", "-", "-", "-", "W"],
@@ -27,17 +21,11 @@
2721
]
2822
},
2923
{
30-
"type": "mixed",
31-
"pattern": [
32-
["W", "W", "W", "W", "W"],
33-
["W", "-", "-", "-", "W"],
34-
["W", "-", "-", "-", "W"],
35-
["W", "-", "-", "-", "W"],
36-
["W", "W", "W", "W", "W"]
37-
]
24+
"type": "compactcrafting:hollow",
25+
"wall": "W"
3826
},
3927
{
40-
"type": "filled",
28+
"type": "compactcrafting:filled",
4129
"component": "W"
4230
}
4331
],

recipepacks/compact-crafting/data/compactmachines/miniaturization/normal_machine.json renamed to recipepacks/compact-crafting/data/compactmachines/recipes/normal_machine.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
"recipeSize": 3,
44
"layers": [
55
{
6-
"type": "filled",
6+
"type": "compactcrafting:filled",
77
"component": "W"
88
},
99
{
10-
"type": "mixed",
10+
"type": "compactcrafting:mixed",
1111
"pattern": [
1212
["W", "W", "W"],
1313
["W", "G", "W"],
1414
["W", "W", "W"]
1515
]
1616
},
1717
{
18-
"type": "filled",
18+
"type": "compactcrafting:filled",
1919
"component": "W"
2020
}
2121
],

recipepacks/compact-crafting/data/compactmachines/miniaturization/small_machine.json renamed to recipepacks/compact-crafting/data/compactmachines/recipes/small_machine.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
"recipeSize": 3,
44
"layers": [
55
{
6-
"type": "filled",
6+
"type": "compactcrafting:filled",
77
"component": "W"
88
},
99
{
10-
"type": "mixed",
10+
"type": "compactcrafting:mixed",
1111
"pattern": [
1212
["W", "W", "W"],
1313
["W", "I", "W"],
1414
["W", "W", "W"]
1515
]
1616
},
1717
{
18-
"type": "filled",
18+
"type": "compactcrafting:filled",
1919
"component": "W"
2020
}
2121
],

recipepacks/compact-crafting/data/compactmachines/miniaturization/tiny_machine.json renamed to recipepacks/compact-crafting/data/compactmachines/recipes/tiny_machine.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,15 @@
33
"recipeSize": 3,
44
"layers": [
55
{
6-
"type": "filled",
6+
"type": "compactcrafting:filled",
77
"component": "W"
88
},
99
{
10-
"type": "mixed",
11-
"pattern": [
12-
["W", "W", "W"],
13-
["W", "-", "W"],
14-
["W", "W", "W"]
15-
]
10+
"type": "compactcrafting:hollow",
11+
"wall": "W"
1612
},
1713
{
18-
"type": "filled",
14+
"type": "compactcrafting:filled",
1915
"component": "W"
2016
}
2117
],

src/main/java/com/robotgryphon/compactmachines/CompactMachines.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,49 @@
11
package com.robotgryphon.compactmachines;
22

33
import com.robotgryphon.compactmachines.compat.theoneprobe.TheOneProbeCompat;
4-
import com.robotgryphon.compactmachines.core.Registrations;
4+
import com.robotgryphon.compactmachines.config.CommonConfig;
5+
import com.robotgryphon.compactmachines.config.EnableVanillaRecipesConfigCondition;
6+
import com.robotgryphon.compactmachines.core.Registration;
57
import com.robotgryphon.compactmachines.network.NetworkHandler;
68
import net.minecraft.item.ItemGroup;
79
import net.minecraft.item.ItemStack;
810
import net.minecraftforge.common.MinecraftForge;
11+
import net.minecraftforge.common.crafting.CraftingHelper;
912
import net.minecraftforge.eventbus.api.IEventBus;
1013
import net.minecraftforge.eventbus.api.SubscribeEvent;
1114
import net.minecraftforge.fml.ModList;
15+
import net.minecraftforge.fml.ModLoadingContext;
1216
import net.minecraftforge.fml.common.Mod;
17+
import net.minecraftforge.fml.config.ModConfig;
1318
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
1419
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
1520
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
1621
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
1722
import org.apache.logging.log4j.LogManager;
1823
import org.apache.logging.log4j.Logger;
1924

20-
@Mod(CompactMachines.MODID)
25+
@Mod(CompactMachines.MOD_ID)
2126
public class CompactMachines
2227
{
23-
public static final String MODID = "compactmachines";
28+
public static final String MOD_ID = "compactmachines";
2429

2530
public static final Logger LOGGER = LogManager.getLogger();
2631

2732
// public static ClientWorldData clientWorldData;
2833
// public static final CreativeTabcompactmachines CREATIVE_TAB = new CreativeTabcompactmachines();
2934

30-
public static ItemGroup COMPACT_MACHINES_ITEMS = new ItemGroup(MODID) {
35+
public static ItemGroup COMPACT_MACHINES_ITEMS = new ItemGroup(MOD_ID) {
3136
@Override
3237
public ItemStack createIcon() {
33-
return new ItemStack(Registrations.MACHINE_BLOCK_ITEM_NORMAL.get());
38+
return new ItemStack(Registration.MACHINE_BLOCK_ITEM_NORMAL.get());
3439
}
3540
};
3641

3742
public CompactMachines() {
3843
IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus();
3944

4045
// Register blocks and items
41-
Registrations.init();
46+
Registration.init();
4247

4348
// Register the setup method for modloading
4449
modBus.addListener(this::setup);
@@ -48,6 +53,11 @@ public CompactMachines() {
4853

4954
// Register ourselves for server and other game events we are interested in
5055
MinecraftForge.EVENT_BUS.register(this);
56+
57+
ModLoadingContext mlCtx = ModLoadingContext.get();
58+
mlCtx.registerConfig(ModConfig.Type.COMMON, CommonConfig.CONFIG);
59+
60+
CraftingHelper.register(EnableVanillaRecipesConfigCondition.Serializer.INSTANCE);
5161
}
5262

5363
private void setup(final FMLCommonSetupEvent event)

src/main/java/com/robotgryphon/compactmachines/block/BlockCompactMachine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import com.robotgryphon.compactmachines.compat.theoneprobe.providers.CompactMachineProvider;
55
import com.robotgryphon.compactmachines.compat.theoneprobe.IProbeData;
66
import com.robotgryphon.compactmachines.compat.theoneprobe.IProbeDataProvider;
7-
import com.robotgryphon.compactmachines.core.Registrations;
7+
import com.robotgryphon.compactmachines.core.Registration;
88
import com.robotgryphon.compactmachines.reference.EnumMachineSize;
99
import com.robotgryphon.compactmachines.reference.Reference;
1010
import com.robotgryphon.compactmachines.util.CompactMachineUtil;
@@ -274,7 +274,7 @@ public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockP
274274
if (mainItem.isEmpty())
275275
return ActionResultType.PASS;
276276

277-
if (mainItem.getItem() == Registrations.PERSONAL_SHRINKING_DEVICE.get()) {
277+
if (mainItem.getItem() == Registration.PERSONAL_SHRINKING_DEVICE.get()) {
278278
// Try teleport to compact machine dimension
279279
CompactMachineUtil.teleportInto(serverPlayer, pos, size);
280280
}

0 commit comments

Comments
 (0)