fix gitignore

This commit is contained in:
creeper123123321 2021-02-10 10:43:41 -03:00
parent fb29519b22
commit dd01584fc3
3 changed files with 76 additions and 3 deletions

6
.gitignore vendored
View File

@ -1,5 +1,5 @@
.idea
.gradle
build
config
logs
/build
/config
/logs

View File

@ -0,0 +1,36 @@
package com.github.creeper123123321.viaaas.config
import us.myles.ViaVersion.AbstractViaConfig
import java.io.File
import java.net.URL
object CloudViaConfig : AbstractViaConfig(File("config/viaversion.yml")) {
// https://github.com/ViaVersion/ViaFabric/blob/mc-1.16/src/main/java/com/github/creeper123123321/viafabric/platform/VRViaConfig.java
override fun getDefaultConfigURL(): URL = javaClass.classLoader.getResource("assets/viaversion/config.yml")!!
override fun handleConfig(config: Map<String, Any>) {
// Nothing Currently
}
override fun getUnsupportedOptions(): List<String> = UNSUPPORTED
override fun isAntiXRay(): Boolean = false
override fun isItemCache(): Boolean = false
override fun isNMSPlayerTicking(): Boolean = false
override fun is1_12QuickMoveActionFix(): Boolean = false
override fun getBlockConnectionMethod(): String = "packet"
override fun is1_9HitboxFix(): Boolean = false
override fun is1_14HitboxFix(): Boolean = false
// Based on Sponge ViaVersion
private val UNSUPPORTED = listOf(
"anti-xray-patch", "bungee-ping-interval",
"bungee-ping-save", "bungee-servers", "quick-move-action-fix", "nms-player-ticking",
"item-cache", "velocity-ping-interval", "velocity-ping-save", "velocity-servers",
"blockconnection-method", "change-1_9-hitbox", "change-1_14-hitbox"
)
init {
// Load config
reloadConfig()
}
}

View File

@ -0,0 +1,37 @@
package com.github.creeper123123321.viaaas.config
import us.myles.ViaVersion.util.Config
import java.io.File
object VIAaaSConfig : Config(File("config/viaaas.yml")) {
init {
reloadConfig()
}
override fun getUnsupportedOptions() = emptyList<String>().toMutableList()
override fun getDefaultConfigURL() = VIAaaSConfig::class.java.classLoader.getResource("viaaas.yml")!!
override fun handleConfig(p0: MutableMap<String, Any>?) {
}
val isNativeTransportMc: Boolean get() = this.getBoolean("native-transport-mc", true)
val port: Int get() = this.getInt("port", 25565)
val bindAddress: String get() = this.getString("bind-address", "localhost")!!
val hostName: String get() = this.getString("host-name", "viaaas.localhost")!!
val mcRsaSize: Int get() = this.getInt("mc-rsa-size", 4096)
val useStrongRandom: Boolean get() = this.getBoolean("use-strong-random", true)
val blockLocalAddress: Boolean get() = this.getBoolean("block-local-address", true)
val requireHostName: Boolean get() = this.getBoolean("require-host-name", true)
val defaultBackendPort: Int get() = this.getInt("default-backend-port", 25565)
val blockedBackAddresses: List<String>
get() = this.get(
"blocked-back-addresses",
List::class.java,
emptyList<String>()
)!!.map { it as String }
val allowedBackAddresses: List<String>
get() = this.get(
"allowed-back-addresses",
List::class.java,
emptyList<String>()
)!!.map { it as String }
}