mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 19:25:20 -04:00
Fixed energy glitch in robots carried over from 1.2.
This commit is contained in:
parent
fcc0dc85c3
commit
8540f2eed0
@ -284,6 +284,10 @@ class Robot(val isRemote: Boolean) extends traits.Computer with traits.PowerInfo
|
|||||||
// Ensure we have a node address, because the proxy needs this to initialize
|
// Ensure we have a node address, because the proxy needs this to initialize
|
||||||
// its own node to the same address ours has.
|
// its own node to the same address ours has.
|
||||||
api.Network.joinNewNetwork(node)
|
api.Network.joinNewNetwork(node)
|
||||||
|
|
||||||
|
// Flush excess energy to other components (mostly relevant for upgrading
|
||||||
|
// robots from 1.2 to 1.3, to move energy to the experience upgrade).
|
||||||
|
bot.node.setLocalBufferSize(bot.node.localBufferSize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import li.cil.oc.common.component.ManagedComponent
|
|||||||
import net.minecraft.nbt.NBTTagCompound
|
import net.minecraft.nbt.NBTTagCompound
|
||||||
|
|
||||||
class UpgradeExperience extends ManagedComponent {
|
class UpgradeExperience extends ManagedComponent {
|
||||||
def node = api.Network.newNode(this, Visibility.Network).
|
val node = api.Network.newNode(this, Visibility.Network).
|
||||||
withComponent("experience").
|
withComponent("experience").
|
||||||
withConnector(30 * Settings.get.bufferPerLevel).
|
withConnector(30 * Settings.get.bufferPerLevel).
|
||||||
create()
|
create()
|
||||||
@ -25,7 +25,6 @@ class UpgradeExperience extends ManagedComponent {
|
|||||||
if (experience >= xpForNextLevel) {
|
if (experience >= xpForNextLevel) {
|
||||||
updateXpInfo()
|
updateXpInfo()
|
||||||
}
|
}
|
||||||
// ServerPacketSender.sendRobotXp(this)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ trait Connector extends network.Connector with Node {
|
|||||||
}
|
}
|
||||||
localBufferSize = math.max(size, 0)
|
localBufferSize = math.max(size, 0)
|
||||||
val surplus = math.max(localBuffer - localBufferSize, 0)
|
val surplus = math.max(localBuffer - localBufferSize, 0)
|
||||||
localBuffer = math.min(localBuffer, localBufferSize)
|
changeBuffer(-surplus)
|
||||||
d.changeBuffer(surplus)
|
d.changeBuffer(surplus)
|
||||||
}
|
}
|
||||||
case _ =>
|
case _ =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user