Fix zapping non androids
This commit is contained in:
parent
2833d1fdb9
commit
64403858f3
@ -89,11 +89,13 @@ class EnergySwordItem : Item(Properties().stacksTo(1).rarity(Rarity.RARE).tab(Ov
|
|||||||
itemStack.getCapability(MatteryCapability.ENERGY).ifPresentK {
|
itemStack.getCapability(MatteryCapability.ENERGY).ifPresentK {
|
||||||
if (!it.extractEnergyInnerExact(ENERGY_PER_SWING, false).isZero) {
|
if (!it.extractEnergyInnerExact(ENERGY_PER_SWING, false).isZero) {
|
||||||
victim.matteryPlayer?.let {
|
victim.matteryPlayer?.let {
|
||||||
|
if (it.isAndroid) {
|
||||||
it.androidEnergy.extractEnergyInner(ENERGY_ZAP, false)
|
it.androidEnergy.extractEnergyInner(ENERGY_ZAP, false)
|
||||||
victim.hurt(EMPDamageSource(attacker), 8f)
|
victim.hurt(EMPDamageSource(attacker), 8f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user