mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 01:04:24 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4952622785 | ||
|
|
ae82ec12d2 | ||
|
|
99818c4fdd | ||
|
|
0e9ba58f19 | ||
|
|
5f5a9a8d2a | ||
|
|
3bba5bf4ec | ||
|
|
8090d1d099 | ||
|
|
09cb6bd11e | ||
|
|
d744f0b254 | ||
|
|
15c989bd77 | ||
|
|
b022b84756 | ||
|
|
5122b0bc3c | ||
|
|
9b47c8647f | ||
|
|
5f47cf52fa | ||
|
|
550925b9c9 | ||
|
|
8448cda699 | ||
|
|
f2887142bd | ||
|
|
b54d77bffb | ||
|
|
4a90846be3 | ||
|
|
0b9573a91f | ||
|
|
621d3f8494 | ||
|
|
fb7e448ff1 | ||
|
|
23db859f86 | ||
|
|
ffcf183f3f | ||
|
|
05fc73aa8d | ||
|
|
6d94dd5306 | ||
|
|
bfd3ed64a4 | ||
|
|
cc5a9a43b9 | ||
|
|
a855b83de8 | ||
|
|
1c2de0cc72 | ||
|
|
388976f288 | ||
|
|
2b67a9f36d | ||
|
|
9305aff10f | ||
|
|
dbd0dba883 | ||
|
|
959a2db3e0 | ||
|
|
ae0c1fb4c1 | ||
|
|
6b166f3f40 | ||
|
|
b1c0cc77bb | ||
|
|
c369f8186b | ||
|
|
de4946a1ae | ||
|
|
76e3afd528 | ||
|
|
4a62c9ed87 | ||
|
|
cc75529ec4 | ||
|
|
bbd8c2e07e | ||
|
|
dfef5101f1 | ||
|
|
664a2c06ad | ||
|
|
e85295a837 | ||
|
|
21582ef641 | ||
|
|
020ec3d51b | ||
|
|
774b79e609 | ||
|
|
ee6022b006 | ||
|
|
37efd2b8ae | ||
|
|
cf3d42ef38 | ||
|
|
03a505a3f2 | ||
|
|
bdc856edf5 | ||
|
|
6eebea0896 | ||
|
|
9218e08955 | ||
|
|
7006fe4f29 | ||
|
|
301e7252b0 | ||
|
|
2b5852072c | ||
|
|
0b38373a45 | ||
|
|
07e538f3dd | ||
|
|
b39e300c1b | ||
|
|
50db51a366 | ||
|
|
df80acc49d |
No files matched your search
+3
-3
@@ -37,9 +37,9 @@ src/generated_test/resources/.cache/
|
||||
src/generated_mdk/resources/.cache/
|
||||
|
||||
#Patch rejects
|
||||
#/patches-/
|
||||
#*.patch.rej
|
||||
#/projects/*/rejects/
|
||||
/patches-/
|
||||
*.patch.rej
|
||||
/projects/*/rejects/
|
||||
|
||||
# FML changelog
|
||||
changelog.txt
|
||||
|
||||
Vendored
+3
-3
@@ -36,9 +36,9 @@ project {
|
||||
buildType(PullRequestCompatibility)
|
||||
|
||||
params {
|
||||
text("docker_jdk_version", "17", label = "Gradle version", description = "The version of the JDK to use during execution of tasks in a JDK.", display = ParameterDisplay.HIDDEN, allowEmpty = false)
|
||||
text("docker_gradle_version", "7.5.1", label = "Gradle version", description = "The version of Gradle to use during execution of Gradle tasks.", display = ParameterDisplay.HIDDEN, allowEmpty = false)
|
||||
text("git_main_branch", "1.19.x", label = "Git Main Branch", description = "The git main or default branch to use in VCS operations.", display = ParameterDisplay.HIDDEN, allowEmpty = false)
|
||||
text("docker_jdk_version", "21", label = "Gradle version", description = "The version of the JDK to use during execution of tasks in a JDK.", display = ParameterDisplay.HIDDEN, allowEmpty = false)
|
||||
text("docker_gradle_version", "8.8", label = "Gradle version", description = "The version of Gradle to use during execution of Gradle tasks.", display = ParameterDisplay.HIDDEN, allowEmpty = false)
|
||||
text("git_main_branch", "1.20.x", label = "Git Main Branch", description = "The git main or default branch to use in VCS operations.", display = ParameterDisplay.HIDDEN, allowEmpty = false)
|
||||
text("git_branch_spec", """
|
||||
+:refs/heads/(main*)
|
||||
+:refs/heads/(master*)
|
||||
|
||||
Vendored
-125
@@ -1,125 +0,0 @@
|
||||
@Library('forge-shared-library')_
|
||||
|
||||
pipeline {
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
}
|
||||
agent {
|
||||
docker {
|
||||
image 'gradle:7-jdk16'
|
||||
//args '-v forgegc:/home/gradle/.gradle_cache/'
|
||||
}
|
||||
}
|
||||
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('notify_start') {
|
||||
when {
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
}
|
||||
steps {
|
||||
discordSend(
|
||||
title: "${DISCORD_PREFIX} Started",
|
||||
successful: true,
|
||||
result: 'ABORTED', //White border
|
||||
thumbnail: JENKINS_HEAD,
|
||||
webhookURL: DISCORD_WEBHOOK
|
||||
)
|
||||
}
|
||||
}
|
||||
/*
|
||||
stage('pull_cache') {
|
||||
steps {
|
||||
sh 'cp -r /home/gradle/.gradle_cache/jdks/ /home/gradle/.gradle/jdks/'
|
||||
sh 'cp -r /home/gradle/.gradle_cache/wrapper/ /home/gradle/.gradle/wrapper/'
|
||||
sh 'cp -r /home/gradle/.gradle_cache/caches/ /home/gradle/.gradle/caches/'
|
||||
}
|
||||
}
|
||||
*/
|
||||
stage('setup') {
|
||||
steps {
|
||||
withGradle {
|
||||
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue setup'
|
||||
}
|
||||
script {
|
||||
env.MYVERSION = sh(returnStdout: true, script: './gradlew :forge:properties -q | grep "^version:" | cut -d" " -f2').trim()
|
||||
env.FMLONLY_VERSION = sh(returnStdout: true, script: './gradlew :fmlonly:properties -q | grep "^version:" | cut -d" " -f2').trim()
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('changelog') {
|
||||
when {
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
}
|
||||
steps {
|
||||
writeChangelog(currentBuild, 'build/changelog.txt')
|
||||
}
|
||||
}
|
||||
stage('publish') {
|
||||
when {
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
}
|
||||
environment {
|
||||
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 {
|
||||
withCredentials([usernamePassword(credentialsId: 'maven-forge-user', usernameVariable: 'MAVEN_USER', passwordVariable: 'MAVEN_PASSWORD')]) {
|
||||
withGradle {
|
||||
sh './gradlew ${GRADLE_ARGS} publish -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
build job: 'filegenerator', parameters: [string(name: 'COMMAND', value: "promote net.minecraftforge:forge ${env.MYVERSION} latest")], propagate: false, wait: false
|
||||
build job: 'filegenerator', parameters: [string(name: 'COMMAND', value: "promote net.minecraftforge:fmlonly ${env.FMLONLY_VERSION} latest")], propagate: false, wait: false
|
||||
}
|
||||
}
|
||||
}
|
||||
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 {
|
||||
withGradle {
|
||||
sh './gradlew ${GRADLE_ARGS} publish -PcrowdinKey=${CROWDIN}'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true, onlyIfSuccessful: true, allowEmptyArchive: true
|
||||
|
||||
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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+91
-75
@@ -1,10 +1,11 @@
|
||||
import de.undercouch.gradle.tasks.download.Download
|
||||
import groovy.json.JsonBuilder
|
||||
import net.minecraftforge.forge.tasks.checks.CheckATs
|
||||
import net.minecraftforge.forge.tasks.checks.CheckExcs
|
||||
import net.minecraftforge.forge.tasks.checks.CheckPatches
|
||||
import net.minecraftforge.forge.tasks.checks.CheckSAS
|
||||
import net.minecraftforge.forge.tasks.checks.CheckTask
|
||||
import net.minecraftforge.forge.tasks.FixPatchImports
|
||||
import net.minecraftforge.forge.tasks.checks.CheckMode
|
||||
|
||||
import java.nio.file.Files
|
||||
import java.util.Date
|
||||
@@ -24,8 +25,9 @@ import org.objectweb.asm.Opcodes
|
||||
plugins {
|
||||
id 'org.cadixdev.licenser' version '0.6.1'
|
||||
id 'com.github.ben-manes.versions' version '0.46.0'
|
||||
id 'net.minecraftforge.gradleutils' version '2.+'
|
||||
id 'net.minecraftforge.gradleutils' version '[2.2,2.3)'
|
||||
id 'eclipse'
|
||||
id 'idea'
|
||||
id 'de.undercouch.download' version '5.4.0'
|
||||
id 'net.minecraftforge.gradle.patcher' version '[6.0,6.2)' apply false
|
||||
id 'net.minecraftforge.gradle.mcp' version '[6.0,6.2)' apply false
|
||||
@@ -43,22 +45,19 @@ ext {
|
||||
]
|
||||
}
|
||||
MAPPING_CHANNEL = 'official'
|
||||
MAPPING_VERSION = '1.20'
|
||||
MC_VERSION = '1.20'
|
||||
MC_NEXT_VERSION = '1.21'
|
||||
MCP_VERSION = '20230608.053357'
|
||||
SNAPSHOT = false
|
||||
|
||||
SPI_VERSION = '7.0.0'
|
||||
MERGETOOL_VERSION = '1.1.5'
|
||||
MAPPING_VERSION = '1.19.4'
|
||||
MC_VERSION = '1.19.4'
|
||||
MC_NEXT_VERSION = '1.20'
|
||||
MCP_VERSION = '20230314.122934'
|
||||
SPI_VERSION = '6.0.0'
|
||||
ACCESSTRANSFORMERS_VERSION = '8.0.4'
|
||||
COREMODS_VERSION = '5.0.1'
|
||||
COREMODS_VERSION = '5.2.4'
|
||||
EVENTBUS_VERSION = '6.0.3'
|
||||
MODLAUNCHER_VERSION = '10.0.8'
|
||||
SECUREJARHANDLER_VERSION = '2.1.6'
|
||||
BOOTSTRAPLAUNCHER_VERSION = '1.1.2'
|
||||
ASM_VERSION = '9.5'
|
||||
INSTALLER_VERSION = '2.1.+'
|
||||
ASM_VERSION = '9.7.1'
|
||||
INSTALLER_VERSION = '2.2.+'
|
||||
MIXIN_VERSION = '0.8.5'
|
||||
TERMINALCONSOLEAPPENDER_VERSION = '1.2.0'
|
||||
JLINE_VERSION = '3.12.+'
|
||||
@@ -84,7 +83,7 @@ ext {
|
||||
FORGE_VERSION = VERSION.substring(MC_VERSION.length() + 1)
|
||||
|
||||
BINPATCH_TOOL = 'net.minecraftforge:binarypatcher:1.1.1:fatjar'
|
||||
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.3.0'
|
||||
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.4.1'
|
||||
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.1.4'
|
||||
FART = 'net.minecraftforge:ForgeAutoRenamingTool:0.1.22:all'
|
||||
MIN_TAG_FOR_CHANGELOG = '41.0'
|
||||
@@ -105,7 +104,7 @@ def extraTxts = [
|
||||
rootProject.tasks.createChangelog.outputFile
|
||||
]
|
||||
|
||||
task downloadVersionManifest(type: Download) {
|
||||
tasks.register('downloadVersionManifest', Download) {
|
||||
src 'https://piston-meta.mojang.com/mc/game/version_manifest_v2.json'
|
||||
dest file('build/versions/version_manifest.json')
|
||||
useETag 'all'
|
||||
@@ -220,45 +219,47 @@ project(':mcp') {
|
||||
}
|
||||
}
|
||||
|
||||
project(':clean') {
|
||||
evaluationDependsOn(':mcp')
|
||||
apply plugin: 'net.minecraftforge.gradle.patcher'
|
||||
tasks.withType(AbstractPublishToMaven.class).forEach{tsk -> tsk.enabled = false } // We don't want to publish anything
|
||||
if (!System.env.TEAMCITY_VERSION) {
|
||||
project(':clean') {
|
||||
evaluationDependsOn(':mcp')
|
||||
apply plugin: 'net.minecraftforge.gradle.patcher'
|
||||
tasks.withType(AbstractPublishToMaven.class).forEach{tsk -> tsk.enabled = false } // We don't want to publish anything
|
||||
|
||||
dependencies {
|
||||
implementation 'net.minecraftforge:forgespi:' + SPI_VERSION
|
||||
}
|
||||
dependencies {
|
||||
implementation 'net.minecraftforge:forgespi:' + SPI_VERSION
|
||||
}
|
||||
|
||||
patcher {
|
||||
parent = project(':mcp')
|
||||
mcVersion = MC_VERSION
|
||||
patchedSrc = file('src/main/java')
|
||||
patcher {
|
||||
parent = project(':mcp')
|
||||
mcVersion = MC_VERSION
|
||||
patchedSrc = file('src/main/java')
|
||||
|
||||
mappings channel: MAPPING_CHANNEL, version: MAPPING_VERSION
|
||||
mappings channel: MAPPING_CHANNEL, version: MAPPING_VERSION
|
||||
|
||||
runs {
|
||||
clean_client {
|
||||
client true
|
||||
taskName 'clean_client'
|
||||
ideaModule "${rootProject.name}.${project.name}.main"
|
||||
runs {
|
||||
clean_client {
|
||||
client true
|
||||
taskName 'clean_client'
|
||||
ideaModule "${rootProject.name}.${project.name}.main"
|
||||
|
||||
main 'net.minecraft.client.main.Main'
|
||||
workingDirectory project.file('run')
|
||||
main 'net.minecraft.client.main.Main'
|
||||
workingDirectory project.file('run')
|
||||
|
||||
args '--gameDir', '.'
|
||||
args '--version', MC_VERSION
|
||||
args '--assetsDir', downloadAssets.output
|
||||
args '--assetIndex', '{asset_index}'
|
||||
args '--accessToken', '0'
|
||||
}
|
||||
args '--gameDir', '.'
|
||||
args '--version', MC_VERSION
|
||||
args '--assetsDir', downloadAssets.output
|
||||
args '--assetIndex', '{asset_index}'
|
||||
args '--accessToken', '0'
|
||||
}
|
||||
|
||||
clean_server {
|
||||
client false
|
||||
taskName 'clean_server'
|
||||
ideaModule "${rootProject.name}.${project.name}.main"
|
||||
clean_server {
|
||||
client false
|
||||
taskName 'clean_server'
|
||||
ideaModule "${rootProject.name}.${project.name}.main"
|
||||
|
||||
main 'net.minecraft.server.Main'
|
||||
workingDirectory project.file('run')
|
||||
main 'net.minecraft.server.Main'
|
||||
workingDirectory project.file('run')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -287,7 +288,6 @@ def sharedDeps = {
|
||||
installer "net.minecraftforge:coremods:${COREMODS_VERSION}"
|
||||
installer "cpw.mods:modlauncher:${MODLAUNCHER_VERSION}"
|
||||
installer 'net.minecraftforge:unsafe:0.2.+'
|
||||
installer "net.minecraftforge:mergetool:${MERGETOOL_VERSION}:api"
|
||||
installer "com.electronwill.night-config:core:${NIGHTCONFIG_VERSION}"
|
||||
installer "com.electronwill.night-config:toml:${NIGHTCONFIG_VERSION}"
|
||||
installer "org.apache.maven:maven-artifact:${APACHE_MAVEN_ARTIFACT_VERSION}"
|
||||
@@ -296,9 +296,11 @@ def sharedDeps = {
|
||||
installer "org.jline:jline-reader:${JLINE_VERSION}" // Dep of TerminalConsoleAppender
|
||||
installer "org.jline:jline-terminal:${JLINE_VERSION}" // Dep of TerminalConsoleAppender
|
||||
installer "org.spongepowered:mixin:${MIXIN_VERSION}"
|
||||
installer 'org.openjdk.nashorn:nashorn-core:15.3'
|
||||
installer 'org.openjdk.nashorn:nashorn-core:15.4'
|
||||
installer "net.minecraftforge:JarJarSelector:${JARJAR_VERSION}"
|
||||
installer "net.minecraftforge:JarJarMetadata:${JARJAR_VERSION}"
|
||||
installer 'net.java.dev.jna:jna:5.12.1'
|
||||
installer 'net.java.dev.jna:jna-platform:5.12.1'
|
||||
|
||||
/*
|
||||
installer 'org.lwjgl:lwjgl:3.2.2'
|
||||
@@ -349,7 +351,7 @@ def sharedFmlonlyForge = { Project prj ->
|
||||
}
|
||||
|
||||
prj.task([type: DownloadMavenArtifact], 'downloadInstaller') {
|
||||
artifact = "net.minecraftforge:installer:${INSTALLER_VERSION}:shrunk"
|
||||
artifact = "net.minecraftforge:installer:${INSTALLER_VERSION}:fatjar"
|
||||
changing = true
|
||||
}
|
||||
|
||||
@@ -457,7 +459,7 @@ def sharedFmlonlyForge = { Project prj ->
|
||||
// SecureJarHandler bootstrap values.
|
||||
run.property 'ignoreList', prj.configurations.moduleonly.files.collect {it.name.replaceAll(/([-_]([.\d]*\d+)|\.jar$)/, '') }.join(',') + ",client-extra,fmlcore,javafmllanguage,lowcodelanguage,mclanguage,${prj.name}-"
|
||||
// FIXME: Without this jna doesn't work at runtime. Someone figure out why please?
|
||||
run.property 'mergeModules', 'jna-5.10.0.jar,jna-platform-5.10.0.jar'
|
||||
run.property 'mergeModules', 'jna-5.12.1.jar,jna-platform-5.12.1.jar'
|
||||
if (userdevRuns.contains(run)) {
|
||||
run.property 'legacyClassPath.file', '{minecraft_classpath_file}'
|
||||
run.jvmArgs '-p', '{modules}'
|
||||
@@ -883,20 +885,21 @@ project(':fmlonly') {
|
||||
}
|
||||
|
||||
project(':forge') {
|
||||
evaluationDependsOn(':clean')
|
||||
evaluationDependsOn(System.env.TEAMCITY_VERSION ? ':mcp' : ':clean')
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'net.minecraftforge.gradle.patcher'
|
||||
apply plugin: 'org.cadixdev.licenser'
|
||||
|
||||
applyPatches { verbose = true }
|
||||
applyPatches {
|
||||
level 'WARNING'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDirs = [
|
||||
"$rootDir/src/main/java",
|
||||
"$rootDir/src/fmlcommon/java",
|
||||
SNAPSHOT ? "$rootDir/src/snapshots/java" : "$rootDir/src/snapshots_disabled/java"
|
||||
"$rootDir/src/fmlcommon/java"
|
||||
]
|
||||
}
|
||||
resources {
|
||||
@@ -960,13 +963,19 @@ project(':forge') {
|
||||
|
||||
patcher {
|
||||
excs.from file("$rootDir/src/main/resources/forge.exc")
|
||||
parent = project(':clean')
|
||||
parent = project(System.env.TEAMCITY_VERSION ? ':mcp' : ':clean')
|
||||
patches = file("$rootDir/patches/minecraft")
|
||||
patchedSrc = file('src/main/java')
|
||||
srgPatches = true
|
||||
accessTransformers.from file("$rootDir/src/main/resources/META-INF/accesstransformer.cfg")
|
||||
sideAnnotationStrippers.from file("$rootDir/src/main/resources/forge.sas")
|
||||
|
||||
// the clean project provides these. if we're not using it, we need to provide them ourselves
|
||||
if (System.env.TEAMCITY_VERSION) {
|
||||
mappings channel: MAPPING_CHANNEL, version: MAPPING_VERSION
|
||||
mcVersion = MC_VERSION
|
||||
}
|
||||
|
||||
runs {
|
||||
forge_client {
|
||||
property 'eventbus.checkTypesOnDispatch', 'true'
|
||||
@@ -1171,9 +1180,12 @@ project(':forge') {
|
||||
]
|
||||
}
|
||||
|
||||
task crowdin(type: Crowdin) {
|
||||
key = project.hasProperty('crowdinKey') ? project.crowdinKey : null
|
||||
//TODO: Merge our english.json?
|
||||
tasks.register('downloadCrowdin', Download) {
|
||||
src 'https://files.minecraftforge.net/crowdin.zip'
|
||||
dest file('build/crowdin.zip')
|
||||
useETag 'all'
|
||||
onlyIfModified true
|
||||
quiet true
|
||||
}
|
||||
|
||||
sharedFmlonlyForge.call(project)
|
||||
@@ -1183,7 +1195,7 @@ project(':forge') {
|
||||
output = rootProject.file('build/libraries/')
|
||||
}
|
||||
|
||||
task extractInheritance(type: ExtractInheritance, dependsOn: [downloadLibraries]) {
|
||||
task extractInheritance(type: ExtractInheritance, dependsOn: [genJoinedBinPatches, downloadLibraries]) {
|
||||
tool = INSTALLER_TOOLS + ':fatjar'
|
||||
args.add '--annotations'
|
||||
input = genJoinedBinPatches.cleanJar
|
||||
@@ -1265,11 +1277,6 @@ project(':forge') {
|
||||
]
|
||||
}
|
||||
|
||||
tasks.register('fixPatchImports', FixPatchImports) {
|
||||
clean.set(rootProject.file('projects/clean/src/main/java'))
|
||||
patched.set(rootProject.file('projects/forge/src/main/java'))
|
||||
}
|
||||
|
||||
genPatches {
|
||||
finalizedBy checkAndFixPatches
|
||||
autoHeader true
|
||||
@@ -1584,9 +1591,12 @@ project(':forge') {
|
||||
from extraTxts
|
||||
|
||||
// add crowdin locales
|
||||
from { crowdin.output.present && crowdin.output.get().asFile.exists() ? zipTree(crowdin.output) : null}
|
||||
dependsOn crowdin
|
||||
duplicatesStrategy = 'exclude'
|
||||
from zipTree(downloadCrowdin.dest).matching {
|
||||
include 'assets/forge/lang/*.json'
|
||||
}
|
||||
|
||||
dependsOn downloadCrowdin
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
|
||||
doFirst {
|
||||
MANIFESTS.each{ pkg, values ->
|
||||
@@ -1631,7 +1641,7 @@ project(':forge') {
|
||||
exclude it
|
||||
}
|
||||
filter(ReplaceTokens, tokens: [
|
||||
FORGE_VERSION: project.version,
|
||||
FORGE_VERSION: FORGE_VERSION,
|
||||
FORGE_GROUP: project.group,
|
||||
FORGE_NAME: project.name,
|
||||
MC_VERSION: MC_VERSION,
|
||||
@@ -1665,8 +1675,9 @@ project(':forge') {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('genAllData') {
|
||||
dependsOn 'forge_data', 'forge_mdk_data', 'forge_test_data'
|
||||
reobfJar {
|
||||
tool = FART
|
||||
args = ['--input', '{input}', '--output', '{output}', '--map', '{srg}']
|
||||
}
|
||||
|
||||
tasks.eclipse.dependsOn('genEclipseRuns')
|
||||
@@ -1781,16 +1792,13 @@ project(':forge') {
|
||||
|
||||
//evaluationDependsOnChildren()
|
||||
task setup() { //These must be strings so that we can do lazy resolution. Else we need evaluationDependsOnChildren above
|
||||
dependsOn ':clean:extractMapped'
|
||||
if (!System.env.TEAMCITY_VERSION)
|
||||
dependsOn ':clean:extractMapped'
|
||||
if (symlinkValid)
|
||||
dependsOn ':fmlonly:extractMapped'
|
||||
dependsOn ':forge:extractMapped'
|
||||
}
|
||||
|
||||
if (symlinkValid)
|
||||
project.gradle.startParameter.excludedTaskNames.add(':fmlonly:genPatches')
|
||||
project.gradle.startParameter.excludedTaskNames.add(':clean:genPatches')
|
||||
|
||||
//Also output FMLOnly when building a version.
|
||||
if (System.env.TEAMCITY_VERSION) {
|
||||
//Only setup the CI environment if and only if the environment variables are set.
|
||||
@@ -1802,3 +1810,11 @@ if (System.env.TEAMCITY_VERSION) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
idea {
|
||||
module {
|
||||
// IntelliJ IDEA does not do this by itself anymore...
|
||||
downloadJavadoc = true
|
||||
downloadSources = true
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
repositories {
|
||||
maven { url = 'https://maven.minecraftforge.net/' }
|
||||
mavenCentral()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
+1
-1
@@ -27,6 +27,6 @@ abstract class BytecodePredicateFinder extends BytecodeFinder {
|
||||
@Internal
|
||||
@Override
|
||||
protected Object getData() {
|
||||
return matches.toSorted(Comparator.naturalOrder()) ?: {throw new RuntimeException('Failed to find any targets, please ensure that method names and descriptors are correct.')}()
|
||||
return matches.stream().sorted().toList() ?: {throw new RuntimeException('Failed to find any targets, please ensure that method names and descriptors are correct.')}()
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package net.minecraftforge.forge.tasks
|
||||
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
import org.gradle.api.tasks.InputDirectory
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
|
||||
import java.nio.file.Files
|
||||
|
||||
abstract class FixPatchImports extends DefaultTask {
|
||||
|
||||
@InputDirectory abstract DirectoryProperty getClean()
|
||||
@InputDirectory abstract DirectoryProperty getPatched()
|
||||
|
||||
@TaskAction
|
||||
void run() {
|
||||
final patchedPath = getPatched().get().asFile.toPath()
|
||||
final cleanPath = getClean().get().asFile.toPath()
|
||||
|
||||
try (final var stream = Files.find(patchedPath, Integer.MAX_VALUE, (path, attr) -> path.toString().endsWith('.java'))) {
|
||||
final itr = stream.iterator()
|
||||
while (itr.hasNext()) {
|
||||
final next = itr.next()
|
||||
final clean = cleanPath.resolve(patchedPath.relativize(next).toString())
|
||||
|
||||
final patchedLines = Files.readAllLines(next)
|
||||
final cleanLines = Files.readAllLines(clean)
|
||||
|
||||
final patchedImport = patchedLines.findLastIndexOf(2) { it.startsWith('import ') }
|
||||
final cleanImport = cleanLines.findLastIndexOf(2) { it.startsWith('import ') }
|
||||
|
||||
if (cleanImport !== patchedImport) {
|
||||
patchedLines.removeIf { it.startsWith('import ') }
|
||||
patchedLines.addAll(2, cleanLines.subList(2, cleanImport + 1))
|
||||
Files.write(next, patchedLines)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ class TeamcityRequests {
|
||||
@Nullable
|
||||
static Map<String, Build> buildsByCommit() throws IOException {
|
||||
final Map<String, Build> builds = [:]
|
||||
jsonRequest(new TypeToken<Builds>() {}, "https://teamcity.minecraftforge.net/guestAuth/app/rest/builds?fields=build:(revisions,number)&locator=buildType:(id:MinecraftForge_MinecraftForge_MinecraftForge_MinecraftForge__Build),count:300,status:SUCCESS")
|
||||
jsonRequest(new TypeToken<Builds>() {}, 'https://teamcity.minecraftforge.net/guestAuth/app/rest/builds?fields=build:(revisions,number)&locator=buildType:(id:MinecraftForge_MinecraftForge_MinecraftForge_MinecraftForge__Build),defaultFilter:false,count:300,status:SUCCESS')
|
||||
?.build?.forEach {
|
||||
it.revisions.revision.each { rev -> builds[rev.version] = it }
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ abstract class CheckATs extends CheckTask {
|
||||
}
|
||||
|
||||
private static List<String> joinBack(TreeMap<String, ATParser.Entry> lines, Map<String, InheritanceData> inheritance, IMappingFile mappings) {
|
||||
final data = [] as List<String>
|
||||
final List<String> data = []
|
||||
final remapComment = { ATParser.Entry entry ->
|
||||
if (!mappings || !entry || !entry.desc) return null
|
||||
final comment = entry.comment?.substring(1)?.trim()
|
||||
|
||||
@@ -36,7 +36,7 @@ abstract class CheckTask extends DefaultTask implements VerificationTask {
|
||||
final doFix = getMode().get() === CheckMode.FIX
|
||||
final Reporter reporter = new Reporter(doFix)
|
||||
check(reporter, doFix)
|
||||
|
||||
|
||||
if (reporter.messages) {
|
||||
if (getMode().get() === CheckMode.CHECK) {
|
||||
logger.error("Check task '{}' found errors:\n{}", name, reporter.messages.join('\n'))
|
||||
@@ -103,7 +103,7 @@ abstract class CheckTask extends DefaultTask implements VerificationTask {
|
||||
def castedTask = task as T
|
||||
configuration.setDelegate(castedTask)
|
||||
configuration.call(castedTask)
|
||||
castedTask.mode.set(CheckMode.FIX)
|
||||
castedTask.mode.set(CheckMode.CHECK)
|
||||
castedTask.group = 'checks'
|
||||
}
|
||||
tasks.named('checkAllAndFix').configure { it.dependsOn("checkAndFix$taskName") }
|
||||
|
||||
+28
-8
@@ -3,14 +3,14 @@
|
||||
MinecraftForge
|
||||
=============
|
||||
[][Download]
|
||||
[][Download] [][Discord] [][Patreon]
|
||||
|
||||
Forge is a free, open-source modding API all of your favourite mods use!
|
||||
|
||||
| Version | Support |
|
||||
|---------| ------------- |
|
||||
| 1.20.x | Active |
|
||||
| Version | Support |
|
||||
|--------------|-----------------------------|
|
||||
| All versions | [Supported][Support-Policy] |
|
||||
|
||||
* [Download]
|
||||
* [Forum]
|
||||
@@ -30,6 +30,19 @@ You can download the installer for the *Recommended Build* or the
|
||||
|
||||
For support and questions, visit [the Support Forum][Support-Forum] or [the Forge Discord server][Discord].
|
||||
|
||||
## Required Java Versions
|
||||
|
||||
We require the version of Java that Minecraft requires, which is currently:
|
||||
|
||||
| Minecraft | Java |
|
||||
|---------------|-------------------|
|
||||
| 1.20.6+ | [21][Adoptium-21] |
|
||||
| 1.18 - 1.20.4 | [17][Adoptium-17] |
|
||||
| 1.17.1 | [16][Adoptium-16] |
|
||||
| 1.16.5- | [8][Adoptium-8] |
|
||||
|
||||
**If you are on Windows and have difficulty using Java to launch JAR files, consider using [Jarfix by Johann Löfflmann][Jarfix].**
|
||||
|
||||
# Creating Mods
|
||||
|
||||
[See the "Getting Started" section in the Forge Documentation][Getting-Started].
|
||||
@@ -62,14 +75,21 @@ Please ensure you have a valid email address associated with your GitHub account
|
||||
|
||||
[Download]: https://files.minecraftforge.net/
|
||||
|
||||
[Adoptium-21]: https://adoptium.net/temurin/releases/?version=21
|
||||
[Adoptium-17]: https://adoptium.net/temurin/releases/?version=17
|
||||
[Adoptium-16]: https://adoptium.net/temurin/releases/?version=16
|
||||
[Adoptium-8]: https://adoptium.net/temurin/releases/?version=8
|
||||
[Jarfix]: https://johann.loefflmann.net/en/software/jarfix/index.html
|
||||
|
||||
[Forum]: https://forums.minecraftforge.net/
|
||||
[Support-Forum]: https://forums.minecraftforge.net/forum/18-support-bug-reports/
|
||||
[Support-Policy]: https://forums.minecraftforge.net/topic/144690-new-tiered-support-policy
|
||||
|
||||
[Discord]: https://discord.minecraftforge.net/
|
||||
|
||||
[Documentation]: https://docs.minecraftforge.net/
|
||||
[Getting-Started]: https://docs.minecraftforge.net/en/latest/gettingstarted/
|
||||
[ForgeDev]: https://docs.minecraftforge.net/en/latest/forgedev/
|
||||
[Pull-Requests]: https://docs.minecraftforge.net/en/latest/forgedev/#making-changes-and-pull-requests
|
||||
[Documentation]: https://docs.minecraftforge.net/en/1.19.x/
|
||||
[Getting-Started]: https://docs.minecraftforge.net/en/1.19.x/gettingstarted/
|
||||
[ForgeDev]: https://docs.minecraftforge.net/en/1.19.x/forgedev/
|
||||
[Pull-Requests]: https://docs.minecraftforge.net/en/1.19.x/forgedev/#making-changes-and-pull-requests
|
||||
|
||||
[Patreon]: https://www.patreon.com/LexManos
|
||||
@@ -44,7 +44,6 @@ ext {
|
||||
}
|
||||
|
||||
jar.doFirst {
|
||||
manifest.attributes['Automatic-Module-Name'] = project.name
|
||||
MANIFESTS.each { pkg, values ->
|
||||
if (pkg == '')
|
||||
manifest.attributes(values)
|
||||
|
||||
@@ -5,36 +5,36 @@
|
||||
|
||||
package net.minecraftforge.fml;
|
||||
|
||||
import cpw.mods.modlauncher.util.ServiceLoaderUtils;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.fml.config.IConfigEvent;
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
|
||||
import java.util.ServiceConfigurationError;
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class Bindings {
|
||||
private static final Bindings INSTANCE = new Bindings();
|
||||
private Bindings() {}
|
||||
|
||||
private final IBindingsProvider provider;
|
||||
|
||||
private Bindings() {
|
||||
final var providers = ServiceLoaderUtils.streamServiceLoader(()->ServiceLoader.load(FMLLoader.getGameLayer(), IBindingsProvider.class), sce->{}).toList();
|
||||
if (providers.size() != 1) {
|
||||
throw new IllegalStateException("Could not find bindings provider");
|
||||
}
|
||||
this.provider = providers.get(0);
|
||||
}
|
||||
/**
|
||||
* The provider of the bindings
|
||||
* @implNote May also throw a {@link ServiceConfigurationError}
|
||||
*/
|
||||
private static final IBindingsProvider PROVIDER = ServiceLoader.load(FMLLoader.getGameLayer(), IBindingsProvider.class)
|
||||
.findFirst().orElseThrow(() -> new IllegalStateException("Could not find bindings provider"));
|
||||
|
||||
/**
|
||||
* @return A supplier of net.minecraftforge.common.MinecraftForge#EVENT_BUS
|
||||
*/
|
||||
public static Supplier<IEventBus> getForgeBus() {
|
||||
return INSTANCE.provider.getForgeBusSupplier();
|
||||
return PROVIDER.getForgeBusSupplier();
|
||||
}
|
||||
|
||||
public static Supplier<I18NParser> getMessageParser() {
|
||||
return INSTANCE.provider.getMessageParser();
|
||||
return PROVIDER.getMessageParser();
|
||||
}
|
||||
|
||||
public static Supplier<IConfigEvent.ConfigConfig> getConfigConfiguration() {
|
||||
return INSTANCE.provider.getConfigConfiguration();
|
||||
return PROVIDER.getConfigConfiguration();
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public class DeferredWorkQueue
|
||||
timer,
|
||||
aggregate
|
||||
);
|
||||
throw aggregate;
|
||||
//TODO 1.20: throw aggregate exception
|
||||
} else {
|
||||
LOGGER.debug(LOADING, "Synchronous work queue completed in {}", timer);
|
||||
}
|
||||
|
||||
@@ -95,5 +95,24 @@ public interface IExtensionPoint<T extends Record>
|
||||
@SuppressWarnings("JavadocReference") // reference to NetworkConstants, ForgeHooksClient
|
||||
record DisplayTest(Supplier<String> suppliedVersion, BiPredicate<String, Boolean> remoteVersionTest) implements IExtensionPoint<DisplayTest> {
|
||||
public static final String IGNORESERVERONLY = "OHNOES\uD83D\uDE31\uD83D\uDE31\uD83D\uDE31\uD83D\uDE31\uD83D\uDE31\uD83D\uDE31\uD83D\uDE31\uD83D\uDE31\uD83D\uDE31\uD83D\uDE31\uD83D\uDE31\uD83D\uDE31\uD83D\uDE31\uD83D\uDE31\uD83D\uDE31\uD83D\uDE31\uD83D\uDE31";
|
||||
|
||||
/**
|
||||
* Ignores any version information coming from the server - use for server only mods
|
||||
*/
|
||||
public static final Supplier<DisplayTest> IGNORE_SERVER_VERSION = () -> new DisplayTest(IGNORESERVERONLY, (remoteVersion, isFromServer) -> true);
|
||||
|
||||
/**
|
||||
* Ignores all information and provides no information
|
||||
*/
|
||||
public static final Supplier<DisplayTest> IGNORE_ALL_VERSION = () -> new DisplayTest("", (remoteVersion, isFromServer) -> true);
|
||||
|
||||
/**
|
||||
* An optional alternative to {@link #DisplayTest(Supplier, BiPredicate)} which accepts a constant version string
|
||||
* instead of a {@link Supplier}.
|
||||
* <p>Internally, the provided version string is wrapped in a Supplier for you.</p>
|
||||
*/
|
||||
public DisplayTest(String version, BiPredicate<String, Boolean> remoteVersionTest) {
|
||||
this(() -> version, remoteVersionTest);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.fml.config.IConfigEvent;
|
||||
import net.minecraftforge.fml.config.ModConfig;
|
||||
import net.minecraftforge.fml.event.IModBusEvent;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ModFileInfo;
|
||||
import net.minecraftforge.forgespi.language.IModInfo;
|
||||
|
||||
import java.util.EnumMap;
|
||||
@@ -20,6 +21,7 @@ import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@@ -57,15 +59,16 @@ public abstract class ModContainer
|
||||
this.modInfo = info;
|
||||
this.modLoadingStage = ModLoadingStage.CONSTRUCT;
|
||||
|
||||
final String displayTestString = info.getConfig().<String>getConfigElement("displayTest").orElse("MATCH_VERSION"); // missing defaults to DEFAULT type
|
||||
final String displayTestString = info.getConfig().<String>getConfigElement("displayTest")
|
||||
.orElseGet(() -> (Boolean) info.getOwningFile().getFileProperties().getOrDefault(ModFileInfo.CLIENT_SIDE_ONLY_PROP, Boolean.FALSE) ? "IGNORE_ALL_VERSION" : "MATCH_VERSION");
|
||||
Supplier<IExtensionPoint.DisplayTest> displayTestSupplier = switch (displayTestString) {
|
||||
case "MATCH_VERSION" -> // default displaytest checks for version string match
|
||||
() -> new IExtensionPoint.DisplayTest(() -> this.modInfo.getVersion().toString(),
|
||||
(incoming, isNetwork) -> Objects.equals(incoming, this.modInfo.getVersion().toString()));
|
||||
case "IGNORE_SERVER_VERSION" -> // Ignores any version information coming from the server - use for server only mods
|
||||
() -> new IExtensionPoint.DisplayTest(() -> IExtensionPoint.DisplayTest.IGNORESERVERONLY, (incoming, isNetwork) -> true);
|
||||
IExtensionPoint.DisplayTest.IGNORE_SERVER_VERSION;
|
||||
case "IGNORE_ALL_VERSION" -> // Ignores all information and provides no information
|
||||
() -> new IExtensionPoint.DisplayTest(() -> "", (incoming, isNetwork) -> true);
|
||||
IExtensionPoint.DisplayTest.IGNORE_ALL_VERSION;
|
||||
case "NONE" -> null; // NO display test at all - use this if you're going to do your own display test
|
||||
default -> // any other value throws an exception
|
||||
throw new IllegalArgumentException("Invalid displayTest value supplied in mods.toml");
|
||||
@@ -142,6 +145,22 @@ public abstract class ModContainer
|
||||
extensionPoints.put(point, extension);
|
||||
}
|
||||
|
||||
public void registerDisplayTest(IExtensionPoint.DisplayTest displayTest) {
|
||||
registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> displayTest);
|
||||
}
|
||||
|
||||
public void registerDisplayTest(Supplier<IExtensionPoint.DisplayTest> displayTest) {
|
||||
registerExtensionPoint(IExtensionPoint.DisplayTest.class, displayTest);
|
||||
}
|
||||
|
||||
public void registerDisplayTest(String version, BiPredicate<String, Boolean> remoteVersionTest) {
|
||||
registerDisplayTest(new IExtensionPoint.DisplayTest(version, remoteVersionTest));
|
||||
}
|
||||
|
||||
public void registerDisplayTest(Supplier<String> suppliedVersion, BiPredicate<String, Boolean> remoteVersionTest) {
|
||||
registerDisplayTest(new IExtensionPoint.DisplayTest(suppliedVersion, remoteVersionTest));
|
||||
}
|
||||
|
||||
public void addConfig(final ModConfig modConfig) {
|
||||
configs.put(modConfig.getType(), modConfig);
|
||||
}
|
||||
|
||||
@@ -8,38 +8,54 @@ package net.minecraftforge.fml;
|
||||
import com.mojang.logging.LogUtils;
|
||||
import net.minecraftforge.fml.config.IConfigSpec;
|
||||
import net.minecraftforge.fml.config.ModConfig;
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class ModLoadingContext
|
||||
{
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
private static final ThreadLocal<ModLoadingContext> context = ThreadLocal.withInitial(ModLoadingContext::new);
|
||||
private ModContainer activeContainer;
|
||||
private Object languageExtension;
|
||||
private ModLoadingStage stage;
|
||||
|
||||
/**
|
||||
* @deprecated Use the context provided by your language loader in your mod's constructor.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.21.1")
|
||||
public static ModLoadingContext get() {
|
||||
return context.get();
|
||||
}
|
||||
|
||||
private ModContainer activeContainer;
|
||||
|
||||
/**
|
||||
* @deprecated Going to be moved to ForgeHooks for internal use.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.21.1")
|
||||
public void setActiveContainer(final ModContainer container) {
|
||||
this.activeContainer = container;
|
||||
this.languageExtension = container == null ? null : container.contextExtension.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Going to be moved to ForgeHooks for internal use.
|
||||
* @deprecated Override/Use {@link ModLoadingContext#getContainer()}
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.21.1")
|
||||
public ModContainer getActiveContainer() {
|
||||
return activeContainer == null ? ModList.get().getModContainerById("minecraft").orElseThrow(()->new RuntimeException("Where is minecraft???!")) : activeContainer;
|
||||
}
|
||||
|
||||
@Deprecated(forRemoval = true, since = "1.21.1")
|
||||
public String getActiveNamespace() {
|
||||
return activeContainer == null ? "minecraft" : activeContainer.getNamespace();
|
||||
}
|
||||
|
||||
public ModContainer getContainer() {
|
||||
return getActiveContainer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register an {@link IExtensionPoint} with the mod container.
|
||||
* @param point The extension point to register
|
||||
@@ -47,29 +63,67 @@ public class ModLoadingContext
|
||||
* @param <T> The type signature of the extension operator
|
||||
*/
|
||||
public <T extends Record & IExtensionPoint<T>> void registerExtensionPoint(Class<? extends IExtensionPoint<T>> point, Supplier<T> extension) {
|
||||
getActiveContainer().registerExtensionPoint(point, extension);
|
||||
getContainer().registerExtensionPoint(point, extension);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a {@link IExtensionPoint.DisplayTest} with the mod container.
|
||||
* <p>A shorthand for registering a DisplayTest with {@link #registerExtensionPoint(Class, Supplier)}.</p>
|
||||
* @param displayTest The {@link IExtensionPoint.DisplayTest} to register
|
||||
*/
|
||||
public void registerDisplayTest(IExtensionPoint.DisplayTest displayTest) {
|
||||
getContainer().registerDisplayTest(() -> displayTest);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a {@link IExtensionPoint.DisplayTest} with the mod container.
|
||||
* <p>A shorthand for registering a DisplayTest supplier with {@link #registerExtensionPoint(Class, Supplier)}.</p>
|
||||
* @param displayTest The {@link Supplier<IExtensionPoint.DisplayTest>} to register
|
||||
*/
|
||||
public void registerDisplayTest(Supplier<IExtensionPoint.DisplayTest> displayTest) {
|
||||
getContainer().registerDisplayTest(displayTest);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a {@link IExtensionPoint.DisplayTest} with the mod container.
|
||||
* <p>A shorthand for registering a DisplayTest with {@link #registerExtensionPoint(Class, Supplier)} that also
|
||||
* creates the DisplayTest instance for you using the provided parameters.</p>
|
||||
* @see IExtensionPoint.DisplayTest#DisplayTest(String, BiPredicate)
|
||||
*/
|
||||
public void registerDisplayTest(String version, BiPredicate<String, Boolean> remoteVersionTest) {
|
||||
getContainer().registerDisplayTest(new IExtensionPoint.DisplayTest(version, remoteVersionTest));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a {@link IExtensionPoint.DisplayTest} with the mod container.
|
||||
* <p>A shorthand for registering a DisplayTest with {@link #registerExtensionPoint(Class, Supplier)} that also
|
||||
* creates the DisplayTest instance for you using the provided parameters.</p>
|
||||
* @see IExtensionPoint.DisplayTest#DisplayTest(Supplier, BiPredicate)
|
||||
*/
|
||||
public void registerDisplayTest(Supplier<String> suppliedVersion, BiPredicate<String, Boolean> remoteVersionTest) {
|
||||
getContainer().registerDisplayTest(new IExtensionPoint.DisplayTest(suppliedVersion, remoteVersionTest));
|
||||
}
|
||||
|
||||
public void registerConfig(ModConfig.Type type, IConfigSpec<?> spec) {
|
||||
if (spec.isEmpty())
|
||||
{
|
||||
// This handles the case where a mod tries to register a config, without any options configured inside it.
|
||||
LOGGER.debug("Attempted to register an empty config for type {} on mod {}", type, getActiveContainer().getModId());
|
||||
LOGGER.debug("Attempted to register an empty config for type {} on mod {}", type, getContainer().getModId());
|
||||
return;
|
||||
}
|
||||
|
||||
getActiveContainer().addConfig(new ModConfig(type, spec, getActiveContainer()));
|
||||
getContainer().addConfig(new ModConfig(type, spec, getContainer()));
|
||||
}
|
||||
|
||||
public void registerConfig(ModConfig.Type type, IConfigSpec<?> spec, String fileName) {
|
||||
if (spec.isEmpty())
|
||||
{
|
||||
// This handles the case where a mod tries to register a config, without any options configured inside it.
|
||||
LOGGER.debug("Attempted to register an empty config for type {} on mod {} using file name {}", type, getActiveContainer().getModId(), fileName);
|
||||
LOGGER.debug("Attempted to register an empty config for type {} on mod {} using file name {}", type, getContainer().getModId(), fileName);
|
||||
return;
|
||||
}
|
||||
|
||||
getActiveContainer().addConfig(new ModConfig(type, spec, getActiveContainer(), fileName));
|
||||
getContainer().addConfig(new ModConfig(type, spec, getContainer(), fileName));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@ public class VersionChecker
|
||||
BETA(),
|
||||
BETA_OUTDATED(6, true);
|
||||
|
||||
final int sheetOffset;
|
||||
final boolean draw, animated;
|
||||
private final int sheetOffset;
|
||||
private final boolean draw, animated;
|
||||
|
||||
Status()
|
||||
{
|
||||
@@ -91,6 +91,9 @@ public class VersionChecker
|
||||
return animated;
|
||||
}
|
||||
|
||||
public boolean isOutdated() {
|
||||
return this == OUTDATED || this == BETA_OUTDATED;
|
||||
}
|
||||
}
|
||||
|
||||
public record CheckResult(VersionChecker.Status status, ComparableVersion target, Map<ComparableVersion, String> changes, String url) {}
|
||||
@@ -257,7 +260,7 @@ public class VersionChecker
|
||||
LOGGER.warn("Failed to process update information", e);
|
||||
status = FAILED;
|
||||
}
|
||||
results.put(mod, new CheckResult(status, target, changes, display_url));
|
||||
RESULTS.put(mod, new CheckResult(status, target, changes, display_url));
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
@@ -273,12 +276,12 @@ public class VersionChecker
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static Map<IModInfo, CheckResult> results = new ConcurrentHashMap<>();
|
||||
private static final Map<IModInfo, CheckResult> RESULTS = new ConcurrentHashMap<>();
|
||||
private static final CheckResult PENDING_CHECK = new CheckResult(PENDING, null, null, null);
|
||||
|
||||
public static CheckResult getResult(IModInfo mod)
|
||||
{
|
||||
return results.getOrDefault(mod, PENDING_CHECK);
|
||||
return RESULTS.getOrDefault(mod, PENDING_CHECK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,7 +17,6 @@ dependencies {
|
||||
api("org.ow2.asm:asm-tree:${ASM_VERSION}")
|
||||
api("org.ow2.asm:asm-commons:${ASM_VERSION}")
|
||||
api("net.minecraftforge:forgespi:${SPI_VERSION}")
|
||||
api("net.minecraftforge:mergetool:${MERGETOOL_VERSION}:api")
|
||||
api("org.apache.logging.log4j:log4j-api:${LOG4J_VERSION}")
|
||||
api("org.slf4j:slf4j-api:${SLF4J_API_VERSION}")
|
||||
api("com.google.guava:guava:${GUAVA_VERSION}")
|
||||
@@ -70,7 +69,6 @@ ext {
|
||||
}
|
||||
|
||||
jar.doFirst {
|
||||
manifest.attributes['Automatic-Module-Name'] = project.name
|
||||
MANIFESTS.each { pkg, values ->
|
||||
manifest.attributes(values, pkg)
|
||||
}
|
||||
|
||||
+30
-9
@@ -8,6 +8,7 @@ package net.minecraftforge.fml.common.asm;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -35,7 +36,11 @@ public class ObjectHolderDefinalize implements ILaunchPluginService {
|
||||
new VanillaObjectHolderData("net.minecraft.core.particles.ParticleTypes", "particle_type", "net.minecraft.core.particles.ParticleType"),
|
||||
new VanillaObjectHolderData("net.minecraft.sounds.SoundEvents", "sound_event", "net.minecraft.sounds.SoundEvent")
|
||||
).collect(Collectors.toMap(VanillaObjectHolderData::holderClass, Function.identity()));
|
||||
private final String OBJECT_HOLDER = "Lnet/minecraftforge/registries/ObjectHolder;"; //Don't directly reference this to prevent class loading.
|
||||
private static final Set<String> VANILLA_OBJECT_HOLDER_CLASSES = VANILLA_OBJECT_HOLDERS.keySet().stream()
|
||||
.map(it -> it.replace('.', '/'))
|
||||
.collect(Collectors.toUnmodifiableSet());
|
||||
private static final String OBJECT_HOLDER = "Lnet/minecraftforge/registries/ObjectHolder;"; //Don't directly reference this to prevent class loading.
|
||||
private static final int PUBLIC_STATIC_FINAL_FLAGS = Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC | Opcodes.ACC_FINAL;
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
@@ -46,13 +51,30 @@ public class ObjectHolderDefinalize implements ILaunchPluginService {
|
||||
private static final EnumSet<Phase> NAY = EnumSet.noneOf(Phase.class);
|
||||
|
||||
@Override
|
||||
public EnumSet<Phase> handlesClass(Type classType, boolean isEmpty)
|
||||
{
|
||||
return isEmpty ? NAY : YAY;
|
||||
public EnumSet<Phase> handlesClass(Type classType, boolean isEmpty) {
|
||||
if (isEmpty)
|
||||
return NAY;
|
||||
|
||||
// Let's skip processing classes that definitely don't have object holders
|
||||
String internalName = classType.getInternalName();
|
||||
|
||||
// Forge classes that aren't in the debug package (that package is used for tests)
|
||||
if (internalName.startsWith("net/minecraftforge/") && !internalName.substring(18).contains("debug")
|
||||
&& !internalName.equals("net/minecraftforge/common/crafting/ConditionalRecipe"))
|
||||
return NAY;
|
||||
|
||||
// Vanilla classes that don't have object holders
|
||||
if (internalName.startsWith("com/mojang/"))
|
||||
return NAY;
|
||||
|
||||
// ...except specific ones we added to the VANILLA_OBJECT_HOLDERS map
|
||||
if (internalName.startsWith("net/minecraft/") && !VANILLA_OBJECT_HOLDER_CLASSES.contains(internalName))
|
||||
return NAY;
|
||||
|
||||
return YAY;
|
||||
}
|
||||
|
||||
private boolean hasHolder(List<AnnotationNode> lst)
|
||||
{
|
||||
private boolean hasHolder(List<AnnotationNode> lst) {
|
||||
return lst != null && lst.stream().anyMatch(n -> n.desc.equals(OBJECT_HOLDER));
|
||||
}
|
||||
|
||||
@@ -75,10 +97,9 @@ public class ObjectHolderDefinalize implements ILaunchPluginService {
|
||||
{
|
||||
final AtomicBoolean changes = new AtomicBoolean();
|
||||
//Must be public static finals, and non-array objects
|
||||
final int flags = Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC | Opcodes.ACC_FINAL;
|
||||
|
||||
//Fix Annotated Fields before injecting from class level
|
||||
classNode.fields.stream().filter(f -> ((f.access & flags) == flags) && f.desc.startsWith("L") && hasHolder(f.visibleAnnotations)).forEach(f ->
|
||||
classNode.fields.stream().filter(f -> ((f.access & PUBLIC_STATIC_FINAL_FLAGS) == PUBLIC_STATIC_FINAL_FLAGS) && f.desc.startsWith("L") && hasHolder(f.visibleAnnotations)).forEach(f ->
|
||||
{
|
||||
int prev = f.access;
|
||||
f.access &= ~Opcodes.ACC_FINAL; //Strip final
|
||||
@@ -88,7 +109,7 @@ public class ObjectHolderDefinalize implements ILaunchPluginService {
|
||||
|
||||
if (VANILLA_OBJECT_HOLDERS.containsKey(classType.getClassName())) //Class level, de-finalize all fields and add @ObjectHolder to them!
|
||||
{
|
||||
classNode.fields.stream().filter(f -> ((f.access & flags) == flags) && f.desc.startsWith("L")).forEach(f ->
|
||||
classNode.fields.stream().filter(f -> ((f.access & PUBLIC_STATIC_FINAL_FLAGS) == PUBLIC_STATIC_FINAL_FLAGS) && f.desc.startsWith("L")).forEach(f ->
|
||||
{
|
||||
int prev = f.access;
|
||||
f.access &= ~Opcodes.ACC_FINAL;
|
||||
|
||||
@@ -66,6 +66,9 @@ public class FMLLoader
|
||||
throw new IncompatibleEnvironmentException("Incompatible modlauncher found "+modLauncherPackage.getSpecificationVersion());
|
||||
}
|
||||
|
||||
// Allows us to communicate properties with other services through ModLauncher
|
||||
setupBlackboardKeys();
|
||||
|
||||
accessTransformer = (AccessTransformerService) environment.findLaunchPlugin("accesstransformer").orElseThrow(()-> {
|
||||
LOGGER.error(CORE, "Access Transformer library is missing, we need this to run");
|
||||
return new IncompatibleEnvironmentException("Missing AccessTransformer, cannot run");
|
||||
@@ -127,6 +130,12 @@ public class FMLLoader
|
||||
}
|
||||
}
|
||||
|
||||
private static void setupBlackboardKeys() {
|
||||
LOGGER.debug(CORE, "Requesting CoreMods to not apply the fix for ASMAPI.findFirstInstructionBefore by default");
|
||||
var blackboardKey = TypesafeMap.Key.getOrCreate(Launcher.INSTANCE.blackboard(), "coremods.use_old_findFirstInstructionBefore", Boolean.class);
|
||||
Launcher.INSTANCE.blackboard().<Boolean>computeIfAbsent(blackboardKey, k -> true);
|
||||
}
|
||||
|
||||
static void setupLaunchHandler(final IEnvironment environment, final Map<String, Object> arguments)
|
||||
{
|
||||
final String launchTarget = environment.getProperty(IEnvironment.Keys.LAUNCHTARGET.get()).orElse("MISSING");
|
||||
|
||||
@@ -74,6 +74,14 @@ public enum FMLPaths
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #getOrCreateGameRelativePath(Path)} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.19.4")
|
||||
public static Path getOrCreateGameRelativePath(Path path, String name) {
|
||||
return getOrCreateGameRelativePath(path);
|
||||
}
|
||||
|
||||
public static Path getOrCreateGameRelativePath(Path path) {
|
||||
Path gameFolderPath = FMLPaths.GAMEDIR.get().resolve(path);
|
||||
|
||||
|
||||
@@ -5,11 +5,35 @@
|
||||
|
||||
package net.minecraftforge.fml.loading;
|
||||
|
||||
import com.mojang.logging.LogUtils;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
public class FileUtils
|
||||
{
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
|
||||
/**
|
||||
* @deprecated Use normal Java NIO methods instead
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.19.4")
|
||||
public static Path getOrCreateDirectory(Path dirPath, String dirLabel) {
|
||||
if (!Files.isDirectory(dirPath))
|
||||
{
|
||||
try {
|
||||
Files.createDirectories(dirPath);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Problem creating directory", e);
|
||||
}
|
||||
}
|
||||
|
||||
return dirPath;
|
||||
}
|
||||
|
||||
|
||||
public static String fileExtension(final Path path) {
|
||||
String fileName = path.getFileName().toString();
|
||||
|
||||
@@ -11,11 +11,17 @@ import net.minecraftforge.forgespi.language.IModInfo;
|
||||
import org.apache.maven.artifact.versioning.ArtifactVersion;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.util.stream.Collectors.*;
|
||||
import static java.util.stream.Collectors.groupingBy;
|
||||
import static java.util.stream.Collectors.joining;
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.LOADING;
|
||||
|
||||
public class UniqueModListBuilder
|
||||
{
|
||||
@@ -66,28 +72,35 @@ public class UniqueModListBuilder
|
||||
|
||||
// Its theoretically possible that some mod has somehow moved an id to a secondary place, thus causing a dupe.
|
||||
// We can't handle this
|
||||
final List<IModInfo> dupedMods = modIds.values().stream()
|
||||
final List<String> dupedModErrors = modIds.values().stream()
|
||||
.filter(modInfos -> modInfos.size() > 1)
|
||||
.map(modInfos -> modInfos.get(0))
|
||||
.toList();
|
||||
.map(mods -> String.format("\tMod ID: '%s' from mod files: %s",
|
||||
mods.get(0).getModId(),
|
||||
mods.stream()
|
||||
.map(modInfo -> modInfo.getOwningFile().getFile().getFileName()).collect(joining(", "))
|
||||
)).toList();
|
||||
|
||||
if (!dupedMods.isEmpty()) {
|
||||
final List<EarlyLoadingException.ExceptionData> duplicateModErrors = dupedMods.stream()
|
||||
.map(dm -> new EarlyLoadingException.ExceptionData("fml.modloading.dupedmod", dm, Objects.toString(dm)))
|
||||
.toList();
|
||||
throw new EarlyLoadingException("Duplicate mods found", null, duplicateModErrors);
|
||||
if (!dupedModErrors.isEmpty()) {
|
||||
LOGGER.error(LOADING, "Found duplicate mods:\n{}", dupedModErrors.stream().collect(joining("\n")));
|
||||
throw new EarlyLoadingException("Duplicate mods found", null, dupedModErrors.stream()
|
||||
.map(s -> new EarlyLoadingException.ExceptionData(s))
|
||||
.toList());
|
||||
}
|
||||
|
||||
final List<ModFile> dupedLibs = versionedLibIds.values().stream()
|
||||
.filter(modFiles -> modFiles.size() > 1)
|
||||
.map(modFiles -> modFiles.get(0))
|
||||
.toList();
|
||||
|
||||
if (!dupedLibs.isEmpty()) {
|
||||
final List<EarlyLoadingException.ExceptionData> duplicateLibErrors = dupedLibs.stream()
|
||||
.map(dm -> new EarlyLoadingException.ExceptionData("fml.modloading.dupedlib.versioned", dm, Objects.toString(dm)))
|
||||
.toList();
|
||||
throw new EarlyLoadingException("Duplicate plugins or libraries found", null, duplicateLibErrors);
|
||||
final List<String> dupedLibErrors = versionedLibIds.values().stream()
|
||||
.filter(modFiles -> modFiles.size() > 1)
|
||||
.map(mods -> String.format("\tLibrary: '%s' from files: %s",
|
||||
getModId(mods.get(0)),
|
||||
mods.stream()
|
||||
.map(modFile -> modFile.getFileName()).collect(joining(", "))
|
||||
)).toList();
|
||||
|
||||
if (!dupedLibErrors.isEmpty()) {
|
||||
LOGGER.error(LOADING, "Found duplicate plugins or libraries:\n{}", dupedLibErrors.stream().collect(joining("\n")));
|
||||
throw new EarlyLoadingException("Duplicate plugins or libraries found", null, dupedLibErrors.stream()
|
||||
.map(s -> new EarlyLoadingException.ExceptionData(s))
|
||||
.toList());
|
||||
}
|
||||
|
||||
// Collect unique mod files by module name. This will be used for deduping purposes
|
||||
|
||||
+7
-2
@@ -34,18 +34,23 @@ public abstract class AbstractModProvider implements IModProvider
|
||||
protected static final String MANIFEST = "META-INF/MANIFEST.MF";
|
||||
|
||||
protected IModLocator.ModFileOrException createMod(Path... path) {
|
||||
return this.createMod(getDefaultJarModType(), path);
|
||||
}
|
||||
|
||||
// FORGE: Backporting artifact, the defaultType must be the first parameter since path is varargs
|
||||
protected IModLocator.ModFileOrException createMod(String defaultType, Path... path) {
|
||||
var mjm = new ModJarMetadata();
|
||||
var sj = SecureJar.from(
|
||||
Manifest::new,
|
||||
jar -> jar.moduleDataProvider().findFile(MODS_TOML).isPresent() ? mjm : JarMetadata.from(jar, path),
|
||||
(root, p) -> true,
|
||||
null,
|
||||
path
|
||||
);
|
||||
|
||||
IModFile mod;
|
||||
var type = sj.moduleDataProvider().getManifest().getMainAttributes().getValue(ModFile.TYPE);
|
||||
if (type == null) {
|
||||
type = getDefaultJarModType();
|
||||
type = defaultType;
|
||||
}
|
||||
if (sj.moduleDataProvider().findFile(MODS_TOML).isPresent()) {
|
||||
LOGGER.debug(LogMarkers.SCAN, "Found {} mod of type {}: {}", MODS_TOML, type, path);
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class ExplodedDirectoryLocator implements IModLocator {
|
||||
explodedMods.forEach(explodedMod ->
|
||||
ModJarMetadata.buildFile(this,
|
||||
jar->jar.moduleDataProvider().findFile("/META-INF/mods.toml").isPresent(),
|
||||
(a,b) -> true,
|
||||
null,
|
||||
explodedMod.paths().toArray(Path[]::new))
|
||||
.ifPresentOrElse(f->mods.put(explodedMod, f), () -> LOGGER.warn(LogMarkers.LOADING, "Failed to find exploded resource mods.toml in directory {}", explodedMod.paths().get(0).toString())));
|
||||
return mods.values().stream().map(mf->new IModLocator.ModFileOrException(mf, null)).toList();
|
||||
|
||||
+8
-1
@@ -81,7 +81,14 @@ public class JarInJarDependencyLocator extends AbstractJarFileDependencyLocator
|
||||
final Map<String, ?> outerFsArgs = ImmutableMap.of("packagePath", pathInModFile);
|
||||
final FileSystem zipFS = FileSystems.newFileSystem(filePathUri, outerFsArgs);
|
||||
final Path pathInFS = zipFS.getPath("/");
|
||||
return Optional.of(createMod(pathInFS).file());
|
||||
final IModFile.Type parentType = file.getType();
|
||||
final String modType;
|
||||
if (parentType == IModFile.Type.LIBRARY || parentType == IModFile.Type.LANGPROVIDER) {
|
||||
modType = IModFile.Type.LIBRARY.name();
|
||||
} else {
|
||||
modType = IModFile.Type.GAMELIBRARY.name();
|
||||
}
|
||||
return Optional.of(createMod(modType, pathInFS).file());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
+20
-1
@@ -12,6 +12,7 @@ import cpw.mods.modlauncher.Launcher;
|
||||
import cpw.mods.modlauncher.api.IModuleLayerManager;
|
||||
import cpw.mods.modlauncher.util.ServiceLoaderUtils;
|
||||
import net.minecraftforge.fml.loading.EarlyLoadingException;
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import net.minecraftforge.fml.loading.UniqueModListBuilder;
|
||||
import net.minecraftforge.fml.loading.progress.StartupMessageManager;
|
||||
@@ -20,6 +21,7 @@ import net.minecraftforge.forgespi.language.IModFileInfo;
|
||||
import net.minecraftforge.forgespi.locating.IDependencyLocator;
|
||||
import net.minecraftforge.forgespi.locating.IModFile;
|
||||
import net.minecraftforge.forgespi.locating.IModLocator;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -67,6 +69,7 @@ public class ModDiscoverer {
|
||||
boolean successfullyLoadedMods = true;
|
||||
List<IModFileInfo> brokenFiles = new ArrayList<>();
|
||||
|
||||
boolean distIsDedicatedServer = FMLLoader.getDist().isDedicatedServer();
|
||||
//Loop all mod locators to get the prime mods to load from.
|
||||
for (IModLocator locator : modLocatorList) {
|
||||
try {
|
||||
@@ -84,8 +87,24 @@ public class ModDiscoverer {
|
||||
if (!badModFiles.isEmpty()) {
|
||||
LOGGER.error(LogMarkers.SCAN, "Locator {} returned {} files which is are not ModFile instances! They will be skipped!", locator, badModFiles.size());
|
||||
brokenFiles.addAll(badModFiles.stream().map(IModFile::getModFileInfo).toList());
|
||||
locatedFiles.removeAll(badModFiles);
|
||||
}
|
||||
locatedFiles.removeAll(badModFiles);
|
||||
|
||||
if (distIsDedicatedServer) {
|
||||
var clientOnlyModFiles = locatedFiles.stream()
|
||||
.filter(file -> {
|
||||
// some mod files can have null infos, like javafml, mclanguage, lowcode, and fmlcore
|
||||
@Nullable var info = file.getModFileInfo();
|
||||
|
||||
return info != null && (Boolean) info.getFileProperties().getOrDefault(ModFileInfo.CLIENT_SIDE_ONLY_PROP, Boolean.FALSE);
|
||||
})
|
||||
.toList();
|
||||
if (!clientOnlyModFiles.isEmpty()) {
|
||||
LOGGER.warn(LogMarkers.SCAN, "Locator {} returned {} files which are client-side-only mods, but we're on a dedicated server. They will be skipped!", locator, clientOnlyModFiles.size());
|
||||
locatedFiles.removeAll(clientOnlyModFiles);
|
||||
}
|
||||
}
|
||||
|
||||
LOGGER.debug(LogMarkers.SCAN, "Locator {} found {} valid mod files", locator, locatedFiles.size());
|
||||
handleLocatedFiles(loadedFiles, locatedFiles);
|
||||
} catch (InvalidModFileException imfe) {
|
||||
|
||||
+18
-1
@@ -43,6 +43,10 @@ public class ModFileInfo implements IModFileInfo, IConfigurable
|
||||
private final String license;
|
||||
private final List<String> usesServices;
|
||||
|
||||
public static final String CLIENT_SIDE_ONLY_PROP = "__FORGE_clientSideOnly";
|
||||
|
||||
private static final Map<String, Object> CLIENT_SIDE_ONLY_MAP = Map.of(CLIENT_SIDE_ONLY_PROP, Boolean.TRUE);
|
||||
|
||||
ModFileInfo(final ModFile modFile, final IConfigurable config)
|
||||
{
|
||||
this.modFile = modFile;
|
||||
@@ -56,8 +60,21 @@ public class ModFileInfo implements IModFileInfo, IConfigurable
|
||||
this.license = config.<String>getConfigElement("license")
|
||||
.orElse("");
|
||||
this.showAsResourcePack = config.<Boolean>getConfigElement("showAsResourcePack").orElse(false);
|
||||
boolean clientSideOnly = config.<Boolean>getConfigElement("clientSideOnly").orElse(false);
|
||||
this.usesServices = config.<List<String>>getConfigElement("services").orElse(List.of());
|
||||
this.properties = config.<Map<String, Object>>getConfigElement("properties").orElse(Collections.emptyMap());
|
||||
|
||||
var maybeProps = config.<Map<String, Object>>getConfigElement("properties");
|
||||
if (clientSideOnly) {
|
||||
if (maybeProps.isPresent()) {
|
||||
this.properties = new HashMap<>(maybeProps.get());
|
||||
this.properties.put(CLIENT_SIDE_ONLY_PROP, Boolean.TRUE);
|
||||
} else {
|
||||
this.properties = CLIENT_SIDE_ONLY_MAP;
|
||||
}
|
||||
} else {
|
||||
this.properties = maybeProps.orElse(Collections.emptyMap());
|
||||
}
|
||||
|
||||
this.modFile.setFileProperties(this.properties);
|
||||
this.issueURL = config.<String>getConfigElement("issueTrackerURL").map(StringUtils::toURL).orElse(null);
|
||||
final List<? extends IConfigurable> modConfigs = config.getConfigList("mods");
|
||||
|
||||
@@ -69,7 +69,9 @@ public class ModInfo implements IModInfo, IConfigurable
|
||||
.map(s -> StringSubstitutor.replace(s, ownFile.map(ModFileInfo::getFile).orElse(null)))
|
||||
.map(DefaultArtifactVersion::new).orElse(DEFAULT_VERSION);
|
||||
this.displayName = config.<String>getConfigElement("displayName").orElse(this.modId);
|
||||
this.description = config.<String>getConfigElement("description").orElse("MISSING DESCRIPTION");
|
||||
this.description = config.<String>getConfigElement("description")
|
||||
.orElse("MISSING DESCRIPTION")
|
||||
.replace("\r\n", "\n").stripIndent();
|
||||
|
||||
this.logoFile = Optional.ofNullable(config.<String>getConfigElement("logoFile")
|
||||
.orElseGet(() -> ownFile.flatMap(mf -> mf.<String>getConfigElement("logoFile")).orElse(null)));
|
||||
@@ -196,7 +198,7 @@ public class ModInfo implements IModInfo, IConfigurable
|
||||
private final boolean mandatory;
|
||||
private final Ordering ordering;
|
||||
private final DependencySide side;
|
||||
private Optional<URL> referralUrl;
|
||||
private final Optional<URL> referralUrl;
|
||||
|
||||
public ModVersion(final IModInfo owner, final IConfigurable config) {
|
||||
this.owner = owner;
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public final class ModJarMetadata implements JarMetadata {
|
||||
// TODO: Remove helper functions to cleanup api
|
||||
@Deprecated(forRemoval = true, since="1.18")
|
||||
static IModFile buildFile(IModLocator locator, Path... files) {
|
||||
return buildFile(locator, j->true, (a,b) -> true, files).orElseThrow(()->new IllegalArgumentException("Failed to find valid JAR file"));
|
||||
return buildFile(locator, j->true, null, files).orElseThrow(()->new IllegalArgumentException("Failed to find valid JAR file"));
|
||||
}
|
||||
|
||||
// TODO: Remove helper functions to cleanup api
|
||||
|
||||
@@ -45,7 +45,7 @@ public class Scanner {
|
||||
try (InputStream in = Files.newInputStream(path)){
|
||||
ModClassVisitor mcv = new ModClassVisitor();
|
||||
ClassReader cr = new ClassReader(in);
|
||||
cr.accept(mcv, 0);
|
||||
cr.accept(mcv, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
|
||||
mcv.buildData(result.getClasses(), result.getAnnotations());
|
||||
} catch (IOException | IllegalArgumentException e) {
|
||||
// mark path bad
|
||||
|
||||
+3
-4
@@ -13,6 +13,7 @@ import net.minecraftforge.api.distmarker.Dist;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public abstract class CommonClientLaunchHandler extends CommonLaunchHandler {
|
||||
@@ -23,9 +24,7 @@ public abstract class CommonClientLaunchHandler extends CommonLaunchHandler {
|
||||
@Override
|
||||
public ServiceRunner launchService(String[] arguments, ModuleLayer layer) {
|
||||
return () -> {
|
||||
var args = preLaunch(arguments, layer);
|
||||
|
||||
Class.forName(layer.findModule("minecraft").orElseThrow(),"net.minecraft.client.main.Main").getMethod("main", String[].class).invoke(null, (Object)args);
|
||||
Class.forName(layer.findModule("minecraft").orElseThrow(),"net.minecraft.client.main.Main").getMethod("main", String[].class).invoke(null, (Object)arguments);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -44,7 +43,7 @@ public abstract class CommonClientLaunchHandler extends CommonLaunchHandler {
|
||||
var lowcodelang = LibraryFinder.findPathForMaven(vers.forgeGroup(), "lowcodelanguage", "", "", vers.mcAndForgeVersion());
|
||||
var mclang = LibraryFinder.findPathForMaven(vers.forgeGroup(), "mclanguage", "", "", vers.mcAndForgeVersion());
|
||||
|
||||
return new LocatedPaths(mcstream.build().toList(), (a,b) -> true, modstream.build().toList(), List.of(fmlcore, javafmllang, lowcodelang, mclang));
|
||||
return new LocatedPaths(mcstream.build().toList(), null, modstream.build().toList(), List.of(fmlcore, javafmllang, lowcodelang, mclang));
|
||||
}
|
||||
|
||||
protected abstract void processMCStream(VersionInfo versionInfo, Stream.Builder<Path> mc, Stream.Builder<List<Path>> mods);
|
||||
|
||||
-3
@@ -46,10 +46,7 @@ public abstract class CommonDevLaunchHandler extends CommonLaunchHandler {
|
||||
return new LocatedPaths(mcstream.build().toList(), mcFilter, modstream.build().toList(), getFmlStuff(legacyCP));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] preLaunch(String[] arguments, ModuleLayer layer) {
|
||||
super.preLaunch(arguments, layer);
|
||||
|
||||
if (getDist().isDedicatedServer())
|
||||
return arguments;
|
||||
|
||||
|
||||
-21
@@ -10,16 +10,9 @@ import cpw.mods.modlauncher.api.ILaunchHandlerService;
|
||||
import cpw.mods.modlauncher.api.ITransformingClassLoaderBuilder;
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import org.apache.logging.log4j.core.LoggerContext;
|
||||
import org.apache.logging.log4j.core.config.ConfigurationFactory;
|
||||
import org.apache.logging.log4j.core.config.ConfigurationSource;
|
||||
import org.apache.logging.log4j.core.config.Configurator;
|
||||
import org.slf4j.Logger;
|
||||
import sun.misc.Unsafe;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
@@ -53,20 +46,6 @@ public abstract class CommonLaunchHandler implements ILaunchHandlerService {
|
||||
|
||||
}
|
||||
|
||||
protected String[] preLaunch(String[] arguments, ModuleLayer layer) {
|
||||
URI uri;
|
||||
try (var reader = layer.configuration().findModule("fmlloader").orElseThrow().reference().open()) {
|
||||
uri = reader.find("log4j2.xml").orElseThrow();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
// Force the log4j2 configuration to be loaded from fmlloader
|
||||
Configurator.reconfigure(ConfigurationFactory.getInstance().getConfiguration(LoggerContext.getContext(), ConfigurationSource.fromUri(uri)));
|
||||
|
||||
return arguments;
|
||||
}
|
||||
|
||||
protected final Map<String, List<Path>> getModClasses() {
|
||||
final String modClasses = Optional.ofNullable(System.getenv("MOD_CLASSES")).orElse("");
|
||||
LOGGER.debug(LogMarkers.CORE, "Got mod coordinates {} from env", modClasses);
|
||||
|
||||
+10
-3
@@ -14,6 +14,7 @@ import net.minecraftforge.api.distmarker.Dist;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -25,9 +26,7 @@ public abstract class CommonServerLaunchHandler extends CommonLaunchHandler {
|
||||
@Override
|
||||
public ServiceRunner launchService(String[] arguments, ModuleLayer layer) {
|
||||
return () -> {
|
||||
var args = preLaunch(arguments, layer);
|
||||
|
||||
Class.forName(layer.findModule("minecraft").orElseThrow(),"net.minecraft.server.Main").getMethod("main", String[].class).invoke(null, (Object)args);
|
||||
Class.forName(layer.findModule("minecraft").orElseThrow(),"net.minecraft.server.Main").getMethod("main", String[].class).invoke(null, (Object)arguments);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -43,13 +42,21 @@ public abstract class CommonServerLaunchHandler extends CommonLaunchHandler {
|
||||
!path.startsWith("META-INF/"));
|
||||
}, mcextra
|
||||
);
|
||||
|
||||
// Todo in 1.20.2: Change the default filter to null instead of always true.
|
||||
BiPredicate<String, String> filter = (path, base) -> true;
|
||||
final BiPredicate<String, String> alwaysTrueFilter = filter;
|
||||
|
||||
var mcstream = Stream.<Path>builder().add(mc).add(mcextra_filtered.getRootPath());
|
||||
var modstream = Stream.<List<Path>>builder();
|
||||
|
||||
filter = processMCStream(vers, mcstream, filter, modstream);
|
||||
|
||||
// Ensure backwards compatibility if anything overrides processMCStream()
|
||||
// and expects the default always true filter by only changing it to null afterwards if left unchanged.
|
||||
if (filter == alwaysTrueFilter)
|
||||
filter = null;
|
||||
|
||||
var fmlcore = LibraryFinder.findPathForMaven(vers.forgeGroup(), "fmlcore", "", "", vers.mcAndForgeVersion());
|
||||
var javafmllang = LibraryFinder.findPathForMaven(vers.forgeGroup(), "javafmllanguage", "", "", vers.mcAndForgeVersion());
|
||||
var lowcodelang = LibraryFinder.findPathForMaven(vers.forgeGroup(), "lowcodelanguage", "", "", vers.mcAndForgeVersion());
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||
networkTimeout=10000
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -85,9 +85,6 @@ done
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
@@ -144,7 +141,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@@ -152,7 +149,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
|
||||
@@ -41,7 +41,6 @@ ext {
|
||||
}
|
||||
|
||||
jar.doFirst {
|
||||
manifest.attributes['Automatic-Module-Name'] = project.name
|
||||
MANIFESTS.each { pkg, values ->
|
||||
if (pkg == '')
|
||||
manifest.attributes(values)
|
||||
|
||||
+8
-1
@@ -8,7 +8,7 @@ package net.minecraftforge.fml.javafmlmod;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
|
||||
public class FMLJavaModLoadingContext
|
||||
public class FMLJavaModLoadingContext extends ModLoadingContext
|
||||
{
|
||||
private final FMLModContainer container;
|
||||
|
||||
@@ -24,11 +24,18 @@ public class FMLJavaModLoadingContext
|
||||
return container.getEventBus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FMLModContainer getContainer() {
|
||||
return container;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to get the right instance from the {@link ModLoadingContext} correctly.
|
||||
* @return The FMLJavaMod language specific extension from the ModLoadingContext
|
||||
*
|
||||
* @deprecated use {@link FMLJavaModLoadingContext} in your mod constructor
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.21.1")
|
||||
public static FMLJavaModLoadingContext get() {
|
||||
return ModLoadingContext.get().extension();
|
||||
}
|
||||
|
||||
+17
-3
@@ -21,6 +21,9 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.Marker;
|
||||
import org.apache.logging.log4j.MarkerManager;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
public class FMLModContainer extends ModContainer
|
||||
@@ -31,6 +34,7 @@ public class FMLModContainer extends ModContainer
|
||||
private final IEventBus eventBus;
|
||||
private Object modInstance;
|
||||
private final Class<?> modClass;
|
||||
private final FMLJavaModLoadingContext context = new FMLJavaModLoadingContext(this);
|
||||
|
||||
public FMLModContainer(IModInfo info, String className, ModFileScanData modFileScanResults, ModuleLayer gameLayer)
|
||||
{
|
||||
@@ -40,8 +44,7 @@ public class FMLModContainer extends ModContainer
|
||||
activityMap.put(ModLoadingStage.CONSTRUCT, this::constructMod);
|
||||
this.eventBus = BusBuilder.builder().setExceptionHandler(this::onEventFailed).setTrackPhases(false).markerType(IModBusEvent.class).useModLauncher().build();
|
||||
this.configHandler = Optional.of(ce->this.eventBus.post(ce.self()));
|
||||
final FMLJavaModLoadingContext contextExtension = new FMLJavaModLoadingContext(this);
|
||||
this.contextExtension = () -> contextExtension;
|
||||
this.contextExtension = () -> context;
|
||||
try
|
||||
{
|
||||
var layer = gameLayer.findModule(info.getOwningFile().moduleName()).orElseThrow();
|
||||
@@ -65,11 +68,22 @@ public class FMLModContainer extends ModContainer
|
||||
try
|
||||
{
|
||||
LOGGER.trace(LOADING, "Loading mod instance {} of type {}", getModId(), modClass.getName());
|
||||
this.modInstance = modClass.getDeclaredConstructor().newInstance();
|
||||
Constructor<?> constructor;
|
||||
try {
|
||||
constructor = modClass.getDeclaredConstructor(context.getClass());
|
||||
} catch (NoSuchMethodException | SecurityException exception) {
|
||||
constructor = modClass.getDeclaredConstructor();
|
||||
}
|
||||
this.modInstance = constructor.getParameterCount() == 0 ? constructor.newInstance() : constructor.newInstance(context);
|
||||
LOGGER.trace(LOADING, "Loaded mod instance {} of type {}", getModId(), modClass.getName());
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
// When a mod constructor throws an exception, it's wrapped in an InvocationTargetException which hides the
|
||||
// actual exception from the mod loading error screen.
|
||||
if (e instanceof InvocationTargetException wrapped)
|
||||
e = Objects.requireNonNullElse(wrapped.getCause(), e); // unwrap the exception
|
||||
|
||||
LOGGER.error(LOADING,"Failed to create mod instance. ModID: {}, class {}", getModId(), modClass.getName(), e);
|
||||
throw new ModLoadingException(modInfo, ModLoadingStage.CONSTRUCT, "fml.modloading.failedtoloadmod", e, modClass);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ ext {
|
||||
}
|
||||
|
||||
jar.doFirst {
|
||||
manifest.attributes['Automatic-Module-Name'] = project.name
|
||||
MANIFESTS.each { pkg, values ->
|
||||
if (pkg == '')
|
||||
manifest.attributes(values)
|
||||
|
||||
@@ -41,7 +41,6 @@ ext {
|
||||
}
|
||||
|
||||
jar.doFirst {
|
||||
manifest.attributes['Automatic-Module-Name'] = project.name
|
||||
MANIFESTS.each { pkg, values ->
|
||||
if (pkg == '')
|
||||
manifest.attributes(values)
|
||||
|
||||
+6
-6
@@ -16,14 +16,14 @@ Step 1: Open your command-line and browse to the folder where you extracted the
|
||||
|
||||
Step 2: You're left with a choice.
|
||||
If you prefer to use Eclipse:
|
||||
1. Run the following command: `gradlew genEclipseRuns` (`./gradlew genEclipseRuns` if you are on Mac/Linux)
|
||||
2. Open Eclipse, Import > Existing Gradle Project > Select Folder
|
||||
1. Run the following command: `./gradlew genEclipseRuns`
|
||||
or run `gradlew eclipse` to generate the project.
|
||||
|
||||
If you prefer to use IntelliJ:
|
||||
1. Open IDEA, and import project.
|
||||
2. Select your build.gradle file and have it import.
|
||||
3. Run the following command: `gradlew genIntellijRuns` (`./gradlew genIntellijRuns` if you are on Mac/Linux)
|
||||
3. Run the following command: `./gradlew genIntellijRuns`
|
||||
4. Refresh the Gradle Project in IDEA if required.
|
||||
|
||||
If at any point you are missing libraries in your IDE, or you've run into problems you can
|
||||
@@ -40,7 +40,7 @@ https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
|
||||
|
||||
Additional Resources:
|
||||
=========================
|
||||
Community Documentation: https://mcforge.readthedocs.io/en/latest/gettingstarted/
|
||||
LexManos' Install Video: https://www.youtube.com/watch?v=8VEdtQLuLO0
|
||||
Forge Forum: https://forums.minecraftforge.net/
|
||||
Forge Discord: https://discord.gg/UvedJ9m
|
||||
Community Documentation: https://docs.minecraftforge.net/en/1.19.x/gettingstarted/
|
||||
LexManos' Install Video: https://youtu.be/8VEdtQLuLO0
|
||||
Forge Forums: https://forums.minecraftforge.net/
|
||||
Forge Discord: https://discord.minecraftforge.net/
|
||||
+38
-66
@@ -32,12 +32,9 @@ minecraft {
|
||||
// Simply re-run your setup task after changing the mappings to update your workspace.
|
||||
mappings channel: mapping_channel, version: mapping_version
|
||||
|
||||
// When true, this property will have all Eclipse run configurations run the "prepareX" task for the given run configuration before launching the game.
|
||||
// When true, this property will have all Eclipse/IntelliJ IDEA run configurations run the "prepareX" task for the given run configuration before launching the game.
|
||||
// In most cases, it is not necessary to enable.
|
||||
// enableEclipsePrepareRuns = true
|
||||
|
||||
// When true, this property will have all IntelliJ IDEA run configurations run the "prepareX" task for the given run configuration before launching the game.
|
||||
// In most cases, it is not necessary to enable.
|
||||
// enableIdeaPrepareRuns = true
|
||||
|
||||
// This property allows configuring Gradle's ProcessResources task(s) to run on IDE output locations before launching the game.
|
||||
@@ -61,7 +58,8 @@ minecraft {
|
||||
// Default run configurations.
|
||||
// These can be tweaked, removed, or duplicated as needed.
|
||||
runs {
|
||||
client {
|
||||
// applies to all the run configs below
|
||||
configureEach {
|
||||
workingDirectory project.file('run')
|
||||
|
||||
// Recommended logging data for a userdev environment
|
||||
@@ -86,56 +84,29 @@ minecraft {
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
workingDirectory project.file('run')
|
||||
|
||||
property 'forge.logging.markers', 'REGISTRIES'
|
||||
|
||||
property 'forge.logging.console.level', 'debug'
|
||||
|
||||
client {
|
||||
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
|
||||
property 'forge.enabledGameTestNamespaces', mod_id
|
||||
}
|
||||
|
||||
mods {
|
||||
"${mod_id}" {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
server {
|
||||
property 'forge.enabledGameTestNamespaces', mod_id
|
||||
args '--nogui'
|
||||
}
|
||||
|
||||
// This run config launches GameTestServer and runs all registered gametests, then exits.
|
||||
// By default, the server will crash when no gametests are provided.
|
||||
// The gametest system is also enabled by default for other run configs under the /test command.
|
||||
gameTestServer {
|
||||
workingDirectory project.file('run')
|
||||
|
||||
property 'forge.logging.markers', 'REGISTRIES'
|
||||
|
||||
property 'forge.logging.console.level', 'debug'
|
||||
|
||||
property 'forge.enabledGameTestNamespaces', mod_id
|
||||
|
||||
mods {
|
||||
"${mod_id}" {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data {
|
||||
workingDirectory project.file('run')
|
||||
|
||||
property 'forge.logging.markers', 'REGISTRIES'
|
||||
|
||||
property 'forge.logging.console.level', 'debug'
|
||||
// example of overriding the workingDirectory set in configureEach above
|
||||
workingDirectory project.file('run-data')
|
||||
|
||||
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
|
||||
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
||||
|
||||
mods {
|
||||
"${mod_id}" {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -182,47 +153,48 @@ dependencies {
|
||||
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
|
||||
// When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
|
||||
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
|
||||
def resourceTargets = ['META-INF/mods.toml', 'pack.mcmeta']
|
||||
def replaceProperties = [
|
||||
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range,
|
||||
forge_version: forge_version, forge_version_range: forge_version_range,
|
||||
loader_version_range: loader_version_range,
|
||||
mod_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
|
||||
mod_authors: mod_authors, mod_description: mod_description
|
||||
]
|
||||
processResources {
|
||||
tasks.named('processResources', ProcessResources).configure {
|
||||
var replaceProperties = [
|
||||
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range,
|
||||
forge_version: forge_version, forge_version_range: forge_version_range,
|
||||
loader_version_range: loader_version_range,
|
||||
mod_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
|
||||
mod_authors: mod_authors, mod_description: mod_description,
|
||||
]
|
||||
inputs.properties replaceProperties
|
||||
replaceProperties.put 'project', project
|
||||
|
||||
filesMatching(resourceTargets) {
|
||||
expand replaceProperties
|
||||
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
|
||||
expand replaceProperties + [project: project]
|
||||
}
|
||||
}
|
||||
|
||||
// Example for how to get properties into the manifest for reading at runtime.
|
||||
jar {
|
||||
tasks.named('jar', Jar).configure {
|
||||
manifest {
|
||||
attributes([
|
||||
"Specification-Title" : mod_id,
|
||||
"Specification-Vendor" : mod_authors,
|
||||
"Specification-Version" : "1", // We are version 1 of ourselves
|
||||
"Implementation-Title" : project.name,
|
||||
"Implementation-Version" : project.jar.archiveVersion,
|
||||
"Implementation-Vendor" : mod_authors,
|
||||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
||||
'Specification-Title' : mod_id,
|
||||
'Specification-Vendor' : mod_authors,
|
||||
'Specification-Version' : '1', // We are version 1 of ourselves
|
||||
'Implementation-Title' : project.name,
|
||||
'Implementation-Version' : project.jar.archiveVersion,
|
||||
'Implementation-Vendor' : mod_authors,
|
||||
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
||||
])
|
||||
}
|
||||
|
||||
// This is the preferred method to reobfuscate your jar file
|
||||
finalizedBy 'reobfJar'
|
||||
}
|
||||
|
||||
// Example configuration to allow publishing using the maven-publish plugin
|
||||
// This is the preferred method to reobfuscate your jar file
|
||||
jar.finalizedBy('reobfJar')
|
||||
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
|
||||
// publish.dependsOn('reobfJar')
|
||||
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing:
|
||||
// tasks.named('publish').configure {
|
||||
// dependsOn 'reobfJar'
|
||||
// }
|
||||
|
||||
// Example configuration to allow publishing using the maven-publish plugin
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
register('mavenJava', MavenPublication) {
|
||||
artifact jar
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,5 +9,5 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
|
||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.example.examplemod;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraftforge.common.ForgeConfigSpec;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.event.config.ModConfigEvent;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
// An example config class. This is not required, but it's a good idea to have one to keep your config organized.
|
||||
// Demonstrates how to use Forge's config APIs
|
||||
@Mod.EventBusSubscriber(modid = ExampleMod.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class Config
|
||||
{
|
||||
private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
|
||||
|
||||
private static final ForgeConfigSpec.BooleanValue LOG_DIRT_BLOCK = BUILDER
|
||||
.comment("Whether to log the dirt block on common setup")
|
||||
.define("logDirtBlock", true);
|
||||
|
||||
private static final ForgeConfigSpec.IntValue MAGIC_NUMBER = BUILDER
|
||||
.comment("A magic number")
|
||||
.defineInRange("magicNumber", 42, 0, Integer.MAX_VALUE);
|
||||
|
||||
public static final ForgeConfigSpec.ConfigValue<String> MAGIC_NUMBER_INTRODUCTION = BUILDER
|
||||
.comment("What you want the introduction message to be for the magic number")
|
||||
.define("magicNumberIntroduction", "The magic number is... ");
|
||||
|
||||
// a list of strings that are treated as resource locations for items
|
||||
private static final ForgeConfigSpec.ConfigValue<List<? extends String>> ITEM_STRINGS = BUILDER
|
||||
.comment("A list of items to log on common setup.")
|
||||
.defineListAllowEmpty(Collections.singletonList("items"), () -> List.of("minecraft:iron_ingot"), Config::validateItemName);
|
||||
|
||||
static final ForgeConfigSpec SPEC = BUILDER.build();
|
||||
|
||||
public static boolean logDirtBlock;
|
||||
public static int magicNumber;
|
||||
public static String magicNumberIntroduction;
|
||||
public static Set<Item> items;
|
||||
|
||||
private static boolean validateItemName(final Object obj)
|
||||
{
|
||||
return obj instanceof final String itemName && ForgeRegistries.ITEMS.containsKey(new ResourceLocation(itemName));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
static void onLoad(final ModConfigEvent event)
|
||||
{
|
||||
logDirtBlock = LOG_DIRT_BLOCK.get();
|
||||
magicNumber = MAGIC_NUMBER.get();
|
||||
magicNumberIntroduction = MAGIC_NUMBER_INTRODUCTION.get();
|
||||
|
||||
// convert the list of strings into a set of items
|
||||
items = ITEM_STRINGS.get().stream()
|
||||
.map(itemName -> ForgeRegistries.ITEMS.getValue(new ResourceLocation(itemName)))
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
}
|
||||
@@ -2,23 +2,21 @@ package com.example.examplemod;
|
||||
|
||||
import com.mojang.logging.LogUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.world.food.FoodProperties;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
import net.minecraft.world.item.CreativeModeTabs;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
|
||||
import net.minecraftforge.event.CreativeModeTabEvent;
|
||||
import net.minecraftforge.event.server.ServerStartingEvent;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.config.ModConfig;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
@@ -39,29 +37,15 @@ public class ExampleMod
|
||||
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MODID);
|
||||
// Create a Deferred Register to hold Items which will all be registered under the "examplemod" namespace
|
||||
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);
|
||||
// Create a Deferred Register to hold CreativeModeTabs which will all be registered under the "examplemod" namespace
|
||||
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, MODID);
|
||||
|
||||
// Creates a new Block with the id "examplemod:example_block", combining the namespace and path
|
||||
public static final RegistryObject<Block> EXAMPLE_BLOCK = BLOCKS.register("example_block", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.STONE)));
|
||||
public static final RegistryObject<Block> EXAMPLE_BLOCK = BLOCKS.register("example_block", () -> new Block(BlockBehaviour.Properties.of(Material.STONE)));
|
||||
// Creates a new BlockItem with the id "examplemod:example_block", combining the namespace and path
|
||||
public static final RegistryObject<Item> EXAMPLE_BLOCK_ITEM = ITEMS.register("example_block", () -> new BlockItem(EXAMPLE_BLOCK.get(), new Item.Properties()));
|
||||
|
||||
// Creates a new food item with the id "examplemod:example_id", nutrition 1 and saturation 2
|
||||
public static final RegistryObject<Item> EXAMPLE_ITEM = ITEMS.register("example_item", () -> new Item(new Item.Properties().food(new FoodProperties.Builder()
|
||||
.alwaysEat().nutrition(1).saturationMod(2f).build())));
|
||||
|
||||
// Creates a creative tab with the id "examplemod:example_tab" for the example item, that is placed after the combat tab
|
||||
public static final RegistryObject<CreativeModeTab> EXAMPLE_TAB = CREATIVE_MODE_TABS.register("example_tab", () -> CreativeModeTab.builder()
|
||||
.withTabsBefore(CreativeModeTabs.COMBAT)
|
||||
.icon(() -> EXAMPLE_ITEM.get().getDefaultInstance())
|
||||
.displayItems((parameters, output) -> {
|
||||
output.accept(EXAMPLE_ITEM.get()); // Add the example item to the tab. For your own tabs, this method is preferred over the event
|
||||
}).build());
|
||||
|
||||
public ExampleMod()
|
||||
public ExampleMod(FMLJavaModLoadingContext context)
|
||||
{
|
||||
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
|
||||
IEventBus modEventBus = context.getModEventBus();
|
||||
|
||||
// Register the commonSetup method for modloading
|
||||
modEventBus.addListener(this::commonSetup);
|
||||
@@ -70,27 +54,33 @@ public class ExampleMod
|
||||
BLOCKS.register(modEventBus);
|
||||
// Register the Deferred Register to the mod event bus so items get registered
|
||||
ITEMS.register(modEventBus);
|
||||
// Register the Deferred Register to the mod event bus so tabs get registered
|
||||
CREATIVE_MODE_TABS.register(modEventBus);
|
||||
|
||||
// Register ourselves for server and other game events we are interested in
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
// Register the item to a creative tab
|
||||
modEventBus.addListener(this::addCreative);
|
||||
|
||||
// Register our mod's ForgeConfigSpec so that Forge can create and load the config file for us
|
||||
context.registerConfig(ModConfig.Type.COMMON, Config.SPEC);
|
||||
}
|
||||
|
||||
private void commonSetup(final FMLCommonSetupEvent event)
|
||||
{
|
||||
// Some common setup code
|
||||
LOGGER.info("HELLO FROM COMMON SETUP");
|
||||
LOGGER.info("DIRT BLOCK >> {}", ForgeRegistries.BLOCKS.getKey(Blocks.DIRT));
|
||||
|
||||
if (Config.logDirtBlock)
|
||||
LOGGER.info("DIRT BLOCK >> {}", ForgeRegistries.BLOCKS.getKey(Blocks.DIRT));
|
||||
|
||||
LOGGER.info(Config.magicNumberIntroduction + Config.magicNumber);
|
||||
|
||||
Config.items.forEach((item) -> LOGGER.info("ITEM >> {}", item.toString()));
|
||||
}
|
||||
|
||||
// Add the example block item to the building blocks tab
|
||||
private void addCreative(BuildCreativeModeTabContentsEvent event)
|
||||
private void addCreative(CreativeModeTabEvent.BuildContents event)
|
||||
{
|
||||
if (event.getTabKey() == CreativeModeTabs.BUILDING_BLOCKS)
|
||||
if (event.getTab() == CreativeModeTabs.BUILDING_BLOCKS)
|
||||
event.accept(EXAMPLE_BLOCK_ITEM);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@ loaderVersion="${loader_version_range}" #mandatory This is typically bumped ever
|
||||
license="${mod_license}"
|
||||
# A URL to refer people to when problems occur with this mod
|
||||
#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional
|
||||
# If your mod is purely client-side and has no multiplayer functionality (be it dedicated servers or Open to LAN),
|
||||
# set this to true, and Forge will set the correct displayTest for you and skip loading your mod on dedicated servers.
|
||||
#clientSideOnly=true #optional - defaults to false if absent
|
||||
# A list of mods - how many allowed here is determined by the individual mod loader
|
||||
[[mods]] #mandatory
|
||||
# The modid of the mod
|
||||
@@ -36,29 +39,29 @@ authors="${mod_authors}" #optional
|
||||
# IGNORE_ALL_VERSION means that your mod will not cause a red X if it's present on the client or the server. This is a special case and should only be used if your mod has no server component.
|
||||
# NONE means that no display test is set on your mod. You need to do this yourself, see IExtensionPoint.DisplayTest for more information. You can define any scheme you wish with this value.
|
||||
# IMPORTANT NOTE: this is NOT an instruction as to which environments (CLIENT or DEDICATED SERVER) your mod loads on. Your mod should load (and maybe do nothing!) whereever it finds itself.
|
||||
#displayTest="MATCH_VERSION" # MATCH_VERSION is the default if nothing is specified (#optional)
|
||||
#displayTest="MATCH_VERSION" # if nothing is specified, MATCH_VERSION is the default when clientSideOnly=false, otherwise IGNORE_ALL_VERSION when clientSideOnly=true (#optional)
|
||||
|
||||
# The description text for the mod (multi line!) (#mandatory)
|
||||
description='''${mod_description}'''
|
||||
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
|
||||
[[dependencies.${mod_id}]] #optional
|
||||
# the modid of the dependency
|
||||
modId="forge" #mandatory
|
||||
# Does this dependency have to exist - if not, ordering below must be specified
|
||||
mandatory=true #mandatory
|
||||
# The version range of the dependency
|
||||
versionRange="${forge_version_range}" #mandatory
|
||||
# An ordering relationship for the dependency - BEFORE or AFTER required if the dependency is not mandatory
|
||||
# BEFORE - This mod is loaded BEFORE the dependency
|
||||
# AFTER - This mod is loaded AFTER the dependency
|
||||
ordering="NONE"
|
||||
# Side this dependency is applied on - BOTH, CLIENT, or SERVER
|
||||
side="BOTH"
|
||||
# the modid of the dependency
|
||||
modId="forge" #mandatory
|
||||
# Does this dependency have to exist - if not, ordering below must be specified
|
||||
mandatory=true #mandatory
|
||||
# The version range of the dependency
|
||||
versionRange="${forge_version_range}" #mandatory
|
||||
# An ordering relationship for the dependency - BEFORE or AFTER required if the dependency is not mandatory
|
||||
# BEFORE - This mod is loaded BEFORE the dependency
|
||||
# AFTER - This mod is loaded AFTER the dependency
|
||||
ordering="NONE"
|
||||
# Side this dependency is applied on - BOTH, CLIENT, or SERVER
|
||||
side="BOTH"
|
||||
# Here's another dependency
|
||||
[[dependencies.${mod_id}]]
|
||||
modId="minecraft"
|
||||
mandatory=true
|
||||
# This version range declares a minimum of the current minecraft version up to but not including the next major version
|
||||
versionRange="${minecraft_version_range}"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
modId="minecraft"
|
||||
mandatory=true
|
||||
# This version range declares a minimum of the current minecraft version up to but not including the next major version
|
||||
versionRange="${minecraft_version_range}"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
@@ -1,32 +1,32 @@
|
||||
--- a/com/mojang/blaze3d/pipeline/RenderTarget.java
|
||||
+++ b/com/mojang/blaze3d/pipeline/RenderTarget.java
|
||||
@@ -113,7 +_,10 @@
|
||||
GlStateManager._texParameter(3553, 34892, 0);
|
||||
GlStateManager._texParameter(3553, 10242, 33071);
|
||||
GlStateManager._texParameter(3553, 10243, 33071);
|
||||
@@ -112,7 +_,10 @@
|
||||
GlStateManager.m_84331_(3553, 34892, 0);
|
||||
GlStateManager.m_84331_(3553, 10242, 33071);
|
||||
GlStateManager.m_84331_(3553, 10243, 33071);
|
||||
+ if (!stencilEnabled)
|
||||
GlStateManager._texImage2D(3553, 0, 6402, this.f_83915_, this.f_83916_, 0, 6402, 5126, (IntBuffer)null);
|
||||
GlStateManager.m_84209_(3553, 0, 6402, this.f_83915_, this.f_83916_, 0, 6402, 5126, (IntBuffer)null);
|
||||
+ else
|
||||
+ GlStateManager._texImage2D(3553, 0, org.lwjgl.opengl.GL30.GL_DEPTH32F_STENCIL8, this.f_83915_, this.f_83916_, 0, org.lwjgl.opengl.GL30.GL_DEPTH_STENCIL, org.lwjgl.opengl.GL30.GL_FLOAT_32_UNSIGNED_INT_24_8_REV, null);
|
||||
+ GlStateManager.m_84209_(3553, 0, org.lwjgl.opengl.GL30.GL_DEPTH32F_STENCIL8, this.f_83915_, this.f_83916_, 0, org.lwjgl.opengl.GL30.GL_DEPTH_STENCIL, org.lwjgl.opengl.GL30.GL_FLOAT_32_UNSIGNED_INT_24_8_REV, null);
|
||||
}
|
||||
|
||||
this.m_83936_(9728);
|
||||
@@ -124,7 +_,14 @@
|
||||
GlStateManager._glBindFramebuffer(36160, this.f_83920_);
|
||||
GlStateManager._glFramebufferTexture2D(36160, 36064, 3553, this.f_83923_, 0);
|
||||
@@ -123,7 +_,14 @@
|
||||
GlStateManager.m_84486_(36160, this.f_83920_);
|
||||
GlStateManager.m_84173_(36160, 36064, 3553, this.f_83923_, 0);
|
||||
if (this.f_83919_) {
|
||||
+ if(!stencilEnabled)
|
||||
GlStateManager._glFramebufferTexture2D(36160, 36096, 3553, this.f_83924_, 0);
|
||||
GlStateManager.m_84173_(36160, 36096, 3553, this.f_83924_, 0);
|
||||
+ else if(net.minecraftforge.common.ForgeConfig.CLIENT.useCombinedDepthStencilAttachment.get()) {
|
||||
+ GlStateManager._glFramebufferTexture2D(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER, org.lwjgl.opengl.GL30.GL_DEPTH_STENCIL_ATTACHMENT, 3553, this.f_83924_, 0);
|
||||
+ GlStateManager.m_84173_(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER, org.lwjgl.opengl.GL30.GL_DEPTH_STENCIL_ATTACHMENT, 3553, this.f_83924_, 0);
|
||||
+ } else {
|
||||
+ GlStateManager._glFramebufferTexture2D(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER, org.lwjgl.opengl.GL30.GL_DEPTH_ATTACHMENT, 3553, this.f_83924_, 0);
|
||||
+ GlStateManager._glFramebufferTexture2D(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER, org.lwjgl.opengl.GL30.GL_STENCIL_ATTACHMENT, 3553, this.f_83924_, 0);
|
||||
+ GlStateManager.m_84173_(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER, org.lwjgl.opengl.GL30.GL_DEPTH_ATTACHMENT, 3553, this.f_83924_, 0);
|
||||
+ GlStateManager.m_84173_(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER, org.lwjgl.opengl.GL30.GL_STENCIL_ATTACHMENT, 3553, this.f_83924_, 0);
|
||||
+ }
|
||||
}
|
||||
|
||||
this.m_83949_();
|
||||
@@ -292,4 +_,27 @@
|
||||
@@ -291,4 +_,27 @@
|
||||
public int m_83980_() {
|
||||
return this.f_83924_;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
--- a/com/mojang/blaze3d/platform/GlStateManager.java
|
||||
+++ b/com/mojang/blaze3d/platform/GlStateManager.java
|
||||
@@ -501,9 +_,16 @@
|
||||
@@ -500,9 +_,16 @@
|
||||
|
||||
}
|
||||
|
||||
+ /* Stores the last values sent into glMultiTexCoord2f */
|
||||
+ public static float lastBrightnessX = 0.0f;
|
||||
+ public static float lastBrightnessY = 0.0f;
|
||||
public static void _texParameter(int p_84161_, int p_84162_, float p_84163_) {
|
||||
RenderSystem.assertOnRenderThreadOrInit();
|
||||
public static void m_84160_(int p_84161_, int p_84162_, float p_84163_) {
|
||||
RenderSystem.m_187555_();
|
||||
GL11.glTexParameterf(p_84161_, p_84162_, p_84163_);
|
||||
+ if (p_84161_ == GL13.GL_TEXTURE1) {
|
||||
+ lastBrightnessX = p_84162_;
|
||||
@@ -16,4 +16,4 @@
|
||||
+ }
|
||||
}
|
||||
|
||||
public static void _texParameter(int p_84332_, int p_84333_, int p_84334_) {
|
||||
public static void m_84331_(int p_84332_, int p_84333_, int p_84334_) {
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/com/mojang/blaze3d/platform/Window.java
|
||||
+++ b/com/mojang/blaze3d/platform/Window.java
|
||||
@@ -83,7 +_,7 @@
|
||||
@@ -82,7 +_,7 @@
|
||||
GLFW.glfwWindowHint(139267, 2);
|
||||
GLFW.glfwWindowHint(139272, 204801);
|
||||
GLFW.glfwWindowHint(139270, 1);
|
||||
@@ -9,7 +9,7 @@
|
||||
if (monitor != null) {
|
||||
VideoMode videomode = monitor.m_84948_(this.f_85355_ ? this.f_85354_ : Optional.empty());
|
||||
this.f_85350_ = this.f_85357_ = monitor.m_84951_() + videomode.m_85332_() / 2 - this.f_85359_ / 2;
|
||||
@@ -238,6 +_,7 @@
|
||||
@@ -260,6 +_,7 @@
|
||||
GLFW.glfwGetFramebufferSize(this.f_85349_, aint, aint1);
|
||||
this.f_85361_ = aint[0] > 0 ? aint[0] : 1;
|
||||
this.f_85362_ = aint1[0] > 0 ? aint1[0] : 1;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/com/mojang/blaze3d/vertex/BufferBuilder.java
|
||||
+++ b/com/mojang/blaze3d/vertex/BufferBuilder.java
|
||||
@@ -459,4 +_,14 @@
|
||||
this.f_276566_ = p_277855_;
|
||||
@@ -486,4 +_,14 @@
|
||||
this.f_166822_ = p_254368_;
|
||||
}
|
||||
}
|
||||
+
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/com/mojang/blaze3d/vertex/VertexFormat.java
|
||||
+++ b/com/mojang/blaze3d/vertex/VertexFormat.java
|
||||
@@ -176,4 +_,11 @@
|
||||
@@ -181,4 +_,11 @@
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import org.joml.Vector3fc;
|
||||
|
||||
-public final class Transformation {
|
||||
+public final class Transformation implements net.minecraftforge.common.extensions.IForgeTransformation {
|
||||
+public final class Transformation implements net.minecraftforge.client.extensions.IForgeTransformation {
|
||||
private final Matrix4f f_121078_;
|
||||
public static final Codec<Transformation> f_268453_ = RecordCodecBuilder.create((p_269604_) -> {
|
||||
return p_269604_.group(ExtraCodecs.f_252432_.fieldOf("translation").forGetter((p_269599_) -> {
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
--- a/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java
|
||||
+++ b/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java
|
||||
@@ -68,6 +_,15 @@
|
||||
return Component.m_237119_().m_7220_(this.f_200947_.f_287789_).m_130946_(": ").m_7220_(this.f_200947_.f_287787_);
|
||||
@@ -65,6 +_,15 @@
|
||||
return Component.m_237119_().m_7220_(this.f_200947_.getFirst()).m_130946_(": ").m_7220_(this.f_200947_.getSecond());
|
||||
}
|
||||
|
||||
+ @Override
|
||||
@@ -13,6 +13,6 @@
|
||||
+ return super.m_7933_(key, scanCode, modifiers);
|
||||
+ }
|
||||
+
|
||||
public void m_88315_(GuiGraphics p_283497_, int p_88680_, int p_88681_, float p_88682_) {
|
||||
this.m_280273_(p_283497_);
|
||||
p_283497_.m_280653_(this.f_96547_, this.f_200947_.f_287789_, this.f_96543_ / 2, 80, 16777215);
|
||||
public void m_86412_(PoseStack p_88679_, int p_88680_, int p_88681_, float p_88682_) {
|
||||
this.m_7333_(p_88679_);
|
||||
m_93215_(p_88679_, this.f_96547_, this.f_200947_.getFirst(), this.f_96543_ / 2, 80, 16777215);
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- a/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java
|
||||
+++ b/com/mojang/realmsclient/gui/screens/RealmsNotificationsScreen.java
|
||||
@@ -45,9 +_,9 @@
|
||||
@@ -47,9 +_,9 @@
|
||||
}
|
||||
};
|
||||
private final RealmsNotificationsScreen.DataFetcherConfiguration f_273849_ = new RealmsNotificationsScreen.DataFetcherConfiguration() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/CrashReport.java
|
||||
+++ b/net/minecraft/CrashReport.java
|
||||
@@ -57,14 +_,8 @@
|
||||
@@ -57,14 +_,9 @@
|
||||
if (this.f_127506_ != null && this.f_127506_.length > 0) {
|
||||
p_127520_.append("-- Head --\n");
|
||||
p_127520_.append("Thread: ").append(Thread.currentThread().getName()).append("\n");
|
||||
@@ -12,6 +12,7 @@
|
||||
- }
|
||||
-
|
||||
- p_127520_.append("\n");
|
||||
+ p_127520_.append(net.minecraftforge.logging.CrashReportAnalyser.appendSuspectedMods(this.f_127501_, this.f_127506_));
|
||||
+ p_127520_.append("Stacktrace:");
|
||||
+ p_127520_.append(net.minecraftforge.logging.CrashReportExtender.generateEnhancedStackTrace(this.f_127506_));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/SharedConstants.java
|
||||
+++ b/net/minecraft/SharedConstants.java
|
||||
@@ -210,6 +_,7 @@
|
||||
@@ -205,6 +_,7 @@
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/Util.java
|
||||
+++ b/net/minecraft/Util.java
|
||||
@@ -171,6 +_,11 @@
|
||||
@@ -170,6 +_,11 @@
|
||||
return 255;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public static ExecutorService m_183991_() {
|
||||
return f_137444_;
|
||||
}
|
||||
@@ -239,7 +_,7 @@
|
||||
@@ -238,7 +_,7 @@
|
||||
try {
|
||||
type = DataFixers.m_14512_().getSchema(DataFixUtils.makeKey(SharedConstants.m_183709_().m_183476_().m_193006_())).getChoiceType(p_137552_, p_137553_);
|
||||
} catch (IllegalArgumentException illegalargumentexception) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/advancements/Advancement.java
|
||||
+++ b/net/minecraft/advancements/Advancement.java
|
||||
@@ -150,7 +_,7 @@
|
||||
@@ -144,7 +_,7 @@
|
||||
return this.f_138305_;
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
@Nullable
|
||||
private ResourceLocation f_138332_;
|
||||
@Nullable
|
||||
@@ -340,7 +_,14 @@
|
||||
return "Task Advancement{parentId=" + this.f_138332_ + ", display=" + this.f_138334_ + ", rewards=" + this.f_138335_ + ", criteria=" + this.f_138336_ + ", requirements=" + Arrays.deepToString(this.f_138337_) + ", sends_telemetry_event=" + this.f_285655_ + "}";
|
||||
@@ -325,7 +_,14 @@
|
||||
return "Task Advancement{parentId=" + this.f_138332_ + ", display=" + this.f_138334_ + ", rewards=" + this.f_138335_ + ", criteria=" + this.f_138336_ + ", requirements=" + Arrays.deepToString(this.f_138337_) + "}";
|
||||
}
|
||||
|
||||
+ /** @deprecated Forge: use {@linkplain #fromJson(JsonObject, DeserializationContext, net.minecraftforge.common.crafting.conditions.ICondition.IContext) overload with context}. */
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
public void m_9989_(ServerPlayer p_9990_) {
|
||||
p_9990_.m_6756_(this.f_9979_);
|
||||
- LootParams lootparams = (new LootParams.Builder(p_9990_.m_284548_())).m_287286_(LootContextParams.f_81455_, p_9990_).m_287286_(LootContextParams.f_81460_, p_9990_.m_20182_()).m_287235_(LootContextParamSets.f_81418_);
|
||||
+ LootParams lootparams = (new LootParams.Builder(p_9990_.m_284548_())).m_287286_(LootContextParams.f_81455_, p_9990_).m_287286_(LootContextParams.f_81460_, p_9990_.m_20182_()).m_287239_(p_9990_.m_36336_()).m_287235_(LootContextParamSets.f_81418_); // Forge: Add luck to LootContext
|
||||
- LootContext lootcontext = (new LootContext.Builder(p_9990_.m_9236_())).m_78972_(LootContextParams.f_81455_, p_9990_).m_78972_(LootContextParams.f_81460_, p_9990_.m_20182_()).m_230911_(p_9990_.m_217043_()).m_78975_(LootContextParamSets.f_81418_);
|
||||
+ LootContext lootcontext = (new LootContext.Builder(p_9990_.m_9236_())).m_78972_(LootContextParams.f_81455_, p_9990_).m_78972_(LootContextParams.f_81460_, p_9990_.m_20182_()).m_230911_(p_9990_.m_217043_()).m_78963_(p_9990_.m_36336_()).m_78975_(LootContextParamSets.f_81418_); // FORGE: luck to LootContext
|
||||
boolean flag = false;
|
||||
|
||||
for(ResourceLocation resourcelocation : this.f_9980_) {
|
||||
@@ -3,7 +3,7 @@
|
||||
@@ -10,6 +_,6 @@
|
||||
|
||||
@DontObfuscate
|
||||
public static String getClientModName() {
|
||||
public static String m_129629_() {
|
||||
- return "vanilla";
|
||||
+ return net.minecraftforge.internal.BrandingControl.getClientBranding();
|
||||
}
|
||||
|
||||
@@ -12,6 +12,15 @@
|
||||
private static final Set<String> f_90811_ = Sets.newHashSet();
|
||||
public static final String f_167805_ = "key.categories.movement";
|
||||
public static final String f_167806_ = "key.categories.misc";
|
||||
@@ -41,7 +_,7 @@
|
||||
private int f_90818_;
|
||||
|
||||
public static void m_90835_(InputConstants.Key p_90836_) {
|
||||
- KeyMapping keymapping = f_90810_.get(p_90836_);
|
||||
+ for (KeyMapping keymapping : f_90810_.getAll(p_90836_))
|
||||
if (keymapping != null) {
|
||||
++keymapping.f_90818_;
|
||||
}
|
||||
@@ -49,7 +_,7 @@
|
||||
}
|
||||
|
||||
@@ -21,7 +30,7 @@
|
||||
if (keymapping != null) {
|
||||
keymapping.m_7249_(p_90839_);
|
||||
}
|
||||
@@ -105,7 +_,7 @@
|
||||
@@ -96,7 +_,7 @@
|
||||
}
|
||||
|
||||
public boolean m_90857_() {
|
||||
@@ -30,7 +39,7 @@
|
||||
}
|
||||
|
||||
public String m_90858_() {
|
||||
@@ -139,7 +_,13 @@
|
||||
@@ -130,7 +_,13 @@
|
||||
}
|
||||
|
||||
public int compareTo(KeyMapping p_90841_) {
|
||||
@@ -45,7 +54,7 @@
|
||||
}
|
||||
|
||||
public static Supplier<Component> m_90842_(String p_90843_) {
|
||||
@@ -150,6 +_,20 @@
|
||||
@@ -141,6 +_,20 @@
|
||||
}
|
||||
|
||||
public boolean m_90850_(KeyMapping p_90851_) {
|
||||
@@ -66,7 +75,7 @@
|
||||
return this.f_90816_.equals(p_90851_.f_90816_);
|
||||
}
|
||||
|
||||
@@ -170,11 +_,13 @@
|
||||
@@ -161,11 +_,13 @@
|
||||
}
|
||||
|
||||
public Component m_90863_() {
|
||||
@@ -81,7 +90,7 @@
|
||||
}
|
||||
|
||||
public String m_90865_() {
|
||||
@@ -184,4 +_,84 @@
|
||||
@@ -175,4 +_,84 @@
|
||||
public void m_7249_(boolean p_90846_) {
|
||||
this.f_90817_ = p_90846_;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/KeyboardHandler.java
|
||||
+++ b/net/minecraft/client/KeyboardHandler.java
|
||||
@@ -329,7 +_,9 @@
|
||||
@@ -328,7 +_,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
if (this.f_90867_.f_91066_.f_92105_.m_90832_(p_90895_, p_90896_)) {
|
||||
this.f_90867_.m_91268_().m_85438_();
|
||||
this.f_90867_.f_91066_.m_231829_().m_231514_(this.f_90867_.m_91268_().m_85440_());
|
||||
@@ -347,6 +_,8 @@
|
||||
@@ -346,6 +_,8 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
|
||||
if (this.f_90867_.m_240477_().m_93316_()) {
|
||||
@@ -369,11 +_,15 @@
|
||||
@@ -368,11 +_,15 @@
|
||||
Screen.m_96579_(() -> {
|
||||
if (p_90897_ != 1 && p_90897_ != 2) {
|
||||
if (p_90897_ == 0) {
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
}, "keyPressed event handler", screen.getClass().getCanonicalName());
|
||||
@@ -424,22 +_,26 @@
|
||||
@@ -425,22 +_,26 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/Minecraft.java
|
||||
+++ b/net/minecraft/client/Minecraft.java
|
||||
@@ -249,7 +_,7 @@
|
||||
@@ -247,7 +_,7 @@
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -9,15 +9,15 @@
|
||||
static Minecraft f_90981_;
|
||||
private static final Logger f_90982_ = LogUtils.getLogger();
|
||||
public static final boolean f_91002_ = Util.m_137581_() == Util.OS.OSX;
|
||||
@@ -413,7 +_,6 @@
|
||||
this.f_193584_ = this.m_193585_(this.f_231338_, p_91084_);
|
||||
@@ -412,7 +_,6 @@
|
||||
this.f_231339_ = SignatureValidator.m_216358_(this.f_231338_.getServicesKey());
|
||||
this.f_90998_ = p_91084_.f_101905_.f_101942_;
|
||||
f_90982_.info("Setting user: {}", (Object)this.f_90998_.m_92546_());
|
||||
- f_90982_.debug("(Session ID is {})", (Object)this.f_90998_.m_92544_());
|
||||
this.f_91033_ = p_91084_.f_101908_.f_101926_;
|
||||
this.f_91034_ = !p_91084_.f_101908_.f_101929_;
|
||||
this.f_91035_ = !p_91084_.f_101908_.f_101930_;
|
||||
@@ -450,7 +_,7 @@
|
||||
@@ -462,7 +_,7 @@
|
||||
|
||||
this.f_90990_.m_85380_(this.f_91066_.m_232035_().m_231551_());
|
||||
this.f_91067_ = new MouseHandler(this);
|
||||
@@ -25,8 +25,8 @@
|
||||
+ // FORGE: Move mouse handler setup further below
|
||||
this.f_91068_ = new KeyboardHandler(this);
|
||||
this.f_91068_.m_90887_(this.f_90990_.m_85439_());
|
||||
RenderSystem.initRenderer(this.f_91066_.f_92035_, false);
|
||||
@@ -458,6 +_,7 @@
|
||||
RenderSystem.m_69580_(this.f_91066_.f_92035_, false);
|
||||
@@ -470,6 +_,7 @@
|
||||
this.f_91042_.m_83931_(0.0F, 0.0F, 0.0F, 0.0F);
|
||||
this.f_91042_.m_83954_(f_91002_);
|
||||
this.f_91036_ = new ReloadableResourceManager(PackType.CLIENT_RESOURCES);
|
||||
@@ -34,7 +34,7 @@
|
||||
this.f_91038_.m_10506_();
|
||||
this.f_91066_.m_92145_(this.f_91038_);
|
||||
this.f_91039_ = new LanguageManager(this.f_91066_.f_92075_);
|
||||
@@ -504,10 +_,13 @@
|
||||
@@ -514,10 +_,13 @@
|
||||
this.f_91063_ = new GameRenderer(this, this.f_90994_.m_234586_(), this.f_91036_, this.f_90993_);
|
||||
this.f_91036_.m_7217_(this.f_91063_.m_247116_());
|
||||
this.f_91060_ = new LevelRenderer(this, this.f_90994_, this.f_167845_, this.f_90993_);
|
||||
@@ -45,11 +45,11 @@
|
||||
+ // this.createSearchTrees();
|
||||
this.f_91036_.m_7217_(this.f_90997_);
|
||||
this.f_91061_ = new ParticleEngine(this.f_91073_, this.f_90987_);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onRegisterParticleProviders(this.f_91061_);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onRegisterParticleProviders(f_91061_);
|
||||
this.f_91036_.m_7217_(this.f_91061_);
|
||||
this.f_91053_ = new PaintingTextureManager(this.f_90987_);
|
||||
this.f_91036_.m_7217_(this.f_91053_);
|
||||
@@ -516,7 +_,9 @@
|
||||
@@ -526,7 +_,9 @@
|
||||
this.f_91047_ = new GpuWarnlistManager();
|
||||
this.f_91036_.m_7217_(this.f_91047_);
|
||||
this.f_91036_.m_7217_(this.f_205120_);
|
||||
@@ -58,9 +58,9 @@
|
||||
+ // FORGE: Moved mouse handler setup below ingame gui creation to prevent NPEs in mouse handler.
|
||||
+ this.f_91067_.m_91524_(this.f_90990_.m_85439_());
|
||||
this.f_91064_ = new DebugRenderer(this);
|
||||
RealmsClient realmsclient = RealmsClient.m_239151_(this);
|
||||
this.f_238717_ = new RealmsDataFetcher(realmsclient);
|
||||
@@ -536,6 +_,7 @@
|
||||
this.f_238717_ = new RealmsDataFetcher(RealmsClient.m_239151_(this));
|
||||
RenderSystem.m_69900_(this::m_91113_);
|
||||
@@ -545,6 +_,7 @@
|
||||
TinyFileDialogs.tinyfd_messageBox("Minecraft", stringbuilder.toString(), "ok", "error", false);
|
||||
}
|
||||
|
||||
@@ -68,51 +68,52 @@
|
||||
this.f_90990_.m_85409_(this.f_91066_.m_231817_().m_231551_());
|
||||
this.f_90990_.m_85424_(this.f_91066_.m_232123_().m_231551_());
|
||||
this.f_90990_.m_85426_();
|
||||
@@ -562,20 +_,23 @@
|
||||
@@ -568,26 +_,26 @@
|
||||
}
|
||||
|
||||
this.f_167847_.m_168556_();
|
||||
this.m_286052_();
|
||||
+ if (net.minecraftforge.client.loading.ClientModLoader.completeModLoading())
|
||||
+ return; // Do not overwrite the error screen if there are errors
|
||||
+ // FORGE: Move opening initial screen to after startup and events are enabled
|
||||
+ if (this.m_239929_()) {
|
||||
+ this.m_91152_(BanNoticeScreen.m_239967_((p_278873_) -> {
|
||||
+ if (p_278873_) {
|
||||
+ if (net.minecraftforge.client.loading.ClientModLoader.completeModLoading()) return; // Do not overwrite the error screen
|
||||
+ // FORGE: Move opening initial screen to after startup and events are enabled.
|
||||
+ if (s != null) {
|
||||
+ ServerAddress serveraddress = new ServerAddress(s, i);
|
||||
+ ConnectScreen.m_169267_(new TitleScreen(), this, serveraddress, new ServerData(I18n.m_118938_("selectServer.defaultName"), serveraddress.toString(), false));
|
||||
+ } else if (this.m_239929_()) {
|
||||
+ this.m_91152_(BanNoticeScreen.m_239967_((p_238185_) -> {
|
||||
+ if (p_238185_) {
|
||||
+ Util.m_137581_().m_137646_("https://aka.ms/mcjavamoderation");
|
||||
+ }
|
||||
+
|
||||
+ this.m_278684_(realmsclient, reloadinstance, p_91084_.f_278410_);
|
||||
+ this.m_91152_(new TitleScreen(true));
|
||||
+ }, this.m_239210_()));
|
||||
+ } else if (this.f_91066_.f_263744_) {
|
||||
+ this.m_91152_(new AccessibilityOnboardingScreen(this.f_91066_));
|
||||
+ } else {
|
||||
+ this.m_278684_(realmsclient, reloadinstance, p_91084_.f_278410_);
|
||||
+ this.m_91152_(new TitleScreen(true));
|
||||
+ }
|
||||
});
|
||||
}, false));
|
||||
this.f_278504_ = QuickPlayLog.m_278648_(p_91084_.f_278410_.f_278493_());
|
||||
- if (this.m_239929_()) {
|
||||
- this.m_91152_(BanNoticeScreen.m_239967_((p_278873_) -> {
|
||||
- if (p_278873_) {
|
||||
- if (s != null) {
|
||||
- ServerAddress serveraddress = new ServerAddress(s, i);
|
||||
- reloadinstance.m_7237_().thenRunAsync(() -> {
|
||||
- ConnectScreen.m_169267_(new TitleScreen(), this, serveraddress, new ServerData(I18n.m_118938_("selectServer.defaultName"), serveraddress.toString(), false));
|
||||
- }, this);
|
||||
- } else if (this.m_239929_()) {
|
||||
- this.m_91152_(BanNoticeScreen.m_239967_((p_238185_) -> {
|
||||
- if (p_238185_) {
|
||||
- Util.m_137581_().m_137646_("https://aka.ms/mcjavamoderation");
|
||||
- }
|
||||
-
|
||||
- this.m_278684_(realmsclient, reloadinstance, p_91084_.f_278410_);
|
||||
- this.m_91152_(new TitleScreen(true));
|
||||
- }, this.m_239210_()));
|
||||
- } else if (this.f_91066_.f_263744_) {
|
||||
- this.m_91152_(new AccessibilityOnboardingScreen(this.f_91066_));
|
||||
- } else {
|
||||
- this.m_278684_(realmsclient, reloadinstance, p_91084_.f_278410_);
|
||||
- this.m_91152_(new TitleScreen(true));
|
||||
- }
|
||||
|
||||
}
|
||||
|
||||
@@ -611,7 +_,7 @@
|
||||
private String m_91270_() {
|
||||
StringBuilder stringbuilder = new StringBuilder("Minecraft");
|
||||
if (m_193589_().m_184597_()) {
|
||||
- stringbuilder.append("*");
|
||||
+ stringbuilder.append(' ').append(net.minecraftforge.forge.snapshots.ForgeSnapshotsMod.BRANDING_NAME).append('*');
|
||||
}
|
||||
|
||||
stringbuilder.append(" ");
|
||||
@@ -635,6 +_,8 @@
|
||||
@@ -639,6 +_,8 @@
|
||||
|
||||
private UserApiService m_193585_(YggdrasilAuthenticationService p_193586_, GameConfig p_193587_) {
|
||||
try {
|
||||
@@ -121,7 +122,7 @@
|
||||
return p_193586_.createUserApiService(p_193587_.f_101905_.f_101942_.m_92547_());
|
||||
} catch (AuthenticationException authenticationexception) {
|
||||
f_90982_.error("Failed to verify authentication", (Throwable)authenticationexception);
|
||||
@@ -647,7 +_,7 @@
|
||||
@@ -651,7 +_,7 @@
|
||||
}
|
||||
|
||||
private void m_91239_(Throwable p_91240_) {
|
||||
@@ -130,21 +131,21 @@
|
||||
this.m_91241_(p_91240_, (Component)null);
|
||||
} else {
|
||||
Util.m_137559_(p_91240_);
|
||||
@@ -739,7 +_,10 @@
|
||||
@@ -743,7 +_,10 @@
|
||||
}
|
||||
|
||||
public void m_91271_() {
|
||||
- this.f_90997_.m_235232_(SearchRegistry.f_119941_, (p_231389_) -> {
|
||||
- this.f_90997_.m_235232_(SearchRegistry.f_119941_, (p_231451_) -> {
|
||||
+ var nameSearchKeys = net.minecraftforge.client.CreativeModeTabSearchRegistry.getNameSearchKeys();
|
||||
+ var tagSearchKeys = net.minecraftforge.client.CreativeModeTabSearchRegistry.getTagSearchKeys();
|
||||
+ for (var nameSearchKey : nameSearchKeys.values())
|
||||
+ this.f_90997_.m_235232_(nameSearchKey, (p_231389_) -> {
|
||||
+ this.f_90997_.m_235232_(nameSearchKey, (p_231451_) -> {
|
||||
return new FullTextSearchTree<>((p_210797_) -> {
|
||||
return p_210797_.m_41651_((Player)null, TooltipFlag.Default.f_256752_.m_257777_()).stream().map((p_210807_) -> {
|
||||
return ChatFormatting.m_126649_(p_210807_.getString()).trim();
|
||||
@@ -750,7 +_,8 @@
|
||||
@@ -754,7 +_,8 @@
|
||||
return Stream.of(BuiltInRegistries.f_257033_.m_7981_(p_91317_.m_41720_()));
|
||||
}, p_231389_);
|
||||
}, p_231451_);
|
||||
});
|
||||
- this.f_90997_.m_235232_(SearchRegistry.f_119942_, (p_231430_) -> {
|
||||
+ for (var tagSearchKey : tagSearchKeys.values())
|
||||
@@ -152,9 +153,9 @@
|
||||
return new IdSearchTree<>((p_231353_) -> {
|
||||
return p_231353_.m_204131_().map(TagKey::f_203868_);
|
||||
}, p_231430_);
|
||||
@@ -770,9 +_,12 @@
|
||||
@@ -774,9 +_,12 @@
|
||||
});
|
||||
}, p_231451_);
|
||||
}, p_231389_);
|
||||
});
|
||||
- CreativeModeTabs.m_258007_().m_257882_((p_255439_) -> {
|
||||
- this.m_231374_(SearchRegistry.f_119941_, p_255439_);
|
||||
@@ -168,7 +169,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
@@ -824,13 +_,13 @@
|
||||
@@ -828,13 +_,13 @@
|
||||
Bootstrap.m_135875_(p_91333_.m_127526_());
|
||||
if (p_91333_.m_127527_() != null) {
|
||||
Bootstrap.m_135875_("#@!@# Game crashed! Crash report saved to: #@!@# " + p_91333_.m_127527_());
|
||||
@@ -185,7 +186,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -954,10 +_,6 @@
|
||||
@@ -959,10 +_,6 @@
|
||||
f_90982_.error("setScreen called from non-game thread");
|
||||
}
|
||||
|
||||
@@ -196,7 +197,7 @@
|
||||
if (p_91153_ == null && this.f_91073_ == null) {
|
||||
p_91153_ = new TitleScreen();
|
||||
} else if (p_91153_ == null && this.f_91074_.m_21224_()) {
|
||||
@@ -968,6 +_,19 @@
|
||||
@@ -973,6 +_,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,8 +217,8 @@
|
||||
this.f_91080_ = p_91153_;
|
||||
if (this.f_91080_ != null) {
|
||||
this.f_91080_.m_274333_();
|
||||
@@ -1113,9 +_,12 @@
|
||||
RenderSystem.enableCull();
|
||||
@@ -1118,9 +_,12 @@
|
||||
RenderSystem.m_69481_();
|
||||
this.f_91026_.m_7238_();
|
||||
if (!this.f_91079_) {
|
||||
+ this.realPartialTick = this.f_91012_ ? this.f_91013_ : this.f_90991_.f_92518_; // Cache this since pause is volatile
|
||||
@@ -229,7 +230,7 @@
|
||||
}
|
||||
|
||||
if (this.f_91056_ != null) {
|
||||
@@ -1240,10 +_,12 @@
|
||||
@@ -1243,10 +_,12 @@
|
||||
this.f_90990_.m_85378_((double)i);
|
||||
if (this.f_91080_ != null) {
|
||||
this.f_91080_.m_6574_(this, this.f_90990_.m_85445_(), this.f_90990_.m_85446_());
|
||||
@@ -242,7 +243,7 @@
|
||||
this.f_91063_.m_109097_(this.f_90990_.m_85441_(), this.f_90990_.m_85442_());
|
||||
this.f_91067_.m_91599_();
|
||||
}
|
||||
@@ -1517,6 +_,7 @@
|
||||
@@ -1520,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_91395_() {
|
||||
@@ -250,7 +251,7 @@
|
||||
this.f_91019_ = false;
|
||||
}
|
||||
|
||||
@@ -1546,10 +_,18 @@
|
||||
@@ -1549,10 +_,18 @@
|
||||
if (p_91387_ && this.f_91077_ != null && this.f_91077_.m_6662_() == HitResult.Type.BLOCK) {
|
||||
BlockHitResult blockhitresult = (BlockHitResult)this.f_91077_;
|
||||
BlockPos blockpos = blockhitresult.m_82425_();
|
||||
@@ -272,7 +273,7 @@
|
||||
this.f_91074_.m_6674_(InteractionHand.MAIN_HAND);
|
||||
}
|
||||
}
|
||||
@@ -1578,6 +_,8 @@
|
||||
@@ -1581,6 +_,8 @@
|
||||
return false;
|
||||
} else {
|
||||
boolean flag = false;
|
||||
@@ -281,7 +282,7 @@
|
||||
switch (this.f_91077_.m_6662_()) {
|
||||
case ENTITY:
|
||||
this.f_91072_.m_105223_(this.f_91074_, ((EntityHitResult)this.f_91077_).m_82443_());
|
||||
@@ -1585,7 +_,7 @@
|
||||
@@ -1588,7 +_,7 @@
|
||||
case BLOCK:
|
||||
BlockHitResult blockhitresult = (BlockHitResult)this.f_91077_;
|
||||
BlockPos blockpos = blockhitresult.m_82425_();
|
||||
@@ -290,7 +291,7 @@
|
||||
this.f_91072_.m_105269_(blockpos, blockhitresult.m_82434_());
|
||||
if (this.f_91073_.m_8055_(blockpos).m_60795_()) {
|
||||
flag = true;
|
||||
@@ -1598,8 +_,10 @@
|
||||
@@ -1601,8 +_,10 @@
|
||||
}
|
||||
|
||||
this.f_91074_.m_36334_();
|
||||
@@ -301,7 +302,7 @@
|
||||
this.f_91074_.m_6674_(InteractionHand.MAIN_HAND);
|
||||
return flag;
|
||||
}
|
||||
@@ -1615,6 +_,11 @@
|
||||
@@ -1618,6 +_,11 @@
|
||||
}
|
||||
|
||||
for(InteractionHand interactionhand : InteractionHand.values()) {
|
||||
@@ -313,7 +314,7 @@
|
||||
ItemStack itemstack = this.f_91074_.m_21120_(interactionhand);
|
||||
if (!itemstack.m_246617_(this.f_91073_.m_246046_())) {
|
||||
return;
|
||||
@@ -1635,7 +_,7 @@
|
||||
@@ -1638,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (interactionresult.m_19077_()) {
|
||||
@@ -322,7 +323,7 @@
|
||||
this.f_91074_.m_6674_(interactionhand);
|
||||
}
|
||||
|
||||
@@ -1647,7 +_,7 @@
|
||||
@@ -1650,7 +_,7 @@
|
||||
int i = itemstack.m_41613_();
|
||||
InteractionResult interactionresult1 = this.f_91072_.m_233732_(this.f_91074_, interactionhand, blockhitresult);
|
||||
if (interactionresult1.m_19077_()) {
|
||||
@@ -331,7 +332,7 @@
|
||||
this.f_91074_.m_6674_(interactionhand);
|
||||
if (!itemstack.m_41619_() && (itemstack.m_41613_() != i || this.f_91072_.m_105290_())) {
|
||||
this.f_91063_.f_109055_.m_109320_(interactionhand);
|
||||
@@ -1663,6 +_,9 @@
|
||||
@@ -1666,6 +_,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,7 +342,7 @@
|
||||
if (!itemstack.m_41619_()) {
|
||||
InteractionResult interactionresult2 = this.f_91072_.m_233721_(this.f_91074_, interactionhand);
|
||||
if (interactionresult2.m_19077_()) {
|
||||
@@ -1689,6 +_,8 @@
|
||||
@@ -1692,6 +_,8 @@
|
||||
--this.f_91011_;
|
||||
}
|
||||
|
||||
@@ -350,7 +351,7 @@
|
||||
this.f_91026_.m_6180_("gui");
|
||||
this.f_240378_.m_240688_();
|
||||
this.f_91065_.m_193832_(this.f_91012_);
|
||||
@@ -1780,6 +_,7 @@
|
||||
@@ -1787,6 +_,7 @@
|
||||
|
||||
this.f_91005_.m_120596_();
|
||||
|
||||
@@ -358,7 +359,7 @@
|
||||
try {
|
||||
this.f_91073_.m_104726_(() -> {
|
||||
return true;
|
||||
@@ -1795,6 +_,7 @@
|
||||
@@ -1802,6 +_,7 @@
|
||||
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
@@ -366,7 +367,7 @@
|
||||
}
|
||||
|
||||
this.f_91026_.m_6182_("animateTick");
|
||||
@@ -1814,6 +_,8 @@
|
||||
@@ -1821,6 +_,8 @@
|
||||
this.f_91026_.m_6182_("keyboard");
|
||||
this.f_91068_.m_90931_();
|
||||
this.f_91026_.m_7238_();
|
||||
@@ -375,15 +376,15 @@
|
||||
}
|
||||
|
||||
private boolean m_91278_() {
|
||||
@@ -2011,6 +_,7 @@
|
||||
@@ -2017,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_91156_(ClientLevel p_91157_) {
|
||||
+ if (this.f_91073_ != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.level.LevelEvent.Unload(this.f_91073_));
|
||||
+ if (f_91073_ != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.level.LevelEvent.Unload(f_91073_));
|
||||
ProgressScreen progressscreen = new ProgressScreen(true);
|
||||
progressscreen.m_6309_(Component.m_237115_("connect.joining"));
|
||||
this.m_91362_(progressscreen);
|
||||
@@ -2044,10 +_,12 @@
|
||||
@@ -2050,10 +_,12 @@
|
||||
IntegratedServer integratedserver = this.f_91007_;
|
||||
this.f_91007_ = null;
|
||||
this.f_91063_.m_109150_();
|
||||
@@ -392,19 +393,19 @@
|
||||
this.f_240365_.m_93328_();
|
||||
this.m_91362_(p_91321_);
|
||||
if (this.f_91073_ != null) {
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.level.LevelEvent.Unload(this.f_91073_));
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.level.LevelEvent.Unload(f_91073_));
|
||||
if (integratedserver != null) {
|
||||
this.f_91026_.m_6180_("waitForServer");
|
||||
|
||||
@@ -2061,6 +_,7 @@
|
||||
@@ -2067,6 +_,7 @@
|
||||
this.f_243981_.m_246151_();
|
||||
this.f_91065_.m_93089_();
|
||||
this.f_91010_ = false;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.handleClientLevelClosing(this.f_91073_);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.handleClientLevelClosing(f_91073_);
|
||||
}
|
||||
|
||||
this.f_91073_ = null;
|
||||
@@ -2167,6 +_,7 @@
|
||||
@@ -2173,6 +_,7 @@
|
||||
|
||||
private void m_91280_() {
|
||||
if (this.f_91077_ != null && this.f_91077_.m_6662_() != HitResult.Type.MISS) {
|
||||
@@ -412,7 +413,7 @@
|
||||
boolean flag = this.f_91074_.m_150110_().f_35937_;
|
||||
BlockEntity blockentity = null;
|
||||
HitResult.Type hitresult$type = this.f_91077_.m_6662_();
|
||||
@@ -2179,10 +_,7 @@
|
||||
@@ -2185,10 +_,7 @@
|
||||
}
|
||||
|
||||
Block block = blockstate.m_60734_();
|
||||
@@ -424,7 +425,7 @@
|
||||
|
||||
if (flag && Screen.m_96637_() && blockstate.m_155947_()) {
|
||||
blockentity = this.f_91073_.m_7702_(blockpos);
|
||||
@@ -2193,7 +_,7 @@
|
||||
@@ -2199,7 +_,7 @@
|
||||
}
|
||||
|
||||
Entity entity = ((EntityHitResult)this.f_91077_).m_82443_();
|
||||
@@ -433,7 +434,7 @@
|
||||
if (itemstack == null) {
|
||||
return;
|
||||
}
|
||||
@@ -2732,6 +_,19 @@
|
||||
@@ -2737,6 +_,19 @@
|
||||
|
||||
public void m_91312_(int p_91313_) {
|
||||
this.f_91051_.m_119410_(p_91313_);
|
||||
@@ -449,7 +450,7 @@
|
||||
+
|
||||
+ private float realPartialTick;
|
||||
+ public float getPartialTick() {
|
||||
+ return this.realPartialTick;
|
||||
+ return realPartialTick;
|
||||
}
|
||||
|
||||
public EntityModelSet m_167973_() {
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/Options.java
|
||||
+++ b/net/minecraft/client/Options.java
|
||||
@@ -545,7 +_,8 @@
|
||||
@@ -544,7 +_,8 @@
|
||||
}, new OptionInstance.LazyEnum<>(() -> {
|
||||
return Stream.concat(Stream.of(""), Minecraft.m_91087_().m_91106_().m_194525_().stream()).toList();
|
||||
}, (p_232011_) -> {
|
||||
@@ -10,7 +10,7 @@
|
||||
}, Codec.STRING), "", (p_275584_) -> {
|
||||
SoundManager soundmanager = Minecraft.m_91087_().m_91106_();
|
||||
soundmanager.m_194526_();
|
||||
@@ -869,6 +_,7 @@
|
||||
@@ -868,6 +_,7 @@
|
||||
}
|
||||
|
||||
public Options(Minecraft p_92138_, File p_92139_) {
|
||||
@@ -18,11 +18,10 @@
|
||||
this.f_92060_ = p_92138_;
|
||||
this.f_92110_ = new File(p_92139_, "options.txt");
|
||||
boolean flag = p_92138_.m_91103_();
|
||||
@@ -990,11 +_,21 @@
|
||||
@@ -989,11 +_,20 @@
|
||||
p_168428_.m_213982_("telemetryOptInExtra", this.f_260461_);
|
||||
this.f_263744_ = p_168428_.m_142682_("onboardAccessibility", this.f_263744_);
|
||||
|
||||
+ net.minecraftforge.forge.snapshots.ForgeSnapshotsMod.processOptions(p_168428_);
|
||||
+ processOptionsForge(p_168428_);
|
||||
+ }
|
||||
+ // FORGE: split off to allow reloading options after mod loading is done
|
||||
@@ -42,7 +41,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1013,6 +_,9 @@
|
||||
@@ -1012,6 +_,9 @@
|
||||
}
|
||||
|
||||
public void m_92140_() {
|
||||
@@ -52,7 +51,7 @@
|
||||
try {
|
||||
if (!this.f_92110_.exists()) {
|
||||
return;
|
||||
@@ -1041,7 +_,8 @@
|
||||
@@ -1040,7 +_,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +61,7 @@
|
||||
@Nullable
|
||||
private String m_168458_(String p_168459_) {
|
||||
return compoundtag1.m_128441_(p_168459_) ? compoundtag1.m_128461_(p_168459_) : null;
|
||||
@@ -1204,6 +_,7 @@
|
||||
@@ -1203,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_92172_() {
|
||||
@@ -70,7 +69,7 @@
|
||||
if (this.f_92060_.f_91074_ != null) {
|
||||
int i = 0;
|
||||
|
||||
@@ -1268,6 +_,23 @@
|
||||
@@ -1267,6 +_,23 @@
|
||||
}
|
||||
|
||||
p_92146_.m_10509_(set);
|
||||
|
||||
@@ -9,11 +9,9 @@
|
||||
super.m_7249_(!this.m_90857_());
|
||||
}
|
||||
} else {
|
||||
@@ -24,6 +_,7 @@
|
||||
@@ -24,4 +_,5 @@
|
||||
}
|
||||
|
||||
}
|
||||
+ @Override public boolean m_90857_() { return this.f_90817_ && (isConflictContextAndModifierActive() || f_92527_.getAsBoolean()); }
|
||||
|
||||
protected void m_289748_() {
|
||||
super.m_7249_(false);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/Font.java
|
||||
+++ b/net/minecraft/client/gui/Font.java
|
||||
@@ -31,7 +_,7 @@
|
||||
@@ -33,7 +_,7 @@
|
||||
import org.joml.Vector3f;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -9,7 +9,7 @@
|
||||
private static final float f_168643_ = 0.01F;
|
||||
private static final Vector3f f_92712_ = new Vector3f(0.0F, 0.0F, 0.03F);
|
||||
public static final int f_193827_ = 8;
|
||||
@@ -202,6 +_,8 @@
|
||||
@@ -260,6 +_,8 @@
|
||||
public StringSplitter m_92865_() {
|
||||
return this.f_92714_;
|
||||
}
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
--- a/net/minecraft/client/gui/Gui.java
|
||||
+++ b/net/minecraft/client/gui/Gui.java
|
||||
@@ -424,6 +_,8 @@
|
||||
@@ -428,6 +_,10 @@
|
||||
|
||||
for(MobEffectInstance mobeffectinstance : Ordering.natural().reverse().sortedCopy(collection)) {
|
||||
MobEffect mobeffect = mobeffectinstance.m_19544_();
|
||||
+ var renderer = net.minecraftforge.client.extensions.common.IClientMobEffectExtensions.of(mobeffectinstance);
|
||||
+ if (!renderer.isVisibleInGui(mobeffectinstance)) continue;
|
||||
+ // Rebind in case previous renderHUDEffect changed texture
|
||||
+ RenderSystem.m_157456_(0, AbstractContainerScreen.f_97725_);
|
||||
if (mobeffectinstance.m_19575_()) {
|
||||
int i = this.f_92977_;
|
||||
int j = 1;
|
||||
@@ -452,6 +_,7 @@
|
||||
@@ -456,6 +_,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ if (renderer.renderGuiIcon(mobeffectinstance, this, p_282812_, i, j, 0, f)) continue;
|
||||
+ if (renderer.renderGuiIcon(mobeffectinstance, this, p_93029_, i, j, 0, f)) continue;
|
||||
TextureAtlasSprite textureatlassprite = mobeffecttexturemanager.m_118732_(mobeffect);
|
||||
int i1 = j;
|
||||
float f1 = f;
|
||||
@@ -574,12 +_,13 @@
|
||||
public void m_280295_(GuiGraphics p_283501_) {
|
||||
@@ -583,12 +_,13 @@
|
||||
public void m_93069_(PoseStack p_93070_) {
|
||||
this.f_92986_.m_91307_().m_6180_("selectedItemName");
|
||||
if (this.f_92993_ > 0 && !this.f_92994_.m_41619_()) {
|
||||
- MutableComponent mutablecomponent = Component.m_237119_().m_7220_(this.f_92994_.m_41786_()).m_130940_(this.f_92994_.m_41791_().f_43022_);
|
||||
@@ -33,22 +35,22 @@
|
||||
int j = (this.f_92977_ - i) / 2;
|
||||
int k = this.f_92978_ - 59;
|
||||
if (!this.f_92986_.f_91072_.m_105205_()) {
|
||||
@@ -593,7 +_,13 @@
|
||||
@@ -602,7 +_,13 @@
|
||||
|
||||
if (l > 0) {
|
||||
p_283501_.m_280509_(j - 2, k - 2, j + i + 2, k + 9 + 2, this.f_92986_.f_91066_.m_92143_(0));
|
||||
- p_283501_.m_280430_(this.m_93082_(), mutablecomponent, j, k, 16777215 + (l << 24));
|
||||
m_93172_(p_93070_, j - 2, k - 2, j + i + 2, k + 9 + 2, this.f_92986_.f_91066_.m_92143_(0));
|
||||
- this.m_93082_().m_92763_(p_93070_, mutablecomponent, (float)j, (float)k, 16777215 + (l << 24));
|
||||
+ Font font = net.minecraftforge.client.extensions.common.IClientItemExtensions.of(f_92994_).getFont(f_92994_, net.minecraftforge.client.extensions.common.IClientItemExtensions.FontContext.SELECTED_ITEM_NAME);
|
||||
+ if (font == null) {
|
||||
+ p_283501_.m_280430_(this.m_93082_(), highlightTip, j, k, 16777215 + (l << 24));
|
||||
+ this.m_93082_().m_92763_(p_93070_, highlightTip, (float)j, (float)k, 16777215 + (l << 24));
|
||||
+ } else {
|
||||
+ j = (this.f_92977_ - font.m_92852_(highlightTip)) / 2;
|
||||
+ p_283501_.m_280430_(font, highlightTip, j, k, 16777215 + (l << 24));
|
||||
+ font.m_92763_(p_93070_, highlightTip, (float)j, (float)k, 16777215 + (l << 24));
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1037,7 +_,7 @@
|
||||
@@ -1054,7 +_,7 @@
|
||||
ItemStack itemstack = this.f_92986_.f_91074_.m_150109_().m_36056_();
|
||||
if (itemstack.m_41619_()) {
|
||||
this.f_92993_ = 0;
|
||||
|
||||
@@ -1,140 +0,0 @@
|
||||
--- a/net/minecraft/client/gui/GuiGraphics.java
|
||||
+++ b/net/minecraft/client/gui/GuiGraphics.java
|
||||
@@ -56,7 +_,7 @@
|
||||
import org.joml.Vector2ic;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
-public class GuiGraphics {
|
||||
+public class GuiGraphics implements net.minecraftforge.client.extensions.IForgeGuiGraphics {
|
||||
public static final float f_289044_ = 10000.0F;
|
||||
public static final float f_289038_ = -10000.0F;
|
||||
private static final int f_279564_ = 2;
|
||||
@@ -270,6 +_,11 @@
|
||||
}
|
||||
|
||||
public int m_280056_(Font p_283343_, @Nullable String p_281896_, int p_283569_, int p_283418_, int p_281560_, boolean p_282130_) {
|
||||
+ return this.drawString(p_283343_, p_281896_, (float)p_283569_, (float)p_283418_, p_281560_, p_282130_);
|
||||
+ }
|
||||
+
|
||||
+ // Forge: Add float variant for x,y coordinates
|
||||
+ public int drawString(Font p_283343_, @Nullable String p_281896_, float p_283569_, float p_283418_, int p_281560_, boolean p_282130_) {
|
||||
if (p_281896_ == null) {
|
||||
return 0;
|
||||
} else {
|
||||
@@ -284,6 +_,11 @@
|
||||
}
|
||||
|
||||
public int m_280649_(Font p_282636_, FormattedCharSequence p_281596_, int p_281586_, int p_282816_, int p_281743_, boolean p_282394_) {
|
||||
+ return this.drawString(p_282636_, p_281596_, (float)p_281586_, (float)p_282816_, p_281743_, p_282394_);
|
||||
+ }
|
||||
+
|
||||
+ // Forge: Add float variant for x,y coordinates
|
||||
+ public int drawString(Font p_282636_, FormattedCharSequence p_281596_, float p_281586_, float p_282816_, int p_281743_, boolean p_282394_) {
|
||||
int i = p_282636_.m_272191_(p_281596_, (float)p_281586_, (float)p_282816_, p_281743_, p_282394_, this.f_279612_.m_85850_().m_252922_(), this.f_279627_, Font.DisplayMode.NORMAL, 0, 15728880);
|
||||
this.m_286081_();
|
||||
return i;
|
||||
@@ -477,6 +_,7 @@
|
||||
crashreportcategory.m_128165_("Item Type", () -> {
|
||||
return String.valueOf((Object)p_281675_.m_41720_());
|
||||
});
|
||||
+ crashreportcategory.m_128165_("Registry Name", () -> String.valueOf(net.minecraftforge.registries.ForgeRegistries.ITEMS.getKey(p_281675_.m_41720_())));
|
||||
crashreportcategory.m_128165_("Item Damage", () -> {
|
||||
return String.valueOf(p_281675_.m_41773_());
|
||||
});
|
||||
@@ -524,18 +_,26 @@
|
||||
}
|
||||
|
||||
this.f_279612_.m_85849_();
|
||||
+ net.minecraftforge.client.ItemDecoratorHandler.of(p_283349_).render(this, p_282005_, p_283349_, p_282641_, p_282146_);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ private ItemStack tooltipStack = ItemStack.f_41583_;
|
||||
|
||||
public void m_280153_(Font p_282308_, ItemStack p_282781_, int p_282687_, int p_282292_) {
|
||||
+ this.tooltipStack = p_282781_;
|
||||
this.m_280677_(p_282308_, Screen.m_280152_(this.f_279544_, p_282781_), p_282781_.m_150921_(), p_282687_, p_282292_);
|
||||
+ this.tooltipStack = ItemStack.f_41583_;
|
||||
+ }
|
||||
+
|
||||
+ public void renderTooltip(Font font, List<Component> textComponents, Optional<TooltipComponent> tooltipComponent, ItemStack stack, int mouseX, int mouseY) {
|
||||
+ this.tooltipStack = stack;
|
||||
+ this.m_280677_(font, textComponents, tooltipComponent, mouseX, mouseY);
|
||||
+ this.tooltipStack = ItemStack.f_41583_;
|
||||
}
|
||||
|
||||
public void m_280677_(Font p_283128_, List<Component> p_282716_, Optional<TooltipComponent> p_281682_, int p_283678_, int p_281696_) {
|
||||
- List<ClientTooltipComponent> list = p_282716_.stream().map(Component::m_7532_).map(ClientTooltipComponent::m_169948_).collect(Collectors.toList());
|
||||
- p_281682_.ifPresent((p_282969_) -> {
|
||||
- list.add(1, ClientTooltipComponent.m_169950_(p_282969_));
|
||||
- });
|
||||
+ List<ClientTooltipComponent> list = net.minecraftforge.client.ForgeHooksClient.gatherTooltipComponents(this.tooltipStack, p_282716_, p_281682_, p_283678_, m_280182_(), m_280206_(), p_283128_);
|
||||
this.m_280497_(p_283128_, list, p_283678_, p_281696_, DefaultTooltipPositioner.f_262752_);
|
||||
}
|
||||
|
||||
@@ -544,7 +_,15 @@
|
||||
}
|
||||
|
||||
public void m_280666_(Font p_282739_, List<Component> p_281832_, int p_282191_, int p_282446_) {
|
||||
- this.m_280245_(p_282739_, Lists.transform(p_281832_, Component::m_7532_), p_282191_, p_282446_);
|
||||
+ List<ClientTooltipComponent> components = net.minecraftforge.client.ForgeHooksClient.gatherTooltipComponents(this.tooltipStack, p_281832_, p_282191_, m_280182_(), m_280206_(), p_282739_);
|
||||
+ this.m_280497_(p_282739_, components, p_282191_, p_282446_, DefaultTooltipPositioner.f_262752_);
|
||||
+ }
|
||||
+
|
||||
+ public void renderComponentTooltip(Font font, List<? extends net.minecraft.network.chat.FormattedText> tooltips, int mouseX, int mouseY, ItemStack stack) {
|
||||
+ this.tooltipStack = stack;
|
||||
+ List<ClientTooltipComponent> components = net.minecraftforge.client.ForgeHooksClient.gatherTooltipComponents(stack, tooltips, mouseX, m_280182_(), m_280206_(), font);
|
||||
+ this.m_280497_(font, components, mouseX, mouseY, DefaultTooltipPositioner.f_262752_);
|
||||
+ this.tooltipStack = ItemStack.f_41583_;
|
||||
}
|
||||
|
||||
public void m_280245_(Font p_282192_, List<? extends FormattedCharSequence> p_282297_, int p_281680_, int p_283325_) {
|
||||
@@ -557,11 +_,13 @@
|
||||
|
||||
private void m_280497_(Font p_282675_, List<ClientTooltipComponent> p_282615_, int p_283230_, int p_283417_, ClientTooltipPositioner p_282442_) {
|
||||
if (!p_282615_.isEmpty()) {
|
||||
+ net.minecraftforge.client.event.RenderTooltipEvent.Pre preEvent = net.minecraftforge.client.ForgeHooksClient.onRenderTooltipPre(this.tooltipStack, this, p_283230_, p_283417_, m_280182_(), m_280206_(), p_282615_, p_282675_, p_282442_);
|
||||
+ if (preEvent.isCanceled()) return;
|
||||
int i = 0;
|
||||
int j = p_282615_.size() == 1 ? -2 : 0;
|
||||
|
||||
for(ClientTooltipComponent clienttooltipcomponent : p_282615_) {
|
||||
- int k = clienttooltipcomponent.m_142069_(p_282675_);
|
||||
+ int k = clienttooltipcomponent.m_142069_(preEvent.getFont());
|
||||
if (k > i) {
|
||||
i = k;
|
||||
}
|
||||
@@ -571,20 +_,21 @@
|
||||
|
||||
int i2 = i;
|
||||
int j2 = j;
|
||||
- Vector2ic vector2ic = p_282442_.m_262814_(this.m_280182_(), this.m_280206_(), p_283230_, p_283417_, i2, j2);
|
||||
+ Vector2ic vector2ic = p_282442_.m_262814_(this.m_280182_(), this.m_280206_(), preEvent.getX(), preEvent.getY(), i2, j2);
|
||||
int l = vector2ic.x();
|
||||
int i1 = vector2ic.y();
|
||||
this.f_279612_.m_85836_();
|
||||
int j1 = 400;
|
||||
this.m_286007_(() -> {
|
||||
- TooltipRenderUtil.m_280205_(this, l, i1, i2, j2, 400);
|
||||
+ net.minecraftforge.client.event.RenderTooltipEvent.Color colorEvent = net.minecraftforge.client.ForgeHooksClient.onRenderTooltipColor(this.tooltipStack, this, l, i1, preEvent.getFont(), p_282615_);
|
||||
+ TooltipRenderUtil.renderTooltipBackground(this, l, i1, i2, j2, 400, colorEvent.getBackgroundStart(), colorEvent.getBackgroundEnd(), colorEvent.getBorderStart(), colorEvent.getBorderEnd());
|
||||
});
|
||||
this.f_279612_.m_252880_(0.0F, 0.0F, 400.0F);
|
||||
int k1 = i1;
|
||||
|
||||
for(int l1 = 0; l1 < p_282615_.size(); ++l1) {
|
||||
ClientTooltipComponent clienttooltipcomponent1 = p_282615_.get(l1);
|
||||
- clienttooltipcomponent1.m_142440_(p_282675_, l, k1, this.f_279612_.m_85850_().m_252922_(), this.f_279627_);
|
||||
+ clienttooltipcomponent1.m_142440_(preEvent.getFont(), l, k1, this.f_279612_.m_85850_().m_252922_(), this.f_279627_);
|
||||
k1 += clienttooltipcomponent1.m_142103_() + (l1 == 0 ? 2 : 0);
|
||||
}
|
||||
|
||||
@@ -592,7 +_,7 @@
|
||||
|
||||
for(int k2 = 0; k2 < p_282615_.size(); ++k2) {
|
||||
ClientTooltipComponent clienttooltipcomponent2 = p_282615_.get(k2);
|
||||
- clienttooltipcomponent2.m_183452_(p_282675_, l, k1, this);
|
||||
+ clienttooltipcomponent2.m_183452_(preEvent.getFont(), l, k1, this);
|
||||
k1 += clienttooltipcomponent2.m_142103_() + (k2 == 0 ? 2 : 0);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
--- a/net/minecraft/client/gui/components/AbstractButton.java
|
||||
+++ b/net/minecraft/client/gui/components/AbstractButton.java
|
||||
@@ -32,7 +_,7 @@
|
||||
RenderSystem.enableDepthTest();
|
||||
p_281670_.m_280027_(f_93617_, this.m_252754_(), this.m_252907_(), this.m_5711_(), this.m_93694_(), 20, 4, 200, 20, 0, this.m_274533_());
|
||||
p_281670_.m_280246_(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.m_69482_();
|
||||
m_275833_(p_275468_, this.m_252754_(), this.m_252907_(), this.m_5711_(), this.m_93694_(), 20, 4, 200, 20, 0, this.m_274533_());
|
||||
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
- int i = this.f_93623_ ? 16777215 : 10526880;
|
||||
+ int i = getFGColor();
|
||||
this.m_280139_(p_281670_, minecraft.f_91062_, i | Mth.m_14167_(this.f_93625_ * 255.0F) << 24);
|
||||
this.m_274375_(p_275468_, minecraft.f_91062_, i | Mth.m_14167_(this.f_93625_ * 255.0F) << 24);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/components/AbstractSelectionList.java
|
||||
+++ b/net/minecraft/client/gui/components/AbstractSelectionList.java
|
||||
@@ -514,6 +_,13 @@
|
||||
@@ -515,6 +_,13 @@
|
||||
return new ScreenRectangle(this.f_93393_, this.f_93390_, this.f_93392_ - this.f_93393_, this.f_93391_ - this.f_93390_);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/components/AbstractWidget.java
|
||||
+++ b/net/minecraft/client/gui/components/AbstractWidget.java
|
||||
@@ -234,6 +_,10 @@
|
||||
@@ -231,6 +_,10 @@
|
||||
this.f_93618_ = p_93675_;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public void m_93650_(float p_93651_) {
|
||||
this.f_93625_ = p_93651_;
|
||||
}
|
||||
@@ -264,6 +_,19 @@
|
||||
@@ -261,6 +_,19 @@
|
||||
|
||||
public void m_93692_(boolean p_93693_) {
|
||||
this.f_93616_ = p_93693_;
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
--- a/net/minecraft/client/gui/components/BossHealthOverlay.java
|
||||
+++ b/net/minecraft/client/gui/components/BossHealthOverlay.java
|
||||
@@ -33,13 +_,16 @@
|
||||
@@ -34,6 +_,8 @@
|
||||
|
||||
for(LerpingBossEvent lerpingbossevent : this.f_93699_.values()) {
|
||||
int k = i / 2 - 91;
|
||||
+ var event = net.minecraftforge.client.ForgeHooksClient.onCustomizeBossEventProgress(p_283175_, this.f_93698_.m_91268_(), lerpingbossevent, k, j, 10 + this.f_93698_.f_91062_.f_92710_);
|
||||
+ var event = net.minecraftforge.client.ForgeHooksClient.onCustomizeBossEventProgress(p_93705_, this.f_93698_.m_91268_(), lerpingbossevent, k, j, 10 + this.f_93698_.f_91062_.f_92710_);
|
||||
+ if (!event.isCanceled()) {
|
||||
this.m_280106_(p_283175_, k, j, lerpingbossevent);
|
||||
RenderSystem.m_157456_(0, f_93697_);
|
||||
this.m_93706_(p_93705_, k, j, lerpingbossevent);
|
||||
Component component = lerpingbossevent.m_18861_();
|
||||
int l = this.f_93698_.f_91062_.m_92852_(component);
|
||||
@@ -41,7 +_,8 @@
|
||||
int i1 = i / 2 - l / 2;
|
||||
int j1 = j - 9;
|
||||
p_283175_.m_280430_(this.f_93698_.f_91062_, component, i1, j1, 16777215);
|
||||
this.f_93698_.f_91062_.m_92763_(p_93705_, component, (float)i1, (float)j1, 16777215);
|
||||
- j += 10 + 9;
|
||||
+ }
|
||||
+ j += event.getIncrement();
|
||||
if (j >= p_283175_.m_280206_() / 3) {
|
||||
if (j >= this.f_93698_.m_91268_().m_85446_() / 3) {
|
||||
break;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/components/DebugScreenOverlay.java
|
||||
+++ b/net/minecraft/client/gui/components/DebugScreenOverlay.java
|
||||
@@ -403,6 +_,7 @@
|
||||
@@ -409,6 +_,7 @@
|
||||
list.add("");
|
||||
list.add(ChatFormatting.UNDERLINE + "Targeted Entity");
|
||||
list.add(String.valueOf((Object)BuiltInRegistries.f_256780_.m_7981_(entity.m_6095_())));
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/components/toasts/ToastComponent.java
|
||||
+++ b/net/minecraft/client/gui/components/toasts/ToastComponent.java
|
||||
@@ -101,6 +_,7 @@
|
||||
@@ -102,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_94922_(Toast p_94923_) {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/client/gui/screens/ConnectScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/ConnectScreen.java
|
||||
@@ -72,6 +_,8 @@
|
||||
}
|
||||
|
||||
if (!optional.isPresent()) {
|
||||
+ ConnectScreen.f_95683_.error("Couldn't connect to server: Unknown host \"{}\"", p_249536_.m_171863_());
|
||||
+ net.minecraftforge.network.DualStackUtils.logInitialPreferences();
|
||||
p_251955_.execute(() -> {
|
||||
p_251955_.m_91152_(new DisconnectedScreen(ConnectScreen.this.f_95686_, CommonComponents.f_130661_, ConnectScreen.f_169260_));
|
||||
});
|
||||
@@ -1,14 +1,14 @@
|
||||
--- a/net/minecraft/client/gui/screens/LoadingOverlay.java
|
||||
+++ b/net/minecraft/client/gui/screens/LoadingOverlay.java
|
||||
@@ -123,6 +_,7 @@
|
||||
int k1 = (int)((double)p_281839_.m_280206_() * 0.8325D);
|
||||
@@ -119,6 +_,7 @@
|
||||
int k1 = (int)((double)this.f_96163_.m_91268_().m_85446_() * 0.8325D);
|
||||
float f6 = this.f_96164_.m_7750_();
|
||||
this.f_96167_ = Mth.m_14036_(this.f_96167_ * 0.95F + f6 * 0.050000012F, 0.0F, 1.0F);
|
||||
+ net.minecraftforge.client.loading.ClientModLoader.renderProgressText();
|
||||
if (f < 1.0F) {
|
||||
this.m_96182_(p_281839_, i / 2 - j1, k1 - 5, i / 2 + j1, k1 + 5, 1.0F - Mth.m_14036_(f, 0.0F, 1.0F));
|
||||
this.m_96182_(p_96178_, i / 2 - j1, k1 - 5, i / 2 + j1, k1 + 5, 1.0F - Mth.m_14036_(f, 0.0F, 1.0F));
|
||||
}
|
||||
@@ -132,6 +_,7 @@
|
||||
@@ -128,6 +_,7 @@
|
||||
}
|
||||
|
||||
if (this.f_96168_ == -1L && this.f_96164_.m_7746_() && (!this.f_96166_ || f1 >= 2.0F)) {
|
||||
@@ -16,11 +16,11 @@
|
||||
try {
|
||||
this.f_96164_.m_7748_();
|
||||
this.f_96165_.accept(Optional.empty());
|
||||
@@ -139,7 +_,6 @@
|
||||
@@ -135,7 +_,6 @@
|
||||
this.f_96165_.accept(Optional.of(throwable));
|
||||
}
|
||||
|
||||
- this.f_96168_ = Util.m_137550_();
|
||||
if (this.f_96163_.f_91080_ != null) {
|
||||
this.f_96163_.f_91080_.m_6575_(this.f_96163_, p_281839_.m_280182_(), p_281839_.m_280206_());
|
||||
this.f_96163_.f_91080_.m_6575_(this.f_96163_, this.f_96163_.m_91268_().m_85445_(), this.f_96163_.m_91268_().m_85446_());
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/MenuScreens.java
|
||||
+++ b/net/minecraft/client/gui/screens/MenuScreens.java
|
||||
@@ -40,6 +_,10 @@
|
||||
@@ -41,6 +_,10 @@
|
||||
private static final Map<MenuType<?>, MenuScreens.ScreenConstructor<?, ?>> f_96196_ = Maps.newHashMap();
|
||||
|
||||
public static <T extends AbstractContainerMenu> void m_96201_(@Nullable MenuType<T> p_96202_, Minecraft p_96203_, int p_96204_, Component p_96205_) {
|
||||
@@ -11,7 +11,7 @@
|
||||
if (p_96202_ == null) {
|
||||
f_96195_.warn("Trying to open invalid screen with name: {}", (Object)p_96205_.getString());
|
||||
} else {
|
||||
@@ -47,9 +_,10 @@
|
||||
@@ -48,9 +_,10 @@
|
||||
if (screenconstructor == null) {
|
||||
f_96195_.warn("Failed to create screen for menu type: {}", (Object)BuiltInRegistries.f_256818_.m_7981_(p_96202_));
|
||||
} else {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/client/gui/screens/OptionsScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/OptionsScreen.java
|
||||
@@ -151,6 +_,14 @@
|
||||
super.m_88315_(p_283520_, p_281826_, p_283378_, p_281975_);
|
||||
super.m_86412_(p_96249_, p_96250_, p_96251_, p_96252_);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
@@ -13,5 +13,5 @@
|
||||
+ }
|
||||
+
|
||||
private Button m_260993_(Component p_261565_, Supplier<Screen> p_262119_) {
|
||||
return Button.m_253074_(p_261565_, (p_280808_) -> {
|
||||
return Button.m_253074_(p_261565_, (p_261361_) -> {
|
||||
this.f_96541_.m_91152_(p_262119_.get());
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/net/minecraft/client/gui/screens/PauseScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/PauseScreen.java
|
||||
@@ -83,6 +_,7 @@
|
||||
} else {
|
||||
gridlayout$rowhelper.m_264139_(this.m_262456_(f_262254_, SocialInteractionsScreen::new));
|
||||
}
|
||||
+ gridlayout$rowhelper.m_264108_(Button.m_253074_(Component.m_237115_("fml.menu.mods"), button -> this.f_96541_.m_91152_(new net.minecraftforge.client.gui.ModListScreen(this))).m_252780_(f_262268_).m_253136_(), 2);
|
||||
|
||||
Component component = this.f_96541_.m_91090_() ? f_262217_ : f_262246_;
|
||||
this.f_252482_ = gridlayout$rowhelper.m_264108_(Button.m_253074_(component, (p_275864_) -> {
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/Screen.java
|
||||
+++ b/net/minecraft/client/gui/screens/Screen.java
|
||||
@@ -205,7 +_,7 @@
|
||||
@@ -214,7 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_7379_() {
|
||||
@@ -9,7 +9,132 @@
|
||||
}
|
||||
|
||||
protected <T extends GuiEventListener & Renderable & NarratableEntry> T m_142416_(T p_169406_) {
|
||||
@@ -317,7 +_,10 @@
|
||||
@@ -251,15 +_,29 @@
|
||||
this.f_169368_.clear();
|
||||
}
|
||||
|
||||
+ private Font tooltipFont = null;
|
||||
+ private ItemStack tooltipStack = ItemStack.f_41583_;
|
||||
protected void m_6057_(PoseStack p_96566_, ItemStack p_96567_, int p_96568_, int p_96569_) {
|
||||
+ tooltipStack = p_96567_;
|
||||
this.m_169388_(p_96566_, this.m_96555_(p_96567_), p_96567_.m_150921_(), p_96568_, p_96569_);
|
||||
+ tooltipStack = ItemStack.f_41583_;
|
||||
}
|
||||
|
||||
+ public void renderTooltip(PoseStack poseStack, List<Component> textComponents, Optional<TooltipComponent> tooltipComponent, int x, int y, ItemStack stack) {
|
||||
+ this.renderTooltip(poseStack, textComponents, tooltipComponent, x, y, null, stack);
|
||||
+ }
|
||||
+ public void renderTooltip(PoseStack poseStack, List<Component> textComponents, Optional<TooltipComponent> tooltipComponent, int x, int y, @Nullable Font font) {
|
||||
+ this.renderTooltip(poseStack, textComponents, tooltipComponent, x, y, font, ItemStack.f_41583_);
|
||||
+ }
|
||||
+ public void renderTooltip(PoseStack poseStack, List<Component> textComponents, Optional<TooltipComponent> tooltipComponent, int x, int y, @Nullable Font font, ItemStack stack) {
|
||||
+ this.tooltipFont = font;
|
||||
+ this.tooltipStack = stack;
|
||||
+ this.m_169388_(poseStack, textComponents, tooltipComponent, x, y);
|
||||
+ this.tooltipFont = null;
|
||||
+ this.tooltipStack = ItemStack.f_41583_;
|
||||
+ }
|
||||
public void m_169388_(PoseStack p_169389_, List<Component> p_169390_, Optional<TooltipComponent> p_169391_, int p_169392_, int p_169393_) {
|
||||
- List<ClientTooltipComponent> list = p_169390_.stream().map(Component::m_7532_).map(ClientTooltipComponent::m_169948_).collect(Collectors.toList());
|
||||
- p_169391_.ifPresent((p_169399_) -> {
|
||||
- list.add(1, ClientTooltipComponent.m_169950_(p_169399_));
|
||||
- });
|
||||
+ List<ClientTooltipComponent> list = net.minecraftforge.client.ForgeHooksClient.gatherTooltipComponents(this.tooltipStack, p_169390_, p_169391_, p_169392_, f_96543_, f_96544_, this.tooltipFont, this.f_96547_);
|
||||
this.m_262809_(p_169389_, list, p_169392_, p_169393_, DefaultTooltipPositioner.f_262752_);
|
||||
}
|
||||
|
||||
@@ -272,24 +_,48 @@
|
||||
}
|
||||
|
||||
public void m_96597_(PoseStack p_96598_, List<Component> p_96599_, int p_96600_, int p_96601_) {
|
||||
- this.m_96617_(p_96598_, Lists.transform(p_96599_, Component::m_7532_), p_96600_, p_96601_);
|
||||
+ List<ClientTooltipComponent> components = net.minecraftforge.client.ForgeHooksClient.gatherTooltipComponents(this.tooltipStack, p_96599_, p_96600_, f_96543_, f_96544_, this.tooltipFont, this.f_96547_);
|
||||
+ this.m_262809_(p_96598_, components, p_96600_, p_96601_, DefaultTooltipPositioner.f_262752_);
|
||||
+ }
|
||||
+ public void renderComponentTooltip(PoseStack poseStack, List<? extends net.minecraft.network.chat.FormattedText> tooltips, int mouseX, int mouseY, ItemStack stack) {
|
||||
+ this.renderComponentTooltip(poseStack, tooltips, mouseX, mouseY, null, stack);
|
||||
+ }
|
||||
+ public void renderComponentTooltip(PoseStack poseStack, List<? extends net.minecraft.network.chat.FormattedText> tooltips, int mouseX, int mouseY, @Nullable Font font) {
|
||||
+ this.renderComponentTooltip(poseStack, tooltips, mouseX, mouseY, font, ItemStack.f_41583_);
|
||||
+ }
|
||||
+
|
||||
+ public void renderComponentTooltip(PoseStack poseStack, List<? extends net.minecraft.network.chat.FormattedText> tooltips, int mouseX, int mouseY, @Nullable Font font, ItemStack stack) {
|
||||
+ this.tooltipFont = font;
|
||||
+ this.tooltipStack = stack;
|
||||
+ List<ClientTooltipComponent> components = net.minecraftforge.client.ForgeHooksClient.gatherTooltipComponents(stack, tooltips, mouseX, f_96543_, f_96544_, this.tooltipFont, this.f_96547_);
|
||||
+ this.m_262809_(poseStack, components, mouseX, mouseY, DefaultTooltipPositioner.f_262752_);
|
||||
+ this.tooltipFont = null;
|
||||
+ this.tooltipStack = ItemStack.f_41583_;
|
||||
}
|
||||
|
||||
public void m_96617_(PoseStack p_96618_, List<? extends FormattedCharSequence> p_96619_, int p_96620_, int p_96621_) {
|
||||
this.m_262809_(p_96618_, p_96619_.stream().map(ClientTooltipComponent::m_169948_).collect(Collectors.toList()), p_96620_, p_96621_, DefaultTooltipPositioner.f_262752_);
|
||||
}
|
||||
|
||||
+ public void renderTooltip(PoseStack poseStack, List<? extends FormattedCharSequence> lines, int x, int y, Font font) {
|
||||
+ this.tooltipFont = font;
|
||||
+ this.m_96617_(poseStack, lines, x, y);
|
||||
+ this.tooltipFont = null;
|
||||
+ }
|
||||
+
|
||||
private void m_262835_(PoseStack p_263080_, Screen.DeferredTooltipRendering p_262968_, int p_263034_, int p_263076_) {
|
||||
this.m_262809_(p_263080_, p_262968_.f_262736_().stream().map(ClientTooltipComponent::m_169948_).collect(Collectors.toList()), p_263034_, p_263076_, p_262968_.f_262758_());
|
||||
}
|
||||
|
||||
private void m_262809_(PoseStack p_263064_, List<ClientTooltipComponent> p_262990_, int p_263065_, int p_262996_, ClientTooltipPositioner p_262920_) {
|
||||
if (!p_262990_.isEmpty()) {
|
||||
+ net.minecraftforge.client.event.RenderTooltipEvent.Pre preEvent = net.minecraftforge.client.ForgeHooksClient.onRenderTooltipPre(this.tooltipStack, p_263064_, p_263065_, p_262996_, f_96543_, f_96544_, p_262990_, this.tooltipFont, this.f_96547_);
|
||||
+ if (preEvent.isCanceled()) return;
|
||||
int i = 0;
|
||||
int j = p_262990_.size() == 1 ? -2 : 0;
|
||||
|
||||
for(ClientTooltipComponent clienttooltipcomponent : p_262990_) {
|
||||
- int k = clienttooltipcomponent.m_142069_(this.f_96547_);
|
||||
+ int k = clienttooltipcomponent.m_142069_(preEvent.getFont());
|
||||
if (k > i) {
|
||||
i = k;
|
||||
}
|
||||
@@ -297,7 +_,7 @@
|
||||
j += clienttooltipcomponent.m_142103_();
|
||||
}
|
||||
|
||||
- Vector2ic vector2ic = p_262920_.m_262814_(this, p_263065_, p_262996_, i, j);
|
||||
+ Vector2ic vector2ic = p_262920_.m_262814_(this, preEvent.getX(), preEvent.getY(), i, j);
|
||||
int l = vector2ic.x();
|
||||
int i1 = vector2ic.y();
|
||||
p_263064_.m_85836_();
|
||||
@@ -307,9 +_,10 @@
|
||||
RenderSystem.m_157427_(GameRenderer::m_172811_);
|
||||
bufferbuilder.m_166779_(VertexFormat.Mode.QUADS, DefaultVertexFormat.f_85815_);
|
||||
Matrix4f matrix4f = p_263064_.m_85850_().m_252922_();
|
||||
- TooltipRenderUtil.m_262796_((p_262872_, p_262873_, p_262874_, p_262875_, p_262876_, p_262877_, p_262878_, p_262879_, p_262880_) -> {
|
||||
+ net.minecraftforge.client.event.RenderTooltipEvent.Color colorEvent = net.minecraftforge.client.ForgeHooksClient.onRenderTooltipColor(this.tooltipStack, p_263064_, l, i1, preEvent.getFont(), p_262990_);
|
||||
+ TooltipRenderUtil.renderTooltipBackground((p_262872_, p_262873_, p_262874_, p_262875_, p_262876_, p_262877_, p_262878_, p_262879_, p_262880_) -> {
|
||||
GuiComponent.m_93123_(p_262872_, p_262873_, p_262874_, p_262875_, p_262876_, p_262877_, p_262878_, p_262879_, p_262880_);
|
||||
- }, matrix4f, bufferbuilder, l, i1, i, j, 400);
|
||||
+ }, matrix4f, bufferbuilder, l, i1, i, j, 400, colorEvent.getBackgroundStart(), colorEvent.getBackgroundEnd(), colorEvent.getBorderStart(), colorEvent.getBorderEnd());
|
||||
RenderSystem.m_69482_();
|
||||
RenderSystem.m_69478_();
|
||||
RenderSystem.m_69453_();
|
||||
@@ -320,7 +_,7 @@
|
||||
|
||||
for(int l1 = 0; l1 < p_262990_.size(); ++l1) {
|
||||
ClientTooltipComponent clienttooltipcomponent1 = p_262990_.get(l1);
|
||||
- clienttooltipcomponent1.m_142440_(this.f_96547_, l, k1, matrix4f, multibuffersource$buffersource);
|
||||
+ clienttooltipcomponent1.m_142440_(preEvent.getFont(), l, k1, matrix4f, multibuffersource$buffersource);
|
||||
k1 += clienttooltipcomponent1.m_142103_() + (l1 == 0 ? 2 : 0);
|
||||
}
|
||||
|
||||
@@ -329,7 +_,7 @@
|
||||
|
||||
for(int i2 = 0; i2 < p_262990_.size(); ++i2) {
|
||||
ClientTooltipComponent clienttooltipcomponent2 = p_262990_.get(i2);
|
||||
- clienttooltipcomponent2.m_183452_(this.f_96547_, l, k1, p_263064_, this.f_96542_);
|
||||
+ clienttooltipcomponent2.m_183452_(preEvent.getFont(), l, k1, p_263064_, this.f_96542_);
|
||||
k1 += clienttooltipcomponent2.m_142103_() + (i2 == 0 ? 2 : 0);
|
||||
}
|
||||
|
||||
@@ -432,7 +_,10 @@
|
||||
this.f_96543_ = p_96608_;
|
||||
this.f_96544_ = p_96609_;
|
||||
if (!this.f_267454_) {
|
||||
@@ -20,7 +145,7 @@
|
||||
} else {
|
||||
this.m_267719_();
|
||||
}
|
||||
@@ -330,7 +_,10 @@
|
||||
@@ -445,7 +_,10 @@
|
||||
protected void m_232761_() {
|
||||
this.m_169413_();
|
||||
this.m_264131_();
|
||||
@@ -31,23 +156,23 @@
|
||||
}
|
||||
|
||||
public List<? extends GuiEventListener> m_6702_() {
|
||||
@@ -352,6 +_,7 @@
|
||||
public void m_280273_(GuiGraphics p_283688_) {
|
||||
@@ -467,6 +_,7 @@
|
||||
public void m_7333_(PoseStack p_96557_) {
|
||||
if (this.f_96541_.f_91073_ != null) {
|
||||
p_283688_.m_280024_(0, 0, this.f_96543_, this.f_96544_, -1072689136, -804253680);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.BackgroundRendered(this, p_283688_));
|
||||
m_93179_(p_96557_, 0, 0, this.f_96543_, this.f_96544_, -1072689136, -804253680);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.BackgroundRendered(this, p_96557_));
|
||||
} else {
|
||||
this.m_280039_(p_283688_);
|
||||
this.m_264065_(p_96557_);
|
||||
}
|
||||
@@ -363,6 +_,7 @@
|
||||
@@ -479,6 +_,7 @@
|
||||
int i = 32;
|
||||
p_282281_.m_280398_(f_279548_, 0, 0, 0, 0.0F, 0.0F, this.f_96543_, this.f_96544_, 32, 32);
|
||||
p_282281_.m_280246_(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.BackgroundRendered(this, p_282281_));
|
||||
m_93143_(p_265092_, 0, 0, 0, 0.0F, 0.0F, this.f_96543_, this.f_96544_, 32, 32);
|
||||
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.BackgroundRendered(this, p_265092_));
|
||||
}
|
||||
|
||||
public boolean m_7043_() {
|
||||
@@ -456,6 +_,10 @@
|
||||
@@ -572,6 +_,10 @@
|
||||
public void m_7400_(List<Path> p_96591_) {
|
||||
}
|
||||
|
||||
@@ -58,7 +183,7 @@
|
||||
private void m_169380_(long p_169381_, boolean p_169382_) {
|
||||
this.f_169377_ = Util.m_137550_() + p_169381_;
|
||||
if (p_169382_) {
|
||||
@@ -622,5 +_,13 @@
|
||||
@@ -733,5 +_,13 @@
|
||||
this.f_169421_ = p_169425_;
|
||||
this.f_169422_ = p_169426_;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
}
|
||||
+ modUpdateNotification = net.minecraftforge.client.gui.TitleScreenModUpdateIndicator.init(this, modButton);
|
||||
|
||||
this.m_142416_(new ImageButton(this.f_96543_ / 2 - 124, l + 72 + 12, 20, 20, 0, 106, 20, Button.f_93617_, 256, 256, (p_280830_) -> {
|
||||
this.m_142416_(new ImageButton(this.f_96543_ / 2 - 124, l + 72 + 12, 20, 20, 0, 106, 20, Button.f_93617_, 256, 256, (p_96791_) -> {
|
||||
this.f_96541_.m_91152_(new LanguageSelectScreen(this, this.f_96541_.f_91066_, this.f_96541_.m_91102_()));
|
||||
@@ -162,7 +_,7 @@
|
||||
}).m_252987_(this.f_96543_ / 2 - 100, p_96764_ + p_96765_ * 1, 200, 20).m_257505_(tooltip).m_253136_())).f_93623_ = flag;
|
||||
@@ -33,35 +33,35 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -244,6 +_,7 @@
|
||||
this.f_232768_.m_280409_(p_282860_, i);
|
||||
@@ -245,6 +_,7 @@
|
||||
this.f_232768_.m_232790_(p_96739_, i);
|
||||
}
|
||||
|
||||
+ net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, p_282860_, this.f_96547_, this.f_96543_, this.f_96544_, i);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, p_96739_, this.f_96547_, this.f_96543_, this.f_96544_, i);
|
||||
if (this.f_96721_ != null) {
|
||||
this.f_96721_.m_280672_(p_282860_, this.f_96543_, this.f_96547_, i);
|
||||
}
|
||||
@@ -259,7 +_,14 @@
|
||||
p_96739_.m_85836_();
|
||||
p_96739_.m_252880_((float)(this.f_96543_ / 2 + 90), 70.0F, 0.0F);
|
||||
@@ -267,7 +_,14 @@
|
||||
s = s + I18n.m_118938_("menu.modded");
|
||||
}
|
||||
|
||||
- p_282860_.m_280488_(this.f_96547_, s, 2, this.f_96544_ - 10, 16777215 | i);
|
||||
- m_93236_(p_96739_, this.f_96547_, s, 2, this.f_96544_ - 10, 16777215 | i);
|
||||
+ net.minecraftforge.internal.BrandingControl.forEachLine(true, true, (brdline, brd) ->
|
||||
+ p_282860_.m_280488_(this.f_96547_, brd, 2, this.f_96544_ - ( 10 + brdline * (this.f_96547_.f_92710_ + 1)), 16777215 | i)
|
||||
+ m_93236_(p_96739_, this.f_96547_, brd, 2, this.f_96544_ - ( 10 + brdline * (this.f_96547_.f_92710_ + 1)), 16777215 | i)
|
||||
+ );
|
||||
+
|
||||
+ net.minecraftforge.internal.BrandingControl.forEachAboveCopyrightLine((brdline, brd) ->
|
||||
+ p_282860_.m_280488_(this.f_96547_, brd, this.f_96543_ - f_96547_.m_92895_(brd), this.f_96544_ - (10 + (brdline + 1) * ( this.f_96547_.f_92710_ + 1)), 16777215 | i)
|
||||
+ m_93236_(p_96739_, this.f_96547_, brd, this.f_96543_ - f_96547_.m_92895_(brd), this.f_96544_ - (10 + (brdline + 1) * ( this.f_96547_.f_92710_ + 1)), 16777215 | i)
|
||||
+ );
|
||||
+
|
||||
|
||||
for(GuiEventListener guieventlistener : this.m_6702_()) {
|
||||
if (guieventlistener instanceof AbstractWidget) {
|
||||
@@ -272,6 +_,7 @@
|
||||
RenderSystem.enableDepthTest();
|
||||
this.f_96726_.m_88315_(p_282860_, p_281753_, p_283539_, p_282628_);
|
||||
@@ -280,6 +_,7 @@
|
||||
RenderSystem.m_69482_();
|
||||
this.f_96726_.m_86412_(p_96739_, p_96740_, p_96741_, p_96742_);
|
||||
}
|
||||
+ if (f1 >= 1.0f) modUpdateNotification.m_88315_(p_282860_, p_281753_, p_283539_, p_282628_);
|
||||
+ if (f1 >= 1.0f) modUpdateNotification.m_86412_(p_96739_, p_96740_, p_96741_, p_96742_);
|
||||
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/advancements/AdvancementTab.java
|
||||
+++ b/net/minecraft/client/gui/screens/advancements/AdvancementTab.java
|
||||
@@ -36,6 +_,7 @@
|
||||
@@ -38,6 +_,7 @@
|
||||
private int f_97141_ = Integer.MIN_VALUE;
|
||||
private float f_97142_;
|
||||
private boolean f_97143_;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public AdvancementTab(Minecraft p_97145_, AdvancementsScreen p_97146_, AdvancementTabType p_97147_, int p_97148_, Advancement p_97149_, DisplayInfo p_97150_) {
|
||||
this.f_97126_ = p_97145_;
|
||||
@@ -50,6 +_,15 @@
|
||||
@@ -52,6 +_,15 @@
|
||||
this.m_97175_(this.f_97134_, p_97149_);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
public AdvancementTabType m_169538_() {
|
||||
return this.f_97128_;
|
||||
}
|
||||
@@ -143,8 +_,8 @@
|
||||
@@ -151,8 +_,8 @@
|
||||
return null;
|
||||
} else {
|
||||
for(AdvancementTabType advancementtabtype : AdvancementTabType.values()) {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/advancements/AdvancementTabType.java
|
||||
+++ b/net/minecraft/client/gui/screens/advancements/AdvancementTabType.java
|
||||
@@ -12,6 +_,7 @@
|
||||
@@ -14,6 +_,7 @@
|
||||
LEFT(0, 64, 32, 28, 5),
|
||||
RIGHT(96, 64, 32, 28, 5);
|
||||
|
||||
|
||||
+19
-15
@@ -34,37 +34,41 @@
|
||||
this.f_97334_.m_104401_(advancementtab.m_97182_(), true);
|
||||
break;
|
||||
}
|
||||
@@ -98,6 +_,11 @@
|
||||
@@ -98,9 +_,15 @@
|
||||
int i = (this.f_96543_ - 252) / 2;
|
||||
int j = (this.f_96544_ - 140) / 2;
|
||||
this.m_280273_(p_282589_);
|
||||
this.m_7333_(p_97361_);
|
||||
+ if (maxPages != 0) {
|
||||
+ net.minecraft.network.chat.Component page = Component.m_237113_(String.format("%d / %d", tabPage + 1, maxPages + 1));
|
||||
+ int width = this.f_96547_.m_92852_(page);
|
||||
+ p_282589_.m_280648_(this.f_96547_, page.m_7532_(), i + (252 / 2) - (width / 2), j - 44, -1);
|
||||
+ this.f_96547_.m_92744_(p_97361_, page.m_7532_(), i + (252 / 2) - (width / 2), j - 44, -1);
|
||||
+ }
|
||||
this.m_97373_(p_282589_, p_282255_, p_283354_, i, j);
|
||||
this.m_280088_(p_282589_, i, j);
|
||||
this.m_280355_(p_282589_, p_282255_, p_283354_, i, j);
|
||||
@@ -135,10 +_,12 @@
|
||||
p_283395_.m_280218_(f_97329_, p_281890_, p_282532_, 0, 0, 252, 140);
|
||||
if (this.f_97335_.size() > 1) {
|
||||
this.m_97373_(p_97361_, p_97362_, p_97363_, i, j);
|
||||
this.m_97356_(p_97361_, i, j);
|
||||
this.m_97381_(p_97361_, p_97362_, p_97363_, i, j);
|
||||
+ super.m_86412_(p_97361_, p_97362_, p_97363_, p_97364_);
|
||||
}
|
||||
|
||||
public boolean m_7979_(double p_97347_, double p_97348_, int p_97349_, double p_97350_, double p_97351_) {
|
||||
@@ -138,10 +_,12 @@
|
||||
RenderSystem.m_157456_(0, f_97330_);
|
||||
|
||||
for(AdvancementTab advancementtab : this.f_97335_.values()) {
|
||||
+ if (advancementtab.getPage() == tabPage)
|
||||
advancementtab.m_280105_(p_283395_, p_281890_, p_282532_, advancementtab == this.f_97336_);
|
||||
advancementtab.m_97165_(p_97357_, p_97358_, p_97359_, advancementtab == this.f_97336_);
|
||||
}
|
||||
|
||||
for(AdvancementTab advancementtab1 : this.f_97335_.values()) {
|
||||
+ if (advancementtab1.getPage() == tabPage)
|
||||
advancementtab1.m_280485_(p_283395_, p_281890_, p_282532_);
|
||||
advancementtab1.m_274613_(p_97357_, p_97358_, p_97359_, this.f_96542_);
|
||||
}
|
||||
}
|
||||
@@ -158,7 +_,7 @@
|
||||
@@ -161,7 +_,7 @@
|
||||
|
||||
if (this.f_97335_.size() > 1) {
|
||||
for(AdvancementTab advancementtab : this.f_97335_.values()) {
|
||||
- if (advancementtab.m_97154_(p_281519_, p_283371_, (double)p_283556_, (double)p_282458_)) {
|
||||
+ if (advancementtab.getPage() == tabPage && advancementtab.m_97154_(p_281519_, p_283371_, (double)p_283556_, (double)p_282458_)) {
|
||||
p_282784_.m_280557_(this.f_96547_, advancementtab.m_97189_(), p_283556_, p_282458_);
|
||||
- if (advancementtab.m_97154_(p_97385_, p_97386_, (double)p_97383_, (double)p_97384_)) {
|
||||
+ if (advancementtab.getPage() == tabPage && advancementtab.m_97154_(p_97385_, p_97386_, (double)p_97383_, (double)p_97384_)) {
|
||||
this.m_96602_(p_97382_, advancementtab.m_97189_(), p_97383_, p_97384_);
|
||||
}
|
||||
}
|
||||
+12
-12
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/controls/KeyBindsList.java
|
||||
+++ b/net/minecraft/client/gui/screens/controls/KeyBindsList.java
|
||||
@@ -64,7 +_,7 @@
|
||||
@@ -65,7 +_,7 @@
|
||||
}
|
||||
|
||||
protected int m_5756_() {
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
public int m_5759_() {
|
||||
@@ -129,10 +_,11 @@
|
||||
@@ -130,10 +_,11 @@
|
||||
this.f_193912_ = Button.m_253074_(p_193917_, (p_269618_) -> {
|
||||
KeyBindsList.this.f_193858_.f_193975_ = p_193916_;
|
||||
KeyBindsList.this.m_269130_();
|
||||
@@ -22,16 +22,16 @@
|
||||
KeyBindsList.this.f_93386_.f_91066_.m_92159_(p_193916_, p_193916_.m_90861_());
|
||||
KeyBindsList.this.m_269130_();
|
||||
}).m_252987_(0, 0, 50, 20).m_252778_((p_253313_) -> {
|
||||
@@ -144,7 +_,7 @@
|
||||
public void m_6311_(GuiGraphics p_281805_, int p_281298_, int p_282357_, int p_281373_, int p_283433_, int p_281932_, int p_282224_, int p_282053_, boolean p_282605_, float p_281432_) {
|
||||
int k = p_281373_ + 90 - KeyBindsList.this.f_193859_;
|
||||
p_281805_.m_280614_(KeyBindsList.this.f_93386_.f_91062_, this.f_193911_, k, p_282357_ + p_281932_ / 2 - 9 / 2, 16777215, false);
|
||||
- this.f_193913_.m_252865_(p_281373_ + 190);
|
||||
+ this.f_193913_.m_252865_(p_281373_ + 190 + 20);
|
||||
this.f_193913_.m_253211_(p_282357_);
|
||||
this.f_193913_.m_88315_(p_281805_, p_282224_, p_282053_, p_281432_);
|
||||
this.f_193912_.m_252865_(p_281373_ + 105);
|
||||
@@ -173,7 +_,7 @@
|
||||
@@ -145,7 +_,7 @@
|
||||
public void m_6311_(PoseStack p_193923_, int p_193924_, int p_193925_, int p_193926_, int p_193927_, int p_193928_, int p_193929_, int p_193930_, boolean p_193931_, float p_193932_) {
|
||||
float f = (float)(p_193926_ + 90 - KeyBindsList.this.f_193859_);
|
||||
KeyBindsList.this.f_93386_.f_91062_.m_92889_(p_193923_, this.f_193911_, f, (float)(p_193925_ + p_193928_ / 2 - 9 / 2), 16777215);
|
||||
- this.f_193913_.m_252865_(p_193926_ + 190);
|
||||
+ this.f_193913_.m_252865_(p_193926_ + 190 + 20);
|
||||
this.f_193913_.m_253211_(p_193925_);
|
||||
this.f_193913_.m_86412_(p_193923_, p_193929_, p_193930_, p_193932_);
|
||||
this.f_193912_.m_252865_(p_193926_ + 105);
|
||||
@@ -174,7 +_,7 @@
|
||||
MutableComponent mutablecomponent = Component.m_237119_();
|
||||
if (!this.f_193910_.m_90862_()) {
|
||||
for(KeyMapping keymapping : KeyBindsList.this.f_93386_.f_91066_.f_92059_) {
|
||||
|
||||
+41
-39
@@ -1,51 +1,53 @@
|
||||
--- a/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java
|
||||
@@ -90,6 +_,7 @@
|
||||
@@ -88,6 +_,7 @@
|
||||
int i = this.f_97735_;
|
||||
int j = this.f_97736_;
|
||||
this.m_7286_(p_283479_, p_281886_, p_283661_, p_281248_);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ContainerScreenEvent.Render.Background(this, p_283479_, p_283661_, p_281248_));
|
||||
RenderSystem.disableDepthTest();
|
||||
super.m_88315_(p_283479_, p_283661_, p_281248_, p_281886_);
|
||||
p_283479_.m_280168_().m_85836_();
|
||||
@@ -107,12 +_,13 @@
|
||||
this.m_7286_(p_97795_, p_97798_, p_97796_, p_97797_);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ContainerScreenEvent.Render.Background(this, p_97795_, p_97796_, p_97797_));
|
||||
RenderSystem.m_69465_();
|
||||
super.m_86412_(p_97795_, p_97796_, p_97797_, p_97798_);
|
||||
p_97795_.m_85836_();
|
||||
@@ -104,11 +_,12 @@
|
||||
this.f_97734_ = slot;
|
||||
int l = slot.f_40220_;
|
||||
int i1 = slot.f_40221_;
|
||||
if (this.f_97734_.m_280329_()) {
|
||||
- m_280359_(p_283479_, l, i1, 0);
|
||||
+ renderSlotHighlight(p_283479_, l, i1, 0, getSlotColor(k));
|
||||
}
|
||||
- m_169606_(p_97795_, l, i1, 0);
|
||||
+ renderSlotHighlight(p_97795_, l, i1, 0, this.getSlotColor(k));
|
||||
}
|
||||
}
|
||||
|
||||
this.m_280003_(p_283479_, p_283661_, p_281248_);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ContainerScreenEvent.Render.Foreground(this, p_283479_, p_283661_, p_281248_));
|
||||
this.m_7027_(p_97795_, p_97796_, p_97797_);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ContainerScreenEvent.Render.Foreground(this, p_97795_, p_97796_, p_97797_));
|
||||
ItemStack itemstack = this.f_97711_.m_41619_() ? this.f_97732_.m_142621_() : this.f_97711_;
|
||||
if (!itemstack.m_41619_()) {
|
||||
int l1 = 8;
|
||||
@@ -149,7 +_,10 @@
|
||||
@@ -147,9 +_,13 @@
|
||||
}
|
||||
|
||||
public static void m_280359_(GuiGraphics p_283692_, int p_281453_, int p_281915_, int p_283504_) {
|
||||
- p_283692_.m_285978_(RenderType.m_286086_(), p_281453_, p_281915_, p_281453_ + 16, p_281915_ + 16, -2130706433, -2130706433, p_283504_);
|
||||
+ renderSlotHighlight(p_283692_, p_281453_, p_281915_, p_283504_, -2130706433);
|
||||
public static void m_169606_(PoseStack p_169607_, int p_169608_, int p_169609_, int p_169610_) {
|
||||
+ renderSlotHighlight(p_169607_, p_169608_, p_169609_, p_169610_, -2130706433);
|
||||
+ }
|
||||
+ public static void renderSlotHighlight(GuiGraphics p_283692_, int p_281453_, int p_281915_, int p_283504_, int color) {
|
||||
+ p_283692_.m_285978_(RenderType.m_286086_(), p_281453_, p_281915_, p_281453_ + 16, p_281915_ + 16, color, color, p_283504_);
|
||||
+
|
||||
+ public static void renderSlotHighlight(PoseStack p_169607_, int p_169608_, int p_169609_, int p_169610_, int slotColor) {
|
||||
RenderSystem.m_69465_();
|
||||
RenderSystem.m_69444_(true, true, true, false);
|
||||
- m_168740_(p_169607_, p_169608_, p_169609_, p_169608_ + 16, p_169609_ + 16, -2130706433, -2130706433, p_169610_);
|
||||
+ m_168740_(p_169607_, p_169608_, p_169609_, p_169608_ + 16, p_169609_ + 16, slotColor, slotColor, p_169610_);
|
||||
RenderSystem.m_69444_(true, true, true, true);
|
||||
RenderSystem.m_69482_();
|
||||
}
|
||||
@@ -165,7 +_,8 @@
|
||||
p_275498_.m_85836_();
|
||||
p_275498_.m_252880_(0.0F, 0.0F, 232.0F);
|
||||
this.f_96542_.m_274369_(p_275498_, p_275341_, p_275289_, p_275690_);
|
||||
- this.f_96542_.m_274364_(p_275498_, this.f_96547_, p_275341_, p_275289_, p_275690_ - (this.f_97711_.m_41619_() ? 0 : 8), p_275201_);
|
||||
+ var font = net.minecraftforge.client.extensions.common.IClientItemExtensions.of(p_275341_).getFont(p_275341_, net.minecraftforge.client.extensions.common.IClientItemExtensions.FontContext.ITEM_COUNT);
|
||||
+ this.f_96542_.m_274364_(p_275498_, font == null ? this.f_96547_ : font, p_275341_, p_275289_, p_275690_ - (this.f_97711_.m_41619_() ? 0 : 8), p_275201_);
|
||||
p_275498_.m_85849_();
|
||||
}
|
||||
|
||||
protected void m_280072_(GuiGraphics p_283594_, int p_282171_, int p_281909_) {
|
||||
@@ -168,7 +_,8 @@
|
||||
p_282567_.m_280168_().m_85836_();
|
||||
p_282567_.m_280168_().m_252880_(0.0F, 0.0F, 232.0F);
|
||||
p_282567_.m_280480_(p_281330_, p_281772_, p_281689_);
|
||||
- p_282567_.m_280302_(this.f_96547_, p_281330_, p_281772_, p_281689_ - (this.f_97711_.m_41619_() ? 0 : 8), p_282568_);
|
||||
+ var font = net.minecraftforge.client.extensions.common.IClientItemExtensions.of(p_281330_).getFont(p_281330_, net.minecraftforge.client.extensions.common.IClientItemExtensions.FontContext.ITEM_COUNT);
|
||||
+ p_282567_.m_280302_(font == null ? this.f_96547_ : font, p_281330_, p_281772_, p_281689_ - (this.f_97711_.m_41619_() ? 0 : 8), p_282568_);
|
||||
p_282567_.m_280168_().m_85849_();
|
||||
}
|
||||
|
||||
@@ -270,7 +_,8 @@
|
||||
@@ -272,7 +_,8 @@
|
||||
if (super.m_6375_(p_97748_, p_97749_, p_97750_)) {
|
||||
return true;
|
||||
} else {
|
||||
@@ -55,7 +57,7 @@
|
||||
Slot slot = this.m_97744_(p_97748_, p_97749_);
|
||||
long i = Util.m_137550_();
|
||||
this.f_97723_ = this.f_97709_ == slot && i - this.f_97721_ < 250L && this.f_97722_ == p_97750_;
|
||||
@@ -281,6 +_,7 @@
|
||||
@@ -283,6 +_,7 @@
|
||||
int j = this.f_97735_;
|
||||
int k = this.f_97736_;
|
||||
boolean flag1 = this.m_7467_(p_97748_, p_97749_, j, k, p_97750_);
|
||||
@@ -63,7 +65,7 @@
|
||||
int l = -1;
|
||||
if (slot != null) {
|
||||
l = slot.f_40219_;
|
||||
@@ -306,7 +_,7 @@
|
||||
@@ -308,7 +_,7 @@
|
||||
}
|
||||
} else if (!this.f_97738_) {
|
||||
if (this.f_97732_.m_142621_().m_41619_()) {
|
||||
@@ -72,7 +74,7 @@
|
||||
this.m_6597_(slot, l, p_97750_, ClickType.CLONE);
|
||||
} else {
|
||||
boolean flag2 = l != -999 && (InputConstants.m_84830_(Minecraft.m_91087_().m_91268_().m_85439_(), 340) || InputConstants.m_84830_(Minecraft.m_91087_().m_91268_().m_85439_(), 344));
|
||||
@@ -330,7 +_,7 @@
|
||||
@@ -332,7 +_,7 @@
|
||||
this.f_97717_ = 0;
|
||||
} else if (p_97750_ == 1) {
|
||||
this.f_97717_ = 1;
|
||||
@@ -81,7 +83,7 @@
|
||||
this.f_97717_ = 2;
|
||||
}
|
||||
}
|
||||
@@ -399,10 +_,13 @@
|
||||
@@ -401,10 +_,13 @@
|
||||
}
|
||||
|
||||
public boolean m_6348_(double p_97812_, double p_97813_, int p_97814_) {
|
||||
@@ -95,7 +97,7 @@
|
||||
int k = -1;
|
||||
if (slot != null) {
|
||||
k = slot.f_40219_;
|
||||
@@ -416,7 +_,7 @@
|
||||
@@ -418,7 +_,7 @@
|
||||
if (m_96638_()) {
|
||||
if (!this.f_97724_.m_41619_()) {
|
||||
for(Slot slot2 : this.f_97732_.f_38839_) {
|
||||
@@ -104,7 +106,7 @@
|
||||
this.m_6597_(slot2, slot2.f_40219_, p_97814_, ClickType.QUICK_MOVE);
|
||||
}
|
||||
}
|
||||
@@ -479,7 +_,7 @@
|
||||
@@ -481,7 +_,7 @@
|
||||
|
||||
this.m_6597_((Slot)null, -999, AbstractContainerMenu.m_38930_(2, this.f_97717_), ClickType.QUICK_CRAFT);
|
||||
} else if (!this.f_97732_.m_142621_().m_41619_()) {
|
||||
@@ -113,7 +115,7 @@
|
||||
this.m_6597_(slot, k, p_97814_, ClickType.CLONE);
|
||||
} else {
|
||||
boolean flag1 = k != -999 && (InputConstants.m_84830_(Minecraft.m_91087_().m_91268_().m_85439_(), 340) || InputConstants.m_84830_(Minecraft.m_91087_().m_91268_().m_85439_(), 344));
|
||||
@@ -526,34 +_,39 @@
|
||||
@@ -528,34 +_,39 @@
|
||||
}
|
||||
|
||||
public boolean m_7933_(int p_97765_, int p_97766_, int p_97767_) {
|
||||
@@ -160,7 +162,7 @@
|
||||
this.m_6597_(this.f_97734_, this.f_97734_.f_40219_, i, ClickType.SWAP);
|
||||
return true;
|
||||
}
|
||||
@@ -588,6 +_,18 @@
|
||||
@@ -590,6 +_,18 @@
|
||||
|
||||
public T m_6262_() {
|
||||
return this.f_97732_;
|
||||
|
||||
+71
-61
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java
|
||||
@@ -74,6 +_,8 @@
|
||||
@@ -75,6 +_,8 @@
|
||||
private boolean f_98515_;
|
||||
private final Set<TagKey<Item>> f_98516_ = new HashSet<>();
|
||||
private final boolean f_256872_;
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
public CreativeModeInventoryScreen(Player p_259788_, FeatureFlagSet p_260074_, boolean p_259569_) {
|
||||
super(new CreativeModeInventoryScreen.ItemPickerMenu(p_259788_), p_259788_.m_150109_(), CommonComponents.f_237098_);
|
||||
@@ -107,7 +_,7 @@
|
||||
@@ -109,7 +_,7 @@
|
||||
private void m_257687_(Collection<ItemStack> p_261591_) {
|
||||
int i = this.f_97732_.m_257485_(this.f_98508_);
|
||||
(this.f_97732_).f_98639_.clear();
|
||||
@@ -18,7 +18,7 @@
|
||||
this.m_98630_();
|
||||
} else {
|
||||
(this.f_97732_).f_98639_.addAll(p_261591_);
|
||||
@@ -263,6 +_,34 @@
|
||||
@@ -273,6 +_,34 @@
|
||||
protected void m_7856_() {
|
||||
if (this.f_96541_.f_91072_.m_105290_()) {
|
||||
super.m_7856_();
|
||||
@@ -53,7 +53,7 @@
|
||||
this.f_98510_ = new EditBox(this.f_96547_, this.f_97735_ + 82, this.f_97736_ + 6, 80, 9, Component.m_237115_("itemGroup.search"));
|
||||
this.f_98510_.m_94199_(50);
|
||||
this.f_98510_.m_94182_(false);
|
||||
@@ -308,7 +_,7 @@
|
||||
@@ -318,7 +_,7 @@
|
||||
public boolean m_5534_(char p_98521_, int p_98522_) {
|
||||
if (this.f_98514_) {
|
||||
return false;
|
||||
@@ -62,7 +62,7 @@
|
||||
return false;
|
||||
} else {
|
||||
String s = this.f_98510_.m_94155_();
|
||||
@@ -326,7 +_,7 @@
|
||||
@@ -336,7 +_,7 @@
|
||||
|
||||
public boolean m_7933_(int p_98547_, int p_98548_, int p_98549_) {
|
||||
this.f_98514_ = false;
|
||||
@@ -71,7 +71,7 @@
|
||||
if (this.f_96541_.f_91066_.f_92098_.m_90832_(p_98547_, p_98548_)) {
|
||||
this.f_98514_ = true;
|
||||
this.m_98560_(CreativeModeTabs.m_258007_());
|
||||
@@ -361,6 +_,7 @@
|
||||
@@ -371,6 +_,7 @@
|
||||
}
|
||||
|
||||
private void m_98630_() {
|
||||
@@ -79,7 +79,7 @@
|
||||
(this.f_97732_).f_98639_.clear();
|
||||
this.f_98516_.clear();
|
||||
String s = this.f_98510_.m_94155_();
|
||||
@@ -370,10 +_,10 @@
|
||||
@@ -380,10 +_,10 @@
|
||||
SearchTree<ItemStack> searchtree;
|
||||
if (s.startsWith("#")) {
|
||||
s = s.substring(1);
|
||||
@@ -92,17 +92,17 @@
|
||||
}
|
||||
|
||||
(this.f_97732_).f_98639_.addAll(searchtree.m_6293_(s.toLowerCase(Locale.ROOT)));
|
||||
@@ -405,7 +_,8 @@
|
||||
@@ -415,7 +_,8 @@
|
||||
|
||||
protected void m_280003_(GuiGraphics p_283168_, int p_281774_, int p_281466_) {
|
||||
protected void m_7027_(PoseStack p_98616_, int p_98617_, int p_98618_) {
|
||||
if (f_98507_.m_40789_()) {
|
||||
- p_283168_.m_280614_(this.f_96547_, f_98507_.m_40786_(), 8, 6, 4210752, false);
|
||||
+ com.mojang.blaze3d.systems.RenderSystem.disableBlend();
|
||||
+ p_283168_.m_280614_(this.f_96547_, f_98507_.m_40786_(), 8, 6, f_98507_.getLabelColor(), false);
|
||||
- this.f_96547_.m_92889_(p_98616_, f_98507_.m_40786_(), 8.0F, 6.0F, 4210752);
|
||||
+ RenderSystem.m_69461_();
|
||||
+ this.f_96547_.m_92889_(p_98616_, f_98507_.m_40786_(), 8.0F, 6.0F, f_98507_.getLabelColor());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -415,7 +_,7 @@
|
||||
@@ -425,7 +_,7 @@
|
||||
double d0 = p_98531_ - (double)this.f_97735_;
|
||||
double d1 = p_98532_ - (double)this.f_97736_;
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
if (this.m_98562_(creativemodetab, d0, d1)) {
|
||||
return true;
|
||||
}
|
||||
@@ -436,7 +_,7 @@
|
||||
@@ -446,7 +_,7 @@
|
||||
double d1 = p_98623_ - (double)this.f_97736_;
|
||||
this.f_98509_ = false;
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
if (this.m_98562_(creativemodetab, d0, d1)) {
|
||||
this.m_98560_(creativemodetab);
|
||||
return true;
|
||||
@@ -454,6 +_,7 @@
|
||||
@@ -464,6 +_,7 @@
|
||||
private void m_98560_(CreativeModeTab p_98561_) {
|
||||
CreativeModeTab creativemodetab = f_98507_;
|
||||
f_98507_ = p_98561_;
|
||||
@@ -128,7 +128,7 @@
|
||||
this.f_97737_.clear();
|
||||
(this.f_97732_).f_98639_.clear();
|
||||
this.m_238391_();
|
||||
@@ -530,13 +_,15 @@
|
||||
@@ -540,13 +_,15 @@
|
||||
this.f_98511_ = null;
|
||||
}
|
||||
|
||||
@@ -145,73 +145,83 @@
|
||||
|
||||
this.m_98630_();
|
||||
} else {
|
||||
@@ -593,7 +_,7 @@
|
||||
this.m_280273_(p_283000_);
|
||||
super.m_88315_(p_283000_, p_281317_, p_282770_, p_281295_);
|
||||
@@ -603,7 +_,7 @@
|
||||
this.m_7333_(p_98577_);
|
||||
super.m_86412_(p_98577_, p_98578_, p_98579_, p_98580_);
|
||||
|
||||
- for(CreativeModeTab creativemodetab : CreativeModeTabs.m_257388_()) {
|
||||
+ for(CreativeModeTab creativemodetab : currentPage.getVisibleTabs()) {
|
||||
if (this.m_280537_(p_283000_, creativemodetab, p_281317_, p_282770_)) {
|
||||
if (this.m_98584_(p_98577_, creativemodetab, p_98578_, p_98579_)) {
|
||||
break;
|
||||
}
|
||||
@@ -603,13 +_,22 @@
|
||||
p_283000_.m_280557_(this.f_96547_, f_98506_, p_281317_, p_282770_);
|
||||
@@ -613,13 +_,22 @@
|
||||
this.m_96602_(p_98577_, f_98506_, p_98578_, p_98579_);
|
||||
}
|
||||
|
||||
+ if (this.pages.size() != 1) {
|
||||
+ Component page = Component.m_237113_(String.format("%d / %d", this.pages.indexOf(this.currentPage) + 1, this.pages.size()));
|
||||
+ p_283000_.m_280168_().m_85836_();
|
||||
+ p_283000_.m_280168_().m_252880_(0F, 0F, 300F);
|
||||
+ p_283000_.m_280648_(f_96547_, page.m_7532_(), f_97735_ + (f_97726_ / 2) - (f_96547_.m_92852_(page) / 2), f_97736_ - 44, -1);
|
||||
+ p_283000_.m_280168_().m_85849_();
|
||||
+ p_98577_.m_85836_();
|
||||
+ p_98577_.m_252880_(0F, 0F, 300F);
|
||||
+ f_96547_.m_92744_(p_98577_, page.m_7532_(), f_97735_ + (f_97726_ / 2f) - (f_96547_.m_92852_(page) / 2f), f_97736_ - 44, -1);
|
||||
+ p_98577_.m_85849_();
|
||||
+ }
|
||||
+
|
||||
+ com.mojang.blaze3d.systems.RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.m_280072_(p_283000_, p_281317_, p_282770_);
|
||||
+ RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.m_7025_(p_98577_, p_98578_, p_98579_);
|
||||
}
|
||||
|
||||
public List<Component> m_280553_(ItemStack p_281769_) {
|
||||
protected void m_6057_(PoseStack p_98590_, ItemStack p_98591_, int p_98592_, int p_98593_) {
|
||||
boolean flag = this.f_97734_ != null && this.f_97734_ instanceof CreativeModeInventoryScreen.CustomCreativeSlot;
|
||||
boolean flag1 = f_98507_.m_257962_() == CreativeModeTab.Type.CATEGORY;
|
||||
- boolean flag2 = f_98507_.m_257962_() == CreativeModeTab.Type.SEARCH;
|
||||
+ boolean flag2 = f_98507_.hasSearchBar();
|
||||
TooltipFlag.Default tooltipflag$default = this.f_96541_.f_91066_.f_92125_ ? TooltipFlag.Default.f_256730_ : TooltipFlag.Default.f_256752_;
|
||||
TooltipFlag tooltipflag = flag ? tooltipflag$default.m_257777_() : tooltipflag$default;
|
||||
List<Component> list = p_281769_.m_41651_(this.f_96541_.f_91074_, tooltipflag);
|
||||
@@ -629,7 +_,7 @@
|
||||
List<Component> list = p_98591_.m_41651_(this.f_96541_.f_91074_, tooltipflag);
|
||||
@@ -639,35 +_,36 @@
|
||||
|
||||
int i = 1;
|
||||
|
||||
for(CreativeModeTab creativemodetab : CreativeModeTabs.m_257388_()) {
|
||||
- if (creativemodetab.m_257962_() != CreativeModeTab.Type.SEARCH && creativemodetab.m_257694_(p_281769_)) {
|
||||
+ if (!creativemodetab.hasSearchBar() && creativemodetab.m_257694_(p_281769_)) {
|
||||
- for(CreativeModeTab creativemodetab : CreativeModeTabs.m_257388_()) {
|
||||
- if (creativemodetab.m_257962_() != CreativeModeTab.Type.SEARCH && creativemodetab.m_257694_(p_98591_)) {
|
||||
+ for(CreativeModeTab creativemodetab : currentPage.getVisibleTabs()) {
|
||||
+ if (!creativemodetab.hasSearchBar() && creativemodetab.m_257694_(p_98591_)) {
|
||||
list1.add(i++, creativemodetab.m_40786_().m_6881_().m_130940_(ChatFormatting.BLUE));
|
||||
}
|
||||
}
|
||||
@@ -639,13 +_,13 @@
|
||||
}
|
||||
|
||||
- this.m_169388_(p_98590_, list1, p_98591_.m_150921_(), p_98592_, p_98593_);
|
||||
+ this.renderTooltip(p_98590_, list1, p_98591_.m_150921_(), p_98592_, p_98593_, null, p_98591_);
|
||||
}
|
||||
|
||||
protected void m_7286_(GuiGraphics p_282663_, float p_282504_, int p_282089_, int p_282249_) {
|
||||
protected void m_7286_(PoseStack p_98572_, float p_98573_, int p_98574_, int p_98575_) {
|
||||
- for(CreativeModeTab creativemodetab : CreativeModeTabs.m_257388_()) {
|
||||
+ for(CreativeModeTab creativemodetab : currentPage.getVisibleTabs()) {
|
||||
RenderSystem.m_157456_(0, f_98504_);
|
||||
if (creativemodetab != f_98507_) {
|
||||
this.m_280560_(p_282663_, creativemodetab);
|
||||
this.m_98581_(p_98572_, creativemodetab);
|
||||
}
|
||||
}
|
||||
|
||||
- p_282663_.m_280218_(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + f_98507_.m_40788_()), this.f_97735_, this.f_97736_, 0, 0, this.f_97726_, this.f_97727_);
|
||||
+ p_282663_.m_280218_(f_98507_.getBackgroundLocation(), this.f_97735_, this.f_97736_, 0, 0, this.f_97726_, this.f_97727_);
|
||||
this.f_98510_.m_88315_(p_282663_, p_282089_, p_282249_, p_282504_);
|
||||
- RenderSystem.m_157456_(0, new ResourceLocation("textures/gui/container/creative_inventory/tab_" + f_98507_.m_40788_()));
|
||||
+ RenderSystem.m_157456_(0, f_98507_.getBackgroundLocation());
|
||||
m_93228_(p_98572_, this.f_97735_, this.f_97736_, 0, 0, this.f_97726_, this.f_97727_);
|
||||
this.f_98510_.m_86412_(p_98572_, p_98574_, p_98575_, p_98573_);
|
||||
int j = this.f_97735_ + 175;
|
||||
int k = this.f_97736_ + 18;
|
||||
@@ -654,6 +_,7 @@
|
||||
p_282663_.m_280218_(f_98504_, j, k + (int)((float)(i - k - 17) * this.f_98508_), 232 + (this.m_98631_() ? 0 : 12), 0, 12, 15);
|
||||
int i = k + 112;
|
||||
- RenderSystem.m_157456_(0, f_98504_);
|
||||
+ RenderSystem.m_157456_(0, f_98507_.getTabsImage());
|
||||
if (f_98507_.m_40791_()) {
|
||||
m_93228_(p_98572_, j, k + (int)((float)(i - k - 17) * this.f_98508_), 232 + (this.m_98631_() ? 0 : 12), 0, 12, 15);
|
||||
}
|
||||
|
||||
+ if (currentPage.getVisibleTabs().contains(f_98507_)) //Forge: only display tab selection when the selected tab is on the current page
|
||||
this.m_280560_(p_282663_, f_98507_);
|
||||
this.m_98581_(p_98572_, f_98507_);
|
||||
if (f_98507_.m_257962_() == CreativeModeTab.Type.INVENTORY) {
|
||||
InventoryScreen.m_274545_(p_282663_, this.f_97735_ + 88, this.f_97736_ + 45, 20, (float)(this.f_97735_ + 88 - p_282089_), (float)(this.f_97736_ + 45 - 30 - p_282249_), this.f_96541_.f_91074_);
|
||||
@@ -662,7 +_,7 @@
|
||||
InventoryScreen.m_274545_(p_98572_, this.f_97735_ + 88, this.f_97736_ + 45, 20, (float)(this.f_97735_ + 88 - p_98574_), (float)(this.f_97736_ + 45 - 30 - p_98575_), this.f_96541_.f_91074_);
|
||||
@@ -676,7 +_,7 @@
|
||||
}
|
||||
|
||||
private int m_258094_(CreativeModeTab p_260136_) {
|
||||
@@ -220,7 +230,7 @@
|
||||
int j = 27;
|
||||
int k = 27 * i;
|
||||
if (p_260136_.m_6563_()) {
|
||||
@@ -674,7 +_,7 @@
|
||||
@@ -688,7 +_,7 @@
|
||||
|
||||
private int m_257995_(CreativeModeTab p_260181_) {
|
||||
int i = 0;
|
||||
@@ -229,26 +239,26 @@
|
||||
i -= 32;
|
||||
} else {
|
||||
i += this.f_97727_;
|
||||
@@ -702,8 +_,8 @@
|
||||
@@ -716,8 +_,8 @@
|
||||
|
||||
protected void m_280560_(GuiGraphics p_283590_, CreativeModeTab p_283489_) {
|
||||
boolean flag = p_283489_ == f_98507_;
|
||||
- boolean flag1 = p_283489_.m_258064_() == CreativeModeTab.Row.TOP;
|
||||
- int i = p_283489_.m_257903_();
|
||||
+ boolean flag1 = currentPage.isTop(p_283489_);
|
||||
+ int i = currentPage.getColumn(p_283489_);
|
||||
protected void m_98581_(PoseStack p_98582_, CreativeModeTab p_98583_) {
|
||||
boolean flag = p_98583_ == f_98507_;
|
||||
- boolean flag1 = p_98583_.m_258064_() == CreativeModeTab.Row.TOP;
|
||||
- int i = p_98583_.m_257903_();
|
||||
+ boolean flag1 = currentPage.isTop(p_98583_);
|
||||
+ int i = currentPage.getColumn(p_98583_);
|
||||
int j = i * 26;
|
||||
int k = 0;
|
||||
int l = this.f_97735_ + this.m_258094_(p_283489_);
|
||||
@@ -720,6 +_,7 @@
|
||||
int l = this.f_97735_ + this.m_258094_(p_98583_);
|
||||
@@ -734,6 +_,7 @@
|
||||
i1 += this.f_97727_ - 4;
|
||||
}
|
||||
|
||||
+ com.mojang.blaze3d.systems.RenderSystem.enableBlend(); //Forge: Make sure blend is enabled else tabs show a white border.
|
||||
p_283590_.m_280218_(f_98504_, l, i1, j, k, 26, 32);
|
||||
p_283590_.m_280168_().m_85836_();
|
||||
p_283590_.m_280168_().m_252880_(0.0F, 0.0F, 100.0F);
|
||||
@@ -763,6 +_,14 @@
|
||||
+ RenderSystem.m_69478_(); //Forge: Make sure blend is enabled else tabs show a white border.
|
||||
m_93228_(p_98582_, l, i1, j, k, 26, 32);
|
||||
p_98582_.m_85836_();
|
||||
p_98582_.m_252880_(0.0F, 0.0F, 100.0F);
|
||||
@@ -777,6 +_,14 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -263,7 +273,7 @@
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
static class CustomCreativeSlot extends Slot {
|
||||
public CustomCreativeSlot(Container p_98633_, int p_98634_, int p_98635_, int p_98636_) {
|
||||
@@ -930,6 +_,22 @@
|
||||
@@ -944,6 +_,22 @@
|
||||
|
||||
public boolean m_8010_(Player p_98665_) {
|
||||
return this.f_98655_.m_8010_(p_98665_);
|
||||
|
||||
+13
-13
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java
|
||||
@@ -41,12 +_,17 @@
|
||||
@@ -42,12 +_,17 @@
|
||||
Collection<MobEffectInstance> collection = this.f_96541_.f_91074_.m_21220_();
|
||||
if (!collection.isEmpty() && j >= 32) {
|
||||
boolean flag = j >= 120;
|
||||
@@ -16,30 +16,30 @@
|
||||
- Iterable<MobEffectInstance> iterable = Ordering.natural().sortedCopy(collection);
|
||||
+
|
||||
+ Iterable<MobEffectInstance> iterable = collection.stream().filter(net.minecraftforge.client.ForgeHooksClient::shouldRenderEffect).sorted().collect(java.util.stream.Collectors.toList());
|
||||
this.m_280172_(p_281945_, i, k, iterable, flag);
|
||||
this.m_280301_(p_281945_, i, k, iterable, flag);
|
||||
this.m_194002_(p_194015_, i, k, iterable, flag);
|
||||
this.m_194008_(p_194015_, i, k, iterable, flag);
|
||||
if (flag) {
|
||||
@@ -92,6 +_,11 @@
|
||||
@@ -94,6 +_,11 @@
|
||||
int i = this.f_97736_;
|
||||
|
||||
for(MobEffectInstance mobeffectinstance : p_282642_) {
|
||||
for(MobEffectInstance mobeffectinstance : p_194012_) {
|
||||
+ var renderer = net.minecraftforge.client.extensions.common.IClientMobEffectExtensions.of(mobeffectinstance);
|
||||
+ if (renderer.renderInventoryIcon(mobeffectinstance, this, p_282745_, p_282521_ + (p_281536_ ? 6 : 7), i, 0)) {
|
||||
+ i += p_282291_;
|
||||
+ if (renderer.renderInventoryIcon(mobeffectinstance, this, p_194009_, p_194010_ + (p_194013_ ? 6 : 7), i, 0)) {
|
||||
+ i += p_194011_;
|
||||
+ continue;
|
||||
+ }
|
||||
MobEffect mobeffect = mobeffectinstance.m_19544_();
|
||||
TextureAtlasSprite textureatlassprite = mobeffecttexturemanager.m_118732_(mobeffect);
|
||||
p_282745_.m_280159_(p_282521_ + (p_281536_ ? 6 : 7), i + 7, 0, 18, 18, textureatlassprite);
|
||||
@@ -104,6 +_,11 @@
|
||||
RenderSystem.m_157456_(0, textureatlassprite.m_247685_());
|
||||
@@ -107,6 +_,11 @@
|
||||
int i = this.f_97736_;
|
||||
|
||||
for(MobEffectInstance mobeffectinstance : p_281986_) {
|
||||
for(MobEffectInstance mobeffectinstance : p_98726_) {
|
||||
+ var renderer = net.minecraftforge.client.extensions.common.IClientMobEffectExtensions.of(mobeffectinstance);
|
||||
+ if (renderer.renderInventoryText(mobeffectinstance, this, p_281462_, p_283484_, i, 0)) {
|
||||
+ i += p_282057_;
|
||||
+ if (renderer.renderInventoryText(mobeffectinstance, this, p_98723_, p_98724_, i, 0)) {
|
||||
+ i += p_98725_;
|
||||
+ continue;
|
||||
+ }
|
||||
Component component = this.m_194000_(mobeffectinstance);
|
||||
p_281462_.m_280430_(this.f_96547_, component, p_283484_ + 10 + 18, i + 6, 16777215);
|
||||
this.f_96547_.m_92763_(p_98723_, component, (float)(p_98724_ + 10 + 18), (float)(i + 6), 16777215);
|
||||
Component component1 = MobEffectUtil.m_267641_(mobeffectinstance, 1.0F);
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
--- a/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/inventory/EnchantmentScreen.java
|
||||
@@ -88,7 +_,7 @@
|
||||
int l1 = 86 - this.f_96547_.m_92895_(s);
|
||||
FormattedText formattedtext = EnchantmentNames.m_98734_().m_98737_(this.f_96547_, l1);
|
||||
int i2 = 6839882;
|
||||
- if ((k < l + 1 || this.f_96541_.f_91074_.f_36078_ < k1) && !this.f_96541_.f_91074_.m_150110_().f_35937_) {
|
||||
+ if (((k < l + 1 || this.f_96541_.f_91074_.f_36078_ < k1) && !this.f_96541_.f_91074_.m_150110_().f_35937_) || this.f_97732_.f_39447_[i1] == -1) { // Forge: render buttons as disabled when enchantable but enchantability not met on lower levels
|
||||
p_282430_.m_280218_(f_98747_, i1, j + 14 + 19 * l, 0, 185, 108, 19);
|
||||
p_282430_.m_280218_(f_98747_, i1 + 1, j + 15 + 19 * l, 16 * l, 239, 16, 16);
|
||||
p_282430_.m_280554_(this.f_96547_, formattedtext, j1, j + 16 + 19 * l, l1, (i2 & 16711422) >> 1);
|
||||
@@ -150,10 +_,13 @@
|
||||
@@ -140,7 +_,7 @@
|
||||
int i2 = 86 - this.f_96547_.m_92895_(s);
|
||||
FormattedText formattedtext = EnchantmentNames.m_98734_().m_98737_(this.f_96547_, i2);
|
||||
int j2 = 6839882;
|
||||
- if ((l < i1 + 1 || this.f_96541_.f_91074_.f_36078_ < l1) && !this.f_96541_.f_91074_.m_150110_().f_35937_) {
|
||||
+ if (((l < i1 + 1 || this.f_96541_.f_91074_.f_36078_ < l1) && !this.f_96541_.f_91074_.m_150110_().f_35937_) || this.f_97732_.f_39447_[i1] == -1) { // Forge: render buttons as disabled when enchantable but enchantability not met on lower levels
|
||||
m_93228_(p_98762_, j1, j + 14 + 19 * i1, 0, 185, 108, 19);
|
||||
m_93228_(p_98762_, j1 + 1, j + 15 + 19 * i1, 16 * i1, 239, 16, 16);
|
||||
this.f_96547_.m_274535_(p_98762_, formattedtext, k1, j + 16 + 19 * i1, i2, (j2 & 16711422) >> 1);
|
||||
@@ -179,10 +_,13 @@
|
||||
Enchantment enchantment = Enchantment.m_44697_((this.f_97732_).f_39447_[j]);
|
||||
int l = (this.f_97732_).f_39448_[j];
|
||||
int i1 = j + 1;
|
||||
- if (this.m_6774_(60, 14 + 19 * j, 108, 17, (double)p_282491_, (double)p_281953_) && k > 0 && l >= 0 && enchantment != null) {
|
||||
+ if (this.m_6774_(60, 14 + 19 * j, 108, 17, (double)p_282491_, (double)p_281953_) && k > 0) {
|
||||
- if (this.m_6774_(60, 14 + 19 * j, 108, 17, (double)p_98768_, (double)p_98769_) && k > 0 && l >= 0 && enchantment != null) {
|
||||
+ if (this.m_6774_(60, 14 + 19 * j, 108, 17, (double)p_98768_, (double)p_98769_) && k > 0) {
|
||||
List<Component> list = Lists.newArrayList();
|
||||
- list.add(Component.m_237110_("container.enchant.clue", enchantment.m_44700_(l)).m_130940_(ChatFormatting.WHITE));
|
||||
- if (!flag) {
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
--- a/net/minecraft/client/gui/screens/inventory/HangingSignEditScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/inventory/HangingSignEditScreen.java
|
||||
@@ -15,7 +_,7 @@
|
||||
@@ -17,7 +_,7 @@
|
||||
private static final Vector3f f_243728_ = new Vector3f(1.0F, 1.0F, 1.0F);
|
||||
private static final int f_244604_ = 16;
|
||||
private static final int f_244207_ = 16;
|
||||
- private final ResourceLocation f_243720_ = new ResourceLocation("textures/gui/hanging_signs/" + this.f_244069_.f_61839_() + ".png");
|
||||
+ private final ResourceLocation f_243720_ = new ResourceLocation(this.f_244069_.f_61839_() + ".png").m_246208_("textures/gui/hanging_signs/");
|
||||
|
||||
public HangingSignEditScreen(SignBlockEntity p_278017_, boolean p_277942_, boolean p_277778_) {
|
||||
super(p_278017_, p_277942_, p_277778_, Component.m_237115_("hanging_sign.edit"));
|
||||
public HangingSignEditScreen(SignBlockEntity p_249425_, boolean p_250356_) {
|
||||
super(p_249425_, p_250356_, Component.m_237115_("hanging_sign.edit"));
|
||||
+4
-4
@@ -1,14 +1,14 @@
|
||||
--- a/net/minecraft/client/gui/screens/inventory/InventoryScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/inventory/InventoryScreen.java
|
||||
@@ -93,6 +_,13 @@
|
||||
public static void m_274545_(GuiGraphics p_282802_, int p_275688_, int p_275245_, int p_275535_, float p_275604_, float p_275546_, LivingEntity p_275689_) {
|
||||
@@ -98,6 +_,13 @@
|
||||
public static void m_274545_(PoseStack p_275396_, int p_275688_, int p_275245_, int p_275535_, float p_275604_, float p_275546_, LivingEntity p_275689_) {
|
||||
float f = (float)Math.atan((double)(p_275604_ / 40.0F));
|
||||
float f1 = (float)Math.atan((double)(p_275546_ / 40.0F));
|
||||
+ // Forge: Allow passing in direct angle components instead of mouse position
|
||||
+ renderEntityInInventoryFollowsAngle(p_282802_, p_275688_, p_275245_, p_275535_, f, f1, p_275689_);
|
||||
+ renderEntityInInventoryFollowsAngle(p_275396_, p_275688_, p_275245_, p_275535_, f, f1, p_275689_);
|
||||
+ }
|
||||
+
|
||||
+ public static void renderEntityInInventoryFollowsAngle(GuiGraphics p_282802_, int p_275688_, int p_275245_, int p_275535_, float angleXComponent, float angleYComponent, LivingEntity p_275689_) {
|
||||
+ public static void renderEntityInInventoryFollowsAngle(PoseStack p_275396_, int p_275688_, int p_275245_, int p_275535_, float angleXComponent, float angleYComponent, LivingEntity p_275689_) {
|
||||
+ float f = angleXComponent;
|
||||
+ float f1 = angleYComponent;
|
||||
Quaternionf quaternionf = (new Quaternionf()).rotateZ((float)Math.PI);
|
||||
|
||||
+13
-13
@@ -1,16 +1,16 @@
|
||||
--- a/net/minecraft/client/gui/screens/inventory/MerchantScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/inventory/MerchantScreen.java
|
||||
@@ -229,7 +_,12 @@
|
||||
p_281357_.m_280370_(this.f_96547_, p_283466_, p_282403_, p_283601_);
|
||||
@@ -234,7 +_,12 @@
|
||||
this.f_96542_.m_274412_(p_99163_, this.f_96547_, p_99164_, p_99166_, p_99167_);
|
||||
} else {
|
||||
p_281357_.m_280302_(this.f_96547_, p_282046_, p_282403_, p_283601_, p_282046_.m_41613_() == 1 ? "1" : null);
|
||||
- p_281357_.m_280302_(this.f_96547_, p_283466_, p_282403_ + 14, p_283601_, p_283466_.m_41613_() == 1 ? "1" : null);
|
||||
+ // Forge: fixes Forge-8806, code for count rendering taken from GuiGraphics#renderGuiItemDecorations
|
||||
+ p_281357_.m_280168_().m_85836_();
|
||||
+ p_281357_.m_280168_().m_252880_(0.0F, 0.0F, 200.0F);
|
||||
+ String count = p_283466_.m_41613_() == 1 ? "1" : String.valueOf(p_283466_.m_41613_());
|
||||
+ f_96547_.m_272078_(count, (float) (p_282403_ + 14) + 19 - 2 - f_96547_.m_92895_(count), (float)p_283601_ + 6 + 3, 0xFFFFFF, true, p_281357_.m_280168_().m_85850_().m_252922_(), p_281357_.m_280091_(), net.minecraft.client.gui.Font.DisplayMode.NORMAL, 0, 15728880, false);
|
||||
+ p_281357_.m_280168_().m_85849_();
|
||||
p_281357_.m_280168_().m_85836_();
|
||||
p_281357_.m_280168_().m_252880_(0.0F, 0.0F, 300.0F);
|
||||
p_281357_.m_280398_(f_99113_, p_282403_ + 7, p_283601_ + 12, 0, 0.0F, 176.0F, 9, 2, 512, 256);
|
||||
this.f_96542_.m_274364_(p_99163_, this.f_96547_, p_99165_, p_99166_, p_99167_, p_99165_.m_41613_() == 1 ? "1" : null);
|
||||
- this.f_96542_.m_274364_(p_99163_, this.f_96547_, p_99164_, p_99166_ + 14, p_99167_, p_99164_.m_41613_() == 1 ? "1" : null);
|
||||
+ // Forge: fixes Forge-8806, code for count rendering taken from ItemRenderer#renderGuiItemDecorations
|
||||
+ PoseStack posestack = new PoseStack();
|
||||
+ posestack.m_85837_(0.0D, 0.0D, 200F);
|
||||
+ net.minecraft.client.renderer.MultiBufferSource.BufferSource bufferSource = net.minecraft.client.renderer.MultiBufferSource.m_109898_(com.mojang.blaze3d.vertex.Tesselator.m_85913_().m_85915_());
|
||||
+ f_96547_.m_272078_(String.valueOf(p_99164_.m_41613_()), (float) (p_99166_ + 14) + 19 - 2 - f_96547_.m_92895_(String.valueOf(p_99164_.m_41613_())), (float)p_99167_ + 6 + 3, 0xFFFFFF, true, posestack.m_85850_().m_252922_(), bufferSource, net.minecraft.client.gui.Font.DisplayMode.NORMAL, 0, 15728880, false);
|
||||
+ bufferSource.m_109911_();
|
||||
RenderSystem.m_157456_(0, f_99113_);
|
||||
p_99163_.m_85836_();
|
||||
p_99163_.m_252880_(0.0F, 0.0F, 300.0F);
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/inventory/tooltip/ClientTooltipComponent.java
|
||||
+++ b/net/minecraft/client/gui/screens/inventory/tooltip/ClientTooltipComponent.java
|
||||
@@ -20,6 +_,8 @@
|
||||
@@ -21,6 +_,8 @@
|
||||
if (p_169951_ instanceof BundleTooltip) {
|
||||
return new ClientBundleTooltip((BundleTooltip)p_169951_);
|
||||
} else {
|
||||
|
||||
+32
-32
@@ -1,49 +1,49 @@
|
||||
--- a/net/minecraft/client/gui/screens/inventory/tooltip/TooltipRenderUtil.java
|
||||
+++ b/net/minecraft/client/gui/screens/inventory/tooltip/TooltipRenderUtil.java
|
||||
@@ -17,16 +_,22 @@
|
||||
@@ -18,16 +_,21 @@
|
||||
private static final int f_262743_ = 1344798847;
|
||||
|
||||
public static void m_280205_(GuiGraphics p_282666_, int p_281901_, int p_281846_, int p_281559_, int p_283336_, int p_283422_) {
|
||||
+ renderTooltipBackground(p_282666_, p_281901_, p_281846_, p_281559_, p_283336_, p_283422_, f_262744_, f_262744_, f_262725_, f_262743_);
|
||||
public static void m_262796_(TooltipRenderUtil.BlitPainter p_262929_, Matrix4f p_263052_, BufferBuilder p_263082_, int p_263046_, int p_263101_, int p_263024_, int p_262926_, int p_263038_) {
|
||||
+ renderTooltipBackground(p_262929_, p_263052_, p_263082_, p_263046_, p_263101_, p_263024_, p_262926_, p_263038_, f_262744_, f_262744_, f_262725_, f_262743_);
|
||||
+ }
|
||||
+
|
||||
+ // Forge: Allow specifying colors for the inner border gradient and a gradient instead of a single color for the background and outer border
|
||||
+ public static void renderTooltipBackground(GuiGraphics p_282666_, int p_281901_, int p_281846_, int p_281559_, int p_283336_, int p_283422_, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
|
||||
+ {
|
||||
int i = p_281901_ - 3;
|
||||
int j = p_281846_ - 3;
|
||||
int k = p_281559_ + 3 + 3;
|
||||
int l = p_283336_ + 3 + 3;
|
||||
- m_280217_(p_282666_, i, j - 1, k, p_283422_, -267386864);
|
||||
- m_280217_(p_282666_, i, j + l, k, p_283422_, -267386864);
|
||||
- m_280538_(p_282666_, i, j, k, l, p_283422_, -267386864);
|
||||
- m_280387_(p_282666_, i - 1, j, l, p_283422_, -267386864);
|
||||
- m_280387_(p_282666_, i + k, j, l, p_283422_, -267386864);
|
||||
- m_280115_(p_282666_, i, j + 1, k, l, p_283422_, 1347420415, 1344798847);
|
||||
+ m_280217_(p_282666_, i, j - 1, k, p_283422_, backgroundTop);
|
||||
+ m_280217_(p_282666_, i, j + l, k, p_283422_, backgroundBottom);
|
||||
+ renderRectangle(p_282666_, i, j, k, l, p_283422_, backgroundTop, backgroundBottom);
|
||||
+ m_280556_(p_282666_, i - 1, j, l, p_283422_, backgroundTop, backgroundBottom);
|
||||
+ m_280556_(p_282666_, i + k, j, l, p_283422_, backgroundTop, backgroundBottom);
|
||||
+ m_280115_(p_282666_, i, j + 1, k, l, p_283422_, borderTop, borderBottom);
|
||||
+ public static void renderTooltipBackground(TooltipRenderUtil.BlitPainter p_262929_, Matrix4f p_263052_, BufferBuilder p_263082_, int p_263046_, int p_263101_, int p_263024_, int p_262926_, int p_263038_, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom) {
|
||||
int i = p_263046_ - 3;
|
||||
int j = p_263101_ - 3;
|
||||
int k = p_263024_ + 3 + 3;
|
||||
int l = p_262926_ + 3 + 3;
|
||||
- m_262855_(p_262929_, p_263052_, p_263082_, i, j - 1, k, p_263038_, -267386864);
|
||||
- m_262855_(p_262929_, p_263052_, p_263082_, i, j + l, k, p_263038_, -267386864);
|
||||
- m_262805_(p_262929_, p_263052_, p_263082_, i, j, k, l, p_263038_, -267386864);
|
||||
- m_262798_(p_262929_, p_263052_, p_263082_, i - 1, j, l, p_263038_, -267386864);
|
||||
- m_262798_(p_262929_, p_263052_, p_263082_, i + k, j, l, p_263038_, -267386864);
|
||||
- m_262846_(p_262929_, p_263052_, p_263082_, i, j + 1, k, l, p_263038_, 1347420415, 1344798847);
|
||||
+ m_262855_(p_262929_, p_263052_, p_263082_, i, j - 1, k, p_263038_, backgroundTop);
|
||||
+ m_262855_(p_262929_, p_263052_, p_263082_, i, j + l, k, p_263038_, backgroundBottom);
|
||||
+ renderRectangle(p_262929_, p_263052_, p_263082_, i, j, k, l, p_263038_, backgroundTop, backgroundBottom);
|
||||
+ m_262849_(p_262929_, p_263052_, p_263082_, i - 1, j, l, p_263038_, backgroundTop, backgroundBottom);
|
||||
+ m_262849_(p_262929_, p_263052_, p_263082_, i + k, j, l, p_263038_, backgroundTop, backgroundBottom);
|
||||
+ m_262846_(p_262929_, p_263052_, p_263082_, i, j + 1, k, l, p_263038_, borderTop, borderBottom);
|
||||
}
|
||||
|
||||
private static void m_280115_(GuiGraphics p_282000_, int p_282055_, int p_281580_, int p_283284_, int p_282599_, int p_283432_, int p_282907_, int p_283153_) {
|
||||
@@ -48,7 +_,16 @@
|
||||
p_282981_.m_280046_(p_282028_, p_282141_, p_282028_ + p_281771_, p_282141_ + 1, p_282734_, p_281979_);
|
||||
private static void m_262846_(TooltipRenderUtil.BlitPainter p_262974_, Matrix4f p_263030_, BufferBuilder p_263061_, int p_262982_, int p_262912_, int p_262946_, int p_263049_, int p_263118_, int p_263104_, int p_262979_) {
|
||||
@@ -49,8 +_,17 @@
|
||||
p_262966_.m_262815_(p_263094_, p_262943_, p_262949_, p_263068_, p_262949_ + p_263111_, p_263068_ + 1, p_263095_, p_262918_, p_262918_);
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * @deprecated Forge: Use gradient overload instead
|
||||
+ */
|
||||
+ * @deprecated Forge: Use gradient overload instead
|
||||
+ */
|
||||
+ @Deprecated
|
||||
private static void m_280538_(GuiGraphics p_281392_, int p_282294_, int p_283353_, int p_282640_, int p_281964_, int p_283211_, int p_282349_) {
|
||||
- p_281392_.m_280046_(p_282294_, p_283353_, p_282294_ + p_282640_, p_283353_ + p_281964_, p_283211_, p_282349_);
|
||||
+ renderRectangle(p_281392_, p_282294_, p_283353_, p_282640_, p_281964_, p_283211_, p_282349_, p_282349_);
|
||||
private static void m_262805_(TooltipRenderUtil.BlitPainter p_262933_, Matrix4f p_263035_, BufferBuilder p_263084_, int p_262945_, int p_262955_, int p_263017_, int p_262978_, int p_262950_, int p_262931_) {
|
||||
- p_262933_.m_262815_(p_263035_, p_263084_, p_262945_, p_262955_, p_262945_ + p_263017_, p_262955_ + p_262978_, p_262950_, p_262931_, p_262931_);
|
||||
+ renderRectangle(p_262933_, p_263035_, p_263084_, p_262945_, p_262955_, p_263017_, p_262978_, p_262950_, p_262931_, p_262931_);
|
||||
+ }
|
||||
+
|
||||
+ // Forge: Allow specifying a gradient instead of a single color for the background
|
||||
+ private static void renderRectangle(GuiGraphics p_281392_, int p_282294_, int p_283353_, int p_282640_, int p_281964_, int p_283211_, int p_282349_, int colorTo) {
|
||||
+ p_281392_.m_280120_(p_282294_, p_283353_, p_282294_ + p_282640_, p_283353_ + p_281964_, p_283211_, p_282349_, colorTo);
|
||||
+ private static void renderRectangle(TooltipRenderUtil.BlitPainter p_262933_, Matrix4f p_263035_, BufferBuilder p_263084_, int p_262945_, int p_262955_, int p_263017_, int p_262978_, int p_262950_, int p_262931_, int colorTo) {
|
||||
+ p_262933_.m_262815_(p_263035_, p_263084_, p_262945_, p_262955_, p_262945_ + p_263017_, p_262955_ + p_262978_, p_262950_, p_262931_, colorTo);
|
||||
}
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/multiplayer/JoinMultiplayerScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/multiplayer/JoinMultiplayerScreen.java
|
||||
@@ -283,6 +_,11 @@
|
||||
@@ -281,6 +_,11 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -1,11 +1,11 @@
|
||||
--- a/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java
|
||||
+++ b/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java
|
||||
@@ -318,6 +_,8 @@
|
||||
@@ -330,6 +_,8 @@
|
||||
this.f_99855_.m_99707_(list1);
|
||||
}
|
||||
|
||||
+ net.minecraftforge.client.ForgeHooksClient.drawForgePingInfo(this.f_99855_, f_99857_, p_281406_, p_281363_, p_282921_, p_283596_, i1, j1);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.drawForgePingInfo(this.f_99855_, f_99857_, p_99879_, p_99882_, p_99881_, p_99883_, i1, j1);
|
||||
+
|
||||
if (this.f_99856_.f_91066_.m_231828_().m_231551_() || p_282999_) {
|
||||
p_281406_.m_280509_(p_281363_, p_282921_, p_281363_ + 32, p_282921_ + 32, -1601138544);
|
||||
int k1 = p_283567_ - p_281363_;
|
||||
if (this.f_99856_.f_91066_.m_231828_().m_231551_() || p_99887_) {
|
||||
RenderSystem.m_157456_(0, ServerSelectionList.f_99759_);
|
||||
GuiComponent.m_93172_(p_99879_, p_99882_, p_99881_, p_99882_ + 32, p_99881_ + 32, -1601138544);
|
||||
Loaded 100 of 654 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user