mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
alpha version up & cleanup code.
This commit is contained in:
parent
1b83c8db81
commit
00fba2f4b0
40 changed files with 893 additions and 718 deletions
|
|
@ -75,7 +75,7 @@ object ItemUtil {
|
|||
(itemMeta as? Damageable)?.let {
|
||||
val durability = type.maxDurability.toInt()
|
||||
val firstDamage = (first.itemMeta as? Damageable)?.damage ?: 0
|
||||
if( firstDamage == 0) return false
|
||||
if (firstDamage == 0) return false
|
||||
|
||||
val firstDurability = durability - firstDamage
|
||||
val secondDamage = (second.itemMeta as? Damageable)?.damage ?: 0
|
||||
|
|
@ -96,12 +96,12 @@ object ItemUtil {
|
|||
(itemMeta as? Damageable)?.let {
|
||||
val durability = type.maxDurability.toInt()
|
||||
val firstDamage = it.damage
|
||||
if( firstDamage == 0) return 0
|
||||
if (firstDamage == 0) return 0
|
||||
var unitCount = 0
|
||||
var damage = firstDamage
|
||||
while((unitCount < unitAmount) && (damage > 0)){
|
||||
while ((unitCount < unitAmount) && (damage > 0)) {
|
||||
unitCount++
|
||||
damage = ceil(firstDamage - durability*percentPerUnit*unitCount).toInt()
|
||||
damage = ceil(firstDamage - durability * percentPerUnit * unitCount).toInt()
|
||||
}
|
||||
|
||||
it.damage = max(damage, 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue