Skip to content

Commit

Permalink
P A I N
Browse files Browse the repository at this point in the history
  • Loading branch information
Seggan committed Sep 26, 2024
1 parent b0032a8 commit 032fce4
Show file tree
Hide file tree
Showing 11 changed files with 213 additions and 157 deletions.
10 changes: 7 additions & 3 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ plugins {

repositories {
mavenCentral()
maven(url = "https://jitpack.io/")
maven(url = "https://repo.papermc.io/repository/maven-public/")
maven(url = "https://repo.aikar.co/content/groups/aikar/")
maven("https://jitpack.io/")
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.aikar.co/content/groups/aikar/")
maven("https://repo.metamechanists.org/releases/")
}

dependencies {
Expand Down Expand Up @@ -43,6 +44,8 @@ dependencies {
implementation("org.bstats:bstats-bukkit:3.0.2")
implementation("co.aikar:acf-paper:0.5.1-SNAPSHOT")

implementation("org.metamechanists:DisplayModelLib:34")

implementation("io.github.seggan:sf4k:0.6.0")

testImplementation(kotlin("test"))
Expand Down Expand Up @@ -89,6 +92,7 @@ tasks.shadowJar {
doRelocate("io.github.seggan.kfun")
doRelocate("co.aikar.commands")
doRelocate("co.aikar.locales")
doRelocate("org.metamechanists.displaymodellib")
} else {
archiveClassifier = "unrelocated"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import org.bukkit.plugin.java.JavaPlugin
import java.nio.file.Path
import java.util.logging.Level
import kotlin.coroutines.CoroutineContext
import kotlin.io.path.createDirectories
import kotlin.script.experimental.api.ResultValue
import kotlin.script.experimental.api.ScriptDiagnostic
import kotlin.script.experimental.api.valueOrThrow
Expand Down Expand Up @@ -116,6 +117,7 @@ open class Galactifun2 : AbstractAddon() {

launchMessages = config.getStringList("rockets.launch-msgs")
structuresFolder = dataFolder.toPath().resolve("structures")
structuresFolder.createDirectories()

BaseUniverse.init()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ open class BetterSlimefunItem : SlimefunItem {
}
}

override fun preRegister() {
final override fun preRegister() {
for (method in javaClass.getAllMethods()) {
if (method.isAnnotationPresent(ItemHandler::class.java)) {
method.isAccessible = true
Expand All @@ -120,8 +120,11 @@ open class BetterSlimefunItem : SlimefunItem {
})
}
}
beforeRegister()
}

protected open fun beforeRegister() {}

protected fun <T : Any> itemSetting(key: String, default: T): ItemSetting<T> {
val setting = ItemSetting(this, key, default)
addItemSetting(setting)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class RocketInfo(
val dryMass = wetMass - stages.unitSumOf { it.fuelMass }

val info = buildString {
val planet = PlanetManager.getByWorld(commandComputer.world) ?: error("Planet not found")
val planet = PlanetManager.getByWorld(commandComputer.world)
appendLine("Stages:")
var stageNum = 1
for (stage in stages) {
Expand All @@ -66,7 +66,9 @@ class RocketInfo(
appendLine("Thrust: %,.2f kilonewtons".format(thrust.kilonewtons))
appendLine("Wet mass: %.2s".format(wetMass))
appendLine("Dry mass: %.2s".format(dryMass))
appendLine("TWR: %.2f".format(twr(planet.gravity)))
if (planet != null) {
appendLine("TWR: %.2f".format(twr(planet.gravity)))
}
appendLine("Delta-V: %.2s".format(deltaV(engines, wetMass, dryMass)))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import io.github.addoncommunity.galactifun.util.menu.PlanetMenu
import io.github.seggan.sf4k.extensions.plusAssign
import kotlinx.datetime.Clock
import org.bukkit.Location
import org.bukkit.entity.BlockDisplay
import org.bukkit.entity.FallingBlock
import org.bukkit.entity.Player

@Suppress("unused")
Expand Down Expand Up @@ -66,7 +66,7 @@ object Gf2Command : BaseCommand() {
fun undiplayentityify(player: Player) {
var count = 0
for (entity in player.world.entities) {
if (entity is BlockDisplay) {
if (entity is FallingBlock) {
if (entity.toBlock()) {
count++
}
Expand Down
Loading

0 comments on commit 032fce4

Please sign in to comment.