adopting Java 9/Kotlin 1.2

This commit is contained in:
minjaesong
2018-02-10 21:40:17 +09:00
parent 941d9fa107
commit 40423ede52
31 changed files with 326 additions and 69 deletions

View File

@@ -84,11 +84,10 @@ object WeatherMixer {
if (KeyToggler.isOn(Input.Keys.F2)) {
val playerPosX = player.hitbox.centeredX
val playerPosY = player.hitbox.centeredY
kotlin.repeat(1) {
// 4 seems good
kotlin.repeat(7) {
val rainParticle = ParticleMegaRain(
playerPosX + HQRNG().nextInt(Terrarum.WIDTH) - Terrarum.HALFW,
playerPosY - Terrarum.HALFH
playerPosY - Terrarum.HEIGHT
)
Terrarum.ingame!!.addParticle(rainParticle)
}
@@ -229,13 +228,13 @@ object WeatherMixer {
var mixFrom: String?
try { mixFrom = JSON.get("mixFrom").asJsonPrimitive.asString }
catch (e: NullPointerException) { mixFrom = null }
catch (e: IllegalStateException) { mixFrom = null }
var mixPercentage: Double?
try { mixPercentage = JSON.get("mixPercentage").asJsonPrimitive.asDouble }
catch (e: NullPointerException) { mixPercentage = null }
catch (e: IllegalStateException) { mixPercentage = null }