mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 03:36:47 -04:00
Added setting to allow disabling nanomachine particle effects client side for people running MC on a toaster. Closes #1550.
This commit is contained in:
parent
72d8a13a8a
commit
fb7aa123ef
@ -106,6 +106,12 @@ opencomputers {
|
|||||||
# treated as relative positions, values in [1, inf) will be treated as
|
# treated as relative positions, values in [1, inf) will be treated as
|
||||||
# absolute positions.
|
# absolute positions.
|
||||||
nanomachineHudPos: [-1, -1]
|
nanomachineHudPos: [-1, -1]
|
||||||
|
|
||||||
|
# Whether to emit particle effects around players via nanomachines. This
|
||||||
|
# includes the basic particles giving a rough indication of the current
|
||||||
|
# power level of the nanomachines as well as particles emitted by the
|
||||||
|
# particle effect behaviors.
|
||||||
|
enableNanomachinePfx: true
|
||||||
}
|
}
|
||||||
|
|
||||||
# Computer related settings, concerns server performance and security.
|
# Computer related settings, concerns server performance and security.
|
||||||
|
@ -45,6 +45,7 @@ class Settings(val config: Config) {
|
|||||||
OpenComputers.log.warn("Bad number of HUD coordiantes, ignoring.")
|
OpenComputers.log.warn("Bad number of HUD coordiantes, ignoring.")
|
||||||
(-1.0, -1.0)
|
(-1.0, -1.0)
|
||||||
}
|
}
|
||||||
|
val enableNanomachinePfx = config.getBoolean("client.enableNanomachinePfx")
|
||||||
|
|
||||||
// ----------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------- //
|
||||||
// computer
|
// computer
|
||||||
|
@ -279,7 +279,7 @@ class ControllerImpl(val player: EntityPlayer) extends Controller with WirelessE
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isClient) {
|
if (isClient && Settings.get.enableNanomachinePfx) {
|
||||||
val energyRatio = getLocalBuffer / (getLocalBufferSize + 1)
|
val energyRatio = getLocalBuffer / (getLocalBufferSize + 1)
|
||||||
val triggerRatio = activeInputs / (configuration.triggers.length + 1)
|
val triggerRatio = activeInputs / (configuration.triggers.length + 1)
|
||||||
val intensity = (energyRatio + triggerRatio) * 0.25
|
val intensity = (energyRatio + triggerRatio) * 0.25
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package li.cil.oc.common.nanomachines.provider
|
package li.cil.oc.common.nanomachines.provider
|
||||||
|
|
||||||
|
import li.cil.oc.Settings
|
||||||
import li.cil.oc.api
|
import li.cil.oc.api
|
||||||
import li.cil.oc.api.nanomachines.Behavior
|
import li.cil.oc.api.nanomachines.Behavior
|
||||||
import li.cil.oc.api.prefab.AbstractBehavior
|
import li.cil.oc.api.prefab.AbstractBehavior
|
||||||
@ -44,7 +45,7 @@ object ParticleProvider extends ScalaProvider("b48c4bbd-51bb-4915-9367-16cff3220
|
|||||||
|
|
||||||
override def update(): Unit = {
|
override def update(): Unit = {
|
||||||
val world = player.getEntityWorld
|
val world = player.getEntityWorld
|
||||||
if (world.isRemote) {
|
if (world.isRemote && Settings.get.enableNanomachinePfx) {
|
||||||
PlayerUtils.spawnParticleAround(player, effectName, api.Nanomachines.getController(player).getInputCount(this) * 0.25)
|
PlayerUtils.spawnParticleAround(player, effectName, api.Nanomachines.getController(player).getInputCount(this) * 0.25)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user