Implement custom Compressed Sieve types

This commit is contained in:
thedarkcolour 2025-02-05 15:27:36 -08:00
parent 43b801220d
commit b2ddaacc56
No known key found for this signature in database
GPG Key ID: 86B37B3575FD5976
3 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,6 @@
## Ex Deorum 3.6
- Implement custom Compressed Sieve types. Works the same as with sieves, just replace `sieve_materials` with `compressed_sieve_materials`
## Ex Deorum 3.5
- Remove Yellorium Dust sieve drop (#116)
- Fixed Fluid Transformation recipes requiring byproducts

View File

@ -20,6 +20,7 @@ package thedarkcolour.exdeorum.material;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import org.jetbrains.annotations.Nullable;
import thedarkcolour.exdeorum.block.CompressedSieveBlock;
public class CompressedSieveMaterial extends SieveMaterial {
@ -31,4 +32,18 @@ public class CompressedSieveMaterial extends SieveMaterial {
protected Block createBlock() {
return new CompressedSieveBlock(props().noOcclusion());
}
@Nullable
public static CompressedSieveMaterial readFromJson(MaterialParser parser) {
SoundType soundType = parser.getSoundType();
float strength = parser.getStrength();
boolean needsCorrectTool = parser.getOptionalBoolean("needs_correct_tool");
String requiredModId = parser.getRequiredModId();
if (parser.error) {
return null;
} else {
return new CompressedSieveMaterial(soundType, strength, needsCorrectTool, requiredModId);
}
}
}

View File

@ -239,7 +239,7 @@ public class DefaultMaterials {
public static void registerMaterials() {
BARRELS.search(BarrelMaterial::readFromJson);
SIEVES.search(SieveMaterial::readFromJson);
// todo compressed sieve JSON
COMPRESSED_SIEVES.search(CompressedSieveMaterial::readFromJson);
LAVA_CRUCIBLES.search(parser -> AbstractCrucibleMaterial.readFromJson(parser, LavaCrucibleMaterial::new));
WATER_CRUCIBLES.search(parser -> AbstractCrucibleMaterial.readFromJson(parser, WaterCrucibleMaterial::new));
}