-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat: chemical storage block
- Loading branch information
Showing
52 changed files
with
948 additions
and
33 deletions.
There are no files selected for viewing
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
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
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
102 changes: 102 additions & 0 deletions
102
src/main/java/com/refinedmods/refinedstorage/mekanism/Config.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,102 @@ | ||
package com.refinedmods.refinedstorage.mekanism; | ||
|
||
import net.neoforged.neoforge.common.ModConfigSpec; | ||
|
||
import static com.refinedmods.refinedstorage.mekanism.MekanismIntegrationIdentifierUtil.createMekanismIntegrationTranslationKey; | ||
|
||
public final class Config { | ||
private final ModConfigSpec.Builder builder = new ModConfigSpec.Builder(); | ||
private final ModConfigSpec spec; | ||
|
||
private final ChemicalStorageBlockEntry chemicalStorageBlock; | ||
|
||
public Config() { | ||
chemicalStorageBlock = new ChemicalStorageBlockEntry(); | ||
spec = builder.build(); | ||
} | ||
|
||
private static String translationKey(final String value) { | ||
return createMekanismIntegrationTranslationKey("config", "option." + value); | ||
} | ||
|
||
public ChemicalStorageBlockEntry getChemicalStorageBlock() { | ||
return chemicalStorageBlock; | ||
} | ||
|
||
public ModConfigSpec getSpec() { | ||
return spec; | ||
} | ||
|
||
public class ChemicalStorageBlockEntry { | ||
private final ModConfigSpec.LongValue sixtyFourBEnergyUsage; | ||
private final ModConfigSpec.LongValue twoHundredFiftySixBEnergyUsage; | ||
private final ModConfigSpec.LongValue thousandTwentyFourBEnergyUsage; | ||
private final ModConfigSpec.LongValue eightThousandHundredNinetyTwoBEnergyUsage; | ||
private final ModConfigSpec.LongValue creativeEnergyUsage; | ||
|
||
ChemicalStorageBlockEntry() { | ||
builder.translation(translationKey("chemicalStorageBlock")).push("chemicalStorageBlock"); | ||
sixtyFourBEnergyUsage = builder | ||
.translation(translationKey("chemicalStorageBlock.sixtyFourBEnergyUsage")) | ||
.defineInRange( | ||
"64bEnergyUsage", | ||
2, | ||
0, | ||
Long.MAX_VALUE | ||
); | ||
twoHundredFiftySixBEnergyUsage = builder | ||
.translation(translationKey("chemicalStorageBlock.twoHundredFiftySixBEnergyUsage")) | ||
.defineInRange( | ||
"256bEnergyUsage", | ||
4, | ||
0, | ||
Long.MAX_VALUE | ||
); | ||
thousandTwentyFourBEnergyUsage = builder | ||
.translation(translationKey("chemicalStorageBlock.thousandTwentyFourBEnergyUsage")) | ||
.defineInRange( | ||
"1024bEnergyUsage", | ||
6, | ||
0, | ||
Long.MAX_VALUE | ||
); | ||
eightThousandHundredNinetyTwoBEnergyUsage = builder | ||
.translation(translationKey("chemicalStorageBlock.eightThousandHundredNinetyTwoBEnergyUsage")) | ||
.defineInRange( | ||
"8192bEnergyUsage", | ||
8, | ||
0, | ||
Long.MAX_VALUE | ||
); | ||
creativeEnergyUsage = builder | ||
.translation(translationKey("chemicalStorageBlock.creativeEnergyUsage")) | ||
.defineInRange( | ||
"creativeEnergyUsage", | ||
16, | ||
0, | ||
Long.MAX_VALUE | ||
); | ||
builder.pop(); | ||
} | ||
|
||
public long get64bEnergyUsage() { | ||
return sixtyFourBEnergyUsage.get(); | ||
} | ||
|
||
public long get256bEnergyUsage() { | ||
return twoHundredFiftySixBEnergyUsage.get(); | ||
} | ||
|
||
public long get1024bEnergyUsage() { | ||
return thousandTwentyFourBEnergyUsage.get(); | ||
} | ||
|
||
public long get8192bEnergyUsage() { | ||
return eightThousandHundredNinetyTwoBEnergyUsage.get(); | ||
} | ||
|
||
public long getCreativeEnergyUsage() { | ||
return creativeEnergyUsage.get(); | ||
} | ||
} | ||
} |
Oops, something went wrong.