generated from Liams-Services/PaperMC-Plugin-Boilerplate
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07dbe37
commit 2ef1cc9
Showing
32 changed files
with
325 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# These are supported funding model platforms | ||
|
||
github: [coasterfreakde] | ||
github: [ coasterfreakde ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,16 @@ | ||
kotlin.code.style=official | ||
|
||
minecraftVersion=1.20.6 | ||
|
||
kotlinxSerializationJsonVersion=1.7.0 | ||
|
||
exposedVersion=0.51.1 | ||
hikariCPVersion=5.1.0 | ||
|
||
mysqlVersion=8.4.0 | ||
postgresqlVersion=42.7.3 | ||
mariaDBVersion=3.4.0 | ||
sqliteVersion=3.46.0.0 | ||
h2Version=2.2.224 | ||
|
||
fruxzAscendVersion=2024.2.1 | ||
fruxzStackedVersion=2024.1.1 | ||
|
||
kotlinxCoroutinesCoreVersion=1.9.0-RC | ||
kotlinxCollectionsImmutableVersion=0.3.7 | ||
|
||
gsonVersion=2.11.0 | ||
|
||
slf4jVersion=2.0.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
|
||
rootProject.name = "EnergeticStorage-Reborn" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/com/liamxsage/energeticstorage/cache/DiskCache.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
src/main/kotlin/com/liamxsage/energeticstorage/cache/DiskDriveCache.kt
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
src/main/kotlin/com/liamxsage/energeticstorage/cache/NetworkInterfaceCache.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.liamxsage.energeticstorage.cache | ||
|
||
import com.liamxsage.energeticstorage.network.NetworkInterface | ||
import java.util.* | ||
import java.util.concurrent.locks.ReadWriteLock | ||
import java.util.concurrent.locks.ReentrantReadWriteLock | ||
|
||
object NetworkInterfaceCache { | ||
|
||
private val cacheLock: ReadWriteLock = ReentrantReadWriteLock() | ||
private var cache = mapOf<UUID, NetworkInterface>() | ||
|
||
fun getNetworkInterfaceByUUID(interfaceUUID: UUID): NetworkInterface? { | ||
cacheLock.readLock().lock() | ||
val networkInterface = cache[interfaceUUID] | ||
cacheLock.readLock().unlock() | ||
return networkInterface | ||
} | ||
|
||
fun addNetworkInterface(networkInterface: NetworkInterface) { | ||
cacheLock.writeLock().lock() | ||
cache = cache + (networkInterface.uuid to networkInterface) | ||
cacheLock.writeLock().unlock() | ||
} | ||
|
||
fun removeNetworkInterfaceByUUID(interfaceUUID: UUID) { | ||
cacheLock.writeLock().lock() | ||
cache = cache - interfaceUUID | ||
cacheLock.writeLock().unlock() | ||
} | ||
|
||
fun getCachedNetworkInterfaces(): List<NetworkInterface> { | ||
cacheLock.readLock().lock() | ||
val networkInterfaces = cache.values.toList() | ||
cacheLock.readLock().unlock() | ||
return networkInterfaces | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.