-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
74 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 0 additions & 75 deletions
75
src/main/kotlin/com/github/zly2006/enclosure/command/EnclosureSelector.kt
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
src/main/kotlin/com/github/zly2006/enclosure/command/ForceLoadSubcommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.github.zly2006.enclosure.command | ||
|
||
import com.github.zly2006.enclosure.EnclosureArea | ||
import com.github.zly2006.enclosure.utils.checkPermission | ||
import me.lucko.fabric.api.permissions.v0.Options | ||
import net.minecraft.server.command.ServerCommandSource | ||
import net.minecraft.server.world.ChunkLevelType | ||
import net.minecraft.server.world.ChunkLevels | ||
import net.minecraft.server.world.ChunkTicketType | ||
|
||
fun BuilderScope<*>.registerForceLoad() { | ||
fun forceLoad(source: ServerCommandSource, area: EnclosureArea, ticks: Int, level: Int) { | ||
if (checkPermission(source, "enclosure.bypass")) { | ||
|
||
} | ||
} | ||
|
||
literal("force-load") { | ||
argument(landArgument()) { | ||
literal("blocks") { | ||
permission("enclosure.command.force_load") | ||
val level = ChunkLevels.getLevelFromType(ChunkLevelType.BLOCK_TICKING) | ||
executes { | ||
val maxTime = Options.get(source, "enclosure.load.max_time", 21600) { it.toInt() } | ||
val land = getEnclosure(this) | ||
ChunkTicketType.FORCED | ||
forceLoad(source, land, maxTime * 20, level) | ||
} | ||
} | ||
literal("entities") { | ||
permission("enclosure.command.force_load") | ||
val level = ChunkLevels.getLevelFromType(ChunkLevelType.ENTITY_TICKING) | ||
executes { | ||
val maxTime = Options.get(source, "enclosure.load.max_time", 21600) { it.toInt() } | ||
val land = getEnclosure(this) | ||
forceLoad(source, land, maxTime * 20, level) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters