Skip to content

Commit

Permalink
1.18 (#90)
Browse files Browse the repository at this point in the history
* begin 1.18 update

* fix fawe-dep

* disable sync command due to api changes im too dumb to get

* fix schedulers except the ones in DeeperWorldPlugin.kt

* more tweaks

* Update ido version to fix scheduler issues

* Update WE sync code

Co-authored-by: 0ffz <dan.voznyy@gmail.com>
  • Loading branch information
Boy0000 and 0ffz authored Mar 20, 2022
1 parent fb0307a commit 0330056
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up JDK 16
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 16
java-version: 17
cache: gradle

- name: Grant execute permission for gradlew
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up JDK 16
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 16
java-version: 17
cache: gradle

- name: Grant execute permission for gradlew
Expand Down
32 changes: 15 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import Com_mineinabyss_conventions_platform_gradle.Deps

val idofrontVersion: String by project

plugins {
id("com.mineinabyss.conventions.kotlin")
id("com.mineinabyss.conventions.papermc")
id("com.mineinabyss.conventions.copyjar")
id("com.mineinabyss.conventions.publication")
id("com.mineinabyss.conventions.testing")
alias(libs.plugins.mia.kotlin)
alias(libs.plugins.mia.papermc)
alias(libs.plugins.mia.copyjar)
alias(libs.plugins.mia.publication)
alias(libs.plugins.mia.testing)
kotlin("plugin.serialization")
}

Expand All @@ -16,25 +14,25 @@ repositories {
maven("https://oss.sonatype.org/content/groups/public/")
maven("https://www.rutgerkok.nl/repo")
maven("https://repo.dmulloy2.net/nexus/repository/public/")
maven("https://repo.mineinabyss.com/releases")
maven("https://repo.mineinabyss.com/releases/")
maven("https://papermc.io/repo/repository/maven-public/") //Paper
maven("https://repo.codemc.org/repository/maven-public/")
maven("https://mvn.intellectualsites.com/content/repositories/releases/") // FAWE
//maven("https://mvn.intellectualsites.com/content/repositories/releases/") // FAWE
maven("https://jitpack.io")
}

dependencies {
// MineInAbyss platform
compileOnly(Deps.kotlin.stdlib)
compileOnly(Deps.kotlinx.serialization.json)
compileOnly(Deps.kotlinx.serialization.kaml)
compileOnly(Deps.minecraft.skedule)
compileOnly(libs.kotlin.stdlib)
compileOnly(libs.kotlinx.serialization.json)
compileOnly(libs.kotlinx.serialization.kaml)
compileOnly(libs.minecraft.skedule)

// Plugin APIs
compileOnly("com.fastasyncworldedit:FAWE-Bukkit:1.17-47") { isTransitive = false }
compileOnly("com.fastasyncworldedit:FAWE-Core:1.17-47")
compileOnly("nl.rutgerkok:blocklocker:1.9.2")
compileOnly("com.comphenix.protocol:ProtocolLib:4.5.0")
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core:2.0.1")
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit:2.0.1") { isTransitive = false }
compileOnly("nl.rutgerkok:blocklocker:1.10.4")
compileOnly("com.comphenix.protocol:ProtocolLib:4.8.0-SNAPSHOT")

// Shaded
implementation("com.mineinabyss:idofront:$idofrontVersion")
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=com.mineinabyss
version=0.4
kotlinVersion=1.6.10
serverVersion=1.17.1-R0.1-SNAPSHOT
idofrontConventions=1.6.10-51
kotlinVersion=1.6.20-RC
serverVersion=1.18.2-R0.1-SNAPSHOT
idofrontConventions=1.6.20-RC-70
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
13 changes: 6 additions & 7 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@ pluginManagement {
repositories {
gradlePluginPortal()
maven("https://repo.mineinabyss.com/releases")
maven("https://papermc.io/repo/repository/maven-public/") //Paper
}
plugins {
val kotlinVersion: String by settings
id("org.jetbrains.kotlin.jvm") version kotlinVersion
id("org.jetbrains.kotlin.plugin.serialization") version kotlinVersion
id("com.github.johnrengelman.shadow") version "6.0.0"
id("io.github.0ffz.github-packages") version "1.2.0"
}
}

dependencyResolutionManagement {
val idofrontConventions: String by settings

resolutionStrategy {
eachPlugin {
if (requested.id.id.startsWith("com.mineinabyss.conventions"))
useVersion(idofrontConventions)
}
repositories {
maven("https://repo.mineinabyss.com/releases")
}
versionCatalogs.create("libs").from("com.mineinabyss:catalog:$idofrontConventions")
}

rootProject.name = "deeperworld"
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.mineinabyss.deeperworld

import com.fastasyncworldedit.core.util.EditSessionBuilder
import com.fastasyncworldedit.core.util.TaskManager
import com.mineinabyss.deeperworld.MinecraftConstants.FULL_DAY_TIME
import com.mineinabyss.deeperworld.config.DeeperConfig
Expand All @@ -20,6 +19,7 @@ import com.mineinabyss.idofront.messaging.error
import com.mineinabyss.idofront.messaging.info
import com.mineinabyss.idofront.messaging.success
import com.sk89q.worldedit.EditSession
import com.sk89q.worldedit.WorldEdit
import com.sk89q.worldedit.bukkit.WorldEditPlugin
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard
import com.sk89q.worldedit.function.operation.ForwardExtentCopy
Expand Down Expand Up @@ -108,9 +108,10 @@ class DeeperCommandExecutor : IdofrontCommandExecutor(), TabCompleter {
val clipboard = BlockArrayClipboard(region)
val wep = WorldEditPlugin.getInstance().bukkitImplAdapter;
val weWorld: World = wep.adapt(player.world)
val editSession: EditSession = EditSessionBuilder(weWorld)
.limitUnlimited()
.build()
val editSession: EditSession = WorldEdit.getInstance().newEditSessionBuilder()
.world(weWorld)
.limitUnlimited()
.build()

val loc = player.location
val linkedSection =
Expand Down
10 changes: 5 additions & 5 deletions src/main/kotlin/com/mineinabyss/deeperworld/DeeperWorldPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class DeeperWorldPlugin : JavaPlugin() {
override fun onLoad() {
IdofrontPlatforms.load(this, "mineinabyss")
}

override fun onEnable() {
saveDefaultConfig()

registerService<WorldManager>(WorldManagerImpl(config))

DeeperConfig.load()
Expand All @@ -49,7 +49,7 @@ class DeeperWorldPlugin : JavaPlugin() {

// Initialize falling damage task
if (DeeperConfig.data.fall.maxSafeDist >= 0f && DeeperConfig.data.fall.fallDistanceDamageScaler >= 0.0) {
schedule {
deeperWorld.schedule {
repeating(DeeperConfig.data.fall.hitDelay.inWholeTicks.coerceAtLeast(1))
while (true) {
server.onlinePlayers.forEach {
Expand All @@ -63,8 +63,8 @@ class DeeperWorldPlugin : JavaPlugin() {
// Initialize time synchronization task
if (DeeperConfig.data.time.syncedWorlds.isNotEmpty()) {
DeeperConfig.data.time.mainWorld?.let { mainWorld ->
schedule {
repeating(DeeperConfig.data.time.updateInterval.inWholeTicks)
deeperWorld.schedule {
repeating(DeeperConfig.data.time.updateInterval.inWholeTicks.coerceAtLeast(1))
while (true) {
val mainWorldTime = mainWorld.time
DeeperConfig.data.time.syncedWorlds.forEach { (world, offset) ->
Expand All @@ -78,7 +78,7 @@ class DeeperWorldPlugin : JavaPlugin() {
}

override fun onDisable() {
MovementListener.temporaryBedrock.forEach{
MovementListener.temporaryBedrock.forEach {
it.type = Material.AIR
}
}
Expand Down

0 comments on commit 0330056

Please sign in to comment.