refactor: Split waypoint classes

This commit is contained in:
Linnea Gräf
2025-03-22 11:27:03 +01:00
parent aa327dcfd0
commit 588f8bbb82
4 changed files with 205 additions and 153 deletions

View File

@@ -0,0 +1,37 @@
package moe.nea.firmament.util.mc
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource
import net.minecraft.server.command.CommandOutput
import net.minecraft.server.command.ServerCommandSource
import net.minecraft.text.Text
fun FabricClientCommandSource.asFakeServer(): ServerCommandSource {
val source = this
return ServerCommandSource(
object : CommandOutput {
override fun sendMessage(message: Text?) {
source.player.sendMessage(message, false)
}
override fun shouldReceiveFeedback(): Boolean {
return true
}
override fun shouldTrackOutput(): Boolean {
return true
}
override fun shouldBroadcastConsoleToOps(): Boolean {
return true
}
},
source.position,
source.rotation,
null,
0,
"FakeServerCommandSource",
Text.literal("FakeServerCommandSource"),
null,
source.player
)
}