mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-13 09:18:05 -04:00
honor enableNanomachinePfx when false
also the distance check for nanomachine wireless comm was perhaps not as intended. this change increases the range by correctly computing the distance closes #2505
This commit is contained in:
parent
1301ed8c3d
commit
a5b6e3fec3
@ -65,7 +65,7 @@ class ControllerImpl(val player: EntityPlayer) extends Controller with WirelessE
|
||||
override def receivePacket(packet: Packet, sender: WirelessEndpoint): Unit = {
|
||||
if (getLocalBuffer > 0 && commandDelay < 1 && !player.isDead) {
|
||||
val (dx, dy, dz) = ((sender.x + 0.5) - player.posX, (sender.y + 0.5) - player.posY, (sender.z + 0.5) - player.posZ)
|
||||
val dSquared = dx * dx + dy * dy + dz * dz
|
||||
val dSquared = Math.sqrt(dx * dx + dy * dy + dz * dz)
|
||||
if (dSquared <= CommandRange) packet.data.headOption match {
|
||||
case Some(header: Array[Byte]) if new String(header, Charsets.UTF_8) == "nanomachines" =>
|
||||
val command = packet.data.drop(1).map {
|
||||
|
@ -57,7 +57,7 @@ object PotionProvider extends ScalaProvider("c29e4eec-5a46-479a-9b3d-ad0f06da784
|
||||
}
|
||||
|
||||
override def update(): Unit = {
|
||||
player.addPotionEffect(new PotionEffect(potion.id, Duration, amplifier(player)))
|
||||
player.addPotionEffect(new PotionEffect(potion.id, Duration, if (Settings.get.enableNanomachinePfx) amplifier(player) else -1))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user