Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
getParameter to retrieves runtime values via API. (#350)
# Conflicts: # src/main/java/mod/chiselsandbits/api/IChiselAndBitsAPI.java
- Loading branch information
1 parent
9a7153b
commit 3bf6fda
Showing
3 changed files
with
139 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package mod.chiselsandbits.api; | ||
|
||
/** | ||
* use these Enums to retrieve various settings or runtime values via | ||
* {@link IChiselAndBitsAPI}.getParameter | ||
*/ | ||
public interface ParameterType<T extends Object> | ||
{ | ||
|
||
public ParamTypes getType(); | ||
|
||
public static enum ParamTypes | ||
{ | ||
BOOLEAN, | ||
FLOAT, | ||
DOUBLE, | ||
INTEGER | ||
}; | ||
|
||
public static enum BooleanParam implements ParameterType<Boolean> | ||
{ | ||
ENABLE_MCMP(/* enableMCMultipart */), | ||
ENABLE_DAMAGE_TOOLS(/* damageTools */), | ||
ENABLE_BIT_LIGHT_SOURCE(/* enableBitLightSource */); | ||
|
||
@Override | ||
public mod.chiselsandbits.api.ParameterType.ParamTypes getType() | ||
{ | ||
return ParamTypes.BOOLEAN; | ||
} | ||
}; | ||
|
||
public static enum FloatParam implements ParameterType<Float> | ||
{ | ||
BLOCK_FULL_LIGHT_PERCENTAGE(/* bitLightPercentage */); | ||
|
||
@Override | ||
public mod.chiselsandbits.api.ParameterType.ParamTypes getType() | ||
{ | ||
return ParamTypes.FLOAT; | ||
} | ||
} | ||
|
||
public static enum DoubleParam implements ParameterType<Double> | ||
{ | ||
BIT_MAX_DRAWN_REGION_SIZE(/* maxDrawnRegionSize */); | ||
|
||
@Override | ||
public mod.chiselsandbits.api.ParameterType.ParamTypes getType() | ||
{ | ||
return ParamTypes.DOUBLE; | ||
} | ||
} | ||
|
||
public static enum IntegerParam implements ParameterType<Integer> | ||
{ | ||
BIT_BAG_MAX_STACK_SIZE(/* bagStackSize */); | ||
|
||
@Override | ||
public mod.chiselsandbits.api.ParameterType.ParamTypes getType() | ||
{ | ||
return ParamTypes.INTEGER; | ||
} | ||
} | ||
|
||
} |
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