Support Bedrock 1.20.70 (#4477)

* Support 1.20.70

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Update readme

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Use 1.20.70 mappings

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Creative lectern drops work but not survival yet

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix lectern book pickup in survival

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Add copyright notices to new files

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Temp fix for incorrect creative_items from Cloudburst/Data

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Fix item frame breaking in creative

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Clarify what to remove when 1.20.60 support is dropped

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

* Don't use dim change enum pre 1.20.70

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>

---------

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
This commit is contained in:
Kas-tle 2024-03-11 00:29:27 -07:00 committed by GitHub
parent a0fd720e7c
commit 1df63c6de8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 12288 additions and 42 deletions

View file

@ -24,11 +24,17 @@
*/
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.artifacts.MinimalExternalModuleDependency
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.options.Option
import org.gradle.api.tasks.TaskAction
import org.gradle.kotlin.dsl.named
import java.io.File
import java.net.URL
fun Project.relocate(pattern: String) {
tasks.named<ShadowJar>("shadowJar") {
@ -69,5 +75,45 @@ fun Project.provided(dependency: MinimalExternalModuleDependency) =
fun Project.provided(provider: Provider<MinimalExternalModuleDependency>) =
provided(provider.get())
open class DownloadFilesTask : DefaultTask() {
@Input
var urls: List<String> = listOf()
@Input
var destinationDir: String = ""
@Option(option="suffix", description="suffix")
@Input
var suffix: String = ""
@Input
var suffixedFiles: List<String> = listOf()
@TaskAction
fun downloadAndAddSuffix() {
urls.forEach { fileUrl ->
val fileName = fileUrl.substringAfterLast("/")
val baseName = fileName.substringBeforeLast(".")
val extension = fileName.substringAfterLast(".", "")
val shouldSuffix = fileName in suffixedFiles
val suffixedFileName = if (shouldSuffix && extension.isNotEmpty()) "$baseName.$suffix.$extension" else fileName
val outputFile = File(destinationDir, suffixedFileName)
if (!outputFile.parentFile.exists()) {
outputFile.parentFile.mkdirs()
}
URL(fileUrl).openStream().use { input ->
outputFile.outputStream().use { output ->
input.copyTo(output)
}
}
println("Downloaded: $suffixedFileName")
}
}
}
private fun calcExclusion(section: String, bit: Int, excludedOn: Int): String =
if (excludedOn and bit > 0) section else ""
if (excludedOn and bit > 0) section else ""