use of mcjty.rftoolsdim.config.Settings in project RFToolsDimensions by McJty.
the class DimensionInformation method addToCost.
private void addToCost(DimletKey key) {
Settings settings = KnownDimletConfiguration.getSettings(key);
if (settings == null)
return;
int rfMaintainCost = settings.getMaintainCost();
if (rfMaintainCost < 0) {
int nominalCost = descriptor.calculateNominalCost();
int rfMinimum = Math.max(10, nominalCost * PowerConfiguration.minimumCostPercentage / 100);
actualRfCost = actualRfCost - (actualRfCost * (-rfMaintainCost) / 100);
if (actualRfCost < rfMinimum) {
// Never consume less then this
actualRfCost = rfMinimum;
}
} else {
actualRfCost += rfMaintainCost;
}
}
use of mcjty.rftoolsdim.config.Settings in project RFToolsDimensions by McJty.
the class DimensionDescriptor method getCreationCost.
private int getCreationCost(DimletType type, DimletKey key) {
int cost = 0;
Settings settings = KnownDimletConfiguration.getSettings(key);
if (settings != null) {
cost = settings.getCreateCost();
}
return cost;
}
use of mcjty.rftoolsdim.config.Settings in project RFToolsDimensions by McJty.
the class DimensionDescriptor method getMaintenanceCost.
private int getMaintenanceCost(DimletType type, DimletKey key) {
int cost = 0;
Settings settings = KnownDimletConfiguration.getSettings(key);
if (settings != null) {
cost = settings.getMaintainCost();
}
return cost;
}
use of mcjty.rftoolsdim.config.Settings in project RFToolsDimensions by McJty.
the class DimensionDescriptor method getTickCost.
private int getTickCost(DimletType type, DimletKey key) {
int cost = 0;
Settings settings = KnownDimletConfiguration.getSettings(key);
if (settings != null) {
cost = settings.getTickCost();
}
return cost;
}
use of mcjty.rftoolsdim.config.Settings in project RFToolsDimensions by McJty.
the class DimletDebug method dumpBlock.
private static void dumpBlock(Block block) {
if (block instanceof BlockLiquid) {
return;
}
Set<Filter.Feature> features = KnownDimletConfiguration.getBlockFeatures(block);
String mod = Block.REGISTRY.getNameForObject(block).getResourceDomain();
for (IBlockState state : block.getBlockState().getValidStates()) {
int meta = state.getBlock().getMetaFromState(state);
List<IProperty<?>> propertyNames = new ArrayList<>(state.getPropertyKeys());
propertyNames.sort(Comparator.comparing(IProperty::getName));
ImmutableMap<IProperty<?>, Comparable<?>> properties = state.getProperties();
Map<String, String> props = new HashMap<>();
for (Map.Entry<IProperty<?>, Comparable<?>> entry : properties.entrySet()) {
props.put(entry.getKey().getName(), entry.getValue().toString());
}
DimletKey key = new DimletKey(DimletType.DIMLET_MATERIAL, block.getRegistryName() + "@" + meta);
Settings settings = DimletRules.getSettings(key, mod, features, props);
Logging.log(key + " (" + state.toString() + "): " + settings.toString());
}
}
Aggregations