From ee5185e59f01d609f4f9d6f2251bf7145f092c55 Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Sat, 12 Jun 2021 02:22:53 +0200 Subject: [PATCH] few fixes to make it actually run --- build-data/mappings-patch.tiny | 4 ++++ patches/server/Build-system-changes.patch | 2 +- patches/server/MC-Utils.patch | 4 ++-- patches/server/Setup-Gradle-project.patch | 16 ++++++++++++++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/build-data/mappings-patch.tiny b/build-data/mappings-patch.tiny index 73cc8abcdf..572cb1137b 100644 --- a/build-data/mappings-patch.tiny +++ b/build-data/mappings-patch.tiny @@ -74,3 +74,7 @@ c net/minecraft/world/entity/projectile/EntityTippedArrow net/minecraft/world/en # p 1 entry # p 2 context # m (Lcom/google/gson/JsonObject;Lnet/minecraft/world/level/storage/loot/entries/LootEntryAbstract;Lcom/google/gson/JsonSerializationContext;)V serializeType serializeCustom + +# missed mapping? +c net/minecraft/world/level/block/MultifaceBlock net/minecraft/world/level/block/MultifaceBlock + m (Lnet/minecraft/world/level/block/state/IBlockData;Lnet/minecraft/world/level/IBlockAccess;Lnet/minecraft/core/BlockPosition;Lnet/minecraft/core/EnumDirection;)Lnet/minecraft/world/level/block/state/IBlockData; c getStateForPlacement diff --git a/patches/server/Build-system-changes.patch b/patches/server/Build-system-changes.patch index ea5a4fd510..a0c95d1abe 100644 --- a/patches/server/Build-system-changes.patch +++ b/patches/server/Build-system-changes.patch @@ -38,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 testImplementation("org.hamcrest:hamcrest-library:1.3") } @@ -0,0 +0,0 @@ tasks.jar { - "Implementation-Vendor" to Instant.now().epochSecond, + "Implementation-Vendor" to SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(Date()), // Paper "Specification-Title" to "Bukkit", "Specification-Version" to project.version, - "Specification-Vendor" to "Bukkit Team" diff --git a/patches/server/MC-Utils.patch b/patches/server/MC-Utils.patch index 020ad029c6..0becc49e8b 100644 --- a/patches/server/MC-Utils.patch +++ b/patches/server/MC-Utils.patch @@ -2302,7 +2302,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } -+ /* // Paper start - comment out useless overrides @Override ++ // Paper start - comment out useless overrides @Override - TODO figure out why this is suddenly important to keep @Override public BlockPos.MutableBlockPos setX(int i) { super.setX(i); @@ -2310,7 +2310,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 super.setZ(i); return this; } -+ */ // Paper end ++ // Paper end @Override public BlockPos immutable() { diff --git a/patches/server/Setup-Gradle-project.patch b/patches/server/Setup-Gradle-project.patch index 558615acb3..2e6121d65d 100644 --- a/patches/server/Setup-Gradle-project.patch +++ b/patches/server/Setup-Gradle-project.patch @@ -22,7 +22,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/build.gradle.kts @@ -0,0 +0,0 @@ +import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer -+import java.time.Instant ++import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer ++import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer ++import org.gradle.api.file.FileTreeElement ++import shadow.org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.PLUGIN_CACHE_FILE ++import java.util.Date ++import java.text.SimpleDateFormat + +plugins { + java @@ -62,7 +67,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + attributes(mapOf( + "Main-Class" to "org.bukkit.craftbukkit.Main", + "Implementation-Title" to "CraftBukkit", -+ "Implementation-Vendor" to Instant.now().epochSecond, ++ "Implementation-Vendor" to SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(Date()), // Paper + "Specification-Title" to "Bukkit", + "Specification-Version" to project.version, + "Specification-Vendor" to "Bukkit Team" @@ -88,8 +93,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + transform(AppendingTransformer::class.java) { + resource = "META-INF/services/java.sql.Driver" + } ++ transform(ModifiedLog4j2PluginsCacheFileTransformer::class.java) +} + +tasks.test { + exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class") +} ++ ++class ModifiedLog4j2PluginsCacheFileTransformer : Transformer by Log4j2PluginsCacheFileTransformer() { ++ override fun canTransformResource(element: FileTreeElement): Boolean { ++ return PLUGIN_CACHE_FILE == element.name || element.name == "Log4j2Plugins.dat" ++ } ++}