Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build-logic/src/main/kotlin/buildlogic.adapter.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ repositories {
includeModule("io.papermc.paper", "dev-bundle")
}
}
maven {
name = "TCodedReleases"
url = uri("https://repo.tcoded.com/releases")
}
mavenCentral()
afterEvaluate {
killNonEngineHubRepositories()
Expand All @@ -44,6 +48,7 @@ repositories {

dependencies {
implementation(project(":worldedit-bukkit"))
compileOnly("com.tcoded:FoliaLib:0.5.1")
constraints {
//Reduces the amount of libraries Gradle and IntelliJ need to resolve
implementation("net.kyori:adventure-bom") {
Expand Down
1 change: 1 addition & 0 deletions build-logic/src/main/kotlin/repositoriesHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ private val ALLOWED_PREFIXES = listOf(
"https://repo.maven.apache.org/maven2/",
"https://s01.oss.sonatype.org/content/repositories/snapshots/",
"https://plugins.gradle.org",
"https://repo.tcoded.com",
"file:"
)
private val LOGGER = Logging.getLogger("repositoriesHelper")
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ parallelgzip = "1.0.5"
adventure = "4.26.1"
adventure-bukkit = "4.4.1"
checkerqual = "3.52.1"
foliaLib = "0.5.1"
truezip = "6.8.4"
auto-value = "1.11.1"
jsr305 = "3.0.2"
Expand Down Expand Up @@ -119,6 +120,7 @@ paster = { group = "com.intellectualsites.paster", name = "Paster", version.ref
vault = { group = "com.github.MilkBowl", name = "VaultAPI", version.ref = "vault" }
serverlib = { group = "dev.notmyfault.serverlib", name = "ServerLib", version.ref = "serverlib" }
checkerqual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerqual" }
foliaLib = { group = "com.tcoded", name = "FoliaLib", version.ref = "foliaLib" }

autoService = { group = "com.google.auto.service", name = "auto-service", version.ref = "autoService" }

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.chunk.LevelChunk;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_20_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_20_R2.block.data.CraftBlockData;
import org.bukkit.event.block.BlockPhysicsEvent;
Expand Down Expand Up @@ -58,7 +59,7 @@ public PaperweightFaweWorldNativeAccess(PaperweightFaweAdapter paperweightFaweAd
this.level = level;
// Use the actual tick as minecraft-defined so we don't try to force blocks into the world when the server's already lagging.
// - With the caveat that we don't want to have too many cached changed (1024) so we'd flush those at 1024 anyway.
this.lastTick = new AtomicInteger(MinecraftServer.currentTick);
this.lastTick = new AtomicInteger(getCurrentTick());
}

private Level getLevel() {
Expand Down Expand Up @@ -94,7 +95,7 @@ public synchronized net.minecraft.world.level.block.state.BlockState setBlockSta
LevelChunk levelChunk, BlockPos blockPos,
net.minecraft.world.level.block.state.BlockState blockState
) {
int currentTick = MinecraftServer.currentTick;
int currentTick = getCurrentTick();
if (Fawe.isMainThread()) {
return levelChunk.setBlockState(blockPos, blockState,
this.sideEffectSet != null && this.sideEffectSet.shouldApply(SideEffect.UPDATE)
Expand Down Expand Up @@ -289,4 +290,16 @@ private record CachedChange(

}

private int getCurrentTick() {
try {
return MinecraftServer.currentTick;
} catch (NoSuchFieldError e) {
try {
return Bukkit.getCurrentTick();
} catch (Exception ex) {
return 0;
}
}
}

}

Large diffs are not rendered by default.

Loading
Loading