Skip to content

Commit 377d388

Browse files
committed
Revert a couple changes that cause conflicts with naming when used in dispatch codecs
1 parent 46c726d commit 377d388

File tree

8 files changed

+9
-7
lines changed

8 files changed

+9
-7
lines changed

src/additions/java/mekanism/additions/common/world/modifier/BabyEntitySpawnBiomeModifier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public MapCodec<? extends BiomeModifier> codec() {
6161

6262
public static MapCodec<BabyEntitySpawnBiomeModifier> makeCodec() {
6363
return RecordCodecBuilder.mapCodec(builder -> builder.group(
64-
BabyType.CODEC.fieldOf(SerializationConstants.TYPE).forGetter(BabyEntitySpawnBiomeModifier::babyType)
64+
BabyType.CODEC.fieldOf(SerializationConstants.BABY_TYPE).forGetter(BabyEntitySpawnBiomeModifier::babyType)
6565
).apply(builder, BabyEntitySpawnBiomeModifier::new));
6666
}
6767
}

src/additions/java/mekanism/additions/common/world/modifier/BabyEntitySpawnStructureModifier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public MapCodec<? extends StructureModifier> codec() {
5252

5353
public static MapCodec<BabyEntitySpawnStructureModifier> makeCodec() {
5454
return RecordCodecBuilder.mapCodec(builder -> builder.group(
55-
BabyType.CODEC.fieldOf(SerializationConstants.TYPE).forGetter(BabyEntitySpawnStructureModifier::babyType)
55+
BabyType.CODEC.fieldOf(SerializationConstants.BABY_TYPE).forGetter(BabyEntitySpawnStructureModifier::babyType)
5656
).apply(builder, BabyEntitySpawnStructureModifier::new));
5757
}
5858
}

src/api/java/mekanism/api/SerializationConstants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ private SerializationConstants() {
110110
public static final String AGE = "age";
111111
public static final String ASSEMBLIES = "assemblies";
112112
public static final String AUTO = "auto";
113+
public static final String BABY_TYPE = "baby_type";
113114
public static final String BLADES = "blades";
114115
public static final String BLOCK = "block";
115116
public static final String BLOCK_ENTITY_TAG = "block_entity_tag";
@@ -216,6 +217,7 @@ private SerializationConstants() {
216217
public static final String NAME = "name";
217218
public static final String NEXT = "next";
218219
public static final String NUM_POWERING = "num_powering";
220+
public static final String ORE_TYPE = "ore_type";
219221
public static final String ORIGINAL_LOCATION = "original_location";
220222
public static final String OUTPUT_MODE = "output_mode";
221223
public static final String OVERFLOW = "overflow";

src/main/java/mekanism/common/attachments/qio/DriveMetadata.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public record DriveMetadata(long count, int types) {
1616

1717
public static final Codec<DriveMetadata> CODEC = RecordCodecBuilder.create(instance -> instance.group(
1818
SerializerHelper.POSITIVE_LONG_CODEC.fieldOf(SerializationConstants.COUNT).forGetter(DriveMetadata::count),
19-
ExtraCodecs.NON_NEGATIVE_INT.fieldOf(SerializationConstants.QIO_META_TYPES).forGetter(DriveMetadata::types)
19+
ExtraCodecs.NON_NEGATIVE_INT.fieldOf(SerializationConstants.TYPES).forGetter(DriveMetadata::types)
2020
).apply(instance, DriveMetadata::new));
2121
public static final StreamCodec<ByteBuf, DriveMetadata> STREAM_CODEC = StreamCodec.composite(
2222
ByteBufCodecs.VAR_LONG, DriveMetadata::count,

src/main/java/mekanism/common/world/ConfigurableConstantInt.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
public class ConfigurableConstantInt extends IntProvider {
1818

1919
public static final MapCodec<ConfigurableConstantInt> CODEC = RecordCodecBuilder.mapCodec(builder -> builder.group(
20-
OreVeinType.CODEC.optionalFieldOf(SerializationConstants.TYPE).forGetter(config -> Optional.ofNullable(config.oreVeinType))
20+
OreVeinType.CODEC.optionalFieldOf(SerializationConstants.ORE_TYPE).forGetter(config -> Optional.ofNullable(config.oreVeinType))
2121
).apply(builder, oreType -> {
2222
if (oreType.isPresent()) {
2323
OreVeinType type = oreType.get();

src/main/java/mekanism/common/world/DisableableFeaturePlacement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
public class DisableableFeaturePlacement extends PlacementFilter {
2121

2222
public static final MapCodec<DisableableFeaturePlacement> CODEC = RecordCodecBuilder.mapCodec(builder -> builder.group(
23-
OreVeinType.CODEC.optionalFieldOf(SerializationConstants.TYPE).forGetter(config -> Optional.ofNullable(config.oreVeinType)),
23+
OreVeinType.CODEC.optionalFieldOf(SerializationConstants.ORE_TYPE).forGetter(config -> Optional.ofNullable(config.oreVeinType)),
2424
Codec.BOOL.fieldOf(SerializationConstants.RETRO_GEN).forGetter(config -> config.retroGen)
2525
).apply(builder, (oreType, retroGen) -> {
2626
if (oreType.isPresent()) {

src/main/java/mekanism/common/world/ResizableOreFeatureConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public record ResizableOreFeatureConfig(List<TargetBlockState> targetStates, Ore
1818

1919
public static final Codec<ResizableOreFeatureConfig> CODEC = RecordCodecBuilder.create(builder -> builder.group(
2020
Codec.list(OreConfiguration.TargetBlockState.CODEC).fieldOf(SerializationConstants.TARGETS).forGetter(config -> config.targetStates),
21-
OreVeinType.CODEC.fieldOf(SerializationConstants.TYPE).forGetter(config -> config.oreVeinType)
21+
OreVeinType.CODEC.fieldOf(SerializationConstants.ORE_TYPE).forGetter(config -> config.oreVeinType)
2222
).apply(builder, (targetStates, oreVeinType) -> {
2323
OreVeinConfig veinConfig = MekanismConfig.world.getVeinConfig(oreVeinType);
2424
return new ResizableOreFeatureConfig(targetStates, oreVeinType, veinConfig.maxVeinSize(), veinConfig.discardChanceOnAirExposure());

src/main/java/mekanism/common/world/height/ConfigurableHeightProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
public class ConfigurableHeightProvider extends HeightProvider {
2121

2222
public static final MapCodec<ConfigurableHeightProvider> CODEC = RecordCodecBuilder.mapCodec(builder -> builder.group(
23-
OreVeinType.CODEC.fieldOf(SerializationConstants.TYPE).forGetter(config -> config.oreVeinType)
23+
OreVeinType.CODEC.fieldOf(SerializationConstants.ORE_TYPE).forGetter(config -> config.oreVeinType)
2424
).apply(builder, type -> new ConfigurableHeightProvider(type, MekanismConfig.world.getVeinConfig(type))));
2525

2626
private final OreVeinType oreVeinType;

0 commit comments

Comments
 (0)