Skip to content

Commit 738f076

Browse files
committed
Fix merge
1 parent c94f810 commit 738f076

19 files changed

+48
-55
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jei_minecraft_version = 1.19.2
5050
jei_version = 11.2.0.254
5151

5252
copycats_minecraft_version = 1.19.2
53-
copycats_version = 1.1.0
53+
copycats_version = 2.2.0
5454
garnished_minecraft_version = 1.19.2-forge
5555
garnished_version = 1.8
5656
dreams_desires_version = 0.1b.Release-Early-Dev

src/generated/resources/data/create_connected/advancements/recipes/crafting/kinetics/empty_fan_catalyst_from_sanding.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
"recipes": [
3434
"create_connected:crafting/kinetics/empty_fan_catalyst_from_sanding"
3535
]
36-
},
37-
"sends_telemetry_event": false
36+
}
3837
},
3938
"conditions": [
4039
{

src/generated/resources/data/create_connected/advancements/recipes/crafting/kinetics/empty_fan_catalyst_from_seething.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
"recipes": [
3434
"create_connected:crafting/kinetics/empty_fan_catalyst_from_seething"
3535
]
36-
},
37-
"sends_telemetry_event": false
36+
}
3837
},
3938
"conditions": [
4039
{

src/generated/resources/data/create_connected/advancements/recipes/crafting/kinetics/inventory_access_port.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
"recipes": [
3434
"create_connected:crafting/kinetics/inventory_access_port"
3535
]
36-
},
37-
"sends_telemetry_event": false
36+
}
3837
},
3938
"conditions": [
4039
{

src/generated/resources/data/create_connected/advancements/recipes/crafting/kinetics/inventory_bridge.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
"recipes": [
3434
"create_connected:crafting/kinetics/inventory_bridge"
3535
]
36-
},
37-
"sends_telemetry_event": false
36+
}
3837
},
3938
"conditions": [
4039
{

src/generated/resources/data/create_connected/loot_tables/blocks/fan_sanding_catalyst.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@
1616
],
1717
"rolls": 1.0
1818
}
19-
],
20-
"random_sequence": "create_connected:blocks/fan_sanding_catalyst"
19+
]
2120
}

src/generated/resources/data/create_connected/loot_tables/blocks/fan_seething_catalyst.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@
1616
],
1717
"rolls": 1.0
1818
}
19-
],
20-
"random_sequence": "create_connected:blocks/fan_seething_catalyst"
19+
]
2120
}

src/generated/resources/data/create_connected/loot_tables/blocks/inventory_access_port.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@
1616
],
1717
"rolls": 1.0
1818
}
19-
],
20-
"random_sequence": "create_connected:blocks/inventory_access_port"
19+
]
2120
}

src/generated/resources/data/create_connected/loot_tables/blocks/inventory_bridge.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@
1616
],
1717
"rolls": 1.0
1818
}
19-
],
20-
"random_sequence": "create_connected:blocks/inventory_bridge"
19+
]
2120
}

src/generated/resources/data/create_connected/recipes/crafting/kinetics/empty_fan_catalyst_from_sanding.json

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
],
1111
"recipe": {
1212
"type": "minecraft:crafting_shapeless",
13-
"category": "misc",
1413
"ingredients": [
1514
{
1615
"item": "create_connected:fan_sanding_catalyst"

src/generated/resources/data/create_connected/recipes/crafting/kinetics/empty_fan_catalyst_from_seething.json

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
],
1111
"recipe": {
1212
"type": "minecraft:crafting_shapeless",
13-
"category": "misc",
1413
"ingredients": [
1514
{
1615
"item": "create_connected:fan_seething_catalyst"

src/generated/resources/data/create_connected/recipes/crafting/kinetics/inventory_access_port.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
],
1111
"recipe": {
1212
"type": "minecraft:crafting_shaped",
13-
"category": "misc",
1413
"key": {
1514
"B": {
1615
"item": "create:brass_casing"
@@ -30,8 +29,7 @@
3029
"result": {
3130
"count": 2,
3231
"item": "create_connected:inventory_access_port"
33-
},
34-
"show_notification": true
32+
}
3533
}
3634
}
3735
]

src/generated/resources/data/create_connected/recipes/crafting/kinetics/inventory_bridge.json

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
],
1111
"recipe": {
1212
"type": "minecraft:crafting_shapeless",
13-
"category": "misc",
1413
"ingredients": [
1514
{
1615
"item": "create_connected:inventory_access_port"

src/main/java/com/hlysine/create_connected/CCBlocks.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ public class CCBlocks {
483483
public static final BlockEntry<WrenchableBlock> FAN_SEETHING_CATALYST = REGISTRATE.block("fan_seething_catalyst", WrenchableBlock::new)
484484
.initialProperties(() -> Blocks.IRON_BLOCK)
485485
.properties(p -> p
486-
.mapColor(MapColor.TERRACOTTA_YELLOW)
486+
.color(MaterialColor.TERRACOTTA_YELLOW)
487487
.requiresCorrectToolForDrops()
488488
.noOcclusion()
489489
.lightLevel(s -> 12)
@@ -502,7 +502,7 @@ public class CCBlocks {
502502
public static final BlockEntry<WrenchableBlock> FAN_SANDING_CATALYST = REGISTRATE.block("fan_sanding_catalyst", WrenchableBlock::new)
503503
.initialProperties(() -> Blocks.IRON_BLOCK)
504504
.properties(p -> p
505-
.mapColor(MapColor.TERRACOTTA_YELLOW)
505+
.color(MaterialColor.TERRACOTTA_YELLOW)
506506
.requiresCorrectToolForDrops()
507507
.noOcclusion()
508508
.isRedstoneConductor((state, level, pos) -> false)
@@ -572,7 +572,7 @@ public class CCBlocks {
572572
public static final BlockEntry<InventoryAccessPortBlock> INVENTORY_ACCESS_PORT =
573573
REGISTRATE.block("inventory_access_port", InventoryAccessPortBlock::new)
574574
.initialProperties(SharedProperties::stone)
575-
.properties(p -> p.mapColor(MapColor.TERRACOTTA_BROWN).noOcclusion())
575+
.properties(p -> p.color(MaterialColor.TERRACOTTA_BROWN).noOcclusion())
576576
.transform(axeOrPickaxe())
577577
.transform(FeatureToggle.register(FeatureCategory.LOGISTICS))
578578
.blockstate(new InventoryAccessPortGenerator()::generate)
@@ -583,7 +583,7 @@ public class CCBlocks {
583583
public static final BlockEntry<InventoryBridgeBlock> INVENTORY_BRIDGE =
584584
REGISTRATE.block("inventory_bridge", InventoryBridgeBlock::new)
585585
.initialProperties(SharedProperties::stone)
586-
.properties(p -> p.mapColor(MapColor.TERRACOTTA_BROWN).noOcclusion())
586+
.properties(p -> p.color(MaterialColor.TERRACOTTA_BROWN).noOcclusion())
587587
.transform(axeOrPickaxe())
588588
.transform(FeatureToggle.register(FeatureCategory.LOGISTICS))
589589
.blockstate((c, p) -> BlockStateGen.axisBlock(c, p, state -> {

src/main/java/com/hlysine/create_connected/compat/CopycatsManager.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ public static BlockState convert(BlockState state) {
7474
}
7575

7676
private static <T extends Comparable<T>> BlockState copyProperty(BlockState from, BlockState to, Property<T> property) {
77-
return from.getOptionalValue(property).map(value -> to.trySetValue(property, value)).orElse(to);
77+
return from.getOptionalValue(property).map(value -> {
78+
if (to.hasProperty(property))
79+
return to.setValue(property, value);
80+
return to;
81+
}).orElse(to);
7882
}
7983

8084
public static Block convertIfEnabled(Block block) {

src/main/java/com/hlysine/create_connected/datagen/recipes/CCStandardRecipes.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ public class CCStandardRecipes extends CreateRecipeProvider {
203203
.requiresResultFeature()
204204
.returns(2)
205205
.viaShaped(b -> b
206-
.define('B', AllBlocks.BRASS_CASING)
207-
.define('C', AllBlocks.CHUTE)
208-
.define('E', AllItems.ELECTRON_TUBE)
206+
.define('B', AllBlocks.BRASS_CASING.get())
207+
.define('C', AllBlocks.CHUTE.get())
208+
.define('E', AllItems.ELECTRON_TUBE.get())
209209
.pattern("B")
210210
.pattern("C")
211211
.pattern("E")
@@ -214,8 +214,8 @@ public class CCStandardRecipes extends CreateRecipeProvider {
214214
GeneratedRecipe INVENTORY_BRIDGE = create(CCBlocks.INVENTORY_BRIDGE).unlockedBy(AllItems.ELECTRON_TUBE::get)
215215
.requiresResultFeature()
216216
.viaShapeless(b -> b
217-
.requires(CCBlocks.INVENTORY_ACCESS_PORT)
218-
.requires(CCBlocks.INVENTORY_ACCESS_PORT)
217+
.requires(CCBlocks.INVENTORY_ACCESS_PORT.get())
218+
.requires(CCBlocks.INVENTORY_ACCESS_PORT.get())
219219
);
220220

221221
GeneratedRecipe EMPTY_FAN_CATALYST = create(CCBlocks.EMPTY_FAN_CATALYST).unlockedBy(AllBlocks.BRASS_BLOCK::get)

src/main/java/com/hlysine/create_connected/datagen/recipes/ItemApplicationRecipeGen.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public class ItemApplicationRecipeGen extends ProcessingRecipeGen {
2626
GeneratedRecipe FREEZING_CATALYST = fanCatalystFromEmpty(
2727
"freezing_catalyst", Items.POWDER_SNOW_BUCKET::asItem, CCBlocks.FAN_FREEZING_CATALYST.get()::asItem);
2828
GeneratedRecipe SEETHING_CATALYST = fanCatalystFromEmpty(
29-
"seething_catalyst", AllItems.BLAZE_CAKE, CCBlocks.FAN_SEETHING_CATALYST::asItem);
29+
"seething_catalyst", AllItems.BLAZE_CAKE.get(), CCBlocks.FAN_SEETHING_CATALYST.get()::asItem);
3030
GeneratedRecipe SANDING_CATALYST = fanCatalystFromEmpty(
31-
"sanding_catalyst", Blocks.SAND, CCBlocks.FAN_SANDING_CATALYST::asItem);
31+
"sanding_catalyst", Blocks.SAND, CCBlocks.FAN_SANDING_CATALYST.get()::asItem);
3232

3333
protected GeneratedRecipe fanCatalystFromEmpty(String type, ItemLike ingredient, Supplier<ItemLike> output) {
3434
return fanCatalystFromEmpty(type, Ingredient.of(ingredient), output);
@@ -42,7 +42,7 @@ protected GeneratedRecipe fanCatalystFromEmpty(String type, Ingredient ingredien
4242
}
4343

4444
protected GeneratedRecipe fanCatalystFromEmpty(String type, Ingredient ingredient, Supplier<ItemLike> output, ICondition condition) {
45-
return create(type + "_from_empty", b -> b.require(CCBlocks.EMPTY_FAN_CATALYST)
45+
return create(type + "_from_empty", b -> b.require(CCBlocks.EMPTY_FAN_CATALYST.get())
4646
.require(ingredient)
4747
.withCondition(new FeatureEnabledCondition(CCBlocks.EMPTY_FAN_CATALYST.getId()))
4848
.withCondition(condition)

src/main/java/com/hlysine/create_connected/mixin/chaincogwheel/RotationPropagatorMixin.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import org.spongepowered.asm.mixin.injection.Inject;
1515
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
1616

17+
import static com.hlysine.create_connected.content.MathHelper.DirectionFromDelta;
18+
1719
@Mixin(value = RotationPropagator.class, remap = false)
1820
public class RotationPropagatorMixin {
1921
@Inject(
@@ -32,7 +34,7 @@ private static void handleChainCogwheels(KineticBlockEntity from,
3234
final IRotate definitionTo = (IRotate) toBlock;
3335
final BlockPos diff = to.getBlockPos()
3436
.subtract(from.getBlockPos());
35-
final Direction direction = Direction.fromDelta(diff.getX(), diff.getY(), diff.getZ());
37+
final Direction direction = DirectionFromDelta(diff.getX(), diff.getY(), diff.getZ());
3638

3739
if (stateFrom.is(CCBlocks.ENCASED_CHAIN_COGWHEEL.get()) && stateTo.is(CCBlocks.ENCASED_CHAIN_COGWHEEL.get())) {
3840
if (direction == null) {

src/main/java/com/hlysine/create_connected/mixin/itemsilo/ContraptionMixin.java

+18-18
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ private void fixNBT(Level world, CompoundTag nbt, boolean spawnData, CallbackInf
5858
List<Map.Entry<BlockPos, StructureTemplate.StructureBlockInfo>> toBeReplaced = new ArrayList<>();
5959
for (Iterator<Map.Entry<BlockPos, StructureTemplate.StructureBlockInfo>> iterator = blocks.entrySet().iterator(); iterator.hasNext(); ) {
6060
Map.Entry<BlockPos, StructureTemplate.StructureBlockInfo> entry = iterator.next();
61-
if (!(entry.getValue().state().getBlock() instanceof ItemSiloBlock))
61+
if (!(entry.getValue().state.getBlock() instanceof ItemSiloBlock))
6262
continue;
63-
if (!entry.getValue().nbt().contains("Length") && (
64-
blocks.get(NbtUtils.readBlockPos(entry.getValue().nbt().getCompound("Controller"))) == null ||
65-
!(blocks.get(NbtUtils.readBlockPos(entry.getValue().nbt().getCompound("Controller"))).state().getBlock() instanceof ItemSiloBlock))) {
66-
entry.getValue().nbt().put("Controller", NbtUtils.writeBlockPos(entry.getKey()));
67-
entry.getValue().nbt().putInt("Length", 1);
68-
entry.getValue().nbt().putInt("Size", 1);
63+
if (!entry.getValue().nbt.contains("Length") && (
64+
blocks.get(NbtUtils.readBlockPos(entry.getValue().nbt.getCompound("Controller"))) == null ||
65+
!(blocks.get(NbtUtils.readBlockPos(entry.getValue().nbt.getCompound("Controller"))).state.getBlock() instanceof ItemSiloBlock))) {
66+
entry.getValue().nbt.put("Controller", NbtUtils.writeBlockPos(entry.getKey()));
67+
entry.getValue().nbt.putInt("Length", 1);
68+
entry.getValue().nbt.putInt("Size", 1);
6969
iterator.remove();
70-
toBeReplaced.add(new AbstractMap.SimpleEntry<>(entry.getKey(), new StructureTemplate.StructureBlockInfo(entry.getKey(), entry.getValue().state().setValue(ItemSiloBlock.LARGE, false), entry.getValue().nbt())));
70+
toBeReplaced.add(new AbstractMap.SimpleEntry<>(entry.getKey(), new StructureTemplate.StructureBlockInfo(entry.getKey(), entry.getValue().state.setValue(ItemSiloBlock.LARGE, false), entry.getValue().nbt)));
7171
}
7272
}
7373
for (Map.Entry<BlockPos, StructureTemplate.StructureBlockInfo> entry : toBeReplaced) {
@@ -76,12 +76,12 @@ private void fixNBT(Level world, CompoundTag nbt, boolean spawnData, CallbackInf
7676
toBeReplaced.clear();
7777
for (Iterator<Map.Entry<BlockPos, StructureTemplate.StructureBlockInfo>> iterator = capturedMultiblocks.entries().iterator(); iterator.hasNext(); ) {
7878
Map.Entry<BlockPos, StructureTemplate.StructureBlockInfo> entry = iterator.next();
79-
if (!(entry.getValue().state().getBlock() instanceof ItemSiloBlock))
79+
if (!(entry.getValue().state.getBlock() instanceof ItemSiloBlock))
8080
continue;
81-
if (!blocks.containsKey(entry.getKey()) || !(blocks.get(entry.getKey()).state().getBlock() instanceof ItemSiloBlock)) {
82-
if (entry.getValue().nbt().contains("Controller")) {
81+
if (!blocks.containsKey(entry.getKey()) || !(blocks.get(entry.getKey()).state.getBlock() instanceof ItemSiloBlock)) {
82+
if (entry.getValue().nbt.contains("Controller")) {
8383
iterator.remove();
84-
toBeReplaced.add(new AbstractMap.SimpleEntry<>(NbtUtils.readBlockPos(entry.getValue().nbt().getCompound("Controller")), entry.getValue()));
84+
toBeReplaced.add(new AbstractMap.SimpleEntry<>(NbtUtils.readBlockPos(entry.getValue().nbt.getCompound("Controller")), entry.getValue()));
8585
}
8686
}
8787
}
@@ -92,23 +92,23 @@ private void fixNBT(Level world, CompoundTag nbt, boolean spawnData, CallbackInf
9292
for (BlockPos blockPos : capturedMultiblocks.keySet()) {
9393
if (!blocks.containsKey(blockPos))
9494
continue;
95-
if (!(blocks.get(blockPos).state().getBlock() instanceof ItemSiloBlock))
95+
if (!(blocks.get(blockPos).state.getBlock() instanceof ItemSiloBlock))
9696
continue;
9797
Collection<StructureTemplate.StructureBlockInfo> parts = capturedMultiblocks.get(blockPos);
9898

9999
if (parts.size() == 1) {
100100
StructureTemplate.StructureBlockInfo part = parts.iterator().next();
101-
if (part.nbt().contains("Length") && part.nbt().getInt("Length") > 1) {
102-
part.nbt().putInt("Length", 1);
103-
part.nbt().putInt("Size", 1);
104-
toBeReplaced.add(new AbstractMap.SimpleEntry<>(blockPos, new StructureTemplate.StructureBlockInfo(part.pos(), part.state().setValue(ItemSiloBlock.LARGE, false), part.nbt())));
101+
if (part.nbt.contains("Length") && part.nbt.getInt("Length") > 1) {
102+
part.nbt.putInt("Length", 1);
103+
part.nbt.putInt("Size", 1);
104+
toBeReplaced.add(new AbstractMap.SimpleEntry<>(blockPos, new StructureTemplate.StructureBlockInfo(part.pos, part.state.setValue(ItemSiloBlock.LARGE, false), part.nbt)));
105105
}
106106
}
107107
}
108108
for (Map.Entry<BlockPos, StructureTemplate.StructureBlockInfo> entry : toBeReplaced) {
109109
capturedMultiblocks.removeAll(entry.getKey());
110110
capturedMultiblocks.put(entry.getKey(), entry.getValue());
111-
blocks.put(entry.getValue().pos(), entry.getValue());
111+
blocks.put(entry.getValue().pos, entry.getValue());
112112
}
113113
}
114114
}

0 commit comments

Comments
 (0)