mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-20 12:09:53 +00:00
Doc and code style pass
This commit is contained in:
4 files changed
+11
-15
No files matched your search
@@ -114,7 +114,7 @@ public class BloodMagicConfiguration {
|
||||
The block to use for filler in meteors if none is provided in the meteor's config file and that
|
||||
meteor's fillerChance is greater than 0. Also used as a fallback for empty ore lists in meteor configs.
|
||||
Specify the block with the format:
|
||||
"modId:itemName:meta", or a MaterialLib block with the format "ml:material:shape".
|
||||
"modId:itemName:meta", or "ml:material:shape" for a MaterialLib block.
|
||||
Defaults to minecraft:stone:0 if no block is provided or the provided block cannot be found.""");
|
||||
MeteorComponent.setDefaultMeteorBlock();
|
||||
AlchemicalWizardry.allowedCrushedOresArray = config.get(
|
||||
|
||||
+2
-2
@@ -55,8 +55,8 @@ public class MeteorComponent {
|
||||
this.reagent = reagent;
|
||||
}
|
||||
|
||||
/// The default meteor block named as `ml:<Material>:<shape>`, whose stack [#getBlock] resolves on first use: the
|
||||
/// config it comes from is read at preInit, before MaterialLib resolves its shapes.
|
||||
/// The default meteor block named as `ml:<Material>:<shape>`. Its stack is resolved on the first [#getBlock]
|
||||
/// call -- the config is read at preInit, before MaterialLib resolves its shapes.
|
||||
private MeteorComponent(String materialName, String shapeToken) {
|
||||
this.itemStack = null;
|
||||
this.materialName = materialName;
|
||||
|
||||
+4
-7
@@ -28,7 +28,7 @@ public class MeteorRegistry {
|
||||
private static int materialLibInvalid;
|
||||
|
||||
/// The stack a `ml:<Material>:<shape>` entry names, or null when MaterialLib is absent or the entry resolves to
|
||||
/// nothing. Every resolution is tallied for [#logMaterialLibTally].
|
||||
/// nothing. Counts the outcome into the tally [#logMaterialLibTally] reports.
|
||||
static ItemStack resolveMaterialLibStack(String materialName, String shapeToken) {
|
||||
ItemStack stack = Loader.isModLoaded("materiallib") ? MaterialLibStacks.getStack(materialName, shapeToken)
|
||||
: null;
|
||||
@@ -40,14 +40,11 @@ public class MeteorRegistry {
|
||||
return stack;
|
||||
}
|
||||
|
||||
/// Logs how many `ml:` entries the meteor and reagent configs resolved, then clears the tally. Call once both
|
||||
/// have been loaded.
|
||||
/// Logs the `ml:` entry tally and clears it. Call once every config that can carry such entries is loaded.
|
||||
public static void logMaterialLibTally() {
|
||||
if (materialLibResolved + materialLibInvalid > 0) {
|
||||
AlchemicalWizardry.logger.info(
|
||||
"Blood Magic: resolved {} MaterialLib entries ({} invalid)",
|
||||
materialLibResolved,
|
||||
materialLibInvalid);
|
||||
AlchemicalWizardry.logger
|
||||
.info("Resolved {} MaterialLib entries ({} invalid)", materialLibResolved, materialLibInvalid);
|
||||
}
|
||||
materialLibResolved = 0;
|
||||
materialLibInvalid = 0;
|
||||
|
||||
+4
-5
@@ -4,16 +4,15 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.ruling_0.materiallib.api.StackResolver;
|
||||
|
||||
/// Resolves a MaterialLib item from the material name and shape token a config entry names, for the `ml:` entry forms
|
||||
/// of the meteor configs.
|
||||
/// Resolves a MaterialLib item from a material name and a shape token.
|
||||
///
|
||||
/// MaterialLib types are named only here, so every caller can gate loading this class on `materiallib` being present.
|
||||
/// MaterialLib types are named only in this class, so it loads only where `materiallib` is present.
|
||||
public final class MaterialLibStacks {
|
||||
|
||||
private MaterialLibStacks() {}
|
||||
|
||||
/// The stack of the named material in the named shape, or null when either name matches nothing or the material
|
||||
/// does not generate the shape. A miss is logged by MaterialLib.
|
||||
/// A single item of the named material in the named shape; see [StackResolver#getStack] for the naming rules and
|
||||
/// the null cases.
|
||||
public static ItemStack getStack(String materialName, String shapeToken) {
|
||||
return StackResolver.getStack(materialName, shapeToken, 1);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user