-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move various configs to data maps instead
- Loading branch information
Showing
27 changed files
with
363 additions
and
198 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
src/generated/resources/data/powah/data_maps/block/heat_source.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"values": { | ||
"minecraft:magma_block": { | ||
"temperature": 800 | ||
}, | ||
"powah:blazing_crystal_block": { | ||
"temperature": 2800 | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/generated/resources/data/powah/data_maps/fluid/fluid_coolant.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"values": { | ||
"#c:water": { | ||
"temperature": 1 | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/generated/resources/data/powah/data_maps/fluid/heat_source.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"values": { | ||
"#c:lava": { | ||
"temperature": 1000 | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/generated/resources/data/powah/data_maps/fluid/magmator_fuel.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"values": { | ||
"#c:lava": { | ||
"energy_produced": 10000 | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/generated/resources/data/powah/data_maps/item/solid_coolant.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"values": { | ||
"minecraft:blue_ice": { | ||
"amount": 568, | ||
"temperature": -17 | ||
}, | ||
"minecraft:ice": { | ||
"amount": 48, | ||
"temperature": -5 | ||
}, | ||
"minecraft:packed_ice": { | ||
"amount": 192, | ||
"temperature": -8 | ||
}, | ||
"minecraft:snow_block": { | ||
"amount": 48, | ||
"temperature": -3 | ||
}, | ||
"minecraft:snowball": { | ||
"amount": 12, | ||
"temperature": -3 | ||
}, | ||
"powah:dry_ice": { | ||
"amount": 712, | ||
"temperature": -32 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package owmii.powah.api; | ||
|
||
import com.mojang.serialization.Codec; | ||
import com.mojang.serialization.codecs.RecordCodecBuilder; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.world.level.material.Fluid; | ||
import net.neoforged.neoforge.registries.datamaps.DataMapType; | ||
import owmii.powah.Powah; | ||
|
||
public record FluidCoolantConfig(int temperature) { | ||
public static final Codec<FluidCoolantConfig> CODEC = RecordCodecBuilder.create(builder -> builder | ||
.group( | ||
Codec.INT.fieldOf("temperature").forGetter(FluidCoolantConfig::temperature)) | ||
.apply(builder, FluidCoolantConfig::new)); | ||
public static final DataMapType<Fluid, FluidCoolantConfig> DATA_MAP_TYPE = DataMapType.builder(Powah.id("fluid_coolant"), Registries.FLUID, CODEC) | ||
.synced(CODEC, true) | ||
.build(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package owmii.powah.api; | ||
|
||
import com.mojang.serialization.Codec; | ||
import com.mojang.serialization.codecs.RecordCodecBuilder; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.world.level.material.Fluid; | ||
import net.neoforged.neoforge.registries.datamaps.DataMapType; | ||
import owmii.powah.Powah; | ||
|
||
/** | ||
* Fuel for the {@link owmii.powah.block.magmator.MagmatorTile}. | ||
* | ||
* @param energyProduced FE per 100mb of fluid | ||
*/ | ||
public record MagmatorFuelValue(int energyProduced) { | ||
public static final Codec<MagmatorFuelValue> CODEC = RecordCodecBuilder.create(builder -> builder | ||
.group( | ||
Codec.INT.fieldOf("energy_produced").forGetter(MagmatorFuelValue::energyProduced)) | ||
.apply(builder, MagmatorFuelValue::new)); | ||
|
||
public static final DataMapType<Fluid, MagmatorFuelValue> DATA_MAP_TYPE = DataMapType.builder(Powah.id("magmator_fuel"), Registries.FLUID, CODEC) | ||
.synced(CODEC, true) | ||
.build(); | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/owmii/powah/api/PassiveHeatSourceConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package owmii.powah.api; | ||
|
||
import com.mojang.serialization.Codec; | ||
import com.mojang.serialization.codecs.RecordCodecBuilder; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.material.Fluid; | ||
import net.neoforged.neoforge.registries.datamaps.DataMapType; | ||
import owmii.powah.Powah; | ||
|
||
public record PassiveHeatSourceConfig(int temperature) { | ||
public static final Codec<PassiveHeatSourceConfig> CODEC = RecordCodecBuilder.create(builder -> builder | ||
.group( | ||
Codec.INT.fieldOf("temperature").forGetter(PassiveHeatSourceConfig::temperature)) | ||
.apply(builder, PassiveHeatSourceConfig::new)); | ||
public static final DataMapType<Block, PassiveHeatSourceConfig> BLOCK_DATA_MAP = DataMapType | ||
.builder(Powah.id("heat_source"), Registries.BLOCK, CODEC) | ||
.synced(CODEC, true) | ||
.build(); | ||
public static final DataMapType<Fluid, PassiveHeatSourceConfig> FLUID_DATA_MAP = DataMapType | ||
.builder(Powah.id("heat_source"), Registries.FLUID, CODEC) | ||
.synced(CODEC, true) | ||
.build(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package owmii.powah.api; | ||
|
||
import com.mojang.serialization.Codec; | ||
import com.mojang.serialization.codecs.RecordCodecBuilder; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.world.item.Item; | ||
import net.neoforged.neoforge.registries.datamaps.DataMapType; | ||
import owmii.powah.Powah; | ||
|
||
public record SolidCoolantConfig(int amount, int temperature) { | ||
public static final Codec<SolidCoolantConfig> CODEC = RecordCodecBuilder.create(builder -> builder | ||
.group( | ||
Codec.INT.fieldOf("amount").forGetter(SolidCoolantConfig::amount), | ||
Codec.INT.fieldOf("temperature").forGetter(SolidCoolantConfig::temperature)) | ||
.apply(builder, SolidCoolantConfig::new)); | ||
public static final DataMapType<Item, SolidCoolantConfig> DATA_MAP_TYPE = DataMapType.builder(Powah.id("solid_coolant"), Registries.ITEM, CODEC) | ||
.synced(CODEC, true) | ||
.build(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.