mirror of
https://github.com/Mr-dayhappy/Minecraft-place-mod.git
synced 2026-10-23 01:53:39 +08:00
原版 PlaceCommand.placeStructure 只调 StructureStart.placeInChunk 摆放方块,从不把 StructureStart 注册进 StructureManager / 区块 StructureAccess,导致结构重启丢失、专属刷怪规则不激活。 新增 PlaceCommandMixin,在 placeStructure 返回前补做自然生成的三步:1) setStartForStructure 把 start 存进所在区块;2) createReferences 写 17x17 邻居引用;3) markUnsaved 强制存盘。全程 try-catch 兜底,注册失败不影响命令返回。 项目骨架参照 CarpetSLSAddition:Loom 1.18-SNAPSHOT + Gradle 9.7.1 + Java 25 + official 映射。
69 lines
1.3 KiB
Groovy
69 lines
1.3 KiB
Groovy
plugins {
|
|
id 'net.fabricmc.fabric-loom' version "${loom_version}"
|
|
id 'maven-publish'
|
|
}
|
|
|
|
version = project.mod_version
|
|
group = project.maven_group
|
|
|
|
base {
|
|
archivesName = project.archives_base_name
|
|
}
|
|
|
|
repositories {
|
|
maven {
|
|
url = "https://maven.fabricmc.net/"
|
|
}
|
|
maven {
|
|
url = "https://oss.sonatype.org/content/repositories/snapshots"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// To change the versions see the gradle.properties file
|
|
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
|
implementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
|
|
|
// Fabric API
|
|
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
|
}
|
|
|
|
processResources {
|
|
def modVersion = project.version
|
|
inputs.property "version", modVersion
|
|
|
|
filesMatching("fabric.mod.json") {
|
|
expand "version": modVersion
|
|
}
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
// Minecraft 26.1 and upwards uses Java 25.
|
|
it.options.release = 25
|
|
}
|
|
|
|
java {
|
|
withSourcesJar()
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_25
|
|
targetCompatibility = JavaVersion.VERSION_25
|
|
}
|
|
|
|
jar {
|
|
def baseName = project.base.archivesName.get()
|
|
from("LICENSE") {
|
|
rename { "${it}_${baseName}"}
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
from components.java
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
// Add repositories to publish to here.
|
|
}
|
|
} |