SalvageBuilder
Link to salvagebuilder
A builder class used to use the CTUtils#setSalvage(ResourceLocation, Map<ResourceLocation, SalvageBuilder>) method.
Requires PMMO 0.5.4 or above!
导入类
Link to 导入类
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport mods.pmmo.SalvageBuilder;
Static Methods
Link to static-methods
Name: start
@return A new salvage builder
Returns: A new salvage builder
Return Type: SalvageBuilder
ZenScript Copy// SalvageBuilder.start() as SalvageBuilder
SalvageBuilder.start();
使用方式
Link to 使用方式
Name: setBaseChance
The default chance irregardless of skills that this salvage will be obtained. default = 0.0
Return Type: SalvageBuilder
ZenScript Copy// SalvageBuilder.setBaseChance(chance as double) as SalvageBuilder
mySalvageBuilder.setBaseChance(0.0);
参数 | 类型 | 描述 |
---|---|---|
参数 chance | 类型 double | 描述 chance before skill based chances are added |
Name: setChancePerLevel
A map of skill names and chances. Salvage logic will take the chance value and multiply it by the player's level in the skill used in the key to increase the player's odds. This is done for all pairs in the map. default = no extra chance
Return Type: SalvageBuilder
ZenScript Copy// SalvageBuilder.setChancePerLevel(chancePerLevel as double?[string]) as SalvageBuilder
mySalvageBuilder.setChancePerLevel({skillname: 0.0 as double?, otherskillname: 0.0 as double?});
参数 | 类型 | 描述 |
---|---|---|
参数 chancePerLevel | 类型 double?[string] | 描述 the increase in chance per level in skill |
Name: setLevelReq
The required levels to have this specific salvage item checked against the chance attributes. default = no requirements
Return Type: SalvageBuilder
ZenScript Copy// SalvageBuilder.setLevelReq(levelReq as int?[string]) as SalvageBuilder
mySalvageBuilder.setLevelReq({skillname: 0.0 as int?, otherskillname: 0.0 as int?});
参数 | 类型 | 描述 |
---|---|---|
参数 levelReq | 类型 int?[string] | 描述 the requirements to attempt this result |
Name: setMaxChance
The maximum chance to obtain this item. This acts as a ceiling for obtaining items where skills levels may create a 100% chance case that is not desired default = 1.0
Return Type: SalvageBuilder
ZenScript Copy// SalvageBuilder.setMaxChance(chance as double) as SalvageBuilder
mySalvageBuilder.setMaxChance(1.0);
参数 | 类型 | 描述 |
---|---|---|
参数 chance | 类型 double | 描述 chance ceiling for this item |
Name: setSalvageMax
The most of this item that can be obtained from salvage default = 1
Return Type: SalvageBuilder
ZenScript Copy// SalvageBuilder.setSalvageMax(max as int) as SalvageBuilder
mySalvageBuilder.setSalvageMax(1);
参数 | 类型 | 描述 |
---|---|---|
参数 max | 类型 int | 描述 the maximum output of this item |
Name: setXpAward
The xp that should be awarded when this item is successfully obtained from salvage default = no xp awarded
Return Type: SalvageBuilder
ZenScript Copy// SalvageBuilder.setXpAward(xpAward as long?[string]) as SalvageBuilder
mySalvageBuilder.setXpAward({skillname: 0.0 as long?, otherskillname: 0.0 as long?});
参数 | 类型 | 描述 |
---|---|---|
参数 xpAward | 类型 long?[string] | 描述 a map of skills and their associated xp awards |