CPU no longer boils

This commit is contained in:
2026-04-25 22:37:23 +00:00
parent f3280f83d1
commit 83749bf3ba
2 changed files with 5 additions and 9 deletions

View File

@@ -12,9 +12,6 @@ import net.minecraft.network.protocol.common.custom.CustomPacketPayload
import net.minecraft.resources.ResourceLocation
import net.minecraft.server.level.ServerLevel
import net.minecraft.server.level.ServerPlayer
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.item.ItemStack
import net.minecraft.world.level.Level
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.EntityBlock
@@ -24,7 +21,6 @@ import net.minecraft.world.level.block.entity.BlockEntityType
import net.minecraft.world.level.block.state.BlockState
import org.neoflock.neocomputers.NeoComputers
import org.neoflock.neocomputers.network.Networking
import org.neoflock.neocomputers.network.PowerRole
import java.time.Duration
object NodeSynchronizer {
@@ -118,7 +114,7 @@ object NodeSynchronizer {
override fun type() = TYPE
}
val screenMap = mutableMapOf<ServerPlayer, NodeBlockEntity>()
val screenMap = HashMap<ServerPlayer, NodeBlockEntity>()
fun playerScreenClosed(player: ServerPlayer) {
screenMap.remove(player)

View File

@@ -196,7 +196,7 @@ object Networking {
}
if(reachability == Visibility.NETWORK) {
// absolute cinema
val working = mutableSetOf<Node>();
val working = HashSet<Node>();
val pending = mutableListOf(this);
var iterCount = 0;
while(iterCount < maxHopCount && pending.isNotEmpty()) {
@@ -246,8 +246,8 @@ object Networking {
abstract fun receiveWireless(message: Message, emitter: WirelessEndpoint)
}
val wirelessNodes = ThreadLocal.withInitial { mutableSetOf<WirelessEndpoint>() }
val allNodes = ThreadLocal.withInitial { mutableMapOf<UUID, Node>() }
val wirelessNodes = ThreadLocal.withInitial { HashSet<WirelessEndpoint>() }
val allNodes = ThreadLocal.withInitial { HashMap<UUID, Node>() }
// node may differ from message.sender in the case of relays,
// as they might have DIRECT reachability but
@@ -326,7 +326,7 @@ object Networking {
nodes.forEach { removeNode(it) }
}
val channels = ThreadLocal.withInitial { mutableMapOf<String, MutableSet<Node>>() }
val channels = ThreadLocal.withInitial { HashMap<String, MutableSet<Node>>() }
fun addToChannel(channel: String, node: Node) {
val localChannels = channels.get()