diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000..0bbcde46f2 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,112 @@ +@Library('forge-shared-library')_ + +pipeline { + options { + disableConcurrentBuilds() + } + agent { + docker { + image 'gradlewrapper:latest' + args '-v gradlecache:/gradlecache' + } + } + environment { + GRADLE_ARGS = '--no-daemon --console=plain' // No daemon for now as FG3 kinda derps. //'-Dorg.gradle.daemon.idletimeout=5000' + DISCORD_WEBHOOK = credentials('forge-discord-jenkins-webhook') + DISCORD_PREFIX = "Job: Forge Branch: ${BRANCH_NAME} Build: #${BUILD_NUMBER}" + JENKINS_HEAD = 'https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png' + } + + stages { + stage('fetch') { + steps { + checkout scm + } + } + stage('notify_start') { + when { + not { + changeRequest() + } + } + steps { + discordSend( + title: "${DISCORD_PREFIX} Started", + successful: true, + result: 'ABORTED', //White border + thumbnail: JENKINS_HEAD, + webhookURL: DISCORD_WEBHOOK + ) + } + } + stage('ciWriteBuildNumber') { + steps { + sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue ciWriteBuildNumber' + script { + env.MYGROUP = sh(returnStdout: true, script: './gradlew :forge:properties -q | grep "group:" | awk \'{print $2}\'').trim() + env.MYARTIFACT = sh(returnStdout: true, script: './gradlew :forge:properties -q | grep "version:" | awk \'{print $2}\'').trim() + env.MYVERSION = sh(returnStdout: true, script: './gradlew :forge:properties -q | grep "version:" | awk \'{print $2}\'').trim() + } + } + } + stage('changelog') { + when { + not { + changeRequest() + } + } + steps { + writeChangelog(currentBuild, 'build/changelog_new.txt') + } + } + stage('publish') { + when { + not { + changeRequest() + } + } + environment { + FORGE_MAVEN = credentials('forge-maven-forge-user') + CROWDIN = credentials('forge-crowdin') + KEYSTORE = credentials('forge-jenkins-keystore-old') + KEYSTORE_KEYPASS = credentials('forge-jenkins-keystore-old-keypass') + KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass') + } + steps { + sh './gradlew ${GRADLE_ARGS} uploadArchives -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}' + sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/${MYGROUP}.${MYARTIFACT}/${MYVERSION}' + } + } + stage('test_publish_pr') { //Publish to local repo to test full process, but don't include credentials so it can't sign/publish to maven + when { + changeRequest() + } + environment { + CROWDIN = credentials('forge-crowdin') + } + steps { + sh './gradlew ${GRADLE_ARGS} uploadArchives -PcrowdinKey=${CROWDIN}' + } + } + } + post { + always { + script { + //archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true, onlyIfSuccessful: true, allowEmptyArchive: true + //junit 'build/test-results/*/*.xml' + //jacoco sourcePattern: '**/src/*/java' + + if (env.CHANGE_ID == null) { // This is unset for non-PRs + discordSend( + title: "${DISCORD_PREFIX} Finished ${currentBuild.currentResult}", + description: '```\n' + getChanges(currentBuild) + '\n```', + successful: currentBuild.resultIsBetterOrEqualTo("SUCCESS"), + result: currentBuild.currentResult, + thumbnail: JENKINS_HEAD, + webhookURL: DISCORD_WEBHOOK + ) + } + } + } + } +} diff --git a/build.gradle b/build.gradle index 0a014bc65e..9e858cf387 100644 --- a/build.gradle +++ b/build.gradle @@ -57,7 +57,21 @@ minecraft { } } -group = 'net.minecraftforge' +ext { + //Dirty hack, but keeps our unique version system on new jenkins + BUILD_NUMBER = 2838 + (System.getenv('BUILD_NUMBER') ?: project.ext.properties.buildNumber ?: 0).toInteger() + + JAR_SIGNER = [:] + if (project.hasProperty('keystore')) { + JAR_SIGNER = [ + storepass: project.properties.keystoreStorePass, + keypass: project.properties.keystoreKeyPass, + keystore: project.properties.keystore + ] + } +} + +group = 'net.minecraftforge.test' version = getVersionFromJava(file("src/main/java/net/minecraftforge/common/ForgeVersion.java")) extractForgeSources { exclude "**/SideOnly.java", "**/Side.java" } @@ -106,20 +120,20 @@ license { } } -task changelog(type: JenkinsChangelog) { - - // skip if there is no forge jenkins pass - onlyIf { - project.hasProperty('forgeJenkinsPass') +task changelog() { + ext { + changelog_old = rootProject.file('legacy_changelog.txt') + changelog_new = rootProject.file('build/changelog_new.txt') + output = rootProject.file('build/changelog.txt') + } + inputs.file changelog_old + if (changelog_new.exists()) + inputs.file changelog_new + outputs.file output + + doLast { + output.text = changelog_new.text + '\n' + changelog_old.text } - - outputs.upToDateWhen { false } // never up to date - serverRoot = "http://jenkins.minecraftforge.net/" - jobName = "minecraftforge" - targetBuild = System.env['BUILD_NUMBER'] ?: project.ext.properties.buildNumber ?:0; - authName = "console_script" - authPassword = project.hasProperty('forgeJenkinsPass') ? project.getProperty('forgeJenkinsPass') : ""; - output = "build/distributions/${project.name}-${project.version}-changelog.txt" } task crowdin(type: CrowdinDownload) { @@ -136,10 +150,9 @@ def extraTxts = [ "CREDITS.txt", "LICENSE.txt", "LICENSE-Paulscode SoundSystem CodecIBXM.txt", - "LICENSE-Paulscode IBXM Library.txt" + "LICENSE-Paulscode IBXM Library.txt", + changelog ] -if (project.hasProperty('forgeJenkinsPass')) - extraTxts += changelog import groovy.json.JsonSlurper; import groovy.json.JsonBuilder; @@ -225,16 +238,11 @@ task signUniversal(type: SignJar, dependsOn: 'outputJar') { project.hasProperty('jarsigner') } - def jarsigner = [:]; - - if (project.hasProperty('jarsigner')) - jarsigner = project.jarsigner; - alias = 'forge' exclude "paulscode/**" - storePass = jarsigner.storepass - keyPass = jarsigner.keypass - keyStore = jarsigner.keystore + storePass = JAR_SIGNER.storepass + keyPass = JAR_SIGNER.keypass + keyStore = JAR_SIGNER.keystore inputFile = outputJar.archivePath outputFile = outputJar.archivePath } @@ -288,21 +296,21 @@ tasks.build.dependsOn 'launch4j' // MAVEN artifacts { - if (project.hasProperty('forgeJenkinsPass')) - archives changelog.output + archives(changelog.outputs.files.singleFile) { + classifier = 'changelog' + } archives file("build/distributions/${project.name}-${project.version}-installer-win.exe") archives makeMdk } task ciWriteBuildNumber << { def file = file("src/main/java/net/minecraftforge/common/ForgeVersion.java"); - def bn = System.getenv("BUILD_NUMBER")?:project.ext.properties.buildNumber?:0; def outfile = ""; def ln = "\n"; //Linux line endings because we're on git! file.eachLine{ String s -> if (s.matches("^ public static final int buildVersion = [\\d]+;\$")) - s = " public static final int buildVersion = ${bn};"; + s = " public static final int buildVersion = ${BUILD_NUMBER};"; if (s.matches('^ public static final String mcVersion = "[^\\"]+";')) s = " public static final String mcVersion = \"${minecraft.version}\";"; outfile += (s+ln); @@ -315,15 +323,14 @@ uploadArchives { dependsOn 'build' - if (project.hasProperty('forgeMavenPass')) + if (project.hasProperty('forgeMavenPassword')) { repository(url: "https://files.minecraftforge.net/maven/manage/upload") { - authentication(userName: "forge", password: project.getProperty('forgeMavenPass')) // the elvis operator. look it up. + authentication(userName: project.getProperty('forgeMavenUser'), password: project.getProperty('forgeMavenPassword')) } } else { - // local repo folder. Might wanna juset use gradle install if you wanans end it to maven-local repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath()) } @@ -423,8 +430,7 @@ String getVersionFromJava(File file) } } - build = System.getenv("BUILD_NUMBER") ?: project.ext.properties.buildNumber ?: 0 - + build = BUILD_NUMBER String branch = null; if (!System.getenv().containsKey("GIT_BRANCH")) diff --git a/legacy_changelog.txt b/legacy_changelog.txt new file mode 100644 index 0000000000..dc70bc5ffa --- /dev/null +++ b/legacy_changelog.txt @@ -0,0 +1,430 @@ + +Build 2838: + bs2609: Fix vanilla handling of options file (MC-117449, MC-151173) (#5725) + +Build 2837: + clienthax: Update EnumHelper to be compatible with Eclipse's OpenJ9 JVM. (#5712) + +Build 2836: + tterrag: + Revert "Invalidate tile entities that are queued for removal (#5512)" + This reverts commit 75788f63eea6c33ccef7e5cbcab27ad9ad2c2a04. + This solution is invalid as TEs are free to modify the world + tileEntities list, usually indirectly via chunkloading, from inside + invalidate(). + This happens in vanilla, in TileEntityChest#invalidate, where it calls + checkForAdjacentChests(), which has the potential to load neighboring + chunks and cause a CME. + A more sophisticated solution is needed. + +Build 2835: + bs2609: Fix some vertex format changes not being handled correctly (#5368) + +Build 2834: + bs2609: + Transform vertex normals as well as positions when generating quads + (#5242) + +Build 2833: + rseifert.phone: Fix for SidedInvWrapper isItemValid using wrong slot (#5642) + +Build 2832: + bs2609: Invalidate tile entities that are queued for removal (#5512) + +Build 2831: + lclc98: Added Wool to OreDictionary (#5414) + +Build 2830: + CreativeMD: Fixed boat not taking care of block-liquid hooks (#5086) + +Build 2829: + bs2609: Add Forge dimension-changing hooks to spectator handling code (#5212) + +Build 2828: + ichttt: + Minor performace improvement when building chunks and rendering blocks + (#5286) + +Build 2827: + bs2609: Catch json parsing errors from constants/factories files (#5258) + +Build 2826: + bs2609: Allow custom DataSerializers to be registered safely (#5245) + +Build 2825: + cpw: + Try and make 1.13 mods more obviously wrong in 1.12.. + Signed-off-by: cpw + +Build 2824: + tterrag: Fix #5651 Re-add canPlaceBlockOnSide check in World#mayPlace + +Build 2823: + Pokechu022: + Fail fast when null is used with setTag instead of crashing in + writeEntry (#5257) + +Build 2822: + tterrag: Fix block placement not checking for player collision + +Build 2821: + wynprice999: Added more Constants (#5323) + +Build 2820: + python0429: [1.12.2] Add a few events pertaining to villages (#5302) + +Build 2819: + Tyler Hancock: [1.12] Fix special spawn event not firing in many cases. (#5389) + +Build 2818: + bs2609: Only prompt for missing registries on local worlds (#5348) + +Build 2817: + ckrier.3000: Add EntityPlaceEvent (#5057) + +Build 2816: + bs2609: Generalise EnumRarity to an interface (#5182) + +Build 2815: + bs2609: Apply access-level changes to inner class attributes (#5468) + +Build 2814: + bs2609: Fix small logic error in ItemTextureQuadConverter (#5463) + +Build 2813: + bs2609: Better support for custom bows (#5209) + +Build 2812: + CovertJaguar: Remove FluidStack amount from hashcode calculation (#5272) + molecularphylo: + Fixed incorrect string representation of string list config property + default values in their comments. + bs2609: + Improve tracking of used dimension IDs (#5249) + Closes #5378 Large dimension IDs bloat level.data + +Build 2811: + bs2609: + Fix up torch placement logic to handle more vanilla special-casing + (#5426) + +Build 2810: + LexManos: Written size does not include int bytes. + +Build 2809: + LexManos: + Extend Region files to support >1MB per chunk. If the 'sector count' is + 255, ask the compressed data header for the proper length. + +Build 2808: + tterrag1098: Add default impl to IConfigElement#getValidValuesDisplay + +Build 2807: + tterrag: Simplify custom item rendering by removing GL emissivity hacks + +Build 2806: + tterrag: Support diffuse lighting flag in item rendering + +Build 2805: + bs2609: + Add a hook to allow continuously using items through stack changes + (#4834) + * Add a hook to allow continuously using items through stack changes + + * Update licences + +Build 2804: + oOMitchOo: + Added an additional constructor to every implementation of IFluidBlock. + It is now possible to create a fluid block with a Fluid, Material and + MapColor, so that the Material's MapColor isn't used for the blocks + MapColor. (#5293) + +Build 2803: + bs2609: Add redirects to PotionEffect to respect registry replacement (#5213) + +Build 2802: + alexiy.ov: + Add an annotation for @Config elements which will automatically create a + slider control (#5026) + +Build 2801: + bs2609: Fix small logic error in emissive item rendering code (#5320) + +Build 2800: + molecularphylo: + Allow config GUI cycling button elements generated from enums to display + toString return values, rather than actual values. (#5125) + +Build 2799: + bs2609: Fix incorrect indexing in mipmap generation code (#5201) + +Build 2798: + bs2609: + Ensure slave maps are cleaned up when handling registry overrides + (#5250) + +Build 2797: + d_scalzi: Fix issue with --modListFile. (#5316) + +Build 2796: + LexManos: + Fix potential issues with the Minecraft FakePlayer lingering around + after world unloads. + +Build 2795: + tterrag: Fix potion remove event not always firing, add expiry event + +Build 2794: + tterrag: Clean up CraftingHelper constants loading API + +Build 2793: + tterrag: Fix crash from CraftingHelper due to FileSystem being closed early + +Build 2792: + tterrag: + added PotionHooks, closes #3867, #4375 (#4614) + * solved merge confilct + + * improved var names & removed tabs + + * Added spaces around != + + * fixed typo + +Build 2791: + tterrag: + Add a hook for farmland watering (#4891) + * Add a FarmlandWaterCheckEvent to allow mods to override when Farmland + is watered or not + + * revert 1.12.2 json + + * Move the farmland patch to a ticket based instead of a event based + system + + * Minor changes + + * Faster isValid checks, faster validation/invalidation if the state did + not change, expand test mod to include a test for the validation system + + * remove isValid boolean flag, we can express it with the tick counter + + * Fix test mod resource warnings + + * Remove tick timeout, add a javadoc note to invalidate on chunk unload, + cleaned up test mod + + * Allow mods to provide custom handling to determine if a pos is valid + or not + + * Make SimpleTicket more simple, make register public so custom tickets + can be registered + + * Fixes for review + + * Add missing license headers + + * Use a weak hash set + + * Split up the map into smaller chunk based maps + + * Add missing license headers + + * Make MultiTicketManager more universal for custom implementations, + cleanup imports + +Build 2790: + tterrag: + Add methods to allow loading json constants outside of _constants + (#4975) + * add interface methods for loading json constants from an arbitary file + + + * use try-with-resources + + * don't make modders create jsoncontext, clean up resource use + + * very minor cleanup + +Build 2789: + tterrag: + Compute ASMDataTable submaps parallel, speeds up contructing mods + (#5246) + * Compute submaps parallel, speeds up contructing mods by a lot + + * Use stream API better + +Build 2788: + mezz: Add logging for data manager key registration errors (#5129) + +Build 2787: + mezz: Improve support for custom block path types (#5203) + +Build 2786: + mezz: Fix missing comments in configs created with annotations (#5189) + +Build 2785: + mezz: Allow items to control the rate of repair from mending (#5102) + +Build 2784: + mezz: Improve exception handling from server starting events (#5226) + +Build 2783: + mezz: Improve context provided by potion icon rendering hooks (#5111) + +Build 2782: + mezz: Fix an ObjectHolderRef internal error message (#5214) + +Build 2781: + mezz: Implement rendering for item models with emissive quads (#5047) + +Build 2780: + mezz: Clean up logged mod states (#5227) + mezz: Fix minor issue in getFilledPercentage for Fluid rendering (#5206) + +Build 2779: + mezz: Improve reflection helper methods (#4853) + mezz: Fix inaccurate main thread name shown in client log (#5078) + +Build 2778: + mezz: Fix Baked Item models with transformations (#5241) + +Build 2777: + mezz: + Re-add some missing villager profession patches (#5200) + * Fix zombie villagers only spawning with vanilla professions + * Fix spawning modded villagers that do not have their own building + mezz: Fix missing string parameters in some log messages (#5210) + mezz: Stop firing LivingSetAttackTargetEvent for setRevengeTarget (#5217) + mezz: Prevent RecipeBook from crashing on empty modded ingredients (#5234) + +Build 2776: + mezz: Fix the bed position given to the SleepingTimeCheck event (#5107) + +Build 2775: + LexManos: Fix some null returns from defaulted registries (#5235) + +Build 2774: + LexManos: + Only remove synthetic lambda methods referenced in body of SideOnly + methods (#5127) + +Build 2773: + LexManos: + A different approach to my changes in + https://github.com/MinecraftForge/MinecraftForge/commit/8ace535995522bec0557d4217e0d98b3dc76cf1e + to fix #5207 + LexManos: Fix patches from #5160 setting rotation as well as position (#5233) + LexManos: Use HTTPS for files website. + +Build 2772: + tterrag: Make Forge-provided default transforms accessible to custom models + tterrag: + Make Forge blockstate variants correctly inherit AO setting from vanilla + models (#5190) + * Make Forge blockstate variants correctly inherit AO setting + + * Move variant format checks into variant, check for added properties + + * Small code cleanup + tterrag: fixed visual bug with guislider + tterrag: + Allow IModel to express itself as a vanilla parent (#5195) + * Fix errors caused by fancy missing model being non-vanilla parent + + * Switch instanceof checks to a default IModel method + + * Small code tweaks + +Build 2771: + tterrag: Add CreativeTabs#getLabelColor + +Build 2770: + tterrag: + Allow providing a BufferedImage for banner render generation (#5041) + * Adds an Event to allow providing a BufferedImage for the banner render + generation (cached) + textures, since banners don't use an atlas. + implementation. + + * Missed some copyright; might as well absolut text match, I guess + + * Remove unneeded patch change + + * Fix event variable access convention + + * Formatting fix + + * Improve event handling registration + + * Import cleanup + + * Replace event approach with Supplier approach + + * Better name for test mod (now that it's no longer an event); adds + ENABLE flag + + * Moves MC code into + net.minecraftforge.client.MinecraftForgeClient.getImageLayer to simplify + patch + + * Generalize naming + +Build 2769: + mezz: Fix Mesa biome entry tags in the BiomeDictionary (#5177) + +Build 2768: + LexManos: Bump version number for RB. + +Build 2767: + LexManos: + Change biome spawn list entries to use factory method where possible + (#5075) + LexManos: Prevent some texture loading errors from crashing the game (#5121) + LexManos: Patch PotionHelper to use registry delegates (#5142) + LexManos: Add a notification event for handling game rule changes (#5152) + +Build 2766: + LexManos: + Change universal bucket support to use fluid names instead of instances + (#5031) + +Build 2765: + LexManos: Fix NPE on clientside entities constructed with null world (#5170) + +Build 2764: + tterrag: Fix patches from #5160 running on the client and causing stutter + +Build 2763: + LexManos: + Class transformer optimizations (#5159) + * Filter packages for deobf transformation + * Only serialize transformed class with TerminalTransformer if bytecode + changed + +Build 2762: + github: Update github stale so issues can be Assigned + +Build 2761: + LexManos: + Fix MC-136995 - Chunk loading and unloading issue with entities placed + in exact positions. (#5160) + Scatter gun patches to improve entity tracking and position tracking. + Provided by Aikar through the Paper project, this commit of patches + combines the following patches: + + https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0306-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch + + https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0315-Always-process-chunk-registration-after-moving.patch + + https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0335-Ensure-chunks-are-always-loaded-on-hard-position-set.patch + + https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0378-Sync-Player-Position-to-Vehicles.patch + +Build 2760: + LexManos: Fix --mods and --modListFile arguments not making it past LaunchWrapper. + +Build 2759: + LexManos: Remove BlamingTransformer (#5115) + diff --git a/patches/minecraft/net/minecraft/block/Block.java.patch b/patches/minecraft/net/minecraft/block/Block.java.patch index 94f2fe37e5..bdc0f4780c 100644 --- a/patches/minecraft/net/minecraft/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/block/Block.java.patch @@ -221,7 +221,7 @@ public SoundType func_185467_w() { return this.field_149762_H; -@@ -934,6 +952,1374 @@ +@@ -934,6 +952,1388 @@ { } @@ -1610,7 +1610,7 @@ public static void func_149671_p() { func_176215_a(0, field_176230_a, (new BlockAir()).func_149663_c("air")); -@@ -1105,7 +2491,7 @@ +@@ -1105,7 +2505,7 @@ Block block11 = (new BlockQuartz()).func_149672_a(SoundType.field_185851_d).func_149711_c(0.8F).func_149663_c("quartzBlock"); func_176219_a(155, "quartz_block", block11); func_176219_a(156, "quartz_stairs", (new BlockStairs(block11.func_176223_P().func_177226_a(BlockQuartz.field_176335_a, BlockQuartz.EnumType.DEFAULT))).func_149663_c("stairsQuartz")); @@ -1619,7 +1619,7 @@ func_176219_a(158, "dropper", (new BlockDropper()).func_149711_c(3.5F).func_149672_a(SoundType.field_185851_d).func_149663_c("dropper")); func_176219_a(159, "stained_hardened_clay", (new BlockStainedHardenedClay()).func_149711_c(1.25F).func_149752_b(7.0F).func_149672_a(SoundType.field_185851_d).func_149663_c("clayHardenedStained")); func_176219_a(160, "stained_glass_pane", (new BlockStainedGlassPane()).func_149711_c(0.3F).func_149672_a(SoundType.field_185853_f).func_149663_c("thinStainedGlass")); -@@ -1230,31 +2616,6 @@ +@@ -1230,31 +2630,6 @@ block15.field_149783_u = flag; } }