Compare commits

..
3 Commits
Author SHA1 Message Date
425eff39ff Update to 1.18.2
Co-authored-by: sciwhiz12 <[email protected]>
Co-authored-by: Marc Hermans <[email protected]>
Co-authored-by: LexManos <[email protected]>
Co-authored-by: Curle <[email protected]>
Signed-off-by: SizableShrimp <[email protected]>
2022-03-01 14:16:46 -08:00
sciwhiz12 34291c1fb2 1.18.x Omnibus (#8239) 2022-03-01 18:59:37 +00:00
ichttt 4011c3fb07 Bump modlauncher and securejarhandler version (#8489) 2022-02-28 14:31:10 -08:00
312 changed files with 3187 additions and 4416 deletions

No files matched your search

+1 -1
View File
@@ -33,7 +33,7 @@ project {
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.3", label = "Gradle version", description = "The version of Gradle to use during execution of Gradle tasks.", display = ParameterDisplay.HIDDEN, allowEmpty = false)
text("docker_gradle_version", "7.4", 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.18.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*)
+14 -20
View File
@@ -44,15 +44,15 @@ ext {
]
}
MAPPING_CHANNEL = 'official'
MAPPING_VERSION = '1.18.1'
MC_VERSION = '1.18.1'
MCP_VERSION = '20211210.034407'
MAPPING_VERSION = '1.18.2'
MC_VERSION = '1.18.2'
MCP_VERSION = '20220228.144236'
SPI_VERSION = '4.0.10'
ACCESSTRANSFORMERS_VERSION = '8.0.4'
COREMODS_VERSION = '5.0.1'
EVENTBUS_VERSION = '5.0.3'
MODLAUNCHER_VERSION = '9.1.0'
SECUREJARHANDLER_VERSION = '1.0.1'
MODLAUNCHER_VERSION = '9.1.3'
SECUREJARHANDLER_VERSION = '1.0.3'
BOOTSTRAPLAUNCHER_VERSION = '1.0.0'
ASM_VERSION = '9.2'
INSTALLER_VERSION = '2.1.+'
@@ -76,10 +76,14 @@ println('Version: ' + VERSION +
' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ')' +
' Arch: ' + System.getProperty('os.arch'))
changelog {
fromTag MIN_TAG_FOR_CHANGELOG
}
def extraTxts = [
rootProject.file('CREDITS.txt'),
rootProject.file('LICENSE.txt'),
rootProject.file('build/changelog.txt') //Now gets generated on build.
rootProject.tasks.createChangelog.outputFile
]
task downloadVersionManifest(type: Download) {
@@ -262,19 +266,12 @@ def sharedDeps = {
installer 'com.electronwill.night-config:core:3.6.4'
installer 'com.electronwill.night-config:toml:3.6.4'
installer 'org.apache.maven:maven-artifact:3.6.3'
installer 'org.apache.commons:commons-lang3:3.12.0'
installer 'net.jodah:typetools:0.8.3'
installer 'org.apache.logging.log4j:log4j-api:2.15.0' //TODO: Unpin in 1.18.1 or when Mojang bumps the Log4J version
installer 'org.apache.logging.log4j:log4j-core:2.15.0' //TODO: Unpin in 1.18.1 or when Mojang bumps the Log4J version
installer 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' //TODO: Unpin in 1.18.1 or when Mojang bumps the Log4J version
installer 'net.minecrell:terminalconsoleappender:1.2.0'
installer 'org.jline:jline-reader:3.12.+' //Dep of TerminaalConsoleeAppender
installer 'org.jline:jline-terminal:3.12.+' //Dep of TerminaalConsoleeAppender
installer 'net.sf.jopt-simple:jopt-simple:5.0.4'
installer "org.spongepowered:mixin:${MIXIN_VERSION}"
installer 'org.openjdk.nashorn:nashorn-core:15.3'
installer 'com.google.guava:guava:31.0.1-jre'
installer 'com.google.code.gson:gson:2.8.8'
/*
installer 'org.lwjgl:lwjgl:3.2.2'
@@ -429,7 +426,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,mclanguage,${prj.name}-"
run.property 'mergeModules', 'jna-5.8.0.jar,jna-platform-58.0.jar,java-objc-bridge-1.0.0.jar'
//run.property 'mergeModules', 'jna-5.10.0.jar,jna-platform-5.10.0.jar,java-objc-bridge-1.0.0.jar'
if (userdevRuns.contains(run)) {
run.property 'legacyClassPath.file', '{minecraft_classpath_file}'
run.jvmArgs '-p', '{modules}'
@@ -622,7 +619,7 @@ project(':fmlonly') {
'--fml.forgeGroup', project.group,
'--fml.mcpVersion', MCP_VERSION],
jvm: ["-DignoreList=${fmlonly_client.properties.ignoreList},\${version_name}.jar",
"-DmergeModules=${fmlonly_client.properties.mergeModules}",
//"-DmergeModules=${fmlonly_client.properties.mergeModules}",
'-DlibraryDirectory=${library_directory}',
'-p', Util.getArtifacts(project, configurations.moduleonly, false).values().collect{"\${library_directory}/${it.downloads.artifact.path}"}.join('${classpath_separator}'),
'--add-modules', 'ALL-MODULE-PATH',
@@ -916,6 +913,7 @@ project(':forge') {
implementation project(':fmlloader')
implementation project(':javafmllanguage')
implementation project(':mclanguage')
runtimeOnly "cpw.mods:bootstraplauncher:${BOOTSTRAPLAUNCHER_VERSION}"
}
dependencies sharedDeps
@@ -1190,7 +1188,7 @@ project(':forge') {
'--fml.forgeGroup', project.group,
'--fml.mcpVersion', MCP_VERSION],
jvm: ["-DignoreList=${forge_client.properties.ignoreList},\${version_name}.jar",
"-DmergeModules=${forge_client.properties.mergeModules}",
//"-DmergeModules=${forge_client.properties.mergeModules}",
'-DlibraryDirectory=${library_directory}',
'-p', Util.getArtifacts(project, configurations.moduleonly, false).values().collect{'${library_directory}/' + it.downloads.artifact.path}.join('${classpath_separator}'),
'--add-modules', 'ALL-MODULE-PATH',
@@ -1559,8 +1557,4 @@ if (System.env.TEAMCITY_VERSION) {
println "##teamcity[setParameter name='env.PUBLISHED_JAVA_FML_ARTIFACT_VERSION' value='${project(':fmlonly').version}']"
}
}
}
changelog {
fromTag MIN_TAG_FOR_CHANGELOG
}
-9
View File
@@ -1,9 +0,0 @@
# On the Contribution of an RF-lite Energy System: "Energy"
Forge has acquired an Energy system, after many years of debate on the topic. The prevalence of the RF API has warranted the inclusion of a similar (but simpler) implementation to forge for 1.10.2 and onwards.
Those who wish to use an RF like API, feel free to use it. If you don't want to think about Energy, but know you need it, you can use it *if you wish*. If you want to interoperate with other energy systems, feel free to use this to broker with them.
# On Diversity in Energy Systems
Forge has always supported diversity in energy-like systems. If you have a burning desire to simulate electricity flow in all it's glory, we fully support you and look forward to playing your mod. If you wish to have pneumatic power, we have no objections, and would love to see your wonderful creations. If you have a power system of your own devising that is simply beyond our imagination, please, blow us away.
# On Modder Obligations
As a modder, you are under *no* obligation to use or support the forge Energy system. If anyone, user, mod-pack maker or even us, tells you otherwise, refer them to this statement. The Forge energy system is not intended to supplant diversity in energy systems. It is not intended to be one-size-fits-all. The choice to support it, is the choice of the modder.
-127
View File
@@ -1,127 +0,0 @@
# FML
Entrypoint : ```FMLServiceProvider.onLoad```
- Verify environment
-- Check all libraries are present: ```accesstransformer```, ```coremod```, ```deobfuscator```
-- Check versions are suitable: ```modlauncher```, ```accesstransformer```, ```coremod```, ```deobfuscator```
- Find deobfuscated and patched MC
-- If not found, trigger job to generate that (loaded later at FMLLaunchProvider.launch)
Injected arguments:
- ```mods``` : CSV list of mod files to load
- ```modlist``` : JSON formatted list of mod files in a maven-like repository format
Entrypoint : ```FMLServiceProvider.initializer```
- Setup paths
-- ```mods``` folder
-- ```config``` folder
- FML config file read (JSON?)
- Trigger initial loading
Entrypoint : ```FMLLaunchProvider.launch```
- Launches the patched and deobfuscated game
- - If that wasn't found it'll be generated from the vanilla jar and patch/deobf files (see above)
- Possible we'll use an alternative launch for the development environment
(A goal is that we pre-generate this JAR during forge installation or modpack installation)
## Loading
- First we discover all mods
- - IModLocator instances present in system are found and queried to compile a master list of all mod artifacts of the three types
- LANGPROVIDERs are added to the supported language system : IModLanguageProvider
- The MODS from the list have their META-INF/mods.json file queried for mod instances to load
- - MODS are cross-referenced for their language being available
- - MODS are cross-referenced for their libraries being available
- - MODS are cross-referenced for their MOD dependencies being available
- - MODS with META-INF/coremods.json specification are loaded into the COREMOD system
- - MODS with META-INF/accesstransformer.json are loaded into the ACCESSTRANSFORMER system
- - MODS are enqueued to the background loading system
- FMLLaunchProvider will be triggered from the ModLauncher to start the game
## Game loading
- Events triggered from loadGame will launch various phases of modloading as before
-- Deprecation of old "FML" events in favour of Forge events
-- If a mod hasn't completed scanning there might be a pause waiting for it to complete before loading (testing indicates this should be a very rare occurrence and isn't worse than existing status quo where all scanning and loading is on-thread)
### ```IModLocator```
Finds mods from various sources of various types
manifest is queried for type: FMLModType
- MOD : this file will be scanned as a mod. This is default if nothing is present
- LIBRARY : this file will be added to the classpath and no further processing is done
- LANGPROVIDER : this file will be loaded as a language provider
#### ```ModsFolderLocator```
- scans for jar files from mods folder
-- able to load all types
-- loads in all environments
-- maybe able to do runtime name transformation for dev time?
Standard mechanism to find and load mods
#### ```ExplodedDirectoryLocator```
- loads a directory as a mod
-- only able to load mods
-- should only load in dev env
Intended as a mechanism to allow development of mods easily by pointing at a compiled output directory
#### ```ArgumentModsLocator``` : NYI
- loads mods from the arguments on the command line
-- able to load all types
-- loads in all environments
### ```IModLanguageProvider```
Provides mod and language provider services
- Provides a means to transform a Mod File (from the IModLocator) into a list of modcontainer objects based on mods.json
- Scanning work will be done in background threads
- Language providers can be provided as JARs via the modlocator for ease of distribution
#### ```FMLModLanguageProvider```
This is the standard Java @Mod implementation provider
- provided by default (always supported)
- All scanning for @Mod will be done in the background thread
#### ```ScalaModLanguageProvider```
This is the scala language provider. It'll be provided separately as a JAR mod download.
- API contract will need definition
Other languages? Kotlin? Alternative Scala versions? Javascript?
## Coremods
Coremods are now forcefully separated into _injection_ and _runtime_ phases.
### Injection
Injection is the act of intercepting the loading of a class and modifying the inbound class with alterations such as additions, replacements and deletions
Injections will be written using Javascript. Two functions are required: a function providing the list of injection sites, and the function to transform the injection site.
All injection sites will need to be pre-specified by the coremod in their metadata. Lookup services should be provided in the Javascript API.
Javascript API for common coremod injection tasks needs to be developed, to allow common best-practice tooling for these complex tasks.
Runtime coremod code (code that has been injected) is Java as usual.
## Background loading thread
Early in loading, a background thread is triggered which will perform scanning tasks for common resources, such as @Mod instances and other annotations. This thread will also be responsible for loading any cached resources, either those defined at build time or pre-computed from previous runs. It may also be tasked with writing those precomputed resources.
There will be a IPreLoaderJobProvider that will allow extension of the scope of these tasks
+3 -6
View File
@@ -2,15 +2,15 @@
MinecraftForge
=============
[![Stable Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Stable&prefix=1.17.1-&query=$.promos["1.17.1-recommended"]&color=brightgreen&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtc3RhciBmYS13LTE4IiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1pY29uPSJzdGFyIiBkYXRhLXByZWZpeD0iZmFzIiBmb2N1c2FibGU9ImZhbHNlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCA1NzYgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjMgMTcuOEwxOTQgMTUwLjIgNDcuOSAxNzEuNWMtMjYuMiAzLjgtMzYuNyAzNi4xLTE3LjcgNTQuNmwxMDUuNyAxMDMtMjUgMTQ1LjVjLTQuNSAyNi4zIDIzLjIgNDYgNDYuNCAzMy43TDI4OCA0MzkuNmwxMzAuNyA2OC43YzIzLjIgMTIuMiA1MC45LTcuNCA0Ni40LTMzLjdsLTI1LTE0NS41IDEwNS43LTEwM2MxOS0xOC41IDguNS01MC44LTE3LjctNTQuNkwzODIgMTUwLjIgMzE2LjcgMTcuOGMtMTEuNy0yMy42LTQ1LjYtMjMuOS01Ny40IDB6IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K)](https://files.minecraftforge.net)
[![Latest Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Latest&prefix=1.17.1-&query=$.promos["1.17.1-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=
[![Stable Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Stable&prefix=1.18-&query=$.promos["1.18-recommended"]&color=brightgreen&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtc3RhciBmYS13LTE4IiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1pY29uPSJzdGFyIiBkYXRhLXByZWZpeD0iZmFzIiBmb2N1c2FibGU9ImZhbHNlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCA1NzYgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjMgMTcuOEwxOTQgMTUwLjIgNDcuOSAxNzEuNWMtMjYuMiAzLjgtMzYuNyAzNi4xLTE3LjcgNTQuNmwxMDUuNyAxMDMtMjUgMTQ1LjVjLTQuNSAyNi4zIDIzLjIgNDYgNDYuNCAzMy43TDI4OCA0MzkuNmwxMzAuNyA2OC43YzIzLjIgMTIuMiA1MC45LTcuNCA0Ni40LTMzLjdsLTI1LTE0NS41IDEwNS43LTEwM2MxOS0xOC41IDguNS01MC44LTE3LjctNTQuNkwzODIgMTUwLjIgMzE2LjcgMTcuOGMtMTEuNy0yMy42LTQ1LjYtMjMuOS01Ny40IDB6IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K)](https://files.minecraftforge.net)
[![Latest Release](https://img.shields.io/badge/dynamic/json?url=https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json&label=Latest&prefix=1.18-&query=$.promos["1.18-latest"]&color=blue&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYnVnIGZhLXctMTYiIGFyaWEtaGlkZGVuPSJ0cnVlIiBkYXRhLWljb249ImJ1ZyIgZGF0YS1wcmVmaXg9ImZhcyIgZm9jdXNhYmxlPSJmYWxzZSIgcm9sZT0iaW1nIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUxMS45ODggMjg4LjljLS40NzggMTcuNDMtMTUuMjE3IDMxLjEtMzIuNjUzIDMxLjFINDI0djE2YzAgMjEuODY0LTQuODgyIDQyLjU4NC0xMy42IDYxLjE0NWw2MC4yMjggNjAuMjI4YzEyLjQ5NiAxMi40OTcgMTIuNDk2IDMyLjc1OCAwIDQ1LjI1NS0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDBsLTU0LjczNi01NC43MzZDMzQ1Ljg4NiA0NjcuOTY1IDMxNC4zNTEgNDgwIDI4MCA0ODBWMjM2YzAtNi42MjctNS4zNzMtMTItMTItMTJoLTI0Yy02LjYyNyAwLTEyIDUuMzczLTEyIDEydjI0NGMtMzQuMzUxIDAtNjUuODg2LTEyLjAzNS05MC42MzYtMzIuMTA4bC01NC43MzYgNTQuNzM2Yy0xMi40OTggMTIuNDk3LTMyLjc1OSAxMi40OTYtNDUuMjU2IDAtMTIuNDk2LTEyLjQ5Ny0xMi40OTYtMzIuNzU4IDAtNDUuMjU1bDYwLjIyOC02MC4yMjhDOTIuODgyIDM3OC41ODQgODggMzU3Ljg2NCA4OCAzMzZ2LTE2SDMyLjY2NkMxNS4yMyAzMjAgLjQ5MSAzMDYuMzMuMDEzIDI4OC45LS40ODQgMjcwLjgxNiAxNC4wMjggMjU2IDMyIDI1Nmg1NnYtNTguNzQ1bC00Ni42MjgtNDYuNjI4Yy0xMi40OTYtMTIuNDk3LTEyLjQ5Ni0zMi43NTggMC00NS4yNTUgMTIuNDk4LTEyLjQ5NyAzMi43NTgtMTIuNDk3IDQ1LjI1NiAwTDE0MS4yNTUgMTYwaDIyOS40ODlsNTQuNjI3LTU0LjYyN2MxMi40OTgtMTIuNDk3IDMyLjc1OC0xMi40OTcgNDUuMjU2IDAgMTIuNDk2IDEyLjQ5NyAxMi40OTYgMzIuNzU4IDAgNDUuMjU1TDQyNCAxOTcuMjU1VjI1Nmg1NmMxNy45NzIgMCAzMi40ODQgMTQuODE2IDMxLjk4OCAzMi45ek0yNTcgMGMtNjEuODU2IDAtMTEyIDUwLjE0NC0xMTIgMTEyaDIyNEMzNjkgNTAuMTQ0IDMxOC44NTYgMCAyNTcgMHoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=
)](https://files.minecraftforge.net) [![Discord](https://img.shields.io/discord/313125603924639766.svg?color=%237289da&label=Discord&logo=discord&logoColor=%237289da)](https://discord.gg/UvedJ9m) [![Support](https://img.shields.io/badge/Patreon-Support-orange.svg?logo=Patreon)](https://www.patreon.com/LexManos)
Forge is a free, open-source modding API all of your favourite mods use!
| Version | Support |
| ------------- | ------------- |
| 1.17.x | Active |
| 1.18.x | Active |
| 1.16.x | LTS |
* [Download]
@@ -18,9 +18,6 @@ Forge is a free, open-source modding API all of your favourite mods use!
* [Discord]
* [Documentation]
#### Notes:
- Introduced in 1.13 was a new FML, information found [here](NewFML.md).
# Installing Forge
Go to [the Forge website](https://files.minecraftforge.net)
+6 -11
View File
@@ -1,12 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg enable-background="new 164.072 372.466 294.41 46.56" version="1.1" viewBox="164.072 372.466 294.41 46.56" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<g fill="#DFA86A">
<polygon points="266.16 417.99 277.12 417.99 277.12 401.05 295.09 401.05 295.09 390.78 277.12 390.78 277.12 383.77 296.18 383.77 296.18 373.5 266.16 373.5"/>
<path d="m337.33 378.7c-2.103-2.057-4.629-3.64-7.51-4.704-2.743-1.015-5.786-1.528-9.041-1.528l-0.356 2e-3c-3.362 0-6.503 0.556-9.338 1.651-2.857 1.106-5.357 2.707-7.434 4.761-2.073 2.052-3.714 4.559-4.877 7.45-1.158 2.876-1.748 6.104-1.748 9.59 0 3.417 0.59 6.582 1.753 9.403 1.163 2.829 2.807 5.297 4.88 7.329 2.073 2.03 4.572 3.621 7.425 4.724 2.834 1.096 5.975 1.651 9.339 1.651h0.023c3.402-0.043 6.57-0.639 9.42-1.772 2.863-1.142 5.375-2.757 7.465-4.804 2.091-2.051 3.742-4.524 4.91-7.358 1.162-2.823 1.75-5.987 1.75-9.402 0-3.487-0.588-6.705-1.748-9.568-1.168-2.874-2.82-5.371-4.913-7.425zm-4.644 16.762c0 1.96-0.302 3.782-0.896 5.413-0.587 1.607-1.42 3.011-2.479 4.167-1.05 1.147-2.335 2.065-3.821 2.728-1.479 0.656-3.164 0.99-5.008 0.99-1.84 0-3.514-0.333-4.973-0.988-1.47-0.662-2.747-1.578-3.799-2.729-1.062-1.156-1.895-2.559-2.479-4.167-0.595-1.63-0.896-3.451-0.896-5.413 0-1.801 0.298-3.497 0.887-5.044 0.584-1.536 1.419-2.894 2.479-4.037 1.048-1.132 2.323-2.03 3.792-2.674 1.465-0.642 3.145-0.968 4.988-0.968 1.848 0 3.539 0.326 5.025 0.971 1.481 0.643 2.766 1.541 3.812 2.671 1.062 1.143 1.896 2.501 2.479 4.036 0.589 1.548 0.889 3.245 0.889 5.044z"/>
<path d="m376.27 395.65c1.902-2.327 2.867-5.221 2.867-8.603 0-2.614-0.508-4.84-1.506-6.613-0.997-1.762-2.354-3.188-4.035-4.234-1.603-0.995-3.445-1.705-5.482-2.114-1.938-0.388-3.969-0.583-6.037-0.583h-16.021v44.487h10.961v-17.282h2.35l9.447 17.282h13.127l-11.199-18.646c2.262-0.728 4.116-1.964 5.528-3.694zm-19.254-12.223h4.426c0.844 0 1.73 0.054 2.636 0.16 0.784 0.094 1.503 0.283 2.132 0.568 0.496 0.225 0.888 0.553 1.193 0.998 0.283 0.415 0.428 1.031 0.428 1.836 0 0.931-0.16 1.643-0.459 2.06-0.34 0.472-0.771 0.813-1.32 1.046-0.686 0.289-1.459 0.477-2.301 0.554-0.975 0.089-1.963 0.136-2.938 0.136h-3.795l-2e-3 -7.358z"/>
<path d="m394.82 386.38c1.05-1.132 2.325-2.03 3.793-2.674 1.464-0.642 3.144-0.968 4.988-0.968 1.843 0 3.611 0.311 5.26 0.921 1.609 0.599 2.992 1.449 4.107 2.531l1.314 1.278 8.019-8.105-1.454-1.298c-2.355-2.103-5.066-3.586-8.058-4.407-2.879-0.789-5.987-1.189-9.247-1.189-3.361 0-6.503 0.556-9.339 1.651-2.856 1.106-5.355 2.707-7.431 4.761-2.074 2.052-3.716 4.559-4.88 7.45-1.158 2.876-1.746 6.104-1.746 9.59 0 3.417 0.59 6.582 1.752 9.403 1.164 2.829 2.807 5.297 4.88 7.329 2.073 2.03 4.572 3.621 7.425 4.724 2.832 1.096 5.975 1.651 9.339 1.651 6.501 0 12.475-1.432 17.751-4.25l0.979-0.522v-23.814h-19.313v10.27h8.354v6.639c-0.871 0.397-1.834 0.709-2.881 0.933-1.5 0.314-3.127 0.478-4.83 0.478-1.841 0-3.514-0.333-4.973-0.988-1.472-0.662-2.748-1.578-3.801-2.729-1.06-1.156-1.893-2.559-2.478-4.167-0.595-1.63-0.896-3.451-0.896-5.413 0-1.801 0.299-3.497 0.887-5.044 0.586-1.54 1.421-2.897 2.479-4.041z"/>
<polygon points="437.69 407.72 437.69 400.36 456.41 400.36 456.41 390.09 437.69 390.09 437.69 383.77 457.44 383.77 457.44 373.5 426.72 373.5 426.72 417.99 458.48 417.99 458.48 407.72"/>
</g>
<path d="m243.63 379.09l-37.842-1.852 46.229-0.034v-3.727h-52.125l-1e-3 7.798v6.201c0 0.115-1.52-9.144-1.87-11.734h-4.098v13.029c0 0.123-1.753-10.888-1.939-12.264h-27.914c1.902 1.648 12.401 10.598 19.865 14.28 3.741 1.846 8.33 1.86 12.414 1.974 2.075 0.06 4.25 0.217 5.803 1.754 2.255 2.236 2.758 5.704 0.814 8.33-1.922 2.594-7.335 3.156-7.335 3.156l-4.509 5.531v6.424h10.251l0.319-6.348 8.863-6.285c-0.946 0.757-3.058 2.783-6.229 7.666-0.717 1.102-1.275 2.306-1.711 3.49 2.238-1.896 6.84-3.194 12.153-3.194 5.307 0 9.903 1.295 12.146 3.188-0.437-1.185-0.994-2.385-1.709-3.483-3.172-4.883-5.284-6.909-6.229-7.666l8.863 6.285 0.32 6.348h9.565v-6.424l-4.507-5.531s-6.675-0.425-8.423-3.156c-5.032-7.869 2.115-20.082 18.836-23.756z" fill="#1E2D41"/>
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="164.072 372.466 294.41 46.56">
<g fill="#DFA86A">
<path d="M266.16 417.99h10.96v-16.94h17.97v-10.27h-17.97v-7.01h19.06V373.5h-30.02zM337.33 378.7c-2.103-2.057-4.629-3.64-7.51-4.704-2.743-1.015-5.786-1.528-9.041-1.528l-.356.002c-3.362 0-6.503.556-9.338 1.651-2.857 1.106-5.357 2.707-7.434 4.761-2.073 2.052-3.714 4.559-4.877 7.45-1.158 2.876-1.748 6.104-1.748 9.59 0 3.417.59 6.582 1.753 9.403 1.163 2.829 2.807 5.297 4.88 7.329 2.073 2.03 4.572 3.621 7.425 4.724 2.834 1.096 5.975 1.651 9.339 1.651h.023c3.402-.043 6.57-.639 9.42-1.772 2.863-1.142 5.375-2.757 7.465-4.804 2.091-2.051 3.742-4.524 4.91-7.358 1.162-2.823 1.75-5.987 1.75-9.402 0-3.487-.588-6.705-1.748-9.568-1.168-2.874-2.82-5.371-4.913-7.425zm-4.644 16.762c0 1.96-.302 3.782-.896 5.413-.587 1.607-1.42 3.011-2.479 4.167-1.05 1.147-2.335 2.065-3.821 2.728-1.479.656-3.164.99-5.008.99-1.84 0-3.514-.333-4.973-.988-1.47-.662-2.747-1.578-3.799-2.729-1.062-1.156-1.895-2.559-2.479-4.167-.595-1.63-.896-3.451-.896-5.413 0-1.801.298-3.497.887-5.044.584-1.536 1.419-2.894 2.479-4.037 1.048-1.132 2.323-2.03 3.792-2.674 1.465-.642 3.145-.968 4.988-.968 1.848 0 3.539.326 5.025.971 1.481.643 2.766 1.541 3.812 2.671 1.062 1.143 1.896 2.501 2.479 4.036.589 1.548.889 3.245.889 5.044zM376.27 395.65c1.902-2.327 2.867-5.221 2.867-8.603 0-2.614-.508-4.84-1.506-6.613-.997-1.762-2.354-3.188-4.035-4.234-1.603-.995-3.445-1.705-5.482-2.114-1.938-.388-3.969-.583-6.037-.583h-16.021v44.487h10.961v-17.282h2.35l9.447 17.282h13.127l-11.199-18.646c2.262-.728 4.116-1.964 5.528-3.694zm-19.254-12.223h4.426c.844 0 1.73.054 2.636.16.784.094 1.503.283 2.132.568.496.225.888.553 1.193.998.283.415.428 1.031.428 1.836 0 .931-.16 1.643-.459 2.06-.34.472-.771.813-1.32 1.046-.686.289-1.459.477-2.301.554-.975.089-1.963.136-2.938.136h-3.795l-.002-7.358z"/>
<path d="M394.82 386.38c1.05-1.132 2.325-2.03 3.793-2.674 1.464-.642 3.144-.968 4.988-.968 1.843 0 3.611.311 5.26.921 1.609.599 2.992 1.449 4.107 2.531l1.314 1.278 8.019-8.105-1.454-1.298c-2.355-2.103-5.066-3.586-8.058-4.407-2.879-.789-5.987-1.189-9.247-1.189-3.361 0-6.503.556-9.339 1.651-2.856 1.106-5.355 2.707-7.431 4.761-2.074 2.052-3.716 4.559-4.88 7.45-1.158 2.876-1.746 6.104-1.746 9.59 0 3.417.59 6.582 1.752 9.403 1.164 2.829 2.807 5.297 4.88 7.329 2.073 2.03 4.572 3.621 7.425 4.724 2.832 1.096 5.975 1.651 9.339 1.651 6.501 0 12.475-1.432 17.751-4.25l.979-.522v-23.814h-19.313v10.27h8.354v6.639c-.871.397-1.834.709-2.881.933-1.5.314-3.127.478-4.83.478-1.841 0-3.514-.333-4.973-.988-1.472-.662-2.748-1.578-3.801-2.729-1.06-1.156-1.893-2.559-2.478-4.167-.595-1.63-.896-3.451-.896-5.413 0-1.801.299-3.497.887-5.044.586-1.54 1.421-2.897 2.479-4.041zM437.69 407.72v-7.36h18.72v-10.27h-18.72v-6.32h19.75V373.5h-30.72v44.49h31.76v-10.27z"/>
</g>
<path fill="#1E2D41" d="m243.63 379.09-37.842-1.852 46.229-.034v-3.727h-52.125l-.001 7.798v6.201c0 .115-1.52-9.144-1.87-11.734h-4.098v13.029c0 .123-1.753-10.888-1.939-12.264H164.07c1.902 1.648 12.401 10.598 19.865 14.28 3.741 1.846 8.33 1.86 12.414 1.974 2.075.06 4.25.217 5.803 1.754 2.255 2.236 2.758 5.704.814 8.33-1.922 2.594-7.335 3.156-7.335 3.156l-4.509 5.531v6.424h10.251l.319-6.348 8.863-6.285c-.946.757-3.058 2.783-6.229 7.666-.717 1.102-1.275 2.306-1.711 3.49 2.238-1.896 6.84-3.194 12.153-3.194 5.307 0 9.903 1.295 12.146 3.188-.437-1.185-.994-2.385-1.709-3.483-3.172-4.883-5.284-6.909-6.229-7.666l8.863 6.285.32 6.348h9.565v-6.424l-4.507-5.531s-6.675-.425-8.423-3.156c-5.032-7.869 2.115-20.082 18.836-23.756z"/>
</svg>

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

+9 -8
View File
@@ -11,23 +11,24 @@ configurations.forEach{ it.transitive = false }
dependencies {
implementation('net.sf.jopt-simple:jopt-simple:5.0.4')
compileOnly('org.jetbrains:annotations:21.0.0')
compileOnly('org.jetbrains:annotations:23.0.0')
api("org.ow2.asm:asm:${ASM_VERSION}")
api("org.ow2.asm:asm-tree:${ASM_VERSION}")
api("org.ow2.asm:asm-commons:${ASM_VERSION}")
api('net.minecraftforge:forgespi:4.0.+')
api('org.apache.logging.log4j:log4j-api:2.14.1')
api('org.apache.logging.log4j:log4j-api:2.17.0')
api('org.slf4j:slf4j-api:1.8.0-beta4')
api('com.google.guava:guava:21.0')
api('com.google.code.gson:gson:2.8.0')
api('com.google.code.gson:gson:2.8.9')
api('org.apache.maven:maven-artifact:3.8.1')
api('org.apache.commons:commons-lang3:3.8.1')
api('com.electronwill.night-config:core:3.6.3')
api('com.electronwill.night-config:toml:3.6.3')
api('org.apache.commons:commons-lang3:3.12.0')
api('com.electronwill.night-config:core:3.6.4')
api('com.electronwill.night-config:toml:3.6.4')
api('cpw.mods:modlauncher:9.0.+')
api('net.minecraftforge:coremods:5.0.+')
implementation("cpw.mods:securejarhandler:${SECUREJARHANDLER_VERSION}")
implementation('org.apache.logging.log4j:log4j-core:2.14.1')
annotationProcessor('org.apache.logging.log4j:log4j-core:2.14.1')
implementation('org.apache.logging.log4j:log4j-core:2.17.0')
annotationProcessor('org.apache.logging.log4j:log4j-core:2.17.0')
implementation('net.minecraftforge:accesstransformers:8.0.4')
implementation('net.minecrell:terminalconsoleappender:1.2.0')
// implementation('org.jline:jline:3.12.+')
@@ -0,0 +1,37 @@
package net.minecraftforge.fml.loading.log4j;
import cpw.mods.modlauncher.api.NamedPath;
import cpw.mods.modlauncher.serviceapi.ILaunchPluginService;
import org.objectweb.asm.Type;
import org.slf4j.LoggerFactory;
import java.util.EnumSet;
public class SLF4JFixerLaunchPluginService implements ILaunchPluginService {
private static final EnumSet<Phase> NO_PHASES = EnumSet.noneOf(Phase.class);
@Override
public String name() {
return "slf4jfixer";
}
@Override
public EnumSet<Phase> handlesClass(Type classType, boolean isEmpty) {
return NO_PHASES;
}
@Override
public void initializeLaunch(ITransformerLoader transformerLoader, NamedPath[] specialPaths) {
Thread curThread = Thread.currentThread();
ClassLoader contextClassLoader = curThread.getContextClassLoader();
// Set the CCL of the current thread to MC-BOOTSTRAP ModuleClassLoader
curThread.setContextClassLoader(this.getClass().getClassLoader());
// Force SLF4J to bind the service providers while we manually set the context classloader to be correct
LoggerFactory.getILoggerFactory();
// Set CCL back to TransformingClassLoader
curThread.setContextClassLoader(contextClassLoader);
}
}
@@ -51,7 +51,6 @@ public class BackgroundScanHandler
private ScanStatus status;
private LoadingModList loadingModList;
@SuppressWarnings("UnstableApiUsage")
public BackgroundScanHandler(final List<ModFile> modFiles) {
this.modFiles = modFiles;
modContentScanner = Executors.newSingleThreadExecutor(r -> {
@@ -1,3 +1,4 @@
net.minecraftforge.fml.loading.log4j.SLF4JFixerLaunchPluginService
net.minecraftforge.fml.loading.RuntimeDistCleaner
net.minecraftforge.fml.common.asm.RuntimeEnumExtender
net.minecraftforge.fml.common.asm.ObjectHolderDefinalize
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+13 -24
View File
@@ -8,10 +8,13 @@ buildscript {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
}
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
plugins {
id 'eclipse'
id 'maven-publish'
}
apply plugin: 'net.minecraftforge.gradle'
version = '1.0'
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
@@ -20,17 +23,19 @@ archivesBaseName = 'modid'
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
minecraft {
// The mappings can be changed at any time and must be in the following format.
// Channel: Version:
// snapshot YYYYMMDD Snapshot are built nightly.
// stable # Stables are built at the discretion of the MCP team.
// official MCVersion Official field/method names from Mojang mapping files
// official MCVersion Official field/method names from Mojang mapping files
// parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official
//
// You must be aware of the Mojang license when using the 'official' mappings.
// You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
//
// Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
// Additional setup is needed to use their mappings: https://github.com/ParchmentMC/Parchment/wiki/Getting-Started
//
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: '@MAPPING_CHANNEL@', version: '@MAPPING_VERSION@'
@@ -68,16 +73,8 @@ minecraft {
server {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'REGISTRIES'
// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
@@ -121,16 +118,8 @@ minecraft {
data {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'REGISTRIES'
// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
@@ -1,5 +1,6 @@
package com.example.examplemod;
import com.mojang.logging.LogUtils;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraftforge.common.MinecraftForge;
@@ -12,8 +13,7 @@ import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent;
import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.slf4j.Logger;
import java.util.stream.Collectors;
@@ -21,10 +21,11 @@ import java.util.stream.Collectors;
@Mod("examplemod")
public class ExampleMod
{
// Directly reference a log4j logger.
private static final Logger LOGGER = LogManager.getLogger();
// Directly reference a slf4j logger
private static final Logger LOGGER = LogUtils.getLogger();
public ExampleMod() {
public ExampleMod()
{
// Register the setup method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
// Register the enqueueIMC method for modloading
@@ -45,31 +46,35 @@ public class ExampleMod
private void enqueueIMC(final InterModEnqueueEvent event)
{
// some example code to dispatch IMC to another mod
// Some example code to dispatch IMC to another mod
InterModComms.sendTo("examplemod", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";});
}
private void processIMC(final InterModProcessEvent event)
{
// some example code to receive and process InterModComms from other mods
// Some example code to receive and process InterModComms from other mods
LOGGER.info("Got IMC {}", event.getIMCStream().
map(m->m.messageSupplier().get()).
collect(Collectors.toList()));
}
// You can use SubscribeEvent and let the Event Bus discover methods to call
@SubscribeEvent
public void onServerStarting(ServerStartingEvent event) {
// do something when the server starts
public void onServerStarting(ServerStartingEvent event)
{
// Do something when the server starts
LOGGER.info("HELLO from server starting");
}
// You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD
// Event bus for receiving Registry Events)
@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
public static class RegistryEvents {
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public static class RegistryEvents
{
@SubscribeEvent
public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
// register a new block here
public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent)
{
// Register a new block here
LOGGER.info("HELLO from Register Block");
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"pack": {
"description": "examplemod resources",
"pack_format": 8
"pack_format": 9
}
}
@@ -1,15 +1,15 @@
--- a/com/mojang/blaze3d/vertex/VertexConsumer.java
+++ b/com/mojang/blaze3d/vertex/VertexConsumer.java
@@ -16,7 +_,7 @@
@@ -14,7 +_,7 @@
import org.lwjgl.system.MemoryStack;
@OnlyIn(Dist.CLIENT)
-public interface VertexConsumer {
+public interface VertexConsumer extends net.minecraftforge.client.extensions.IForgeVertexConsumer {
Logger f_85943_ = LogManager.getLogger();
VertexConsumer m_5483_(double p_85945_, double p_85946_, double p_85947_);
@@ -105,11 +_,12 @@
VertexConsumer m_6122_(int p_85973_, int p_85974_, int p_85975_, int p_85976_);
@@ -101,11 +_,12 @@
f5 = afloat[k] * p_86001_;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/SharedConstants.java
+++ b/net/minecraft/SharedConstants.java
@@ -184,6 +_,7 @@
@@ -183,6 +_,7 @@
}
static {
@@ -1,6 +1,6 @@
--- a/net/minecraft/Util.java
+++ b/net/minecraft/Util.java
@@ -158,6 +_,9 @@
@@ -155,6 +_,9 @@
return 255;
}
@@ -10,7 +10,7 @@
public static ExecutorService m_183988_() {
return f_137443_;
}
@@ -236,7 +_,7 @@
@@ -233,7 +_,7 @@
try {
type = DataFixers.m_14512_().getSchema(DataFixUtils.makeKey(SharedConstants.m_183709_().getWorldVersion())).getChoiceType(p_137552_, p_137553_);
} catch (IllegalArgumentException illegalargumentexception) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/advancements/critereon/ItemPredicate.java
+++ b/net/minecraft/advancements/critereon/ItemPredicate.java
@@ -29,6 +_,8 @@
@@ -28,6 +_,8 @@
import net.minecraft.world.level.ItemLike;
public class ItemPredicate {
@@ -8,8 +8,8 @@
+ private static final Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> unmod_predicates = java.util.Collections.unmodifiableMap(custom_predicates);
public static final ItemPredicate f_45028_ = new ItemPredicate();
@Nullable
private final Tag<Item> f_45029_;
@@ -108,6 +_,11 @@
private final TagKey<Item> f_45029_;
@@ -107,6 +_,11 @@
public static ItemPredicate m_45051_(@Nullable JsonElement p_45052_) {
if (p_45052_ != null && !p_45052_.isJsonNull()) {
JsonObject jsonobject = GsonHelper.m_13918_(p_45052_, "item");
@@ -21,7 +21,7 @@
MinMaxBounds.Ints minmaxbounds$ints = MinMaxBounds.Ints.m_55373_(jsonobject.get("count"));
MinMaxBounds.Ints minmaxbounds$ints1 = MinMaxBounds.Ints.m_55373_(jsonobject.get("durability"));
if (jsonobject.has("data")) {
@@ -219,6 +_,14 @@
@@ -214,6 +_,14 @@
} else {
return new ItemPredicate[0];
}
@@ -1,13 +1,13 @@
--- a/net/minecraft/client/Minecraft.java
+++ b/net/minecraft/client/Minecraft.java
@@ -254,7 +_,7 @@
import org.lwjgl.util.tinyfd.TinyFileDialogs;
@@ -252,7 +_,7 @@
import org.slf4j.Logger;
@OnlyIn(Dist.CLIENT)
-public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements WindowEventHandler {
+public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements WindowEventHandler, net.minecraftforge.client.extensions.IForgeMinecraft {
private static Minecraft f_90981_;
private static final Logger f_90982_ = LogManager.getLogger();
private static final Logger f_90982_ = LogUtils.getLogger();
public static final boolean f_91002_ = Util.m_137581_() == Util.OS.OSX;
@@ -394,14 +_,13 @@
this.f_91029_ = p_91084_.f_101908_.f_101928_;
@@ -44,7 +44,7 @@
@@ -456,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 SimpleReloadableResourceManager(PackType.CLIENT_RESOURCES);
this.f_91036_ = new ReloadableResourceManager(PackType.CLIENT_RESOURCES);
+ net.minecraftforge.client.loading.ClientModLoader.begin(this, this.f_91038_, this.f_91036_, this.f_91037_);
this.f_91038_.m_10506_();
this.f_91066_.m_92145_(this.f_91038_);
@@ -57,17 +57,17 @@
this.f_91036_.m_7217_(this.f_91061_);
this.f_91053_ = new PaintingTextureManager(this.f_90987_);
this.f_91036_.m_7217_(this.f_91053_);
@@ -511,7 +_,8 @@
this.f_91036_.m_7217_(this.f_91054_);
@@ -512,7 +_,8 @@
this.f_91047_ = new GpuWarnlistManager();
this.f_91036_.m_7217_(this.f_91047_);
this.f_91036_.m_7217_(this.f_205120_);
- this.f_91065_ = new Gui(this);
+ this.f_91065_ = new net.minecraftforge.client.gui.ForgeIngameGui(this);
+ this.f_91067_.m_91524_(this.f_90990_.m_85439_()); //Forge: Moved below ingameGUI setting to prevent NPEs in handeler.
this.f_91064_ = new DebugRenderer(this);
RenderSystem.m_69900_(this::m_91113_);
if (this.f_91042_.f_83915_ == this.f_90990_.m_85441_() && this.f_91042_.f_83916_ == this.f_90990_.m_85442_()) {
@@ -529,6 +_,11 @@
@@ -530,6 +_,11 @@
TinyFileDialogs.tinyfd_messageBox("Minecraft", stringbuilder.toString(), "ok", "error", false);
}
@@ -79,7 +79,7 @@
this.f_90990_.m_85409_(this.f_91066_.f_92041_);
this.f_90990_.m_85424_(this.f_91066_.f_92034_);
this.f_90990_.m_85426_();
@@ -544,13 +_,16 @@
@@ -545,13 +_,16 @@
}
this.f_167847_.m_168556_();
@@ -101,7 +101,7 @@
}
@@ -585,6 +_,8 @@
@@ -594,6 +_,8 @@
private UserApiService m_193585_(YggdrasilAuthenticationService p_193586_, GameConfig p_193587_) {
try {
@@ -110,25 +110,16 @@
return p_193586_.createUserApiService(p_193587_.f_101905_.f_101942_.m_92547_());
} catch (AuthenticationException authenticationexception) {
f_90982_.error("Failed to verify authentication", (Throwable)authenticationexception);
@@ -597,7 +_,7 @@
@@ -606,7 +_,7 @@
}
private void m_91239_(Throwable p_91240_) {
- if (this.f_91038_.m_10523_().size() > 1) {
+ if (this.f_91038_.m_10524_().stream().anyMatch(e -> !e.m_10449_())) { //Forge: This caused infinite loop if any resource packs are forced. Such as mod resources. So check if we can disable any.
Component component;
if (p_91240_ instanceof SimpleReloadableResourceManager.ResourcePackLoadingFailure) {
component = new TextComponent(((SimpleReloadableResourceManager.ResourcePackLoadingFailure)p_91240_).m_10921_().m_8017_());
@@ -691,7 +_,7 @@
return Stream.of(Registry.f_122827_.m_7981_(p_91317_.m_41720_()));
});
ReloadableIdSearchTree<ItemStack> reloadableidsearchtree = new ReloadableIdSearchTree<>((p_91121_) -> {
- return ItemTags.m_13193_().m_13394_(p_91121_.m_41720_()).stream();
+ return p_91121_.m_41720_().getTags().stream();
});
NonNullList<ItemStack> nonnulllist = NonNullList.m_122779_();
@@ -761,13 +_,13 @@
this.m_91241_(p_91240_, (Component)null);
} else {
Util.m_137559_(p_91240_);
@@ -763,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_());
@@ -145,7 +136,7 @@
}
}
@@ -877,10 +_,6 @@
@@ -879,10 +_,6 @@
f_90982_.error("setScreen called from non-game thread");
}
@@ -156,7 +147,7 @@
if (p_91153_ == null && this.f_91073_ == null) {
p_91153_ = new TitleScreen();
} else if (p_91153_ == null && this.f_91074_.m_21224_()) {
@@ -891,6 +_,15 @@
@@ -893,6 +_,15 @@
}
}
@@ -172,7 +163,7 @@
this.f_91080_ = p_91153_;
BufferUploader.m_166835_();
if (p_91153_ != null) {
@@ -1019,11 +_,13 @@
@@ -1022,11 +_,13 @@
RenderSystem.m_69481_();
this.f_91026_.m_7238_();
if (!this.f_91079_) {
@@ -186,7 +177,7 @@
}
if (this.f_91056_ != null) {
@@ -1129,10 +_,12 @@
@@ -1132,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_());
@@ -199,7 +190,7 @@
this.f_91063_.m_109097_(this.f_90990_.m_85441_(), this.f_90990_.m_85442_());
this.f_91067_.m_91599_();
}
@@ -1429,11 +_,21 @@
@@ -1432,11 +_,21 @@
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_();
@@ -223,36 +214,36 @@
}
}
@@ -1452,6 +_,8 @@
@@ -1460,6 +_,8 @@
return false;
} else {
boolean flag = false;
+ net.minecraftforge.client.event.InputEvent.ClickInputEvent inputEvent = net.minecraftforge.client.ForgeHooksClient.onClickInput(0, this.f_91066_.f_92096_, InteractionHand.MAIN_HAND);
+ if (!inputEvent.isCanceled())
switch(this.f_91077_.m_6662_()) {
case ENTITY:
this.f_91072_.m_105223_(this.f_91074_, ((EntityHitResult)this.f_91077_).m_82443_());
@@ -1467,7 +_,7 @@
case BLOCK:
BlockHitResult blockhitresult = (BlockHitResult)this.f_91077_;
BlockPos blockpos = blockhitresult.m_82425_();
- if (!this.f_91073_.m_8055_(blockpos).m_60795_()) {
+ if (!this.f_91073_.m_46859_(blockpos)) {
this.f_91072_.m_105269_(blockpos, blockhitresult.m_82434_());
if (this.f_91073_.m_8055_(blockpos).m_60795_()) {
flag = true;
@@ -1480,8 +_,10 @@
}
} else if (!this.f_91074_.m_108637_()) {
+ net.minecraftforge.client.event.InputEvent.ClickInputEvent inputEvent = net.minecraftforge.client.ForgeHooksClient.onClickInput(0, this.f_91066_.f_92096_, InteractionHand.MAIN_HAND);
+ if (!inputEvent.isCanceled())
switch(this.f_91077_.m_6662_()) {
case ENTITY:
this.f_91072_.m_105223_(this.f_91074_, ((EntityHitResult)this.f_91077_).m_82443_());
@@ -1459,7 +_,7 @@
case BLOCK:
BlockHitResult blockhitresult = (BlockHitResult)this.f_91077_;
BlockPos blockpos = blockhitresult.m_82425_();
- if (!this.f_91073_.m_8055_(blockpos).m_60795_()) {
+ if (!this.f_91073_.m_46859_(blockpos)) {
this.f_91072_.m_105269_(blockpos, blockhitresult.m_82434_());
break;
}
@@ -1469,8 +_,10 @@
}
this.f_91074_.m_36334_();
+ net.minecraftforge.common.ForgeHooks.onEmptyLeftClick(this.f_91074_);
}
+ if (inputEvent.shouldSwingHand())
this.f_91074_.m_6674_(InteractionHand.MAIN_HAND);
this.f_91074_.m_36334_();
+ net.minecraftforge.common.ForgeHooks.onEmptyLeftClick(this.f_91074_);
}
+ if (inputEvent.shouldSwingHand())
this.f_91074_.m_6674_(InteractionHand.MAIN_HAND);
return flag;
}
@@ -1485,6 +_,11 @@
@@ -1496,6 +_,11 @@
}
for(InteractionHand interactionhand : InteractionHand.values()) {
@@ -264,7 +255,7 @@
ItemStack itemstack = this.f_91074_.m_21120_(interactionhand);
if (this.f_91077_ != null) {
switch(this.f_91077_.m_6662_()) {
@@ -1502,6 +_,7 @@
@@ -1513,6 +_,7 @@
if (interactionresult.m_19077_()) {
if (interactionresult.m_19080_()) {
@@ -272,7 +263,7 @@
this.f_91074_.m_6674_(interactionhand);
}
@@ -1514,6 +_,7 @@
@@ -1525,6 +_,7 @@
InteractionResult interactionresult1 = this.f_91072_.m_105262_(this.f_91074_, this.f_91073_, interactionhand, blockhitresult);
if (interactionresult1.m_19077_()) {
if (interactionresult1.m_19080_()) {
@@ -280,7 +271,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);
@@ -1529,6 +_,9 @@
@@ -1540,6 +_,9 @@
}
}
@@ -290,7 +281,7 @@
if (!itemstack.m_41619_()) {
InteractionResult interactionresult2 = this.f_91072_.m_105235_(this.f_91074_, this.f_91073_, interactionhand);
if (interactionresult2.m_19077_()) {
@@ -1555,6 +_,8 @@
@@ -1566,6 +_,8 @@
--this.f_91011_;
}
@@ -299,7 +290,7 @@
this.f_91026_.m_6180_("gui");
this.f_91065_.m_193832_(this.f_91012_);
this.f_91026_.m_7238_();
@@ -1683,6 +_,8 @@
@@ -1694,6 +_,8 @@
this.f_91026_.m_6182_("keyboard");
this.f_91068_.m_90931_();
this.f_91026_.m_7238_();
@@ -308,72 +299,73 @@
}
private boolean m_91278_() {
@@ -1821,11 +_,12 @@
@@ -1814,11 +_,11 @@
}
public void m_91200_(String p_91201_) {
- this.m_91219_(p_91201_, RegistryAccess.m_123086_(), Minecraft::m_91133_, Minecraft::m_91135_, false, Minecraft.ExperimentalDialogType.BACKUP);
+ // We need to delay the call to RegistryAccess.builtin() as long as possible, in order to allow our world persistence hooks to run. So we pass in null here, and fix it later, only in the case where creating = false
+ this.doLoadLevel(p_91201_, null, Minecraft::m_91133_, Minecraft::m_91135_, false, Minecraft.ExperimentalDialogType.BACKUP, false);
- this.m_205205_(p_91201_, WorldStem.DataPackConfigSupplier::m_206928_, WorldStem.WorldDataSupplier::m_206954_, false, Minecraft.ExperimentalDialogType.BACKUP);
+ this.doLoadLevel(p_91201_, WorldStem.DataPackConfigSupplier::m_206928_, WorldStem.WorldDataSupplier::m_206954_, false, Minecraft.ExperimentalDialogType.BACKUP, false);
}
public void m_91202_(String p_91203_, LevelSettings p_91204_, RegistryAccess.RegistryHolder p_91205_, WorldGenSettings p_91206_) {
- this.m_91219_(p_91203_, p_91205_, (p_167869_) -> {
+ this.doLoadLevel(p_91203_, p_91205_, (p_91129_) -> {
return p_91204_.m_46934_();
}, (p_167886_, p_167887_, p_167888_, p_167889_) -> {
RegistryWriteOps<JsonElement> registrywriteops = RegistryWriteOps.m_135767_(JsonOps.INSTANCE, p_91205_);
@@ -1835,10 +_,10 @@
});
WorldGenSettings worldgensettings = dataresult.resultOrPartial(Util.m_137489_("Error reading worldgen settings after loading data packs: ", f_90982_::error)).orElse(p_91206_);
return new PrimaryLevelData(p_91204_, worldgensettings, dataresult.lifecycle());
public void m_205185_(String p_205186_, LevelSettings p_205187_, RegistryAccess p_205188_, WorldGenSettings p_205189_) {
- this.m_205205_(p_205186_, (p_210684_) -> {
+ this.doLoadLevel(p_205186_, (p_210684_) -> {
return p_205187_::m_46934_;
}, (p_210718_) -> {
return (p_210712_, p_210713_) -> {
@@ -1831,10 +_,10 @@
WorldGenSettings worldgensettings = dataresult.getOrThrow(false, Util.m_137489_("Error reading worldgen settings after loading data packs: ", f_90982_::error));
return Pair.of(new PrimaryLevelData(p_205187_, worldgensettings, dataresult.lifecycle()), registryaccess$writable.m_203557_());
};
- }, false, Minecraft.ExperimentalDialogType.CREATE);
+ }, false, Minecraft.ExperimentalDialogType.CREATE, true);
}
- private void m_91219_(String p_91220_, RegistryAccess.RegistryHolder p_91221_, Function<LevelStorageSource.LevelStorageAccess, DataPackConfig> p_91222_, Function4<LevelStorageSource.LevelStorageAccess, RegistryAccess.RegistryHolder, ResourceManager, DataPackConfig, WorldData> p_91223_, boolean p_91224_, Minecraft.ExperimentalDialogType p_91225_) {
+ private void doLoadLevel(String p_91220_, RegistryAccess.RegistryHolder p_91221_, Function<LevelStorageSource.LevelStorageAccess, DataPackConfig> p_91222_, Function4<LevelStorageSource.LevelStorageAccess, RegistryAccess.RegistryHolder, ResourceManager, DataPackConfig, WorldData> p_91223_, boolean p_91224_, Minecraft.ExperimentalDialogType p_91225_, boolean creating) {
- private void m_205205_(String p_205206_, Function<LevelStorageSource.LevelStorageAccess, WorldStem.DataPackConfigSupplier> p_205207_, Function<LevelStorageSource.LevelStorageAccess, WorldStem.WorldDataSupplier> p_205208_, boolean p_205209_, Minecraft.ExperimentalDialogType p_205210_) {
+ private void doLoadLevel(String p_205206_, Function<LevelStorageSource.LevelStorageAccess, WorldStem.DataPackConfigSupplier> p_205207_, Function<LevelStorageSource.LevelStorageAccess, WorldStem.WorldDataSupplier> p_205208_, boolean p_205209_, Minecraft.ExperimentalDialogType p_205210_, boolean creating) {
LevelStorageSource.LevelStorageAccess levelstoragesource$levelstorageaccess;
try {
levelstoragesource$levelstorageaccess = this.f_91031_.m_78260_(p_91220_);
@@ -1850,12 +_,15 @@
}
levelstoragesource$levelstorageaccess = this.f_91031_.m_78260_(p_205206_);
@@ -1849,11 +_,18 @@
Minecraft.ServerStem minecraft$serverstem;
+ final RegistryAccess.RegistryHolder registryHolder;
WorldStem worldstem;
try {
- minecraft$serverstem = this.m_91190_(p_91221_, p_91222_, p_91223_, p_91224_, levelstoragesource$levelstorageaccess);
+ if (!creating) levelstoragesource$levelstorageaccess.readAdditionalLevelSaveData();
+
+ //TODO-PATCHING: World loading has changed massively. Figure out what calls need to be delayed.
+ /*if (!creating) levelstoragesource$levelstorageaccess.readAdditionalLevelSaveData();
+ registryHolder = creating ? p_91221_ : RegistryAccess.m_123086_();
+ minecraft$serverstem = this.m_91190_(registryHolder, p_91222_, p_91223_, p_91224_, levelstoragesource$levelstorageaccess);
+*/
+
worldstem = this.m_205125_(packrepository, p_205209_, p_205207_.apply(levelstoragesource$levelstorageaccess), p_205208_.apply(levelstoragesource$levelstorageaccess));
} catch (Exception exception) {
f_90982_.warn("Failed to load datapacks, can't proceed with server load", (Throwable)exception);
this.m_91152_(new DatapackLoadFailureScreen(() -> {
- this.m_91219_(p_91220_, p_91221_, p_91222_, p_91223_, true, p_91225_);
+ this.doLoadLevel(p_91220_, p_91221_, p_91222_, p_91223_, true, p_91225_, creating);
- this.m_205205_(p_205206_, p_205207_, p_205208_, true, p_205210_);
+ this.doLoadLevel(p_205206_, p_205207_, p_205208_, true, p_205210_, creating);
}));
try {
@@ -1875,7 +_,7 @@
this.f_90999_.set((StoringChunkProgressListener)null);
try {
- levelstoragesource$levelstorageaccess.m_78287_(p_91221_, worlddata);
+ levelstoragesource$levelstorageaccess.m_78287_(registryHolder, worlddata);
minecraft$serverstem.m_91433_().m_136179_();
RegistryAccess.Frozen registryaccess$frozen = worldstem.f_206894_();
- levelstoragesource$levelstorageaccess.m_78287_(registryaccess$frozen, worlddata);
+ levelstoragesource$levelstorageaccess.m_78287_(registryaccess$frozen, worlddata); //TODO-PATCHING: Figure out what registry access needs to be passed in here.
worldstem.m_206901_();
YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(this.f_91030_);
MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
@@ -1885,7 +_,7 @@
SkullBlockEntity.m_196700_(gameprofilecache, minecraftsessionservice, this);
GameProfileCache.m_11004_(false);
this.f_91007_ = MinecraftServer.m_129872_((p_167898_) -> {
- return new IntegratedServer(p_167898_, this, p_91221_, levelstoragesource$levelstorageaccess, minecraft$serverstem.m_91432_(), minecraft$serverstem.m_91433_(), worlddata, minecraftsessionservice, gameprofilerepository, gameprofilecache, (p_168000_) -> {
+ return new IntegratedServer(p_167898_, this, registryHolder, levelstoragesource$levelstorageaccess, minecraft$serverstem.m_91432_(), minecraft$serverstem.m_91433_(), worlddata, minecraftsessionservice, gameprofilerepository, gameprofilecache, (p_168000_) -> {
StoringChunkProgressListener storingchunkprogresslistener = new StoringChunkProgressListener(p_168000_ + 0);
this.f_91007_ = MinecraftServer.m_129872_((p_210695_) -> {
- return new IntegratedServer(p_210695_, this, levelstoragesource$levelstorageaccess, packrepository, worldstem, minecraftsessionservice, gameprofilerepository, gameprofilecache, (p_210795_) -> {
+ return new IntegratedServer(p_210695_, this, levelstoragesource$levelstorageaccess, packrepository, worldstem, minecraftsessionservice, gameprofilerepository, gameprofilecache, (p_210795_) -> { //TODO-PATCHING: Handle the registry freeze delay again.
StoringChunkProgressListener storingchunkprogresslistener = new StoringChunkProgressListener(p_210795_ + 0);
this.f_90999_.set(storingchunkprogresslistener);
return ProcessorChunkProgressListener.m_143583_(storingchunkprogresslistener, this.f_91023_::add);
@@ -1929,11 +_,16 @@
connection.m_129505_(new ClientHandshakePacketListenerImpl(connection, this, (Screen)null, (p_167998_) -> {
connection.m_129505_(new ClientHandshakePacketListenerImpl(connection, this, (Screen)null, (p_210793_) -> {
}));
connection.m_129512_(new ClientIntentionPacket(socketaddress.toString(), 0, ConnectionProtocol.LOGIN));
- connection.m_129512_(new ServerboundHelloPacket(this.m_91094_().m_92548_()));
@@ -385,13 +377,13 @@
+ connection.m_129512_(new ServerboundHelloPacket(gameProfile));
this.f_91009_ = connection;
} else {
this.m_91143_(p_91225_, p_91220_, flag, () -> {
- this.m_91219_(p_91220_, p_91221_, p_91222_, p_91223_, p_91224_, Minecraft.ExperimentalDialogType.NONE);
+ this.doLoadLevel(p_91220_, registryHolder, p_91222_, p_91223_, p_91224_, Minecraft.ExperimentalDialogType.NONE, creating);
this.m_91143_(p_205210_, p_205206_, flag, () -> {
- this.m_205205_(p_205206_, p_205207_, p_205208_, p_205209_, Minecraft.ExperimentalDialogType.NONE);
+ this.doLoadLevel(p_205206_, p_205207_, p_205208_, p_205209_, Minecraft.ExperimentalDialogType.NONE, creating);
});
minecraft$serverstem.close();
worldstem.close();
@@ -2021,6 +_,7 @@
@@ -2026,6 +_,7 @@
}
public void m_91156_(ClientLevel p_91157_) {
@@ -399,7 +391,7 @@
ProgressScreen progressscreen = new ProgressScreen(true);
progressscreen.m_6309_(new TranslatableComponent("connect.joining"));
this.m_91362_(progressscreen);
@@ -2053,10 +_,12 @@
@@ -2058,10 +_,12 @@
IntegratedServer integratedserver = this.f_91007_;
this.f_91007_ = null;
this.f_91063_.m_109150_();
@@ -412,7 +404,7 @@
if (integratedserver != null) {
this.f_91026_.m_6180_("waitForServer");
@@ -2071,6 +_,7 @@
@@ -2076,6 +_,7 @@
this.f_91065_.m_93089_();
this.f_91008_ = null;
this.f_91010_ = false;
@@ -420,7 +412,7 @@
this.f_91004_.m_90740_();
}
@@ -2157,66 +_,9 @@
@@ -2162,66 +_,9 @@
private void m_91280_() {
if (this.f_91077_ != null && this.f_91077_.m_6662_() != HitResult.Type.MISS) {
@@ -490,7 +482,7 @@
}
}
@@ -2707,7 +_,7 @@
@@ -2713,7 +_,7 @@
return this.f_90993_;
}
@@ -499,7 +491,7 @@
int i = p_167938_.m_10374_();
Supplier<PackResources> supplier = p_167937_;
if (i <= 3) {
@@ -2718,7 +_,7 @@
@@ -2724,7 +_,7 @@
supplier = m_91352_(supplier);
}
@@ -508,7 +500,7 @@
}
private static Supplier<PackResources> m_91330_(Supplier<PackResources> p_91331_) {
@@ -2735,6 +_,14 @@
@@ -2741,6 +_,14 @@
public void m_91312_(int p_91313_) {
this.f_91051_.m_119410_(p_91313_);
@@ -63,11 +63,11 @@
@@ -135,6 +_,7 @@
}
this.f_91518_ -= (double)f1;
this.f_91518_ -= (double)i;
+ if (net.minecraftforge.client.ForgeHooksClient.onMouseScroll(this, d0)) return;
if (this.f_91503_.f_91074_.m_5833_()) {
if (this.f_91503_.f_91065_.m_93085_().m_94768_()) {
this.f_91503_.f_91065_.m_93085_().m_94769_((double)(-f1));
this.f_91503_.f_91065_.m_93085_().m_205380_(-i);
@@ -203,7 +_,9 @@
double d2 = (p_91563_ - this.f_91507_) * (double)this.f_91503_.m_91268_().m_85445_() / (double)this.f_91503_.m_91268_().m_85443_();
double d3 = (p_91564_ - this.f_91508_) * (double)this.f_91503_.m_91268_().m_85446_() / (double)this.f_91503_.m_91268_().m_85444_();
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/Options.java
+++ b/net/minecraft/client/Options.java
@@ -187,6 +_,7 @@
@@ -188,6 +_,7 @@
public boolean f_92076_;
public Options(Minecraft p_92138_, File p_92139_) {
@@ -8,7 +8,7 @@
this.f_92060_ = p_92138_;
this.f_92110_ = new File(p_92139_, "options.txt");
if (p_92138_.m_91103_() && Runtime.getRuntime().maxMemory() >= 1000000000L) {
@@ -300,10 +_,14 @@
@@ -302,10 +_,14 @@
this.f_193762_ = p_168428_.m_142682_("allowServerListing", this.f_193762_);
for(KeyMapping keymapping : this.f_92059_) {
@@ -25,7 +25,7 @@
}
}
@@ -491,6 +_,7 @@
@@ -493,6 +_,7 @@
}
public void m_92169_() {
@@ -33,7 +33,7 @@
try {
final PrintWriter printwriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(this.f_92110_), StandardCharsets.UTF_8));
@@ -639,6 +_,23 @@
@@ -641,6 +_,23 @@
}
p_92146_.m_10509_(set);
@@ -1,28 +1,10 @@
--- a/net/minecraft/client/gui/components/DebugScreenOverlay.java
+++ b/net/minecraft/client/gui/components/DebugScreenOverlay.java
@@ -363,7 +_,7 @@
list.add(this.m_94071_(entry));
}
- for(ResourceLocation resourcelocation : this.f_94030_.m_91403_().m_105148_().m_144452_(Registry.f_122901_).m_13394_(blockstate.m_60734_())) {
+ for(ResourceLocation resourcelocation : blockstate.m_60734_().getTags()) {
list.add("#" + resourcelocation);
}
}
@@ -379,7 +_,7 @@
list.add(this.m_94071_(entry1));
}
- for(ResourceLocation resourcelocation1 : this.f_94030_.m_91403_().m_105148_().m_144452_(Registry.f_122899_).m_13394_(fluidstate.m_76152_())) {
+ for(ResourceLocation resourcelocation1 : fluidstate.m_76152_().getTags()) {
list.add("#" + resourcelocation1);
}
}
@@ -389,6 +_,7 @@
@@ -399,6 +_,7 @@
list.add("");
list.add(ChatFormatting.UNDERLINE + "Targeted Entity");
list.add(String.valueOf((Object)Registry.f_122826_.m_7981_(entity.m_6095_())));
+ entity.m_6095_().getTags().forEach(t -> list.add("#" + t));
+ entity.m_6095_().m_204041_().m_203616_().forEach(t -> list.add("#" + t.f_203868_()));
}
return list;
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/Screen.java
+++ b/net/minecraft/client/gui/screens/Screen.java
@@ -126,7 +_,7 @@
@@ -127,7 +_,7 @@
}
public void m_7379_() {
@@ -9,7 +9,7 @@
}
protected <T extends GuiEventListener & Widget & NarratableEntry> T m_142416_(T p_169406_) {
@@ -163,15 +_,29 @@
@@ -164,15 +_,29 @@
this.f_169368_.clear();
}
@@ -43,7 +43,7 @@
this.m_169383_(p_169389_, list, p_169392_, p_169393_);
}
@@ -184,20 +_,44 @@
@@ -185,20 +_,44 @@
}
public void m_96597_(PoseStack p_96598_, List<Component> p_96599_, int p_96600_, int p_96601_) {
@@ -90,7 +90,7 @@
if (k > i) {
i = k;
}
@@ -205,8 +_,8 @@
@@ -206,8 +_,8 @@
j += clienttooltipcomponent.m_142103_();
}
@@ -101,7 +101,7 @@
if (j2 + i > this.f_96543_) {
j2 -= 28 + i;
}
@@ -227,15 +_,16 @@
@@ -228,15 +_,16 @@
RenderSystem.m_157427_(GameRenderer::m_172811_);
bufferbuilder.m_166779_(VertexFormat.Mode.QUADS, DefaultVertexFormat.f_85815_);
Matrix4f matrix4f = p_169384_.m_85850_().m_85861_();
@@ -127,7 +127,7 @@
RenderSystem.m_69482_();
RenderSystem.m_69472_();
RenderSystem.m_69478_();
@@ -250,7 +_,7 @@
@@ -251,7 +_,7 @@
for(int i2 = 0; i2 < p_169385_.size(); ++i2) {
ClientTooltipComponent clienttooltipcomponent1 = p_169385_.get(i2);
@@ -136,7 +136,7 @@
l1 += clienttooltipcomponent1.m_142103_() + (i2 == 0 ? 2 : 0);
}
@@ -260,7 +_,7 @@
@@ -261,7 +_,7 @@
for(int l2 = 0; l2 < p_169385_.size(); ++l2) {
ClientTooltipComponent clienttooltipcomponent2 = p_169385_.get(l2);
@@ -145,7 +145,7 @@
l1 += clienttooltipcomponent2.m_142103_() + (l2 == 0 ? 2 : 0);
}
@@ -354,9 +_,12 @@
@@ -355,9 +_,12 @@
}
public void m_96612_(String p_96613_, boolean p_96614_) {
@@ -158,7 +158,7 @@
this.f_96541_.f_91074_.m_108739_(p_96613_);
}
@@ -367,11 +_,21 @@
@@ -368,11 +_,21 @@
this.f_96547_ = p_96607_.f_91062_;
this.f_96543_ = p_96608_;
this.f_96544_ = p_96609_;
@@ -180,7 +180,7 @@
}
public List<? extends GuiEventListener> m_6702_() {
@@ -394,6 +_,7 @@
@@ -395,6 +_,7 @@
public void m_96558_(PoseStack p_96559_, int p_96560_) {
if (this.f_96541_.f_91073_ != null) {
this.m_93179_(p_96559_, 0, 0, this.f_96543_, this.f_96544_, -1072689136, -804253680);
@@ -188,7 +188,7 @@
} else {
this.m_96626_(p_96560_);
}
@@ -413,6 +_,7 @@
@@ -414,6 +_,7 @@
bufferbuilder.m_5483_((double)this.f_96543_, 0.0D, 0.0D).m_7421_((float)this.f_96543_ / 32.0F, (float)p_96627_).m_6122_(64, 64, 64, 255).m_5752_();
bufferbuilder.m_5483_(0.0D, 0.0D, 0.0D).m_7421_(0.0F, (float)p_96627_).m_6122_(64, 64, 64, 255).m_5752_();
tesselator.m_85914_();
@@ -196,7 +196,7 @@
}
public boolean m_7043_() {
@@ -498,6 +_,10 @@
@@ -499,6 +_,10 @@
}
public void m_7400_(List<Path> p_96591_) {
@@ -1,48 +1,48 @@
--- a/net/minecraft/client/gui/screens/TitleScreen.java
+++ b/net/minecraft/client/gui/screens/TitleScreen.java
@@ -64,6 +_,7 @@
private final PanoramaRenderer f_96729_ = new PanoramaRenderer(f_96716_);
private final boolean f_96714_;
private long f_96715_;
@@ -73,6 +_,7 @@
private TitleScreen.Warning32Bit f_210857_;
private RealmsClient f_210858_;
private boolean f_210859_ = false;
+ private net.minecraftforge.client.gui.NotificationModUpdateScreen modUpdateNotification;
public TitleScreen() {
this(false);
@@ -107,11 +_,16 @@
this.f_96728_ = this.f_96543_ - this.f_96727_ - 2;
int i = 24;
int j = this.f_96544_ / 4 + 48;
@@ -131,11 +_,16 @@
int j = this.f_96543_ - i - 2;
int k = 24;
int l = this.f_96544_ / 4 + 48;
+ Button modButton = null;
if (this.f_96541_.m_91402_()) {
this.m_96772_(j, 24);
this.m_96772_(l, 24);
} else {
this.m_96763_(j, 24);
+ modButton = this.m_142416_(new Button(this.f_96543_ / 2 - 100, j + 24 * 2, 98, 20, new TranslatableComponent("fml.menu.mods"), button -> {
this.m_96763_(l, 24);
+ modButton = this.m_142416_(new Button(this.f_96543_ / 2 - 100, l + 24 * 2, 98, 20, new TranslatableComponent("fml.menu.mods"), button -> {
+ this.f_96541_.m_91152_(new net.minecraftforge.client.gui.ModListScreen(this));
+ }));
}
+ modUpdateNotification = net.minecraftforge.client.gui.NotificationModUpdateScreen.init(this, modButton);
this.m_142416_(new ImageButton(this.f_96543_ / 2 - 124, j + 72 + 12, 20, 20, 0, 106, 20, Button.f_93617_, 256, 256, (p_96791_) -> {
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_()));
@@ -159,7 +_,7 @@
@@ -201,7 +_,7 @@
Screen screen = (Screen)(this.f_96541_.f_91066_.f_92083_ ? new JoinMultiplayerScreen(this) : new SafetyScreen(this));
this.f_96541_.m_91152_(screen);
}, button$ontooltip))).f_93623_ = flag;
- (this.m_142416_(new Button(this.f_96543_ / 2 - 100, p_96764_ + p_96765_ * 2, 200, 20, new TranslatableComponent("menu.online"), (p_96776_) -> {
- (this.m_142416_(new Button(this.f_96543_ / 2 - 100, p_96764_ + p_96765_ * 2, 200, 20, new TranslatableComponent("menu.online"), (p_211788_) -> {
+ (this.m_142416_(new Button(this.f_96543_ / 2 + 2, p_96764_ + p_96765_ * 2, 98, 20, new TranslatableComponent("menu.online"), (p_96771_) -> {
this.m_96793_();
}, button$ontooltip))).f_93623_ = flag;
}
@@ -284,6 +_,7 @@
@@ -331,6 +_,7 @@
this.f_210857_.f_210875_.m_6514_(p_96739_, this.f_210857_.f_210876_, this.f_210857_.f_210877_, 9, 16777215 | l);
}
RenderSystem.m_157456_(0, f_96724_);
m_93133_(p_96739_, j + 88, 67, 0.0F, 0.0F, 98, 14, 128, 16);
+ net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, p_96739_, this.f_96547_, this.f_96543_, this.f_96544_, l);
if (this.f_96721_ != null) {
p_96739_.m_85836_();
p_96739_.m_85837_((double)(this.f_96543_ / 2 + 90), 70.0D, 0.0D);
@@ -306,7 +_,14 @@
@@ -353,7 +_,14 @@
s = s + I18n.m_118938_("menu.modded");
}
@@ -55,10 +55,10 @@
+ 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 | l)
+ );
+
m_93236_(p_96739_, this.f_96547_, "Copyright Mojang AB. Do not distribute!", this.f_96728_, this.f_96544_ - 10, 16777215 | l);
if (p_96740_ > this.f_96728_ && p_96740_ < this.f_96728_ + this.f_96727_ && p_96741_ > this.f_96544_ - 10 && p_96741_ < this.f_96544_) {
m_93172_(p_96739_, this.f_96728_, this.f_96544_ - 1, this.f_96728_ + this.f_96727_, this.f_96544_, 16777215 | l);
@@ -322,6 +_,7 @@
for(GuiEventListener guieventlistener : this.m_6702_()) {
if (guieventlistener instanceof AbstractWidget) {
@@ -365,6 +_,7 @@
if (this.m_96789_() && f1 >= 1.0F) {
this.f_96726_.m_6305_(p_96739_, p_96740_, p_96741_, p_96742_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/AbstractContainerScreen.java
@@ -91,6 +_,7 @@
@@ -90,6 +_,7 @@
int i = this.f_97735_;
int j = this.f_97736_;
this.m_7286_(p_97795_, p_97798_, p_97796_, p_97797_);
@@ -8,7 +8,7 @@
RenderSystem.m_69465_();
super.m_6305_(p_97795_, p_97796_, p_97797_, p_97798_);
PoseStack posestack = RenderSystem.m_157191_();
@@ -112,11 +_,12 @@
@@ -111,11 +_,12 @@
this.f_97734_ = slot;
int l = slot.f_40220_;
int i1 = slot.f_40221_;
@@ -22,7 +22,7 @@
ItemStack itemstack = this.f_97711_.m_41619_() ? this.f_97732_.m_142621_() : this.f_97711_;
if (!itemstack.m_41619_()) {
int l1 = 8;
@@ -156,9 +_,13 @@
@@ -155,9 +_,13 @@
}
public static void m_169606_(PoseStack p_169607_, int p_169608_, int p_169609_, int p_169610_) {
@@ -37,7 +37,7 @@
RenderSystem.m_69444_(true, true, true, true);
RenderSystem.m_69482_();
}
@@ -176,8 +_,10 @@
@@ -175,8 +_,10 @@
RenderSystem.m_157182_();
this.m_93250_(200);
this.f_96542_.f_115093_ = 200.0F;
@@ -49,7 +49,7 @@
this.m_93250_(0);
this.f_96542_.f_115093_ = 0.0F;
}
@@ -287,7 +_,8 @@
@@ -286,7 +_,8 @@
if (super.m_6375_(p_97748_, p_97749_, p_97750_)) {
return true;
} else {
@@ -59,7 +59,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_;
@@ -298,6 +_,7 @@
@@ -297,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_);
@@ -67,7 +67,7 @@
int l = -1;
if (slot != null) {
l = slot.f_40219_;
@@ -323,7 +_,7 @@
@@ -322,7 +_,7 @@
}
} else if (!this.f_97738_) {
if (this.f_97732_.m_142621_().m_41619_()) {
@@ -76,7 +76,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));
@@ -347,7 +_,7 @@
@@ -346,7 +_,7 @@
this.f_97717_ = 0;
} else if (p_97750_ == 1) {
this.f_97717_ = 1;
@@ -85,7 +85,7 @@
this.f_97717_ = 2;
}
}
@@ -416,10 +_,13 @@
@@ -415,10 +_,13 @@
}
public boolean m_6348_(double p_97812_, double p_97813_, int p_97814_) {
@@ -99,7 +99,7 @@
int k = -1;
if (slot != null) {
k = slot.f_40219_;
@@ -433,7 +_,7 @@
@@ -432,7 +_,7 @@
if (m_96638_()) {
if (!this.f_97724_.m_41619_()) {
for(Slot slot2 : this.f_97732_.f_38839_) {
@@ -108,7 +108,7 @@
this.m_6597_(slot2, slot2.f_40219_, p_97814_, ClickType.QUICK_MOVE);
}
}
@@ -497,7 +_,7 @@
@@ -496,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_()) {
@@ -117,7 +117,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));
@@ -539,34 +_,39 @@
@@ -538,34 +_,39 @@
}
public boolean m_7933_(int p_97765_, int p_97766_, int p_97767_) {
@@ -164,7 +164,7 @@
this.m_6597_(this.f_97734_, this.f_97734_.f_40219_, i, ClickType.SWAP);
return true;
}
@@ -601,6 +_,18 @@
@@ -600,6 +_,18 @@
public T m_6262_() {
return this.f_97732_;
@@ -1,15 +1,15 @@
--- a/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen.java
@@ -74,6 +_,8 @@
@@ -73,6 +_,8 @@
private Slot f_98512_;
private CreativeInventoryListener f_98513_;
private boolean f_98514_;
+ private static int tabPage = 0;
+ private int maxPages = 0;
private boolean f_98515_;
private final Map<ResourceLocation, Tag<Item>> f_98516_ = Maps.newTreeMap();
private final Set<TagKey<Item>> f_98516_ = new HashSet<>();
@@ -233,6 +_,12 @@
@@ -232,6 +_,12 @@
protected void m_7856_() {
if (this.f_96541_.f_91072_.m_105290_()) {
super.m_7856_();
@@ -22,7 +22,7 @@
this.f_96541_.f_91068_.m_90926_(true);
this.f_98510_ = new EditBox(this.f_96547_, this.f_97735_ + 82, this.f_97736_ + 6, 80, 9, new TranslatableComponent("itemGroup.search"));
this.f_98510_.m_94199_(50);
@@ -274,7 +_,7 @@
@@ -273,7 +_,7 @@
public boolean m_5534_(char p_98521_, int p_98522_) {
if (this.f_98514_) {
return false;
@@ -31,7 +31,7 @@
return false;
} else {
String s = this.f_98510_.m_94155_();
@@ -292,7 +_,7 @@
@@ -291,7 +_,7 @@
public boolean m_7933_(int p_98547_, int p_98548_, int p_98549_) {
this.f_98514_ = false;
@@ -40,7 +40,7 @@
if (this.f_96541_.f_91066_.f_92098_.m_90832_(p_98547_, p_98548_)) {
this.f_98514_ = true;
this.m_98560_(CreativeModeTab.f_40754_);
@@ -329,6 +_,32 @@
@@ -328,6 +_,32 @@
private void m_98630_() {
(this.f_97732_).f_98639_.clear();
this.f_98516_.clear();
@@ -73,7 +73,7 @@
String s = this.f_98510_.m_94155_();
if (s.isEmpty()) {
for(Item item : Registry.f_122827_) {
@@ -374,9 +_,9 @@
@@ -372,9 +_,9 @@
protected void m_7027_(PoseStack p_98616_, int p_98617_, int p_98618_) {
CreativeModeTab creativemodetab = CreativeModeTab.f_40748_[f_98507_];
@@ -85,7 +85,7 @@
}
}
@@ -387,7 +_,7 @@
@@ -385,7 +_,7 @@
double d1 = p_98532_ - (double)this.f_97736_;
for(CreativeModeTab creativemodetab : CreativeModeTab.f_40748_) {
@@ -94,7 +94,7 @@
return true;
}
}
@@ -408,7 +_,7 @@
@@ -406,7 +_,7 @@
this.f_98509_ = false;
for(CreativeModeTab creativemodetab : CreativeModeTab.f_40748_) {
@@ -103,7 +103,7 @@
this.m_98560_(creativemodetab);
return true;
}
@@ -419,12 +_,15 @@
@@ -417,12 +_,15 @@
}
private boolean m_98631_() {
@@ -119,7 +119,7 @@
this.f_97737_.clear();
(this.f_97732_).f_98639_.clear();
if (p_98561_ == CreativeModeTab.f_40760_) {
@@ -501,13 +_,15 @@
@@ -499,13 +_,15 @@
}
if (this.f_98510_ != null) {
@@ -136,7 +136,7 @@
this.m_98630_();
} else {
@@ -567,16 +_,34 @@
@@ -565,16 +_,34 @@
this.m_7333_(p_98577_);
super.m_6305_(p_98577_, p_98578_, p_98579_, p_98580_);
@@ -173,7 +173,7 @@
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
this.m_7025_(p_98577_, p_98578_, p_98579_);
}
@@ -611,7 +_,7 @@
@@ -609,7 +_,7 @@
list1.add(1, creativemodetab.m_40786_().m_6881_().m_130940_(ChatFormatting.BLUE));
}
@@ -182,7 +182,7 @@
} else {
super.m_6057_(p_98590_, p_98591_, p_98592_, p_98593_);
}
@@ -622,16 +_,32 @@
@@ -620,16 +_,32 @@
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
CreativeModeTab creativemodetab = CreativeModeTab.f_40748_[f_98507_];
@@ -219,7 +219,7 @@
this.m_93228_(p_98572_, this.f_97735_, this.f_97736_, 0, 0, this.f_97726_, this.f_97727_);
this.f_98510_.m_6305_(p_98572_, p_98574_, p_98575_, p_98573_);
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
@@ -639,11 +_,14 @@
@@ -637,11 +_,14 @@
int j = this.f_97736_ + 18;
int k = j + 112;
RenderSystem.m_157427_(GameRenderer::m_172817_);
@@ -235,7 +235,7 @@
this.m_98581_(p_98572_, creativemodetab);
if (creativemodetab == CreativeModeTab.f_40761_) {
InventoryScreen.m_98850_(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_);
@@ -652,6 +_,7 @@
@@ -650,6 +_,7 @@
}
protected boolean m_98562_(CreativeModeTab p_98563_, double p_98564_, double p_98565_) {
@@ -243,7 +243,7 @@
int i = p_98563_.m_40793_();
int j = 28 * i;
int k = 0;
@@ -720,6 +_,7 @@
@@ -718,6 +_,7 @@
i1 += this.f_97727_ - 4;
}
@@ -251,7 +251,7 @@
this.m_93228_(p_98582_, l, i1, j, k, 28, 32);
this.f_96542_.f_115093_ = 100.0F;
l += 6;
@@ -909,6 +_,22 @@
@@ -907,6 +_,22 @@
public boolean m_8010_(Player p_98665_) {
return this.f_98655_.m_8010_(p_98665_);
@@ -1,15 +1,15 @@
--- a/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java
+++ b/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java
@@ -116,7 +_,7 @@
@@ -106,7 +_,7 @@
public static CreateWorldScreen m_100898_(@Nullable Screen p_100899_) {
RegistryAccess.RegistryHolder registryaccess$registryholder = RegistryAccess.m_123086_();
- return new CreateWorldScreen(p_100899_, DataPackConfig.f_45842_, new WorldGenSettingsComponent(registryaccess$registryholder, WorldGenSettings.m_190050_(registryaccess$registryholder), Optional.of(WorldPreset.f_101506_), OptionalLong.empty()));
+ return new CreateWorldScreen(p_100899_, DataPackConfig.f_45842_, new WorldGenSettingsComponent(registryaccess$registryholder, net.minecraftforge.client.ForgeHooksClient.getDefaultWorldPreset().map(type -> type.m_7012_(registryaccess$registryholder, new java.util.Random().nextLong(), true, false)).orElseGet(() -> WorldGenSettings.m_190050_(registryaccess$registryholder)), net.minecraftforge.client.ForgeHooksClient.getDefaultWorldPreset(), OptionalLong.empty()));
public static CreateWorldScreen m_205424_(@Nullable Screen p_205425_) {
RegistryAccess.Frozen registryaccess$frozen = RegistryAccess.f_123049_.get();
- return new CreateWorldScreen(p_205425_, DataPackConfig.f_45842_, new WorldGenSettingsComponent(registryaccess$frozen, WorldGenSettings.m_190050_(registryaccess$frozen), Optional.of(WorldPreset.f_101506_), OptionalLong.empty()));
+ return new CreateWorldScreen(p_205425_, DataPackConfig.f_45842_, new WorldGenSettingsComponent(registryaccess$frozen, net.minecraftforge.client.ForgeHooksClient.getDefaultWorldPreset().map(type -> type.m_205485_(registryaccess$frozen, new java.util.Random().nextLong(), true, false)).orElseGet(() -> WorldGenSettings.m_190050_(registryaccess$frozen)), net.minecraftforge.client.ForgeHooksClient.getDefaultWorldPreset(), OptionalLong.empty()));
}
private CreateWorldScreen(@Nullable Screen p_100861_, DataPackConfig p_100862_, WorldGenSettingsComponent p_100863_) {
@@ -595,6 +_,7 @@
public static CreateWorldScreen m_205426_(@Nullable Screen p_205427_, WorldStem p_205428_, @Nullable Path p_205429_) {
@@ -625,6 +_,7 @@
File file1 = path.toFile();
if (this.f_100832_ == null) {
this.f_100832_ = new PackRepository(PackType.SERVER_DATA, new ServerPacksSource(), new FolderRepositorySource(file1, PackSource.f_10527_));
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/worldselection/WorldGenSettingsComponent.java
+++ b/net/minecraft/client/gui/screens/worldselection/WorldGenSettingsComponent.java
@@ -113,6 +_,7 @@
@@ -107,6 +_,7 @@
this.f_170244_.f_93624_ = false;
this.f_101391_ = p_101430_.m_142416_(new Button(j, 120, 150, 20, new TranslatableComponent("selectWorld.customizeType"), (p_170248_) -> {
WorldPreset.PresetEditor worldpreset$preseteditor = WorldPreset.f_101509_.get(this.f_101395_);
@@ -8,7 +8,7 @@
if (worldpreset$preseteditor != null) {
p_101431_.m_91152_(worldpreset$preseteditor.m_101642_(p_101430_, this.f_101394_));
}
@@ -283,7 +_,7 @@
@@ -273,7 +_,7 @@
} else {
this.f_101389_.f_93624_ = p_170288_;
this.f_101380_.f_93624_ = p_170288_;
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/worldselection/WorldPreset.java
+++ b/net/minecraft/client/gui/screens/worldselection/WorldPreset.java
@@ -83,6 +_,9 @@
@@ -93,6 +_,9 @@
WorldPreset(String p_101519_) {
this.f_101516_ = new TranslatableComponent("generator." + p_101519_);
}
@@ -8,9 +8,9 @@
+ this.f_101516_ = displayName;
+ }
private static WorldGenSettings m_101549_(RegistryAccess p_101550_, WorldGenSettings p_101551_, WorldPreset p_101552_, Biome p_101553_) {
BiomeSource biomesource = new FixedBiomeSource(p_101553_);
@@ -125,4 +_,8 @@
private static WorldGenSettings m_205493_(RegistryAccess p_205494_, WorldGenSettings p_205495_, Holder<Biome> p_205496_) {
BiomeSource biomesource = new FixedBiomeSource(p_205496_);
@@ -134,4 +_,8 @@
public interface PresetEditor {
Screen m_101642_(CreateWorldScreen p_101643_, WorldGenSettings p_101644_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/multiplayer/ClientChunkCache.java
+++ b/net/minecraft/client/multiplayer/ClientChunkCache.java
@@ -59,6 +_,7 @@
@@ -60,6 +_,7 @@
int i = this.f_104410_.m_104481_(p_104456_, p_104457_);
LevelChunk levelchunk = this.f_104410_.m_104479_(i);
if (m_104438_(levelchunk, p_104456_, p_104457_)) {
@@ -8,7 +8,7 @@
this.f_104410_.m_104487_(i, levelchunk, (LevelChunk)null);
}
@@ -99,6 +_,7 @@
@@ -100,6 +_,7 @@
}
this.f_104411_.m_171649_(chunkpos);
@@ -1,7 +1,7 @@
--- a/net/minecraft/client/multiplayer/ClientLevel.java
+++ b/net/minecraft/client/multiplayer/ClientLevel.java
@@ -130,6 +_,8 @@
this.f_194123_ = p_194134_;
@@ -129,6 +_,8 @@
this.f_194123_ = p_205510_;
this.m_46465_();
this.m_46466_();
+ this.gatherCapabilities();
@@ -9,7 +9,7 @@
}
public void m_194171_(Runnable p_194172_) {
@@ -216,6 +_,7 @@
@@ -215,6 +_,7 @@
this.m_46473_().m_6521_(() -> {
return Registry.f_122826_.m_7981_(p_104640_.m_6095_()).toString();
});
@@ -17,7 +17,7 @@
p_104640_.m_8119_();
this.m_46473_().m_7238_();
@@ -278,8 +_,10 @@
@@ -277,8 +_,10 @@
}
private void m_104739_(int p_104740_, Entity p_104741_) {
@@ -28,7 +28,7 @@
}
public void m_171642_(int p_171643_, Entity.RemovalReason p_171644_) {
@@ -410,6 +_,11 @@
@@ -409,6 +_,11 @@
}
public void m_6263_(@Nullable Player p_104645_, double p_104646_, double p_104647_, double p_104648_, SoundEvent p_104649_, SoundSource p_104650_, float p_104651_, float p_104652_) {
@@ -40,7 +40,7 @@
if (p_104645_ == this.f_104565_.f_91074_) {
this.m_7785_(p_104646_, p_104647_, p_104648_, p_104649_, p_104650_, p_104651_, p_104652_, false);
}
@@ -417,6 +_,11 @@
@@ -416,6 +_,11 @@
}
public void m_6269_(@Nullable Player p_104659_, Entity p_104660_, SoundEvent p_104661_, SoundSource p_104662_, float p_104663_, float p_104664_) {
@@ -52,7 +52,7 @@
if (p_104659_ == this.f_104565_.f_91074_) {
this.f_104565_.m_91106_().m_120367_(new EntityBoundSoundInstance(p_104661_, p_104662_, p_104663_, p_104664_, p_104660_));
}
@@ -879,6 +_,7 @@
@@ -870,6 +_,7 @@
}
public void m_104851_(Difficulty p_104852_) {
@@ -60,7 +60,7 @@
this.f_104840_ = p_104852_;
}
@@ -921,6 +_,9 @@
@@ -912,6 +_,9 @@
public void m_141981_(Entity p_171716_) {
p_171716_.m_19877_();
ClientLevel.this.f_104566_.remove(p_171716_);
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/multiplayer/ClientPacketListener.java
+++ b/net/minecraft/client/multiplayer/ClientPacketListener.java
@@ -357,6 +_,7 @@
@@ -360,6 +_,7 @@
this.f_104888_.f_91064_.m_113434_();
this.f_104888_.f_91074_.m_172530_();
@@ -8,7 +8,7 @@
int i = p_105030_.f_132360_();
this.f_104888_.f_91074_.m_20234_(i);
this.f_104889_.m_104630_(i, this.f_104888_.f_91074_);
@@ -368,6 +_,7 @@
@@ -371,6 +_,7 @@
this.f_104888_.f_91074_.m_108711_(p_105030_.f_132372_());
this.f_104888_.f_91072_.m_171805_(p_105030_.f_132363_(), p_105030_.f_132364_());
this.f_104888_.f_91066_.m_193770_(p_105030_.f_132370_());
@@ -16,7 +16,7 @@
this.f_104888_.f_91066_.m_92172_();
this.f_104885_.m_129512_(new ServerboundCustomPayloadPacket(ServerboundCustomPayloadPacket.f_133979_, (new FriendlyByteBuf(Unpooled.buffer())).m_130070_(ClientBrandRetriever.m_129629_())));
this.f_104888_.m_91309_().m_90739_();
@@ -715,7 +_,9 @@
@@ -712,7 +_,9 @@
public void m_5784_(ClientboundChatPacket p_104986_) {
PacketUtils.m_131363_(p_104986_, this, this.f_104888_);
@@ -27,7 +27,7 @@
}
public void m_7791_(ClientboundAnimatePacket p_104968_) {
@@ -886,8 +_,10 @@
@@ -894,8 +_,10 @@
localplayer1.m_21204_().m_22159_(localplayer.m_21204_());
}
@@ -38,19 +38,19 @@
this.f_104889_.m_104630_(i, localplayer1);
localplayer1.m_146922_(-180.0F);
localplayer1.f_108618_ = new KeyboardInput(this.f_104888_.f_91066_);
@@ -990,10 +_,7 @@
@@ -998,10 +_,7 @@
PacketUtils.m_131363_(p_104976_, this, this.f_104888_);
BlockPos blockpos = p_104976_.m_131704_();
this.f_104888_.f_91073_.m_141902_(blockpos, p_104976_.m_195645_()).ifPresent((p_194239_) -> {
this.f_104888_.f_91073_.m_141902_(blockpos, p_104976_.m_195645_()).ifPresent((p_205557_) -> {
- CompoundTag compoundtag = p_104976_.m_131708_();
- if (compoundtag != null) {
- p_194239_.m_142466_(compoundtag);
- p_205557_.m_142466_(compoundtag);
- }
+ p_194239_.onDataPacket(f_104885_, p_104976_);
+ p_205557_.onDataPacket(f_104885_, p_104976_);
if (p_194239_ instanceof CommandBlockEntity && this.f_104888_.f_91080_ instanceof CommandBlockEditScreen) {
if (p_205557_ instanceof CommandBlockEntity && this.f_104888_.f_91080_ instanceof CommandBlockEditScreen) {
((CommandBlockEditScreen)this.f_104888_.f_91080_).m_98398_();
@@ -1139,6 +_,7 @@
@@ -1147,6 +_,7 @@
public void m_7443_(ClientboundCommandsPacket p_104990_) {
PacketUtils.m_131363_(p_104990_, this, this.f_104888_);
this.f_104899_ = new CommandDispatcher<>(p_104990_.m_131884_());
@@ -58,7 +58,7 @@
}
public void m_7183_(ClientboundStopSoundPacket p_105116_) {
@@ -1160,6 +_,7 @@
@@ -1168,6 +_,7 @@
clientrecipebook.m_90625_(this.f_104900_.m_44051_());
clientrecipebook.m_90639_().forEach(mutablesearchtree::m_8080_);
mutablesearchtree.m_7729_();
@@ -66,24 +66,24 @@
}
public void m_7244_(ClientboundPlayerLookAtPacket p_105054_) {
@@ -1237,7 +_,7 @@
@@ -1245,7 +_,7 @@
PacketUtils.m_131363_(p_105130_, this, this.f_104888_);
Entity entity = this.f_104889_.m_6815_(p_105130_.m_133622_());
if (entity instanceof LivingEntity) {
- MobEffect mobeffect = MobEffect.m_19453_(p_105130_.m_133623_());
+ MobEffect mobeffect = MobEffect.m_19453_(p_105130_.m_133623_() & 0xFF);
- MobEffect mobeffect = MobEffect.m_19453_(p_105130_.m_211135_());
+ MobEffect mobeffect = MobEffect.m_19453_(p_105130_.m_211135_() & 0xFF);
if (mobeffect != null) {
MobEffectInstance mobeffectinstance = new MobEffectInstance(mobeffect, p_105130_.m_133625_(), p_105130_.m_133624_(), p_105130_.m_133627_(), p_105130_.m_133626_(), p_105130_.m_133628_());
mobeffectinstance.m_19562_(p_105130_.m_133619_());
@@ -1254,6 +_,7 @@
f_104883_.warn("Incomplete server tags, disconnecting. Missing: {}", (Object)multimap);
this.f_104885_.m_129507_(new TranslatableComponent("multiplayer.disconnect.missing_tags"));
} else {
+ tagcontainer = net.minecraftforge.common.ForgeTagHandler.reinjectOptionalTags(tagcontainer);
this.f_104895_ = tagcontainer;
if (!this.f_104885_.m_129531_()) {
tagcontainer.m_13431_();
@@ -1803,7 +_,8 @@
@@ -1262,6 +_,7 @@
}
this.f_104888_.m_91171_(SearchRegistry.f_119942_).m_7729_();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent(this.f_104903_));
}
private <T> void m_205560_(ResourceKey<? extends Registry<? extends T>> p_205561_, TagNetworkSerialization.NetworkPayload p_205562_) {
@@ -1815,7 +_,8 @@
int i5 = friendlybytebuf.m_130242_();
this.f_104888_.f_91064_.f_173815_.m_173830_(positionsource, i5);
} else {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/player/LocalPlayer.java
+++ b/net/minecraft/client/player/LocalPlayer.java
@@ -144,6 +_,7 @@
@@ -145,6 +_,7 @@
}
public boolean m_6469_(DamageSource p_108662_, float p_108663_) {
@@ -8,7 +8,7 @@
return false;
}
@@ -466,6 +_,11 @@
@@ -461,6 +_,11 @@
}
public void m_5496_(SoundEvent p_108651_, float p_108652_, float p_108653_) {
@@ -20,7 +20,7 @@
this.f_19853_.m_7785_(this.m_20185_(), this.m_20186_(), this.m_20189_(), p_108651_, this.m_5720_(), p_108652_, p_108653_, false);
}
@@ -621,6 +_,7 @@
@@ -616,6 +_,7 @@
boolean flag2 = this.m_108733_();
this.f_108601_ = !this.m_150110_().f_35935_ && !this.m_6069_() && this.m_20175_(Pose.CROUCHING) && (this.m_6144_() || !this.m_5803_() && !this.m_20175_(Pose.STANDING));
this.f_108618_.m_7606_(this.m_108635_());
@@ -28,7 +28,7 @@
this.f_108619_.m_91301_().m_120586_(this.f_108618_);
if (this.m_6117_() && !this.m_20159_()) {
this.f_108618_.f_108566_ *= 0.2F;
@@ -693,7 +_,7 @@
@@ -688,7 +_,7 @@
if (this.f_108618_.f_108572_ && !flag7 && !flag && !this.m_150110_().f_35935_ && !this.m_20159_() && !this.m_6147_()) {
ItemStack itemstack = this.m_6844_(EquipmentSlot.CHEST);
@@ -37,7 +37,7 @@
this.f_108617_.m_104955_(new ServerboundPlayerCommandPacket(this, ServerboundPlayerCommandPacket.Action.START_FALL_FLYING));
}
}
@@ -811,6 +_,7 @@
@@ -806,6 +_,7 @@
public void m_6083_() {
super.m_6083_();
@@ -45,7 +45,7 @@
this.f_108611_ = false;
if (this.m_20202_() instanceof Boat) {
Boat boat = (Boat)this.m_20202_();
@@ -1024,6 +_,18 @@
@@ -1019,6 +_,18 @@
} else {
return super.m_7398_(p_108758_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/FogRenderer.java
+++ b/net/minecraft/client/renderer/FogRenderer.java
@@ -171,21 +_,40 @@
@@ -173,24 +_,42 @@
if (f_109010_ != 0.0F && f_109011_ != 0.0F && f_109012_ != 0.0F) {
float f8 = Math.min(1.0F / f_109010_, Math.min(1.0F / f_109011_, 1.0F / f_109012_));
@@ -33,20 +33,22 @@
+ public static void setupFog(Camera p_109025_, FogRenderer.FogMode p_109026_, float p_109027_, boolean p_109028_, float partialTicks) {
FogType fogtype = p_109025_.m_167685_();
Entity entity = p_109025_.m_90592_();
+ // TODO
FogShape fogshape = FogShape.SPHERE;
float f;
float f1;
+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(p_109026_, p_109025_, partialTicks, 0.1F);
+ if (hook >= 0) {
+ RenderSystem.m_157445_(-8.0F);
+ RenderSystem.m_157443_(hook * 0.5F);
+ f = -8.0f;
+ f1 = hook * 0.5F;
+ } else
if (fogtype == FogType.WATER) {
float f = 192.0F;
if (entity instanceof LocalPlayer) {
@@ -245,6 +_,7 @@
RenderSystem.m_157445_(f2);
RenderSystem.m_157443_(f3);
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(p_109026_, p_109025_, partialTicks, f3);
}
if (fogtype == FogType.LAVA) {
if (entity.m_5833_()) {
f = -8.0F;
@@ -253,6 +_,7 @@
RenderSystem.m_157445_(f);
RenderSystem.m_157443_(f1);
RenderSystem.m_202160_(fogshape);
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(p_109026_, p_109025_, partialTicks, f1);
}
public static void m_109036_() {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/GameRenderer.java
+++ b/net/minecraft/client/renderer/GameRenderer.java
@@ -286,6 +_,8 @@
@@ -288,6 +_,8 @@
this.m_109128_(new ResourceLocation("shaders/post/spider.json"));
} else if (p_109107_ instanceof EnderMan) {
this.m_109128_(new ResourceLocation("shaders/post/invert.json"));
@@ -9,7 +9,7 @@
}
}
@@ -542,6 +_,7 @@
@@ -544,6 +_,7 @@
list1.add(Pair.of(new ShaderInstance(p_172768_, "rendertype_crumbling", DefaultVertexFormat.f_85811_), (p_172733_) -> {
f_172607_ = p_172733_;
}));
@@ -17,7 +17,7 @@
} catch (IOException ioexception) {
list1.forEach((p_172772_) -> {
p_172772_.getFirst().close();
@@ -704,7 +_,7 @@
@@ -706,7 +_,7 @@
d0 *= (double)Mth.m_14179_(this.f_109059_.f_91066_.f_92070_, 1.0F, 0.85714287F);
}
@@ -26,7 +26,7 @@
}
}
@@ -841,11 +_,11 @@
@@ -843,11 +_,11 @@
Window window = this.f_109059_.m_91268_();
RenderSystem.m_69421_(256, Minecraft.f_91002_);
@@ -40,7 +40,7 @@
RenderSystem.m_157182_();
Lighting.m_84931_();
PoseStack posestack1 = new PoseStack();
@@ -880,7 +_,7 @@
@@ -882,7 +_,7 @@
}
} else if (this.f_109059_.f_91080_ != null) {
try {
@@ -49,7 +49,7 @@
} catch (Throwable throwable1) {
CrashReport crashreport1 = CrashReport.m_127521_(throwable1, "Rendering screen");
CrashReportCategory crashreportcategory1 = crashreport1.m_127514_("Screen render details");
@@ -1037,6 +_,11 @@
@@ -1040,6 +_,11 @@
Matrix4f matrix4f = posestack.m_85850_().m_85861_();
this.m_109111_(matrix4f);
camera.m_90575_(this.f_109059_.f_91073_, (Entity)(this.f_109059_.m_91288_() == null ? this.f_109059_.f_91074_ : this.f_109059_.m_91288_()), !this.f_109059_.f_91066_.m_92176_().m_90612_(), this.f_109059_.f_91066_.m_92176_().m_90613_(), p_109090_);
@@ -61,7 +61,7 @@
p_109092_.m_85845_(Vector3f.f_122223_.m_122240_(camera.m_90589_()));
p_109092_.m_85845_(Vector3f.f_122225_.m_122240_(camera.m_90590_() + 180.0F));
Matrix3f matrix3f = p_109092_.m_85850_().m_85864_().m_8183_();
@@ -1046,6 +_,8 @@
@@ -1049,6 +_,8 @@
this.f_109059_.f_91060_.m_172961_(p_109092_, camera.m_90583_(), this.m_172716_(Math.max(d0, this.f_109059_.f_91066_.f_92068_)));
this.f_109059_.f_91060_.m_109599_(p_109092_, p_109090_, p_109091_, flag, camera, this, this.f_109074_, matrix4f);
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/LevelRenderer.java
+++ b/net/minecraft/client/renderer/LevelRenderer.java
@@ -257,6 +_,11 @@
@@ -259,6 +_,11 @@
}
private void m_109703_(LightTexture p_109704_, float p_109705_, double p_109706_, double p_109707_, double p_109708_) {
@@ -12,7 +12,7 @@
float f = this.f_109461_.f_91073_.m_46722_(p_109705_);
if (!(f <= 0.0F)) {
p_109704_.m_109896_();
@@ -377,6 +_,11 @@
@@ -379,6 +_,11 @@
}
public void m_109693_(Camera p_109694_) {
@@ -24,14 +24,14 @@
float f = this.f_109461_.f_91073_.m_46722_(1.0F) / (Minecraft.m_91405_() ? 1.0F : 2.0F);
if (!(f <= 0.0F)) {
Random random = new Random((long)this.f_109477_ * 312987231L);
@@ -1148,20 +_,23 @@
@@ -1134,20 +_,23 @@
RenderSystem.m_69421_(16640, Minecraft.f_91002_);
float f = p_109605_.m_109152_();
boolean flag2 = this.f_109461_.f_91073_.m_104583_().m_5781_(Mth.m_14107_(d0), Mth.m_14107_(d1)) || this.f_109461_.f_91065_.m_93090_().m_93715_();
+ FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_SKY, f, flag2, p_109601_);
profilerfiller.m_6182_("sky");
RenderSystem.m_157427_(GameRenderer::m_172808_);
this.m_181409_(p_109600_, p_109607_, p_109601_, () -> {
this.m_202423_(p_109600_, p_109607_, p_109601_, p_109604_, flag2, () -> {
- FogRenderer.m_109024_(p_109604_, FogRenderer.FogMode.FOG_SKY, f, flag2);
+ FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_SKY, f, flag2, p_109601_);
});
@@ -50,46 +50,46 @@
this.m_172993_(RenderType.m_110463_(), p_109600_, d0, d1, d2, p_109607_);
if (this.f_109465_.m_104583_().m_108885_()) {
Lighting.m_84925_(p_109600_.m_85850_().m_85861_());
@@ -1191,7 +_,7 @@
MultiBufferSource.BufferSource multibuffersource$buffersource = this.f_109464_.m_110104_();
@@ -1179,7 +_,7 @@
for(Entity entity : this.f_109465_.m_104735_()) {
- if ((this.f_109463_.m_114397_(entity, frustum, d0, d1, d2) || entity.m_20367_(this.f_109461_.f_91074_)) && (entity != p_109604_.m_90592_() || p_109604_.m_90594_() || p_109604_.m_90592_() instanceof LivingEntity && ((LivingEntity)p_109604_.m_90592_()).m_5803_()) && (!(entity instanceof LocalPlayer) || p_109604_.m_90592_() == entity)) {
+ if ((this.f_109463_.m_114397_(entity, frustum, d0, d1, d2) || entity.m_20367_(this.f_109461_.f_91074_)) && (entity != p_109604_.m_90592_() || p_109604_.m_90594_() || p_109604_.m_90592_() instanceof LivingEntity && ((LivingEntity)p_109604_.m_90592_()).m_5803_()) && (!(entity instanceof LocalPlayer) || p_109604_.m_90592_() == entity || (entity == f_109461_.f_91074_ && !f_109461_.f_91074_.m_5833_()))) { //FORGE: render local player entity when it is not the renderViewEntity
++this.f_109439_;
if (entity.f_19797_ == 0) {
entity.f_19790_ = entity.m_20185_();
@@ -1230,6 +_,7 @@
if (this.f_109463_.m_114397_(entity, frustum, d0, d1, d2) || entity.m_20367_(this.f_109461_.f_91074_)) {
BlockPos blockpos = entity.m_142538_();
- if ((this.f_109465_.m_151562_(blockpos.m_123342_()) || this.m_202430_(blockpos)) && (entity != p_109604_.m_90592_() || p_109604_.m_90594_() || p_109604_.m_90592_() instanceof LivingEntity && ((LivingEntity)p_109604_.m_90592_()).m_5803_()) && (!(entity instanceof LocalPlayer) || p_109604_.m_90592_() == entity)) {
+ if ((this.f_109465_.m_151562_(blockpos.m_123342_()) || this.m_202430_(blockpos)) && (entity != p_109604_.m_90592_() || p_109604_.m_90594_() || p_109604_.m_90592_() instanceof LivingEntity && ((LivingEntity)p_109604_.m_90592_()).m_5803_()) && (!(entity instanceof LocalPlayer) || p_109604_.m_90592_() == entity || (entity == f_109461_.f_91074_ && !f_109461_.f_91074_.m_5833_()))) { //FORGE: render local player entity when it is not the renderViewEntity
++this.f_109439_;
if (entity.f_19797_ == 0) {
entity.f_19790_ = entity.m_20185_();
@@ -1219,6 +_,7 @@
List<BlockEntity> list = levelrenderer$renderchunkinfo.f_109839_.m_112835_().m_112773_();
if (!list.isEmpty()) {
for(BlockEntity blockentity1 : list) {
+ if(!frustum.m_113029_(blockentity1.getRenderBoundingBox())) continue;
BlockPos blockpos3 = blockentity1.m_58899_();
BlockPos blockpos4 = blockentity1.m_58899_();
MultiBufferSource multibuffersource1 = multibuffersource$buffersource;
p_109600_.m_85836_();
@@ -1255,6 +_,7 @@
@@ -1244,6 +_,7 @@
synchronized(this.f_109468_) {
for(BlockEntity blockentity : this.f_109468_) {
+ if(!frustum.m_113029_(blockentity.getRenderBoundingBox())) continue;
BlockPos blockpos2 = blockentity.m_58899_();
BlockPos blockpos3 = blockentity.m_58899_();
p_109600_.m_85836_();
p_109600_.m_85837_((double)blockpos2.m_123341_() - d0, (double)blockpos2.m_123342_() - d1, (double)blockpos2.m_123343_() - d2);
@@ -1306,10 +_,13 @@
p_109600_.m_85837_((double)blockpos3.m_123341_() - d0, (double)blockpos3.m_123342_() - d1, (double)blockpos3.m_123343_() - d2);
@@ -1295,10 +_,13 @@
profilerfiller.m_6182_("outline");
BlockPos blockpos = ((BlockHitResult)hitresult).m_82425_();
BlockState blockstate = this.f_109465_.m_8055_(blockpos);
BlockPos blockpos1 = ((BlockHitResult)hitresult).m_82425_();
BlockState blockstate = this.f_109465_.m_8055_(blockpos1);
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawHighlight(this, p_109604_, hitresult, p_109601_, p_109600_, multibuffersource$buffersource))
if (!blockstate.m_60795_() && this.f_109465_.m_6857_().m_61937_(blockpos)) {
if (!blockstate.m_60795_() && this.f_109465_.m_6857_().m_61937_(blockpos1)) {
VertexConsumer vertexconsumer2 = multibuffersource$buffersource.m_6299_(RenderType.m_110504_());
this.m_109637_(p_109600_, vertexconsumer2, p_109604_.m_90592_(), d0, d1, d2, blockpos, blockstate);
this.m_109637_(p_109600_, vertexconsumer2, p_109604_.m_90592_(), d0, d1, d2, blockpos1, blockstate);
}
+ } else if (hitresult != null && hitresult.m_6662_() == HitResult.Type.ENTITY) {
+ net.minecraftforge.client.ForgeHooksClient.onDrawHighlight(this, p_109604_, hitresult, p_109601_, p_109600_, multibuffersource$buffersource);
}
PoseStack posestack = RenderSystem.m_157191_();
@@ -1344,7 +_,7 @@
@@ -1333,7 +_,7 @@
this.f_109415_.m_83945_(this.f_109461_.m_91385_());
RenderStateShard.f_110126_.m_110185_();
profilerfiller.m_6182_("particles");
@@ -98,7 +98,7 @@
RenderStateShard.f_110126_.m_110188_();
} else {
profilerfiller.m_6182_("translucent");
@@ -1358,7 +_,7 @@
@@ -1347,7 +_,7 @@
profilerfiller.m_6182_("string");
this.m_172993_(RenderType.m_110503_(), p_109600_, d0, d1, d2, p_109607_);
profilerfiller.m_6182_("particles");
@@ -107,19 +107,19 @@
}
posestack.m_85836_();
@@ -1790,6 +_,11 @@
@@ -1783,6 +_,11 @@
public void m_181409_(PoseStack p_181410_, Matrix4f p_181411_, float p_181412_, Runnable p_181413_) {
p_181413_.run();
public void m_202423_(PoseStack p_202424_, Matrix4f p_202425_, float p_202426_, Camera p_202427_, boolean p_202428_, Runnable p_202429_) {
p_202429_.run();
+ net.minecraftforge.client.ISkyRenderHandler renderHandler = f_109465_.m_104583_().getSkyRenderHandler();
+ if (renderHandler != null) {
+ renderHandler.render(f_109477_, p_181412_, p_181410_, f_109465_, f_109461_);
+ renderHandler.render(f_109477_, p_202426_, p_202424_, f_109465_, f_109461_);
+ return;
+ }
if (this.f_109461_.f_91073_.m_104583_().m_108883_() == DimensionSpecialEffects.SkyType.END) {
this.m_109780_(p_181410_);
} else if (this.f_109461_.f_91073_.m_104583_().m_108883_() == DimensionSpecialEffects.SkyType.NORMAL) {
@@ -1904,6 +_,11 @@
if (!p_202428_) {
FogType fogtype = p_202427_.m_167685_();
if (fogtype != FogType.POWDER_SNOW && fogtype != FogType.LAVA) {
@@ -1910,6 +_,11 @@
}
public void m_172954_(PoseStack p_172955_, Matrix4f p_172956_, float p_172957_, double p_172958_, double p_172959_, double p_172960_) {
@@ -131,7 +131,7 @@
float f = this.f_109465_.m_104583_().m_108871_();
if (!Float.isNaN(f)) {
RenderSystem.m_69464_();
@@ -2089,7 +_,7 @@
@@ -2095,7 +_,7 @@
}
} else {
BlockPos blockpos1 = chunkrenderdispatcher$renderchunk.m_112839_().m_142082_(8, 8, 8);
@@ -140,7 +140,7 @@
}
if (flag) {
@@ -2387,7 +_,12 @@
@@ -2393,7 +_,12 @@
this.f_109469_.m_110859_(p_109502_, p_109503_, p_109504_, p_109505_);
}
@@ -153,7 +153,7 @@
SoundInstance soundinstance = this.f_109410_.get(p_109516_);
if (soundinstance != null) {
this.f_109461_.m_91106_().m_120399_(soundinstance);
@@ -2395,7 +_,7 @@
@@ -2401,7 +_,7 @@
}
if (p_109515_ != null) {
@@ -162,7 +162,7 @@
if (recorditem != null) {
this.f_109461_.f_91065_.m_93055_(recorditem.m_43050_());
}
@@ -2547,7 +_,7 @@
@@ -2553,7 +_,7 @@
break;
case 1010:
if (Item.m_41445_(p_109536_) instanceof RecordItem) {
@@ -171,7 +171,7 @@
} else {
this.m_109514_((SoundEvent)null, p_109535_);
}
@@ -2717,7 +_,7 @@
@@ -2723,7 +_,7 @@
case 2001:
BlockState blockstate = Block.m_49803_(p_109536_);
if (!blockstate.m_60795_()) {
@@ -180,7 +180,7 @@
this.f_109465_.m_104677_(p_109535_, soundtype.m_56775_(), SoundSource.BLOCKS, (soundtype.m_56773_() + 1.0F) / 2.0F, soundtype.m_56774_() * 0.8F, false);
}
@@ -2882,7 +_,7 @@
@@ -2888,7 +_,7 @@
} else {
int i = p_109538_.m_45517_(LightLayer.SKY, p_109540_);
int j = p_109538_.m_45517_(LightLayer.BLOCK, p_109540_);
@@ -15,7 +15,7 @@
}
if (!p_110719_.f_91074_.m_5833_()) {
if (p_110719_.f_91074_.m_19941_(FluidTags.f_13131_)) {
if (p_110719_.f_91074_.m_204029_(FluidTags.f_13131_)) {
+ if (!net.minecraftforge.event.ForgeEventFactory.renderWaterOverlay(player, p_110720_))
m_110725_(p_110719_, p_110720_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/ShaderInstance.java
+++ b/net/minecraft/client/renderer/ShaderInstance.java
@@ -94,10 +_,14 @@
@@ -96,10 +_,14 @@
@Nullable
public final Uniform f_173320_;
@@ -17,7 +17,7 @@
Resource resource = null;
try {
@@ -206,8 +_,9 @@
@@ -209,8 +_,9 @@
Program program1 = p_173342_.m_85570_().get(p_173343_);
Program program;
if (program1 == null) {
@@ -1,96 +1,98 @@
--- a/net/minecraft/client/renderer/block/LiquidBlockRenderer.java
+++ b/net/minecraft/client/renderer/block/LiquidBlockRenderer.java
@@ -72,9 +_,10 @@
@@ -68,8 +_,9 @@
public boolean m_110954_(BlockAndTintGetter p_110955_, BlockPos p_110956_, VertexConsumer p_110957_, FluidState p_110958_) {
boolean flag = p_110958_.m_76153_(FluidTags.f_13132_);
public boolean m_203173_(BlockAndTintGetter p_203174_, BlockPos p_203175_, VertexConsumer p_203176_, BlockState p_203177_, FluidState p_203178_) {
boolean flag = p_203178_.m_205070_(FluidTags.f_13132_);
- TextureAtlasSprite[] atextureatlassprite = flag ? this.f_110940_ : this.f_110941_;
+ TextureAtlasSprite[] atextureatlassprite = net.minecraftforge.client.ForgeHooksClient.getFluidSprites(p_110955_, p_110956_, p_110958_);
BlockState blockstate = p_110955_.m_8055_(p_110956_);
- int i = flag ? 16777215 : BiomeColors.m_108811_(p_110955_, p_110956_);
+ int i = p_110958_.m_76152_().getAttributes().getColor(p_110955_, p_110956_);
- int i = flag ? 16777215 : BiomeColors.m_108811_(p_203174_, p_203175_);
+ TextureAtlasSprite[] atextureatlassprite = net.minecraftforge.client.ForgeHooksClient.getFluidSprites(p_203174_, p_203175_, p_203178_);
+ int i = p_203178_.m_76152_().getAttributes().getColor(p_203174_, p_203175_);
+ float alpha = (float)(i >> 24 & 255) / 255.0F;
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
@@ -159,15 +_,15 @@
float f25 = f4 * f;
float f26 = f4 * f1;
float f27 = f4 * f2;
- this.m_110984_(p_110957_, d0 + 0.0D, d1 + (double)f7, d2 + 0.0D, f25, f26, f27, f13, f17, j);
- this.m_110984_(p_110957_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, f14, f18, j);
- this.m_110984_(p_110957_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, f15, f19, j);
- this.m_110984_(p_110957_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, f16, f20, j);
+ this.vertex(p_110957_, d0 + 0.0D, d1 + (double)f7, d2 + 0.0D, f25, f26, f27, alpha, f13, f17, j);
+ this.vertex(p_110957_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, alpha, f14, f18, j);
+ this.vertex(p_110957_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, alpha, f15, f19, j);
+ this.vertex(p_110957_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, alpha, f16, f20, j);
if (p_110958_.m_76171_(p_110955_, p_110956_.m_7494_())) {
- this.m_110984_(p_110957_, d0 + 0.0D, d1 + (double)f7, d2 + 0.0D, f25, f26, f27, f13, f17, j);
- this.m_110984_(p_110957_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, f16, f20, j);
- this.m_110984_(p_110957_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, f15, f19, j);
- this.m_110984_(p_110957_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, f14, f18, j);
+ this.vertex(p_110957_, d0 + 0.0D, d1 + (double)f7, d2 + 0.0D, f25, f26, f27, alpha, f13, f17, j);
+ this.vertex(p_110957_, d0 + 1.0D, d1 + (double)f10, d2 + 0.0D, f25, f26, f27, alpha, f16, f20, j);
+ this.vertex(p_110957_, d0 + 1.0D, d1 + (double)f9, d2 + 1.0D, f25, f26, f27, alpha, f15, f19, j);
+ this.vertex(p_110957_, d0 + 0.0D, d1 + (double)f8, d2 + 1.0D, f25, f26, f27, alpha, f14, f18, j);
@@ -184,15 +_,16 @@
float f30 = f4 * f;
float f31 = f4 * f1;
float f32 = f4 * f2;
- this.m_110984_(p_203176_, d1 + 0.0D, d2 + (double)f8, d0 + 0.0D, f30, f31, f32, f18, f22, j);
- this.m_110984_(p_203176_, d1 + 0.0D, d2 + (double)f10, d0 + 1.0D, f30, f31, f32, f19, f23, j);
- this.m_110984_(p_203176_, d1 + 1.0D, d2 + (double)f9, d0 + 1.0D, f30, f31, f32, f20, f24, j);
- this.m_110984_(p_203176_, d1 + 1.0D, d2 + (double)f7, d0 + 0.0D, f30, f31, f32, f21, f25, j);
+
+ this.vertex(p_203176_, d1 + 0.0D, d2 + (double)f8, d0 + 0.0D, f30, f31, f32, alpha, f18, f22, j);
+ this.vertex(p_203176_, d1 + 0.0D, d2 + (double)f10, d0 + 1.0D, f30, f31, f32, alpha, f19, f23, j);
+ this.vertex(p_203176_, d1 + 1.0D, d2 + (double)f9, d0 + 1.0D, f30, f31, f32, alpha, f20, f24, j);
+ this.vertex(p_203176_, d1 + 1.0D, d2 + (double)f7, d0 + 0.0D, f30, f31, f32, alpha, f21, f25, j);
if (p_203178_.m_76171_(p_203174_, p_203175_.m_7494_())) {
- this.m_110984_(p_203176_, d1 + 0.0D, d2 + (double)f8, d0 + 0.0D, f30, f31, f32, f18, f22, j);
- this.m_110984_(p_203176_, d1 + 1.0D, d2 + (double)f7, d0 + 0.0D, f30, f31, f32, f21, f25, j);
- this.m_110984_(p_203176_, d1 + 1.0D, d2 + (double)f9, d0 + 1.0D, f30, f31, f32, f20, f24, j);
- this.m_110984_(p_203176_, d1 + 0.0D, d2 + (double)f10, d0 + 1.0D, f30, f31, f32, f19, f23, j);
+ this.vertex(p_203176_, d1 + 0.0D, d2 + (double)f8, d0 + 0.0D, f30, f31, f32, alpha, f18, f22, j);
+ this.vertex(p_203176_, d1 + 1.0D, d2 + (double)f7, d0 + 0.0D, f30, f31, f32, alpha, f21, f25, j);
+ this.vertex(p_203176_, d1 + 1.0D, d2 + (double)f9, d0 + 1.0D, f30, f31, f32, alpha, f20, f24, j);
+ this.vertex(p_203176_, d1 + 0.0D, d2 + (double)f10, d0 + 1.0D, f30, f31, f32, alpha, f19, f23, j);
}
}
@@ -180,10 +_,10 @@
float f41 = f3 * f;
float f42 = f3 * f1;
float f43 = f3 * f2;
- this.m_110984_(p_110957_, d0, d1 + (double)f12, d2 + 1.0D, f41, f42, f43, f35, f39, i1);
- this.m_110984_(p_110957_, d0, d1 + (double)f12, d2, f41, f42, f43, f35, f37, i1);
- this.m_110984_(p_110957_, d0 + 1.0D, d1 + (double)f12, d2, f41, f42, f43, f36, f37, i1);
- this.m_110984_(p_110957_, d0 + 1.0D, d1 + (double)f12, d2 + 1.0D, f41, f42, f43, f36, f39, i1);
+ this.vertex(p_110957_, d0, d1 + (double)f12, d2 + 1.0D, f41, f42, f43, alpha, f35, f39, i1);
+ this.vertex(p_110957_, d0, d1 + (double)f12, d2, f41, f42, f43, alpha, f35, f37, i1);
+ this.vertex(p_110957_, d0 + 1.0D, d1 + (double)f12, d2, f41, f42, f43, alpha, f36, f37, i1);
+ this.vertex(p_110957_, d0 + 1.0D, d1 + (double)f12, d2 + 1.0D, f41, f42, f43, alpha, f36, f39, i1);
@@ -205,10 +_,11 @@
float f46 = f3 * f;
float f47 = f3 * f1;
float f48 = f3 * f2;
- this.m_110984_(p_203176_, d1, d2 + (double)f17, d0 + 1.0D, f46, f47, f48, f40, f43, l);
- this.m_110984_(p_203176_, d1, d2 + (double)f17, d0, f46, f47, f48, f40, f42, l);
- this.m_110984_(p_203176_, d1 + 1.0D, d2 + (double)f17, d0, f46, f47, f48, f41, f42, l);
- this.m_110984_(p_203176_, d1 + 1.0D, d2 + (double)f17, d0 + 1.0D, f46, f47, f48, f41, f43, l);
+
+ this.vertex(p_203176_, d1, d2 + (double)f17, d0 + 1.0D, f46, f47, f48, alpha, f40, f43, l);
+ this.vertex(p_203176_, d1, d2 + (double)f17, d0, f46, f47, f48, alpha, f40, f42, l);
+ this.vertex(p_203176_, d1 + 1.0D, d2 + (double)f17, d0, f46, f47, f48, alpha, f41, f42, l);
+ this.vertex(p_203176_, d1 + 1.0D, d2 + (double)f17, d0 + 1.0D, f46, f47, f48, alpha, f41, f43, l);
flag7 = true;
}
@@ -240,10 +_,9 @@
@@ -264,10 +_,9 @@
flag7 = true;
BlockPos blockpos = p_110956_.m_142300_(direction);
BlockPos blockpos = p_203175_.m_142300_(direction);
TextureAtlasSprite textureatlassprite2 = atextureatlassprite[1];
- if (!flag) {
- Block block = p_110955_.m_8055_(blockpos).m_60734_();
- Block block = p_203174_.m_8055_(blockpos).m_60734_();
- if (block instanceof HalfTransparentBlock || block instanceof LeavesBlock) {
- textureatlassprite2 = this.f_110942_;
+ if (atextureatlassprite[2] != null) {
+ if (p_110955_.m_8055_(blockpos).shouldDisplayFluidOverlay(p_110955_, blockpos, p_110958_)) {
+ if (p_203174_.m_8055_(blockpos).shouldDisplayFluidOverlay(p_203174_, blockpos, p_203178_)) {
+ textureatlassprite2 = atextureatlassprite[2];
}
}
@@ -256,15 +_,15 @@
float f32 = f4 * f31 * f;
float f33 = f4 * f31 * f1;
float f34 = f4 * f31 * f2;
- this.m_110984_(p_110957_, d3, d1 + (double)f38, d4, f32, f33, f34, f49, f28, k);
- this.m_110984_(p_110957_, d5, d1 + (double)f40, d6, f32, f33, f34, f50, f29, k);
- this.m_110984_(p_110957_, d5, d1 + (double)f12, d6, f32, f33, f34, f50, f30, k);
- this.m_110984_(p_110957_, d3, d1 + (double)f12, d4, f32, f33, f34, f49, f30, k);
+ this.vertex(p_110957_, d3, d1 + (double)f38, d4, f32, f33, f34, alpha, f49, f28, k);
+ this.vertex(p_110957_, d5, d1 + (double)f40, d6, f32, f33, f34, alpha, f50, f29, k);
+ this.vertex(p_110957_, d5, d1 + (double)f12, d6, f32, f33, f34, alpha, f50, f30, k);
+ this.vertex(p_110957_, d3, d1 + (double)f12, d4, f32, f33, f34, alpha, f49, f30, k);
@@ -280,15 +_,16 @@
float f37 = f4 * f36 * f;
float f38 = f4 * f36 * f1;
float f39 = f4 * f36 * f2;
- this.m_110984_(p_203176_, d3, d2 + (double)f44, d4, f37, f38, f39, f54, f33, k);
- this.m_110984_(p_203176_, d5, d2 + (double)f45, d6, f37, f38, f39, f55, f34, k);
- this.m_110984_(p_203176_, d5, d2 + (double)f17, d6, f37, f38, f39, f55, f35, k);
- this.m_110984_(p_203176_, d3, d2 + (double)f17, d4, f37, f38, f39, f54, f35, k);
+
+ this.vertex(p_203176_, d3, d2 + (double)f44, d4, f37, f38, f39, alpha, f54, f33, k);
+ this.vertex(p_203176_, d5, d2 + (double)f45, d6, f37, f38, f39, alpha, f55, f34, k);
+ this.vertex(p_203176_, d5, d2 + (double)f17, d6, f37, f38, f39, alpha, f55, f35, k);
+ this.vertex(p_203176_, d3, d2 + (double)f17, d4, f37, f38, f39, alpha, f54, f35, k);
if (textureatlassprite2 != this.f_110942_) {
- this.m_110984_(p_110957_, d3, d1 + (double)f12, d4, f32, f33, f34, f49, f30, k);
- this.m_110984_(p_110957_, d5, d1 + (double)f12, d6, f32, f33, f34, f50, f30, k);
- this.m_110984_(p_110957_, d5, d1 + (double)f40, d6, f32, f33, f34, f50, f29, k);
- this.m_110984_(p_110957_, d3, d1 + (double)f38, d4, f32, f33, f34, f49, f28, k);
+ this.vertex(p_110957_, d3, d1 + (double)f12, d4, f32, f33, f34, alpha, f49, f30, k);
+ this.vertex(p_110957_, d5, d1 + (double)f12, d6, f32, f33, f34, alpha, f50, f30, k);
+ this.vertex(p_110957_, d5, d1 + (double)f40, d6, f32, f33, f34, alpha, f50, f29, k);
+ this.vertex(p_110957_, d3, d1 + (double)f38, d4, f32, f33, f34, alpha, f49, f28, k);
- this.m_110984_(p_203176_, d3, d2 + (double)f17, d4, f37, f38, f39, f54, f35, k);
- this.m_110984_(p_203176_, d5, d2 + (double)f17, d6, f37, f38, f39, f55, f35, k);
- this.m_110984_(p_203176_, d5, d2 + (double)f45, d6, f37, f38, f39, f55, f34, k);
- this.m_110984_(p_203176_, d3, d2 + (double)f44, d4, f37, f38, f39, f54, f33, k);
+ this.vertex(p_203176_, d3, d2 + (double)f17, d4, f37, f38, f39, alpha, f54, f35, k);
+ this.vertex(p_203176_, d5, d2 + (double)f17, d6, f37, f38, f39, alpha, f55, f35, k);
+ this.vertex(p_203176_, d5, d2 + (double)f45, d6, f37, f38, f39, alpha, f55, f34, k);
+ this.vertex(p_203176_, d3, d2 + (double)f44, d4, f37, f38, f39, alpha, f54, f33, k);
}
}
}
@@ -273,8 +_,8 @@
@@ -343,8 +_,8 @@
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java
+++ b/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java
@@ -72,12 +_,15 @@
@@ -73,12 +_,15 @@
private Vec3 f_112683_ = Vec3.f_82478_;
public ChunkRenderDispatcher(ClientLevel p_194405_, LevelRenderer p_194406_, Executor p_194407_, boolean p_194408_, ChunkBufferBuilderPack p_194409_) {
@@ -17,7 +17,7 @@
this.f_112678_ = p_194409_;
List<ChunkBufferBuilderPack> list = Lists.newArrayListWithExpectedSize(l);
@@ -415,7 +_,7 @@
@@ -420,7 +_,7 @@
if (!chunkrenderdispatcher$compiledchunk.f_112750_.contains(p_112810_)) {
return false;
} else {
@@ -26,16 +26,16 @@
p_112811_.m_112709_(this.f_112788_);
return true;
}
@@ -443,7 +_,7 @@
BlockPos blockpos = this.f_112793_.m_7949_();
int i = 1;
RenderChunkRegion renderchunkregion = p_200438_.m_200465_(ChunkRenderDispatcher.this.f_112681_, blockpos.m_142082_(-1, -1, -1), blockpos.m_142082_(16, 16, 16), 1);
- this.f_112787_ = new ChunkRenderDispatcher.RenderChunk.RebuildTask(this.m_112832_(), renderchunkregion, flag || this.f_112784_.get() != ChunkRenderDispatcher.CompiledChunk.f_112748_);
@@ -452,7 +_,7 @@
this.f_202433_.incrementAndGet();
}
- this.f_112787_ = new ChunkRenderDispatcher.RenderChunk.RebuildTask(this.m_112832_(), renderchunkregion, !flag1 || this.f_202433_.get() > 2);
+ this.f_112787_ = new ChunkRenderDispatcher.RenderChunk.RebuildTask(new net.minecraft.world.level.ChunkPos(m_112839_()), this.m_112832_(), renderchunkregion, flag || this.f_112784_.get() != ChunkRenderDispatcher.CompiledChunk.f_112748_);
return this.f_112787_;
}
@@ -476,10 +_,20 @@
@@ -485,10 +_,20 @@
protected final double f_112847_;
protected final AtomicBoolean f_112848_ = new AtomicBoolean(false);
protected final boolean f_194420_;
@@ -56,7 +56,7 @@
}
public abstract CompletableFuture<ChunkRenderDispatcher.ChunkTaskResult> m_5869_(ChunkBufferBuilderPack p_112853_);
@@ -491,6 +_,10 @@
@@ -500,6 +_,10 @@
public int compareTo(ChunkRenderDispatcher.RenderChunk.ChunkCompileTask p_112855_) {
return Doubles.compare(this.f_112847_, p_112855_.f_112847_);
}
@@ -67,7 +67,7 @@
}
@OnlyIn(Dist.CLIENT)
@@ -498,8 +_,13 @@
@@ -507,8 +_,13 @@
@Nullable
protected RenderChunkRegion f_112858_;
@@ -82,10 +82,10 @@
this.f_112858_ = p_194428_;
}
@@ -580,8 +_,10 @@
}
@@ -591,8 +_,10 @@
FluidState fluidstate = renderchunkregion.m_6425_(blockpos2);
BlockState blockstate1 = renderchunkregion.m_8055_(blockpos2);
FluidState fluidstate = blockstate1.m_60819_();
- if (!fluidstate.m_76178_()) {
- RenderType rendertype = ItemBlockRenderTypes.m_109287_(fluidstate);
+ net.minecraftforge.client.model.data.IModelData modelData = getModelData(blockpos2);
@@ -95,7 +95,7 @@
BufferBuilder bufferbuilder = p_112870_.m_108839_(rendertype);
if (p_112869_.f_112750_.add(rendertype)) {
RenderChunk.this.m_112805_(bufferbuilder);
@@ -593,8 +_,8 @@
@@ -604,8 +_,8 @@
}
}
@@ -106,7 +106,7 @@
BufferBuilder bufferbuilder2 = p_112870_.m_108839_(rendertype1);
if (p_112869_.f_112750_.add(rendertype1)) {
RenderChunk.this.m_112805_(bufferbuilder2);
@@ -602,14 +_,16 @@
@@ -613,14 +_,16 @@
posestack.m_85836_();
posestack.m_85837_((double)(blockpos2.m_123341_() & 15), (double)(blockpos2.m_123342_() & 15), (double)(blockpos2.m_123343_() & 15));
@@ -124,7 +124,7 @@
if (p_112869_.f_112749_.contains(RenderType.m_110466_())) {
BufferBuilder bufferbuilder1 = p_112870_.m_108839_(RenderType.m_110466_());
@@ -628,10 +_,10 @@
@@ -639,10 +_,10 @@
private <E extends BlockEntity> void m_112877_(ChunkRenderDispatcher.CompiledChunk p_112878_, Set<BlockEntity> p_112879_, E p_112880_) {
BlockEntityRenderer<E> blockentityrenderer = Minecraft.m_91087_().m_167982_().m_112265_(p_112880_);
if (blockentityrenderer != null) {
@@ -136,7 +136,7 @@
}
}
@@ -649,8 +_,13 @@
@@ -660,8 +_,13 @@
class ResortTransparencyTask extends ChunkRenderDispatcher.RenderChunk.ChunkCompileTask {
private final ChunkRenderDispatcher.CompiledChunk f_112886_;
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/server/IntegratedServer.java
+++ b/net/minecraft/client/server/IntegratedServer.java
@@ -62,9 +_,10 @@
@@ -60,9 +_,10 @@
this.m_129997_(true);
this.m_129999_(true);
this.m_129793_();
@@ -12,7 +12,7 @@
}
public void m_5705_(BooleanSupplier p_120049_) {
@@ -181,6 +_,7 @@
@@ -179,6 +_,7 @@
}
public void m_7570_(boolean p_120053_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/commands/Commands.java
+++ b/net/minecraft/commands/Commands.java
@@ -175,7 +_,7 @@
@@ -177,7 +_,7 @@
JfrCommand.m_183645_(this.f_82090_);
}
@@ -9,7 +9,7 @@
TestCommand.m_127946_(this.f_82090_);
}
@@ -199,6 +_,7 @@
@@ -201,6 +_,7 @@
if (p_82093_.f_82144_) {
PublishCommand.m_138184_(this.f_82090_);
}
@@ -17,7 +17,7 @@
this.f_82090_.findAmbiguities((p_82108_, p_82109_, p_82110_, p_82111_) -> {
f_82089_.warn("Ambiguity between arguments {} and {} with inputs: {}", this.f_82090_.getPath(p_82109_), this.f_82090_.getPath(p_82110_), p_82111_);
@@ -218,7 +_,15 @@
@@ -220,7 +_,15 @@
try {
try {
@@ -9,12 +9,12 @@
Objective objective = scoreboard.m_83477_(s);
if (objective == null) {
throw f_101953_.create(s);
@@ -55,7 +_,7 @@
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> p_101974_, SuggestionsBuilder p_101975_) {
if (p_101974_.getSource() instanceof CommandSourceStack) {
- return SharedSuggestionProvider.m_82970_(((CommandSourceStack)p_101974_.getSource()).m_81377_().m_129896_().m_83474_(), p_101975_);
+ return SharedSuggestionProvider.m_82970_(((CommandSourceStack)p_101974_.getSource()).getScoreboard().m_83474_(), p_101975_);
} else if (p_101974_.getSource() instanceof SharedSuggestionProvider) {
SharedSuggestionProvider sharedsuggestionprovider = (SharedSuggestionProvider)p_101974_.getSource();
return sharedsuggestionprovider.m_5497_((CommandContext<SharedSuggestionProvider>)p_101974_, p_101975_);
@@ -57,7 +_,7 @@
S s = p_101974_.getSource();
if (s instanceof CommandSourceStack) {
CommandSourceStack commandsourcestack = (CommandSourceStack)s;
- return SharedSuggestionProvider.m_82970_(commandsourcestack.m_81377_().m_129896_().m_83474_(), p_101975_);
+ return SharedSuggestionProvider.m_82970_(commandsourcestack.getScoreboard().m_83474_(), p_101975_);
} else if (s instanceof SharedSuggestionProvider) {
SharedSuggestionProvider sharedsuggestionprovider = (SharedSuggestionProvider)s;
return sharedsuggestionprovider.m_212155_(p_101974_);
@@ -1,20 +1,20 @@
--- a/net/minecraft/commands/arguments/ResourceLocationArgument.java
+++ b/net/minecraft/commands/arguments/ResourceLocationArgument.java
@@ -44,7 +_,7 @@
@@ -39,7 +_,7 @@
public static Advancement m_106987_(CommandContext<CommandSourceStack> p_106988_, String p_106989_) throws CommandSyntaxException {
ResourceLocation resourcelocation = p_106988_.getArgument(p_106989_, ResourceLocation.class);
ResourceLocation resourcelocation = m_107011_(p_106988_, p_106989_);
- Advancement advancement = p_106988_.getSource().m_81377_().m_129889_().m_136041_(resourcelocation);
+ Advancement advancement = p_106988_.getSource().getAdvancement(resourcelocation);
if (advancement == null) {
throw f_106978_.create(resourcelocation);
} else {
@@ -53,7 +_,7 @@
@@ -48,7 +_,7 @@
}
public static Recipe<?> m_106994_(CommandContext<CommandSourceStack> p_106995_, String p_106996_) throws CommandSyntaxException {
- RecipeManager recipemanager = p_106995_.getSource().m_81377_().m_129894_();
+ RecipeManager recipemanager = p_106995_.getSource().getRecipeManager();
ResourceLocation resourcelocation = p_106995_.getArgument(p_106996_, ResourceLocation.class);
ResourceLocation resourcelocation = m_107011_(p_106995_, p_106996_);
return recipemanager.m_44043_(resourcelocation).orElseThrow(() -> {
return f_106979_.create(resourcelocation);
@@ -1,17 +1,17 @@
--- a/net/minecraft/commands/synchronization/ArgumentTypes.java
+++ b/net/minecraft/commands/synchronization/ArgumentTypes.java
@@ -118,7 +_,7 @@
m_121601_("dimension", DimensionArgument.class, new EmptyArgumentSerializer<>(DimensionArgument::m_88805_));
m_121601_("time", TimeArgument.class, new EmptyArgumentSerializer<>(TimeArgument::m_113037_));
@@ -122,7 +_,7 @@
m_121601_("uuid", UuidArgument.class, new EmptyArgumentSerializer<>(UuidArgument::m_113850_));
m_121601_("resource", m_211031_(ResourceKeyArgument.class), new ResourceKeyArgument.Serializer());
m_121601_("resource_or_tag", m_211031_(ResourceOrTagLocationArgument.class), new ResourceOrTagLocationArgument.Serializer());
- if (SharedConstants.f_136183_) {
+ if (net.minecraftforge.gametest.ForgeGameTestHooks.isGametestEnabled()) {
m_121601_("test_argument", TestFunctionArgument.class, new EmptyArgumentSerializer<>(TestFunctionArgument::m_128088_));
m_121601_("test_class", TestClassNameArgument.class, new EmptyArgumentSerializer<>(TestClassNameArgument::m_127917_));
}
@@ -256,5 +_,9 @@
this.f_121619_ = p_121623_;
this.f_121620_ = p_121624_;
@@ -262,5 +_,9 @@
this.f_121619_ = p_211034_;
this.f_121620_ = p_211035_;
}
+ }
+ @javax.annotation.Nullable public static ResourceLocation getId(ArgumentType<?> type) {
@@ -1,15 +1,16 @@
--- a/net/minecraft/core/MappedRegistry.java
+++ b/net/minecraft/core/MappedRegistry.java
@@ -218,9 +_,10 @@
@@ -279,6 +_,13 @@
return this.f_205842_.containsKey(p_175392_);
}
public static <T> Codec<MappedRegistry<T>> m_122756_(ResourceKey<? extends Registry<T>> p_122757_, Lifecycle p_122758_, Codec<T> p_122759_) {
- return Codec.unboundedMap(ResourceLocation.f_135803_.xmap(ResourceKey.m_135797_(p_122757_), ResourceKey::m_135782_), p_122759_).xmap((p_194547_) -> {
+ // FORGE: Fix MC-197860
+ return new net.minecraftforge.common.LenientUnboundedMapCodec<>(ResourceLocation.f_135803_.xmap(ResourceKey.m_135797_(p_122757_), ResourceKey::m_135782_), p_122759_).xmap((p_122726_) -> {
MappedRegistry<T> mappedregistry = new MappedRegistry<>(p_122757_, p_122758_);
- p_194547_.forEach((p_194536_, p_194537_) -> {
+ p_122726_.forEach((p_194536_, p_194537_) -> {
mappedregistry.m_7135_(p_194536_, p_194537_, p_122758_);
});
return mappedregistry;
+ // Forge: For internal use only. Use the Register events when registering values.
+ public void unfreeze() {
+ this.f_205845_ = false;
+ if (this.f_205846_ != null && this.f_205847_ == null)
+ this.f_205847_ = new IdentityHashMap<>();
+ }
+
public Registry<T> m_203521_() {
this.f_205845_ = true;
List<ResourceLocation> list = this.f_205842_.entrySet().stream().filter((p_211055_) -> {
@@ -1,195 +1,195 @@
--- a/net/minecraft/core/Registry.java
+++ b/net/minecraft/core/Registry.java
@@ -106,6 +_,10 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -116,6 +_,10 @@
import org.apache.commons.lang3.Validate;
import org.slf4j.Logger;
+/*
+ * Attention Modders: This SHOULD NOT be used, you should use ForgeRegistries instead. As it has a cleaner modder facing API.
+ * We will be wrapping all of these in our API as necessary for syncing and management.
+ */
public abstract class Registry<T> implements Keyable, IdMap<T> {
protected static final Logger f_122894_ = LogManager.getLogger();
private static final Logger f_122894_ = LogUtils.getLogger();
private static final Map<ResourceLocation, Supplier<?>> f_122834_ = Maps.newLinkedHashMap();
@@ -153,43 +_,43 @@
public static final DefaultedRegistry<GameEvent> f_175412_ = m_122995_(f_175423_, "step", () -> {
@@ -163,43 +_,43 @@
public static final DefaultedRegistry<GameEvent> f_175412_ = m_206031_(f_175423_, "step", GameEvent::m_204530_, (p_206044_) -> {
return GameEvent.f_157785_;
});
- public static final Registry<SoundEvent> f_122821_ = m_122999_(f_122898_, () -> {
+ @Deprecated public static final Registry<SoundEvent> f_122821_ = forge(f_122898_, () -> {
- public static final Registry<SoundEvent> f_122821_ = m_206008_(f_122898_, (p_206042_) -> {
+ @Deprecated public static final Registry<SoundEvent> f_122821_ = forge(f_122898_, (registry) -> {
return SoundEvents.f_12019_;
});
- public static final DefaultedRegistry<Fluid> f_122822_ = m_122995_(f_122899_, "empty", () -> {
+ @Deprecated public static final DefaultedRegistry<Fluid> f_122822_ = forge(f_122899_, "empty", () -> {
- public static final DefaultedRegistry<Fluid> f_122822_ = m_206031_(f_122899_, "empty", Fluid::m_205069_, (p_206040_) -> {
+ @Deprecated public static final DefaultedRegistry<Fluid> f_122822_ = forge(f_122899_, "empty", (registry) -> {
return Fluids.f_76191_;
});
- public static final Registry<MobEffect> f_122823_ = m_122999_(f_122900_, () -> {
+ @Deprecated public static final Registry<MobEffect> f_122823_ = forge(f_122900_, () -> {
- public static final Registry<MobEffect> f_122823_ = m_206008_(f_122900_, (p_205982_) -> {
+ @Deprecated public static final Registry<MobEffect> f_122823_ = forge(f_122900_, (registry) -> {
return MobEffects.f_19621_;
});
- public static final DefaultedRegistry<Block> f_122824_ = m_122995_(f_122901_, "air", () -> {
+ @Deprecated public static final DefaultedRegistry<Block> f_122824_ = forge(f_122901_, "air", () -> {
- public static final DefaultedRegistry<Block> f_122824_ = m_206031_(f_122901_, "air", Block::m_204297_, (p_205980_) -> {
+ @Deprecated public static final DefaultedRegistry<Block> f_122824_ = forge(f_122901_, "air", (registry) -> {
return Blocks.f_50016_;
});
- public static final Registry<Enchantment> f_122825_ = m_122999_(f_122902_, () -> {
+ @Deprecated public static final Registry<Enchantment> f_122825_ = forge(f_122902_, () -> {
- public static final Registry<Enchantment> f_122825_ = m_206008_(f_122902_, (p_205978_) -> {
+ @Deprecated public static final Registry<Enchantment> f_122825_ = forge(f_122902_, (registry) -> {
return Enchantments.f_44987_;
});
- public static final DefaultedRegistry<EntityType<?>> f_122826_ = m_122995_(f_122903_, "pig", () -> {
+ @Deprecated public static final DefaultedRegistry<EntityType<?>> f_122826_ = forge(f_122903_, "pig", () -> {
- public static final DefaultedRegistry<EntityType<?>> f_122826_ = m_206031_(f_122903_, "pig", EntityType::m_204041_, (p_205976_) -> {
+ @Deprecated public static final DefaultedRegistry<EntityType<?>> f_122826_ = forge(f_122903_, "pig", (registry) -> {
return EntityType.f_20510_;
});
- public static final DefaultedRegistry<Item> f_122827_ = m_122995_(f_122904_, "air", () -> {
+ @Deprecated public static final DefaultedRegistry<Item> f_122827_ = forge(f_122904_, "air", () -> {
- public static final DefaultedRegistry<Item> f_122827_ = m_206031_(f_122904_, "air", Item::m_204114_, (p_205974_) -> {
+ @Deprecated public static final DefaultedRegistry<Item> f_122827_ = forge(f_122904_, "air", (registry) -> {
return Items.f_41852_;
});
- public static final DefaultedRegistry<Potion> f_122828_ = m_122995_(f_122905_, "empty", () -> {
+ @Deprecated public static final DefaultedRegistry<Potion> f_122828_ = forge(f_122905_, "empty", () -> {
- public static final DefaultedRegistry<Potion> f_122828_ = m_206027_(f_122905_, "empty", (p_205972_) -> {
+ @Deprecated public static final DefaultedRegistry<Potion> f_122828_ = forge(f_122905_, "empty", (registry) -> {
return Potions.f_43598_;
});
- public static final Registry<ParticleType<?>> f_122829_ = m_122999_(f_122906_, () -> {
+ @Deprecated public static final Registry<ParticleType<?>> f_122829_ = forge(f_122906_, () -> {
- public static final Registry<ParticleType<?>> f_122829_ = m_206008_(f_122906_, (p_205970_) -> {
+ @Deprecated public static final Registry<ParticleType<?>> f_122829_ = forge(f_122906_, (registry) -> {
return ParticleTypes.f_123794_;
});
- public static final Registry<BlockEntityType<?>> f_122830_ = m_122999_(f_122907_, () -> {
+ @Deprecated public static final Registry<BlockEntityType<?>> f_122830_ = forge(f_122907_, () -> {
- public static final Registry<BlockEntityType<?>> f_122830_ = m_206008_(f_122907_, (p_205968_) -> {
+ @Deprecated public static final Registry<BlockEntityType<?>> f_122830_ = forge(f_122907_, (registry) -> {
return BlockEntityType.f_58917_;
});
- public static final DefaultedRegistry<Motive> f_122831_ = m_122995_(f_122908_, "kebab", () -> {
+ @Deprecated public static final DefaultedRegistry<Motive> f_122831_ = forge(f_122908_, "kebab", () -> {
- public static final DefaultedRegistry<Motive> f_122831_ = m_206027_(f_122908_, "kebab", (p_205966_) -> {
+ @Deprecated public static final DefaultedRegistry<Motive> f_122831_ = forge(f_122908_, "kebab", (registry) -> {
return Motive.f_31866_;
});
public static final Registry<ResourceLocation> f_122832_ = m_122999_(f_122909_, () -> {
public static final Registry<ResourceLocation> f_122832_ = m_206008_(f_122909_, (p_205964_) -> {
return Stats.f_12926_;
});
- public static final DefaultedRegistry<ChunkStatus> f_122833_ = m_122995_(f_122910_, "empty", () -> {
+ @Deprecated public static final DefaultedRegistry<ChunkStatus> f_122833_ = forge(f_122910_, "empty", () -> {
- public static final DefaultedRegistry<ChunkStatus> f_122833_ = m_206027_(f_122910_, "empty", (p_205962_) -> {
+ @Deprecated public static final DefaultedRegistry<ChunkStatus> f_122833_ = forge(f_122910_, "empty", (registry) -> {
return ChunkStatus.f_62314_;
});
public static final Registry<RuleTestType<?>> f_122861_ = m_122999_(f_122911_, () -> {
@@ -198,43 +_,43 @@
public static final Registry<PosRuleTestType<?>> f_122862_ = m_122999_(f_122912_, () -> {
public static final Registry<RuleTestType<?>> f_122861_ = m_206008_(f_122911_, (p_205960_) -> {
@@ -208,43 +_,43 @@
public static final Registry<PosRuleTestType<?>> f_122862_ = m_206008_(f_122912_, (p_205958_) -> {
return PosRuleTestType.f_74205_;
});
- public static final Registry<MenuType<?>> f_122863_ = m_122999_(f_122913_, () -> {
+ @Deprecated public static final Registry<MenuType<?>> f_122863_ = forge(f_122913_, () -> {
- public static final Registry<MenuType<?>> f_122863_ = m_206008_(f_122913_, (p_205956_) -> {
+ @Deprecated public static final Registry<MenuType<?>> f_122863_ = forge(f_122913_, (registry) -> {
return MenuType.f_39964_;
});
public static final Registry<RecipeType<?>> f_122864_ = m_122999_(f_122914_, () -> {
public static final Registry<RecipeType<?>> f_122864_ = m_206008_(f_122914_, (p_205954_) -> {
return RecipeType.f_44107_;
});
- public static final Registry<RecipeSerializer<?>> f_122865_ = m_122999_(f_122915_, () -> {
+ @Deprecated public static final Registry<RecipeSerializer<?>> f_122865_ = forge(f_122915_, () -> {
- public static final Registry<RecipeSerializer<?>> f_122865_ = m_206008_(f_122915_, (p_205952_) -> {
+ @Deprecated public static final Registry<RecipeSerializer<?>> f_122865_ = forge(f_122915_, (registry) -> {
return RecipeSerializer.f_44077_;
});
- public static final Registry<Attribute> f_122866_ = m_122999_(f_122916_, () -> {
+ @Deprecated public static final Registry<Attribute> f_122866_ = forge(f_122916_, () -> {
- public static final Registry<Attribute> f_122866_ = m_206008_(f_122916_, (p_205950_) -> {
+ @Deprecated public static final Registry<Attribute> f_122866_ = forge(f_122916_, (registry) -> {
return Attributes.f_22286_;
});
public static final Registry<PositionSourceType<?>> f_175420_ = m_122999_(f_175408_, () -> {
public static final Registry<PositionSourceType<?>> f_175420_ = m_206008_(f_175408_, (p_205948_) -> {
return PositionSourceType.f_157871_;
});
- public static final Registry<StatType<?>> f_122867_ = m_122999_(f_122917_, () -> {
+ @Deprecated public static final Registry<StatType<?>> f_122867_ = forge(f_122917_, () -> {
- public static final Registry<StatType<?>> f_122867_ = m_206008_(f_122917_, (p_205946_) -> {
+ @Deprecated public static final Registry<StatType<?>> f_122867_ = forge(f_122917_, (registry) -> {
return Stats.f_12982_;
});
public static final DefaultedRegistry<VillagerType> f_122868_ = m_122995_(f_122808_, "plains", () -> {
public static final DefaultedRegistry<VillagerType> f_122868_ = m_206027_(f_122808_, "plains", (p_205944_) -> {
return VillagerType.f_35821_;
});
- public static final DefaultedRegistry<VillagerProfession> f_122869_ = m_122995_(f_122809_, "none", () -> {
+ @Deprecated public static final DefaultedRegistry<VillagerProfession> f_122869_ = forge(f_122809_, "none", () -> {
- public static final DefaultedRegistry<VillagerProfession> f_122869_ = m_206027_(f_122809_, "none", (p_205942_) -> {
+ @Deprecated public static final DefaultedRegistry<VillagerProfession> f_122869_ = forge(f_122809_, "none", (registry) -> {
return VillagerProfession.f_35585_;
});
- public static final DefaultedRegistry<PoiType> f_122870_ = m_122995_(f_122810_, "unemployed", () -> {
+ @Deprecated public static final DefaultedRegistry<PoiType> f_122870_ = forge(f_122810_, "unemployed", () -> {
- public static final DefaultedRegistry<PoiType> f_122870_ = m_206027_(f_122810_, "unemployed", (p_205940_) -> {
+ @Deprecated public static final DefaultedRegistry<PoiType> f_122870_ = forge(f_122810_, "unemployed", (registry) -> {
return PoiType.f_27331_;
});
- public static final DefaultedRegistry<MemoryModuleType<?>> f_122871_ = m_122995_(f_122811_, "dummy", () -> {
+ @Deprecated public static final DefaultedRegistry<MemoryModuleType<?>> f_122871_ = forge(f_122811_, "dummy", () -> {
- public static final DefaultedRegistry<MemoryModuleType<?>> f_122871_ = m_206027_(f_122811_, "dummy", (p_205938_) -> {
+ @Deprecated public static final DefaultedRegistry<MemoryModuleType<?>> f_122871_ = forge(f_122811_, "dummy", (registry) -> {
return MemoryModuleType.f_26349_;
});
- public static final DefaultedRegistry<SensorType<?>> f_122872_ = m_122995_(f_122812_, "dummy", () -> {
+ @Deprecated public static final DefaultedRegistry<SensorType<?>> f_122872_ = forge(f_122812_, "dummy", () -> {
- public static final DefaultedRegistry<SensorType<?>> f_122872_ = m_206027_(f_122812_, "dummy", (p_205936_) -> {
+ @Deprecated public static final DefaultedRegistry<SensorType<?>> f_122872_ = forge(f_122812_, "dummy", (registry) -> {
return SensorType.f_26809_;
});
- public static final Registry<Schedule> f_122873_ = m_122999_(f_122813_, () -> {
+ @Deprecated public static final Registry<Schedule> f_122873_ = forge(f_122813_, () -> {
- public static final Registry<Schedule> f_122873_ = m_206008_(f_122813_, (p_205934_) -> {
+ @Deprecated public static final Registry<Schedule> f_122873_ = forge(f_122813_, (registry) -> {
return Schedule.f_38012_;
});
- public static final Registry<Activity> f_122874_ = m_122999_(f_122814_, () -> {
+ @Deprecated public static final Registry<Activity> f_122874_ = forge(f_122814_, () -> {
- public static final Registry<Activity> f_122874_ = m_206008_(f_122814_, (p_205932_) -> {
+ @Deprecated public static final Registry<Activity> f_122874_ = forge(f_122814_, (registry) -> {
return Activity.f_37979_;
});
public static final Registry<LootPoolEntryType> f_122875_ = m_122999_(f_122815_, () -> {
@@ -281,15 +_,15 @@
public static final ResourceKey<Registry<Biome>> f_122885_ = m_122978_("worldgen/biome");
public static final Registry<LootPoolEntryType> f_122875_ = m_206008_(f_122815_, (p_206133_) -> {
@@ -293,15 +_,15 @@
public static final ResourceKey<Registry<NormalNoise.NoiseParameters>> f_194568_ = m_122978_("worldgen/noise");
public static final ResourceKey<Registry<DensityFunction>> f_211074_ = m_122978_("worldgen/density_function");
public static final ResourceKey<Registry<WorldCarver<?>>> f_122836_ = m_122978_("worldgen/carver");
- public static final Registry<WorldCarver<?>> f_122837_ = m_122999_(f_122836_, () -> {
+ @Deprecated public static final Registry<WorldCarver<?>> f_122837_ = forge(f_122836_, () -> {
- public static final Registry<WorldCarver<?>> f_122837_ = m_206008_(f_122836_, (p_206112_) -> {
+ @Deprecated public static final Registry<WorldCarver<?>> f_122837_ = forge(f_122836_, (registry) -> {
return WorldCarver.f_64974_;
});
public static final ResourceKey<Registry<Feature<?>>> f_122838_ = m_122978_("worldgen/feature");
- public static final Registry<Feature<?>> f_122839_ = m_122999_(f_122838_, () -> {
+ @Deprecated public static final Registry<Feature<?>> f_122839_ = forge(f_122838_, () -> {
- public static final Registry<Feature<?>> f_122839_ = m_206008_(f_122838_, (p_206109_) -> {
+ @Deprecated public static final Registry<Feature<?>> f_122839_ = forge(f_122838_, (registry) -> {
return Feature.f_65731_;
});
public static final ResourceKey<Registry<StructureFeature<?>>> f_122840_ = m_122978_("worldgen/structure_feature");
- public static final Registry<StructureFeature<?>> f_122841_ = m_122999_(f_122840_, () -> {
+ @Deprecated public static final Registry<StructureFeature<?>> f_122841_ = forge(f_122840_, () -> {
- public static final Registry<StructureFeature<?>> f_122841_ = m_206008_(f_122840_, (p_206107_) -> {
+ @Deprecated public static final Registry<StructureFeature<?>> f_122841_ = forge(f_122840_, (registry) -> {
return StructureFeature.f_67014_;
});
public static final ResourceKey<Registry<StructurePieceType>> f_122842_ = m_122978_("worldgen/structure_piece");
@@ -311,16 +_,16 @@
public static final ResourceKey<Registry<Codec<? extends SurfaceRules.RuleSource>>> f_194572_ = m_122978_("worldgen/material_rule");
public static final ResourceKey<Registry<StructurePlacementType<?>>> f_205929_ = m_122978_("worldgen/structure_placement");
@@ -328,16 +_,16 @@
public static final ResourceKey<Registry<Codec<? extends DensityFunction>>> f_211075_ = m_122978_("worldgen/density_function_type");
public static final ResourceKey<Registry<StructureProcessorType<?>>> f_122854_ = m_122978_("worldgen/structure_processor");
public static final ResourceKey<Registry<StructurePoolElementType<?>>> f_122855_ = m_122978_("worldgen/structure_pool_element");
- public static final Registry<BlockStateProviderType<?>> f_122856_ = m_122999_(f_122846_, () -> {
+ @Deprecated public static final Registry<BlockStateProviderType<?>> f_122856_ = forge(f_122846_, () -> {
- public static final Registry<BlockStateProviderType<?>> f_122856_ = m_206008_(f_122846_, (p_206098_) -> {
+ @Deprecated public static final Registry<BlockStateProviderType<?>> f_122856_ = forge(f_122846_, (registry) -> {
return BlockStateProviderType.f_68752_;
});
- public static final Registry<FoliagePlacerType<?>> f_122858_ = m_122999_(f_122848_, () -> {
+ @Deprecated public static final Registry<FoliagePlacerType<?>> f_122858_ = forge(f_122848_, () -> {
- public static final Registry<FoliagePlacerType<?>> f_122858_ = m_206008_(f_122848_, (p_206092_) -> {
+ @Deprecated public static final Registry<FoliagePlacerType<?>> f_122858_ = forge(f_122848_, (registry) -> {
return FoliagePlacerType.f_68591_;
});
public static final Registry<TrunkPlacerType<?>> f_122859_ = m_122999_(f_122849_, () -> {
public static final Registry<TrunkPlacerType<?>> f_122859_ = m_206008_(f_122849_, (p_206086_) -> {
return TrunkPlacerType.f_70315_;
});
- public static final Registry<TreeDecoratorType<?>> f_122860_ = m_122999_(f_122850_, () -> {
+ @Deprecated public static final Registry<TreeDecoratorType<?>> f_122860_ = forge(f_122850_, () -> {
- public static final Registry<TreeDecoratorType<?>> f_122860_ = m_206008_(f_122850_, (p_206078_) -> {
+ @Deprecated public static final Registry<TreeDecoratorType<?>> f_122860_ = forge(f_122850_, (registry) -> {
return TreeDecoratorType.f_70043_;
});
public static final Registry<FeatureSizeType<?>> f_122888_ = m_122999_(f_122851_, () -> {
@@ -365,16 +_,32 @@
return m_122981_(p_123000_, Lifecycle.experimental(), p_123001_);
public static final Registry<FeatureSizeType<?>> f_122888_ = m_206008_(f_122851_, (p_206072_) -> {
@@ -383,16 +_,32 @@
return m_205999_(p_206009_, Lifecycle.experimental(), p_206010_);
}
+ private static <T extends net.minecraftforge.registries.IForgeRegistryEntry<T>> Registry<T> forge(ResourceKey<? extends Registry<T>> key, Supplier<T> def) {
+ private static <T extends net.minecraftforge.registries.IForgeRegistryEntry<T>> Registry<T> forge(ResourceKey<? extends Registry<T>> key, Registry.RegistryBootstrap<T> def) {
+ return forge(key, Lifecycle.experimental(), def);
+ }
+
private static <T> DefaultedRegistry<T> m_122995_(ResourceKey<? extends Registry<T>> p_122996_, String p_122997_, Supplier<T> p_122998_) {
return m_122990_(p_122996_, p_122997_, Lifecycle.experimental(), p_122998_);
private static <T> DefaultedRegistry<T> m_206027_(ResourceKey<? extends Registry<T>> p_206028_, String p_206029_, Registry.RegistryBootstrap<T> p_206030_) {
return m_206016_(p_206028_, p_206029_, Lifecycle.experimental(), p_206030_);
}
+ private static <T extends net.minecraftforge.registries.IForgeRegistryEntry<T>> DefaultedRegistry<T> forge(ResourceKey<? extends Registry<T>> key, String defKey, Supplier<T> def) {
+ private static <T extends net.minecraftforge.registries.IForgeRegistryEntry<T>> DefaultedRegistry<T> forge(ResourceKey<? extends Registry<T>> key, String defKey, Registry.RegistryBootstrap<T> def) {
+ return forge(key, defKey, Lifecycle.experimental(), def);
+ }
+
private static <T> Registry<T> m_122981_(ResourceKey<? extends Registry<T>> p_122982_, Lifecycle p_122983_, Supplier<T> p_122984_) {
return m_122985_(p_122982_, new MappedRegistry<>(p_122982_, p_122983_), p_122984_, p_122983_);
private static <T> DefaultedRegistry<T> m_206031_(ResourceKey<? extends Registry<T>> p_206032_, String p_206033_, Function<T, Holder.Reference<T>> p_206034_, Registry.RegistryBootstrap<T> p_206035_) {
return m_206021_(p_206032_, p_206033_, Lifecycle.experimental(), p_206034_, p_206035_);
}
+ private static <T extends net.minecraftforge.registries.IForgeRegistryEntry<T>> Registry<T> forge(ResourceKey<? extends Registry<T>> key, Lifecycle cycle, Supplier<T> def) {
+ return m_122985_(key, net.minecraftforge.registries.GameData.getWrapper(key, cycle), def, cycle);
+ private static <T extends net.minecraftforge.registries.IForgeRegistryEntry<T>> Registry<T> forge(ResourceKey<? extends Registry<T>> key, Lifecycle cycle, Registry.RegistryBootstrap<T> def) {
+ return m_206011_(key, net.minecraftforge.registries.GameData.getWrapper(key, cycle), def, cycle);
+ }
+
private static <T> DefaultedRegistry<T> m_122990_(ResourceKey<? extends Registry<T>> p_122991_, String p_122992_, Lifecycle p_122993_, Supplier<T> p_122994_) {
return m_122985_(p_122991_, new DefaultedRegistry<>(p_122992_, p_122991_, p_122993_), p_122994_, p_122993_);
private static <T> Registry<T> m_205999_(ResourceKey<? extends Registry<T>> p_206000_, Lifecycle p_206001_, Registry.RegistryBootstrap<T> p_206002_) {
return m_206011_(p_206000_, new MappedRegistry<>(p_206000_, p_206001_, (Function<T, Holder.Reference<T>>)null), p_206002_, p_206001_);
+ }
+
+ private static <T extends net.minecraftforge.registries.IForgeRegistryEntry<T>> DefaultedRegistry<T> forge(ResourceKey<? extends Registry<T>> key, String defKey, Lifecycle cycle, Supplier<T> def) {
+ return m_122985_(key, net.minecraftforge.registries.GameData.getWrapper(key, cycle, defKey), def, cycle);
+ private static <T extends net.minecraftforge.registries.IForgeRegistryEntry<T>> DefaultedRegistry<T> forge(ResourceKey<? extends Registry<T>> key, String defKey, Lifecycle cycle, Registry.RegistryBootstrap<T> def) {
+ return m_206011_(key, net.minecraftforge.registries.GameData.getWrapper(key, cycle, defKey), def, cycle);
}
private static <T, R extends WritableRegistry<T>> R m_122985_(ResourceKey<? extends Registry<T>> p_122986_, R p_122987_, Supplier<T> p_122988_, Lifecycle p_122989_) {
private static <T> Registry<T> m_206003_(ResourceKey<? extends Registry<T>> p_206004_, Lifecycle p_206005_, Function<T, Holder.Reference<T>> p_206006_, Registry.RegistryBootstrap<T> p_206007_) {
@@ -1,11 +1,11 @@
--- a/net/minecraft/core/RegistryAccess.java
+++ b/net/minecraft/core/RegistryAccess.java
@@ -109,6 +_,8 @@
ResourceKey<? extends Registry<E>> resourcekey = p_194617_.f_123101_();
boolean flag = !resourcekey.equals(Registry.f_122878_) && !resourcekey.equals(Registry.f_122818_);
Registry<E> registry = f_123049_.m_175515_(resourcekey);
@@ -185,6 +_,8 @@
private static <E> void m_211081_(RegistryResourceAccess.InMemoryStorage p_211082_, RegistryAccess.RegistryData<E> p_211083_) {
ResourceKey<? extends Registry<E>> resourcekey = p_211083_.f_123101_();
Registry<E> registry = BuiltinRegistries.f_206379_.m_175515_(resourcekey);
+ if (!resourcekey.equals(Registry.f_122818_))
+ registry = ((Registry<Registry<E>>)BuiltinRegistries.f_123858_).m_6246_((ResourceKey<Registry<E>>)resourcekey);
WritableRegistry<E> writableregistry = p_194615_.m_175512_(resourcekey);
for(Entry<ResourceKey<E>, E> entry : registry.m_6579_()) {
ResourceKey<E> resourcekey1 = entry.getKey();
@@ -0,0 +1,12 @@
--- a/net/minecraft/core/RegistryCodecs.java
+++ b/net/minecraft/core/RegistryCodecs.java
@@ -95,7 +_,8 @@
}
private static <T> Codec<Map<ResourceKey<T>, T>> m_206315_(ResourceKey<? extends Registry<T>> p_206316_, Codec<T> p_206317_) {
- return Codec.unboundedMap(ResourceLocation.f_135803_.xmap(ResourceKey.m_135797_(p_206316_), ResourceKey::m_135782_), p_206317_);
+ // FORGE: Fix MC-197860
+ return new net.minecraftforge.common.LenientUnboundedMapCodec<>(ResourceLocation.f_135803_.xmap(ResourceKey.m_135797_(p_206316_), ResourceKey::m_135782_), p_206317_);
}
public static <E> Codec<HolderSet<E>> m_206279_(ResourceKey<? extends Registry<E>> p_206280_, Codec<E> p_206281_) {
@@ -1,22 +1,22 @@
--- a/net/minecraft/data/BuiltinRegistries.java
+++ b/net/minecraft/data/BuiltinRegistries.java
@@ -44,7 +_,7 @@
@@ -52,7 +_,7 @@
return ProcessorLists.f_127199_;
});
public static final Registry<StructureTemplatePool> f_123864_ = m_123893_(Registry.f_122884_, Pools::m_127189_);
- public static final Registry<Biome> f_123865_ = m_123893_(Registry.f_122885_, () -> {
+ @Deprecated public static final Registry<Biome> f_123865_ = forge(Registry.f_122885_, () -> {
return Biomes.f_127321_;
});
public static final Registry<NoiseGeneratorSettings> f_123866_ = m_123893_(Registry.f_122878_, NoiseGeneratorSettings::m_64488_);
@@ -52,6 +_,10 @@
public static final Registry<StructureTemplatePool> f_123864_ = m_123893_(Registry.f_122884_, Pools::m_206434_);
- public static final Registry<Biome> f_123865_ = m_123893_(Registry.f_122885_, Biomes::m_206462_);
+ @Deprecated public static final Registry<Biome> f_123865_ = forge(Registry.f_122885_, Biomes::m_206462_);
public static final Registry<NormalNoise.NoiseParameters> f_194654_ = m_123893_(Registry.f_194568_, NoiseData::m_206433_);
public static final Registry<DensityFunction> f_211085_ = m_123893_(Registry.f_211074_, NoiseRouterData::m_209468_);
public static final Registry<NoiseGeneratorSettings> f_123866_ = m_123893_(Registry.f_122878_, NoiseGeneratorSettings::m_204599_);
@@ -60,6 +_,10 @@
private static <T> Registry<T> m_123893_(ResourceKey<? extends Registry<T>> p_123894_, Supplier<T> p_123895_) {
private static <T> Registry<T> m_123893_(ResourceKey<? extends Registry<T>> p_123894_, Supplier<? extends Holder<? extends T>> p_123895_) {
return m_123884_(p_123894_, Lifecycle.stable(), p_123895_);
+ }
+
+ private static <T extends net.minecraftforge.registries.IForgeRegistryEntry<T>> Registry<T> forge(ResourceKey<? extends Registry<T>> key, Supplier<T> def) {
+ return m_123888_(key, net.minecraftforge.registries.GameData.getWrapper(key, Lifecycle.stable()), def, Lifecycle.stable());
+ private static <T extends net.minecraftforge.registries.IForgeRegistryEntry<T>> Registry<T> forge(ResourceKey<? extends Registry<T>> key, Supplier<? extends Holder<? extends T>> holderSupplier) {
+ return m_123888_(key, net.minecraftforge.registries.GameData.getWrapper(key, Lifecycle.stable()), holderSupplier, Lifecycle.stable());
}
private static <T> Registry<T> m_123884_(ResourceKey<? extends Registry<T>> p_123885_, Lifecycle p_123886_, Supplier<T> p_123887_) {
private static <T> Registry<T> m_123884_(ResourceKey<? extends Registry<T>> p_123885_, Lifecycle p_123886_, Supplier<? extends Holder<? extends T>> p_123887_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/data/Main.java
+++ b/net/minecraft/data/Main.java
@@ -41,8 +_,15 @@
@@ -43,8 +_,15 @@
OptionSpec<Void> optionspec6 = optionparser.accepts("all", "Include all generators");
OptionSpec<String> optionspec7 = optionparser.accepts("output", "Output folder").withRequiredArg().defaultsTo("generated");
OptionSpec<String> optionspec8 = optionparser.accepts("input", "Input folder").withRequiredArg();
@@ -17,7 +17,7 @@
Path path = Paths.get(optionspec7.value(optionset));
boolean flag = optionset.has(optionspec6);
boolean flag1 = flag || optionset.has(optionspec2);
@@ -50,10 +_,14 @@
@@ -52,10 +_,14 @@
boolean flag3 = flag || optionset.has(optionspec3);
boolean flag4 = flag || optionset.has(optionspec4);
boolean flag5 = flag || optionset.has(optionspec5);
@@ -1,6 +1,6 @@
--- a/net/minecraft/data/tags/BlockTagsProvider.java
+++ b/net/minecraft/data/tags/BlockTagsProvider.java
@@ -9,8 +_,12 @@
@@ -7,8 +_,12 @@
import net.minecraft.world.level.block.Blocks;
public class BlockTagsProvider extends TagsProvider<Block> {
@@ -1,6 +1,6 @@
--- a/net/minecraft/data/tags/EntityTypeTagsProvider.java
+++ b/net/minecraft/data/tags/EntityTypeTagsProvider.java
@@ -8,8 +_,12 @@
@@ -6,8 +_,12 @@
import net.minecraft.world.entity.EntityType;
public class EntityTypeTagsProvider extends TagsProvider<EntityType<?>> {
@@ -1,6 +1,6 @@
--- a/net/minecraft/data/tags/FluidTagsProvider.java
+++ b/net/minecraft/data/tags/FluidTagsProvider.java
@@ -9,8 +_,12 @@
@@ -7,8 +_,12 @@
import net.minecraft.world.level.material.Fluids;
public class FluidTagsProvider extends TagsProvider<Fluid> {
@@ -1,6 +1,6 @@
--- a/net/minecraft/data/tags/GameEventTagsProvider.java
+++ b/net/minecraft/data/tags/GameEventTagsProvider.java
@@ -8,8 +_,12 @@
@@ -6,8 +_,12 @@
import net.minecraft.world.level.gameevent.GameEvent;
public class GameEventTagsProvider extends TagsProvider<GameEvent> {
@@ -1,16 +1,16 @@
--- a/net/minecraft/data/tags/ItemTagsProvider.java
+++ b/net/minecraft/data/tags/ItemTagsProvider.java
@@ -15,8 +_,13 @@
@@ -14,8 +_,13 @@
public class ItemTagsProvider extends TagsProvider<Item> {
private final Function<Tag.Named<Block>, Tag.Builder> f_126528_;
private final Function<TagKey<Block>, Tag.Builder> f_126528_;
+ @Deprecated
public ItemTagsProvider(DataGenerator p_126530_, BlockTagsProvider p_126531_) {
super(p_126530_, Registry.f_122827_);
+ this.f_126528_ = p_126531_::m_126562_;
+ this.f_126528_ = p_126531_::m_206426_;
+ }
+ public ItemTagsProvider(DataGenerator p_126530_, BlockTagsProvider p_126531_, String modId, @javax.annotation.Nullable net.minecraftforge.common.data.ExistingFileHelper existingFileHelper) {
+ super(p_126530_, Registry.f_122827_, modId, existingFileHelper);
this.f_126528_ = p_126531_::m_126562_;
this.f_126528_ = p_126531_::m_206426_;
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/data/tags/TagsProvider.java
+++ b/net/minecraft/data/tags/TagsProvider.java
@@ -29,10 +_,29 @@
@@ -32,10 +_,29 @@
protected final DataGenerator f_126539_;
protected final Registry<T> f_126540_;
protected final Map<ResourceLocation, Tag.Builder> f_126543_ = Maps.newLinkedHashMap();
@@ -30,11 +30,11 @@
}
protected abstract void m_6577_();
@@ -43,12 +_,13 @@
@@ -46,12 +_,13 @@
this.f_126543_.forEach((p_176835_, p_176836_) -> {
List<Tag.BuilderEntry> list = p_176836_.m_13330_().filter((p_176832_) -> {
return !p_176832_.m_13347_().m_142746_(this.f_126540_::m_7804_, this.f_126543_::containsKey);
- }).collect(Collectors.toList());
return !p_176832_.f_13338_().m_142746_(this.f_126540_::m_7804_, this.f_126543_::containsKey);
- }).toList();
+ }).filter(this::missing).collect(Collectors.toList()); // Forge: Add validation via existing resources
if (!list.isEmpty()) {
throw new IllegalArgumentException(String.format("Couldn't define tag %s as it is missing following references: %s", p_176835_, list.stream().map(Objects::toString).collect(Collectors.joining(","))));
@@ -45,30 +45,35 @@
try {
String s = f_126542_.toJson((JsonElement)jsonobject);
@@ -85,20 +_,31 @@
@@ -88,6 +_,18 @@
});
}
+ private boolean missing(Tag.BuilderEntry reference) {
+ Tag.Entry entry = reference.m_13347_();
+ Tag.Entry entry = reference.f_13338_();
+ // We only care about non-optional tag entries, this is the only type that can reference a resource and needs validation
+ // Optional tags should not be validated
+
+ //TODO-PATCHING:Figure out optional tag data.
+ if (entry instanceof Tag.TagEntry) {
+ return existingFileHelper == null || !existingFileHelper.exists(((Tag.TagEntry)entry).getId(), resourceType);
+ }
+ return false;
+ }
+
protected abstract Path m_6648_(ResourceLocation p_126561_);
protected Path m_6648_(ResourceLocation p_126561_) {
ResourceKey<? extends Registry<T>> resourcekey = this.f_126540_.m_123023_();
return this.f_126539_.m_123916_().resolve("data/" + p_126561_.m_135827_() + "/" + TagManager.m_203918_(resourcekey) + "/" + p_126561_.m_135815_() + ".json");
@@ -95,16 +_,17 @@
protected TagsProvider.TagAppender<T> m_126548_(Tag.Named<T> p_126549_) {
Tag.Builder tag$builder = this.m_126562_(p_126549_);
protected TagsProvider.TagAppender<T> m_206424_(TagKey<T> p_206425_) {
Tag.Builder tag$builder = this.m_206426_(p_206425_);
- return new TagsProvider.TagAppender<>(tag$builder, this.f_126540_, "vanilla");
+ return new TagsProvider.TagAppender<>(tag$builder, this.f_126540_, modId);
}
protected Tag.Builder m_126562_(Tag.Named<T> p_126563_) {
return this.f_126543_.computeIfAbsent(p_126563_.m_6979_(), (p_176838_) -> {
protected Tag.Builder m_206426_(TagKey<T> p_206427_) {
return this.f_126543_.computeIfAbsent(p_206427_.f_203868_(), (p_176838_) -> {
+ existingFileHelper.trackGenerated(p_176838_, resourceType);
return new Tag.Builder();
});
@@ -79,25 +84,7 @@
private final Tag.Builder f_126568_;
public final Registry<T> f_126569_;
private final String f_126570_;
@@ -114,7 +_,7 @@
return this;
}
- public TagsProvider.TagAppender<T> m_176839_(ResourceLocation p_176840_) {
+ public TagsProvider.TagAppender<T> addOptional(ResourceLocation p_176840_) {
this.f_126568_.m_144379_(p_176840_, this.f_126570_);
return this;
}
@@ -124,7 +_,7 @@
return this;
}
- public TagsProvider.TagAppender<T> m_176841_(ResourceLocation p_176842_) {
+ public TagsProvider.TagAppender<T> addOptionalTag(ResourceLocation p_176842_) {
this.f_126568_.m_144382_(p_176842_, this.f_126570_);
return this;
}
@@ -135,6 +_,19 @@
@@ -150,6 +_,19 @@
this.f_126568_.m_13327_(p_126587_, this.f_126570_);
});
return this;
@@ -1,8 +1,8 @@
--- a/net/minecraft/gametest/framework/GameTestServer.java
+++ b/net/minecraft/gametest/framework/GameTestServer.java
@@ -69,12 +_,13 @@
@@ -93,12 +_,13 @@
public boolean m_7038_() {
this.m_129823_(new PlayerList(this, this.f_129746_, this.f_129745_, 1) {
this.m_129823_(new PlayerList(this, this.m_206579_(), this.f_129745_, 1) {
});
+ if (!net.minecraftforge.server.ServerLifecycleHooks.handleServerAboutToStart(this)) return false;
this.m_130006_();
@@ -1,6 +1,6 @@
--- a/net/minecraft/nbt/NbtIo.java
+++ b/net/minecraft/nbt/NbtIo.java
@@ -218,10 +_,12 @@
@@ -268,10 +_,12 @@
private static Tag m_128930_(DataInput p_128931_, int p_128932_, NbtAccounter p_128933_) throws IOException {
byte b0 = p_128931_.readByte();
@@ -1,6 +1,6 @@
--- a/net/minecraft/network/Connection.java
+++ b/net/minecraft/network/Connection.java
@@ -77,6 +_,7 @@
@@ -87,6 +_,7 @@
private float f_129477_;
private int f_129478_;
private boolean f_129479_;
@@ -8,7 +8,7 @@
public Connection(PacketFlow p_129482_) {
this.f_129466_ = p_129482_;
@@ -86,6 +_,7 @@
@@ -96,6 +_,7 @@
super.channelActive(p_129525_);
this.f_129468_ = p_129525_.channel();
this.f_129469_ = this.f_129468_.remoteAddress();
@@ -16,7 +16,7 @@
try {
this.m_129498_(ConnectionProtocol.HANDSHAKING);
@@ -179,7 +_,7 @@
@@ -191,7 +_,7 @@
++this.f_129475_;
if (connectionprotocol1 != connectionprotocol) {
f_129465_.debug("Disabled auto read");
@@ -25,7 +25,7 @@
}
if (this.f_129468_.eventLoop().inEventLoop()) {
@@ -277,7 +_,9 @@
@@ -289,7 +_,9 @@
}
public static Connection m_178300_(InetSocketAddress p_178301_, boolean p_178302_) {
@@ -35,7 +35,7 @@
Class<? extends SocketChannel> oclass;
LazyLoadedValue<? extends EventLoopGroup> lazyloadedvalue;
if (Epoll.isAvailable() && p_178302_) {
@@ -303,6 +_,7 @@
@@ -315,6 +_,7 @@
public static Connection m_129493_(SocketAddress p_129494_) {
final Connection connection = new Connection(PacketFlow.CLIENTBOUND);
@@ -43,7 +43,7 @@
(new Bootstrap()).group(f_129464_.m_13971_()).handler(new ChannelInitializer<Channel>() {
protected void initChannel(Channel p_129557_) {
p_129557_.pipeline().addLast("packet_handler", connection);
@@ -389,6 +_,14 @@
@@ -401,6 +_,14 @@
public float m_129543_() {
return this.f_129477_;
@@ -1,11 +0,0 @@
--- a/net/minecraft/network/PacketEncoder.java
+++ b/net/minecraft/network/PacketEncoder.java
@@ -48,7 +_,7 @@
JvmProfiler.f_185340_.m_183508_(k, integer, p_130545_.channel().remoteAddress(), j);
}
} catch (Throwable throwable) {
- f_130538_.error(throwable);
+ f_130538_.error("Error encoding packet", throwable); // Forge: Get Minecraft to spit out more information about the Throwable we got.
if (p_130546_.m_6588_()) {
throw new SkipPacketException(throwable);
} else {
@@ -8,11 +8,12 @@
optional = Optional.of(p_195896_.parse(p_195893_, jsonelement).map(RegistryResourceAccess.ParsedEntry::m_195956_));
} catch (Throwable throwable2) {
try {
@@ -138,6 +_,7 @@
@@ -138,6 +_,8 @@
public <E> Optional<DataResult<RegistryResourceAccess.ParsedEntry<E>>> m_183313_(DynamicOps<JsonElement> p_195917_, ResourceKey<? extends Registry<E>> p_195918_, ResourceKey<E> p_195919_, Decoder<E> p_195920_) {
RegistryResourceAccess.InMemoryStorage.Entry registryresourceaccess$inmemorystorage$entry = this.f_195913_.get(p_195919_);
+ if (registryresourceaccess$inmemorystorage$entry != null && registryresourceaccess$inmemorystorage$entry.f_195936_ != null) registryresourceaccess$inmemorystorage$entry.f_195936_.getAsJsonObject().addProperty("forge:registry_name", p_195919_.m_135782_().toString());
+ if (registryresourceaccess$inmemorystorage$entry != null && registryresourceaccess$inmemorystorage$entry.f_195936_ != null && registryresourceaccess$inmemorystorage$entry.f_195936_.isJsonObject())
+ registryresourceaccess$inmemorystorage$entry.f_195936_.getAsJsonObject().addProperty("forge:registry_name", p_195919_.m_135782_().toString());
return registryresourceaccess$inmemorystorage$entry == null ? Optional.of(DataResult.error("Unknown element: " + p_195919_)) : Optional.of(p_195920_.parse(p_195917_, registryresourceaccess$inmemorystorage$entry.f_195936_).setLifecycle(registryresourceaccess$inmemorystorage$entry.f_195938_).map((p_195930_) -> {
return RegistryResourceAccess.ParsedEntry.m_195958_(p_195930_, registryresourceaccess$inmemorystorage$entry.f_195937_);
}));
@@ -9,7 +9,7 @@
private static final Map<String, ResourceKey<?>> f_135775_ = Collections.synchronizedMap(Maps.newIdentityHashMap());
private final ResourceLocation f_135776_;
private final ResourceLocation f_135777_;
@@ -59,5 +_,23 @@
@@ -63,5 +_,23 @@
return (p_195974_) -> {
return m_135785_(p_135798_, p_195974_);
};
@@ -1,15 +1,15 @@
--- a/net/minecraft/server/Bootstrap.java
+++ b/net/minecraft/server/Bootstrap.java
@@ -56,6 +_,8 @@
@@ -55,6 +_,8 @@
CauldronInteraction.m_175649_();
ArgumentTypes.m_121586_();
StaticTags.m_13282_();
Registry.m_206101_();
+ net.minecraftforge.registries.GameData.vanillaSnapshot();
+ if (false) // skip redirectOutputToLog, Forge already redirects stdout and stderr output to log so that they print with more context
m_135890_();
}
}
@@ -129,7 +_,6 @@
@@ -128,7 +_,6 @@
m_197757_();
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/Main.java
+++ b/net/minecraft/server/Main.java
@@ -76,6 +_,15 @@
@@ -77,6 +_,15 @@
OptionSpec<String> optionspec12 = optionparser.accepts("serverId").withRequiredArg();
OptionSpec<Void> optionspec13 = optionparser.accepts("jfrProfile");
OptionSpec<String> optionspec14 = optionparser.nonOptions();
@@ -16,7 +16,7 @@
try {
OptionSet optionset = optionparser.parse(p_129699_);
@@ -83,6 +_,13 @@
@@ -84,6 +_,13 @@
optionparser.printHelpOn(System.err);
return;
}
@@ -30,13 +30,12 @@
CrashReport.m_127529_();
if (optionset.has(optionspec13)) {
@@ -92,30 +_,30 @@
@@ -93,29 +_,29 @@
Bootstrap.m_135870_();
Bootstrap.m_135889_();
Util.m_137584_();
- RegistryAccess.RegistryHolder registryaccess$registryholder = RegistryAccess.m_123086_();
+ if (!optionset.has(optionspec1)) net.minecraftforge.server.loading.ServerModLoader.load(); // Load mods before we load almost anything else anymore. Single spot now. Only loads if they haven't passed the initserver param
+ RegistryAccess.RegistryHolder registryaccess$registryholder; // RegistryAccess.builtin(); // Delay initialization until after we read additional save data
+ //TODO-PATCHING: Figure out how to handle the delayed initialization.
Path path = Paths.get("server.properties");
DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(path);
dedicatedserversettings.m_139780_();
@@ -65,34 +64,24 @@
LevelStorageSource levelstoragesource = LevelStorageSource.m_78242_(file1.toPath());
LevelStorageSource.LevelStorageAccess levelstoragesource$levelstorageaccess = levelstoragesource.m_78260_(s);
+ levelstoragesource$levelstorageaccess.readAdditionalLevelSaveData();
+ registryaccess$registryholder = RegistryAccess.m_123086_();
LevelSummary levelsummary = levelstoragesource$levelstorageaccess.m_78308_();
if (levelsummary != null) {
if (levelsummary.m_193020_()) {
@@ -164,6 +_,8 @@
worldgensettings = optionset.has(optionspec3) ? dedicatedserverproperties.m_180927_(registryaccess$registryholder).m_64671_() : dedicatedserverproperties.m_180927_(registryaccess$registryholder);
}
+ // Forge: Deserialize the DimensionGeneratorSettings to ensure modded dims are loaded on first server load (see SimpleRegistryCodec#decode). Vanilla behaviour only loads from the server.properties and deserializes only after the 2nd server load.
+ worldgensettings = WorldGenSettings.f_64600_.encodeStart(net.minecraft.resources.RegistryWriteOps.m_135767_(NbtOps.f_128958_, registryaccess$registryholder), worldgensettings).flatMap(nbt -> WorldGenSettings.f_64600_.parse(registryreadops, nbt)).getOrThrow(false, errorMsg->{});
worlddata = new PrimaryLevelData(levelsettings, worldgensettings, Lifecycle.stable());
@@ -181,22 +_,34 @@
}
@@ -175,22 +_,33 @@
levelstoragesource$levelstorageaccess.m_78287_(registryaccess$registryholder, worlddata);
WorldData worlddata1 = worlddata;
- final DedicatedServer dedicatedserver = MinecraftServer.m_129872_((p_129697_) -> {
- DedicatedServer dedicatedserver1 = new DedicatedServer(p_129697_, registryaccess$registryholder, levelstoragesource$levelstorageaccess, packrepository, serverresources, worlddata1, dedicatedserversettings, DataFixers.m_14512_(), minecraftsessionservice, gameprofilerepository, gameprofilecache, LoggerChunkProgressListener::new);
levelstoragesource$levelstorageaccess.m_78287_(registryaccess$frozen, worlddata);
- final DedicatedServer dedicatedserver = MinecraftServer.m_129872_((p_206536_) -> {
- DedicatedServer dedicatedserver1 = new DedicatedServer(p_206536_, levelstoragesource$levelstorageaccess, packrepository, worldstem, dedicatedserversettings, DataFixers.m_14512_(), minecraftsessionservice, gameprofilerepository, gameprofilecache, LoggerChunkProgressListener::new);
+ final MinecraftServer dedicatedserver = MinecraftServer.m_129872_((p_129697_) -> {
+ MinecraftServer dedicatedserver1;
+ if (gametestEnabled) {
+ net.minecraftforge.gametest.ForgeGameTestHooks.registerGametests();
+ java.util.Collection<net.minecraft.gametest.framework.GameTestBatch> testBatches = net.minecraft.gametest.framework.GameTestRunner.m_127724_(net.minecraft.gametest.framework.GameTestRegistry.m_127658_());
+ net.minecraft.core.BlockPos spawnPos = optionset.valueOf(spawnPosOpt);
+ dedicatedserver1 = new net.minecraft.gametest.framework.GameTestServer(p_129697_, levelstoragesource$levelstorageaccess, packrepository, serverresources, testBatches, spawnPos, registryaccess$registryholder);
+ dedicatedserver1 = new net.minecraft.gametest.framework.GameTestServer(p_129697_, levelstoragesource$levelstorageaccess, packrepository, worldstem, testBatches, spawnPos);
+ } else {
+ dedicatedserver1 = new DedicatedServer(p_129697_, registryaccess$registryholder, levelstoragesource$levelstorageaccess, packrepository, serverresources, worlddata1, dedicatedserversettings, DataFixers.m_14512_(), minecraftsessionservice, gameprofilerepository, gameprofilecache, LoggerChunkProgressListener::new);
+ dedicatedserver1 = new DedicatedServer(p_129697_, levelstoragesource$levelstorageaccess, packrepository, worldstem, dedicatedserversettings, DataFixers.m_14512_(), minecraftsessionservice, gameprofilerepository, gameprofilecache, LoggerChunkProgressListener::new);
+ }
dedicatedserver1.m_129981_(optionset.valueOf(optionspec8));
dedicatedserver1.m_129801_(optionset.valueOf(optionspec11));
@@ -112,7 +101,8 @@
+ // FORGE: Halting as GameTestServer will cause issues as it always calls System#exit on both crash and normal exit, so skip it
+ if (!(dedicatedserver instanceof net.minecraft.gametest.framework.GameTestServer))
dedicatedserver.m_7570_(true);
+ LogManager.shutdown(); // we're manually managing the logging shutdown on the server. Make sure we do it here at the end.
+ //TODO-PATCHING: Figure out what needs to be done here after the logging update.
+ //LogManager.shutdown(); // we're manually managing the logging shutdown on the server. Make sure we do it here at the end.
}
};
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(f_129670_));
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -254,7 +_,7 @@
@@ -257,7 +_,7 @@
public static <S extends MinecraftServer> S m_129872_(Function<Thread, S> p_129873_) {
AtomicReference<S> atomicreference = new AtomicReference<>();
@@ -9,7 +9,7 @@
atomicreference.get().m_130011_();
}, "Server thread");
thread.setUncaughtExceptionHandler((p_177909_, p_177910_) -> {
@@ -355,6 +_,7 @@
@@ -358,6 +_,7 @@
this.m_129841_(dimensiondatastorage);
this.f_129732_ = new CommandStorage(dimensiondatastorage);
WorldBorder worldborder = serverlevel.m_6857_();
@@ -17,15 +17,15 @@
if (!serverleveldata.m_6535_()) {
try {
m_177896_(serverlevel, serverleveldata, worldgensettings.m_64660_(), flag);
@@ -391,6 +_,7 @@
ServerLevel serverlevel1 = new ServerLevel(this, this.f_129738_, this.f_129744_, derivedleveldata, resourcekey1, dimensiontype1, p_129816_, chunkgenerator1, flag, j, ImmutableList.of(), false);
@@ -394,6 +_,7 @@
ServerLevel serverlevel1 = new ServerLevel(this, this.f_129738_, this.f_129744_, derivedleveldata, resourcekey1, holder1, p_129816_, chunkgenerator1, flag, j, ImmutableList.of(), false);
worldborder.m_61929_(new BorderChangeListener.DelegateBorderChangeListener(serverlevel1.m_6857_()));
this.f_129762_.put(resourcekey1, serverlevel1);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(f_129762_.get(resourcekey)));
}
}
@@ -402,6 +_,7 @@
@@ -405,6 +_,7 @@
p_177898_.m_7250_(BlockPos.f_121853_.m_6630_(80), 0.0F);
} else {
ChunkGenerator chunkgenerator = p_177897_.m_7726_().m_8481_();
@@ -33,15 +33,7 @@
ChunkPos chunkpos = new ChunkPos(chunkgenerator.m_183403_().m_183230_());
int i = chunkgenerator.m_142051_(p_177897_);
if (i < p_177897_.m_141937_()) {
@@ -455,6 +_,7 @@
}
private void m_129940_(ChunkProgressListener p_129941_) {
+ net.minecraftforge.common.world.StructureSpawnManager.gatherEntitySpawns();
ServerLevel serverlevel = this.m_129783_();
f_129750_.info("Preparing start region for dimension {}", (Object)serverlevel.m_46472_().m_135782_());
BlockPos blockpos = serverlevel.m_8900_();
@@ -482,6 +_,7 @@
@@ -485,6 +_,7 @@
ChunkPos chunkpos = new ChunkPos(i);
serverlevel1.m_7726_().m_6692_(chunkpos, true);
}
@@ -49,15 +41,15 @@
}
}
@@ -591,6 +_,7 @@
for(ServerLevel serverlevel1 : this.m_129785_()) {
if (serverlevel1 != null) {
@@ -609,6 +_,7 @@
for(ServerLevel serverlevel2 : this.m_129785_()) {
if (serverlevel2 != null) {
try {
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(serverlevel1));
serverlevel1.close();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(serverlevel2));
serverlevel2.close();
} catch (IOException ioexception1) {
f_129750_.error("Exception closing the level", (Throwable)ioexception1);
@@ -636,6 +_,7 @@
@@ -654,6 +_,7 @@
protected void m_130011_() {
try {
if (this.m_7038_()) {
@@ -65,7 +57,7 @@
this.f_129726_ = Util.m_137550_();
this.f_129757_.m_134908_(new TextComponent(this.f_129709_));
this.f_129757_.m_134912_(new ServerStatus.Version(SharedConstants.m_183709_().getName(), SharedConstants.m_183709_().getProtocolVersion()));
@@ -668,7 +_,10 @@
@@ -686,7 +_,10 @@
this.f_129717_ = true;
JvmProfiler.f_185340_.m_183597_(this.f_129737_);
}
@@ -76,7 +68,7 @@
this.m_7268_((CrashReport)null);
}
} catch (Throwable throwable1) {
@@ -688,6 +_,7 @@
@@ -700,6 +_,7 @@
f_129750_.error("We were unable to save this crash report to disk.");
}
@@ -84,7 +76,7 @@
this.m_7268_(crashreport);
} finally {
try {
@@ -700,6 +_,7 @@
@@ -712,6 +_,7 @@
this.f_129723_.m_196559_();
}
@@ -92,7 +84,7 @@
this.m_6988_();
}
@@ -791,6 +_,7 @@
@@ -826,6 +_,7 @@
public void m_5705_(BooleanSupplier p_129871_) {
long i = Util.m_137569_();
@@ -100,7 +92,7 @@
++this.f_129766_;
this.m_5703_(p_129871_);
if (i - this.f_129724_ >= 5000000000L) {
@@ -812,6 +_,7 @@
@@ -847,6 +_,7 @@
Collections.shuffle(Arrays.asList(agameprofile));
this.f_129757_.m_134914_().m_134924_(agameprofile);
}
@@ -108,7 +100,7 @@
}
if (this.f_129766_ % 6000 == 0) {
@@ -828,6 +_,7 @@
@@ -863,6 +_,7 @@
long i1 = Util.m_137569_();
this.f_129735_.m_13755_(i1 - i);
this.f_129754_.m_7238_();
@@ -116,7 +108,7 @@
}
public void m_5703_(BooleanSupplier p_129954_) {
@@ -835,7 +_,8 @@
@@ -870,7 +_,8 @@
this.m_129890_().m_136128_();
this.f_129754_.m_6182_("levels");
@@ -126,7 +118,7 @@
this.f_129754_.m_6521_(() -> {
return serverlevel + " " + serverlevel.m_46472_().m_135782_();
});
@@ -846,6 +_,7 @@
@@ -881,6 +_,7 @@
}
this.f_129754_.m_6180_("tick");
@@ -134,7 +126,7 @@
try {
serverlevel.m_8793_(p_129954_);
@@ -854,16 +_,18 @@
@@ -889,16 +_,18 @@
serverlevel.m_6026_(crashreport);
throw new ReportedException(crashreport);
}
@@ -154,7 +146,7 @@
GameTestTicker.f_177648_.m_127790_();
}
@@ -931,7 +_,7 @@
@@ -966,7 +_,7 @@
@DontObfuscate
public String m_130001_() {
@@ -163,23 +155,23 @@
}
public SystemReport m_177935_(SystemReport p_177936_) {
@@ -947,6 +_,7 @@
@@ -982,6 +_,7 @@
p_177936_.m_143522_("Data Packs", () -> {
StringBuilder stringbuilder = new StringBuilder();
+ LogManager.shutdown(); // we're manually managing the logging shutdown on the server. Make sure we do it here at the end.
+ //TODO-PATCHING:Figure out how to stop the logger here.
for(Pack pack : this.f_129730_.m_10524_()) {
if (stringbuilder.length() > 0) {
stringbuilder.append(", ");
@@ -1261,6 +_,7 @@
@@ -1316,6 +_,7 @@
this.m_6846_().m_11315_();
this.f_129734_.m_136120_(this.f_129740_.m_136157_());
this.f_129741_.m_74335_(this.f_129740_.m_136178_());
this.f_129734_.m_136120_(this.f_129740_.f_206585_.m_206860_());
this.f_129741_.m_74335_(this.f_129740_.f_206584_);
+ this.m_6846_().m_11314_().forEach(this.m_6846_()::m_11289_); //Forge: Fix newly added/modified commands not being sent to the client when commands reload.
}, this);
if (this.m_18695_()) {
this.m_18701_(completablefuture::isDone);
@@ -1270,10 +_,13 @@
@@ -1325,10 +_,13 @@
}
public static DataPackConfig m_129819_(PackRepository p_129820_, DataPackConfig p_129821_, boolean p_129822_) {
@@ -195,7 +187,7 @@
} else {
Set<String> set = Sets.newLinkedHashSet();
@@ -1428,6 +_,31 @@
@@ -1479,6 +_,31 @@
public abstract boolean m_7779_(GameProfile p_129840_);
@@ -227,14 +219,14 @@
public void m_142116_(Path p_177911_) throws IOException {
}
@@ -1681,6 +_,10 @@
@@ -1732,6 +_,10 @@
public WorldData m_129910_() {
return this.f_129749_;
+ }
+
+ public ServerResources getServerResources() {
+ public MinecraftServer.ReloadableResources getServerResources() {
+ return f_129740_;
}
public RegistryAccess m_129911_() {
public RegistryAccess.Frozen m_206579_() {
@@ -0,0 +1,21 @@
--- a/net/minecraft/server/ReloadableServerResources.java
+++ b/net/minecraft/server/ReloadableServerResources.java
@@ -76,7 +_,9 @@
public static CompletableFuture<ReloadableServerResources> m_206861_(ResourceManager p_206862_, RegistryAccess.Frozen p_206863_, Commands.CommandSelection p_206864_, int p_206865_, Executor p_206866_, Executor p_206867_) {
ReloadableServerResources reloadableserverresources = new ReloadableServerResources(p_206863_, p_206864_, p_206865_);
- return SimpleReloadInstance.m_203834_(p_206862_, reloadableserverresources.m_206890_(), p_206866_, p_206867_, f_206846_, f_206845_.isDebugEnabled()).m_7237_().thenApply((p_206880_) -> {
+ List<PreparableReloadListener> listeners = new java.util.ArrayList<>(reloadableserverresources.m_206890_());
+ listeners.addAll(net.minecraftforge.event.ForgeEventFactory.onResourceReload());
+ return SimpleReloadInstance.m_203834_(p_206862_, listeners, p_206866_, p_206867_, f_206846_, f_206845_.isDebugEnabled()).m_7237_().thenApply((p_206880_) -> {
return reloadableserverresources;
});
}
@@ -86,6 +_,7 @@
m_206870_(p_206869_, p_206884_);
});
Blocks.m_50758_();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent(p_206869_));
}
private static <T> void m_206870_(RegistryAccess p_206871_, TagManager.LoadResult<T> p_206872_) {
@@ -1,10 +0,0 @@
--- a/net/minecraft/server/ServerResources.java
+++ b/net/minecraft/server/ServerResources.java
@@ -41,6 +_,7 @@
this.f_136145_.m_7217_(this.f_180000_);
this.f_136145_.m_7217_(this.f_136152_);
this.f_136145_.m_7217_(this.f_136151_);
+ net.minecraftforge.event.ForgeEventFactory.onResourceReload(this).forEach(f_136145_::m_7217_);
}
public ServerFunctionLibrary m_136157_() {
@@ -1,21 +0,0 @@
--- a/net/minecraft/server/commands/LocateCommand.java
+++ b/net/minecraft/server/commands/LocateCommand.java
@@ -25,11 +_,18 @@
return p_137861_.m_6761_(2);
});
+ if (false)
for(Entry<String, StructureFeature<?>> entry : StructureFeature.f_67012_.entrySet()) {
literalargumentbuilder = literalargumentbuilder.then(Commands.m_82127_(entry.getKey()).executes((p_137876_) -> {
return m_137862_(p_137876_.getSource(), entry.getValue());
}));
}
+ else {
+ for (StructureFeature<?> structurefeatureFeature : net.minecraftforge.registries.ForgeRegistries.STRUCTURE_FEATURES) {
+ String name = structurefeatureFeature.getRegistryName().toString().replace("minecraft:", "");
+ literalargumentbuilder = literalargumentbuilder.then(Commands.m_82127_(name)
+ .executes(ctx -> m_137862_(ctx.getSource(), structurefeatureFeature)));
+ }}
p_137859_.register(literalargumentbuilder);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/commands/SpreadPlayersCommand.java
+++ b/net/minecraft/server/commands/SpreadPlayersCommand.java
@@ -163,7 +_,8 @@
@@ -173,7 +_,8 @@
spreadplayerscommand$position = p_138732_[i++];
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
@@ -91,6 +_,7 @@
@@ -89,6 +_,7 @@
public boolean m_7038_() throws IOException {
Thread thread = new Thread("Server console handler") {
public void run() {
@@ -8,7 +8,7 @@
BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));
String s1;
@@ -169,11 +_,13 @@
@@ -167,11 +_,13 @@
long i = Util.m_137569_();
SkullBlockEntity.m_196700_(this.m_129927_(), this.m_129925_(), this);
GameProfileCache.m_11004_(this.m_129797_());
@@ -22,7 +22,7 @@
if (dedicatedserverproperties.f_139744_ != null) {
this.m_129900_().m_46170_(GameRules.f_46153_).m_46246_(dedicatedserverproperties.f_139744_, this);
}
@@ -197,12 +_,13 @@
@@ -195,12 +_,13 @@
}
Items.f_41852_.m_6787_(CreativeModeTab.f_40754_, NonNullList.m_122779_());
@@ -37,7 +37,7 @@
}
}
@@ -545,6 +_,11 @@
@@ -543,6 +_,11 @@
public boolean m_7779_(GameProfile p_139642_) {
return false;
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/level/ChunkHolder.java
+++ b/net/minecraft/server/level/ChunkHolder.java
@@ -64,6 +_,7 @@
@@ -67,6 +_,7 @@
private final ChunkHolder.PlayerProvider f_140016_;
private boolean f_140017_;
private boolean f_140018_;
@@ -1,14 +1,14 @@
--- a/net/minecraft/server/level/ChunkMap.java
+++ b/net/minecraft/server/level/ChunkMap.java
@@ -440,6 +_,7 @@
if (this.f_140131_.remove(p_140182_, p_140183_) && p_198809_ != null) {
if (p_198809_ instanceof LevelChunk) {
((LevelChunk)p_198809_).m_62913_(false);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Unload((LevelChunk)p_198809_));
@@ -476,6 +_,7 @@
if (this.f_140131_.remove(p_140182_, p_140183_) && p_203002_ != null) {
if (p_203002_ instanceof LevelChunk) {
((LevelChunk)p_203002_).m_62913_(false);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Unload(p_203002_));
}
this.m_140258_(p_198809_);
@@ -621,8 +_,14 @@
this.m_140258_(p_203002_);
@@ -658,8 +_,14 @@
levelchunk.m_62952_();
if (this.f_140132_.add(chunkpos.m_45588_())) {
levelchunk.m_62913_(true);
@@ -23,7 +23,7 @@
}
return levelchunk;
@@ -712,6 +_,7 @@
@@ -762,6 +_,7 @@
this.f_140133_.m_46473_().m_6174_("chunkSave");
CompoundTag compoundtag = ChunkSerializer.m_63454_(this.f_140133_, p_140259_);
@@ -31,7 +31,7 @@
this.m_63502_(chunkpos, compoundtag);
this.m_140229_(chunkpos, chunkstatus.m_62494_());
return true;
@@ -768,6 +_,7 @@
@@ -818,6 +_,7 @@
protected void m_183754_(ServerPlayer p_183755_, ChunkPos p_183756_, MutableObject<ClientboundLevelChunkWithLightPacket> p_183757_, boolean p_183758_, boolean p_183759_) {
if (p_183755_.f_19853_ == this.f_140133_) {
@@ -39,7 +39,7 @@
if (p_183759_ && !p_183758_) {
ChunkHolder chunkholder = this.m_140327_(p_183756_.m_45588_());
if (chunkholder != null) {
@@ -1020,7 +_,7 @@
@@ -1070,7 +_,7 @@
}
protected void m_140199_(Entity p_140200_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/level/DistanceManager.java
+++ b/net/minecraft/server/level/DistanceManager.java
@@ -58,6 +_,8 @@
@@ -59,6 +_,8 @@
private long f_140771_;
private int f_183902_ = 10;
@@ -9,7 +9,7 @@
protected DistanceManager(Executor p_140774_, Executor p_140775_) {
ProcessorHandle<Runnable> processorhandle = ProcessorHandle.m_18714_("player ticket throttler", p_140775_::execute);
ChunkTaskPriorityQueueSorter chunktaskpriorityqueuesorter = new ChunkTaskPriorityQueueSorter(ImmutableList.of(processorhandle), p_140774_, 4);
@@ -163,6 +_,10 @@
@@ -164,6 +_,10 @@
this.f_140762_.m_140715_(p_140785_, p_140786_.m_9433_(), true);
}
@@ -20,7 +20,7 @@
}
void m_140818_(long p_140819_, Ticket<?> p_140820_) {
@@ -175,6 +_,13 @@
@@ -176,6 +_,13 @@
}
this.f_140762_.m_140715_(p_140819_, m_140797_(sortedarrayset), false);
@@ -34,7 +34,7 @@
}
public <T> void m_140792_(TicketType<T> p_140793_, ChunkPos p_140794_, int p_140795_, T p_140796_) {
@@ -200,6 +_,14 @@
@@ -201,6 +_,14 @@
this.f_183901_.m_184165_(i, ticket);
}
@@ -49,7 +49,7 @@
private SortedArraySet<Ticket<?>> m_140857_(long p_140858_) {
return this.f_140761_.computeIfAbsent(p_140858_, (p_183923_) -> {
return SortedArraySet.m_14246_(4);
@@ -285,6 +_,11 @@
@@ -286,6 +_,11 @@
public String m_140837_() {
return this.f_140766_.m_140558_();
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/level/ServerChunkCache.java
+++ b/net/minecraft/server/level/ServerChunkCache.java
@@ -163,6 +_,7 @@
@@ -160,6 +_,7 @@
if (chunkholder == null) {
return null;
} else {
@@ -12,8 +12,8 @@
for(ServerChunkCache.ChunkAndHolder serverchunkcache$chunkandholder : list) {
LevelChunk levelchunk1 = serverchunkcache$chunkandholder.f_184028_;
ChunkPos chunkpos = levelchunk1.m_7697_();
- if (this.f_8329_.m_143275_(chunkpos) && this.f_8325_.m_183879_(chunkpos)) {
+ if ((this.f_8329_.m_143275_(chunkpos) && this.f_8325_.m_183879_(chunkpos)) || this.f_8327_.shouldForceTicks(chunkpos.m_45588_())) {
- if (this.f_8329_.m_201916_(chunkpos) && this.f_8325_.m_183879_(chunkpos)) {
+ if ((this.f_8329_.m_201916_(chunkpos) && this.f_8325_.m_183879_(chunkpos)) || this.f_8327_.shouldForceTicks(chunkpos.m_45588_())) {
levelchunk1.m_187632_(j);
if (flag2 && (this.f_8335_ || this.f_8336_) && this.f_8329_.m_6857_().m_61927_(chunkpos)) {
NaturalSpawner.m_47029_(this.f_8329_, levelchunk1, naturalspawner$spawnstate, this.f_8336_, this.f_8335_, flag1);
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -179,10 +_,11 @@
@@ -181,10 +_,11 @@
private final List<CustomSpawner> f_8558_;
@Nullable
private final EndDragonFight f_8559_;
@@ -11,9 +11,9 @@
private final boolean f_8561_;
+ private net.minecraftforge.common.util.WorldCapabilityData capabilityData;
public ServerLevel(MinecraftServer p_8571_, Executor p_8572_, LevelStorageSource.LevelStorageAccess p_8573_, ServerLevelData p_8574_, ResourceKey<Level> p_8575_, DimensionType p_8576_, ChunkProgressListener p_8577_, ChunkGenerator p_8578_, boolean p_8579_, long p_8580_, List<CustomSpawner> p_8581_, boolean p_8582_) {
super(p_8574_, p_8575_, p_8576_, p_8571_::m_129905_, false, p_8579_, p_8580_);
@@ -220,6 +_,7 @@
public ServerLevel(MinecraftServer p_203762_, Executor p_203763_, LevelStorageSource.LevelStorageAccess p_203764_, ServerLevelData p_203765_, ResourceKey<Level> p_203766_, Holder<DimensionType> p_203767_, ChunkProgressListener p_203768_, ChunkGenerator p_203769_, boolean p_203770_, long p_203771_, List<CustomSpawner> p_203772_, boolean p_203773_) {
super(p_203765_, p_203766_, p_203767_, p_203762_::m_129905_, false, p_203770_, p_203771_);
@@ -223,6 +_,7 @@
}
this.f_143245_ = new SleepStatus();
@@ -21,7 +21,7 @@
}
public void m_8606_(int p_8607_, int p_8608_, boolean p_8609_, boolean p_8610_) {
@@ -248,8 +_,8 @@
@@ -251,8 +_,8 @@
int i = this.m_46469_().m_46215_(GameRules.f_151486_);
if (this.f_143245_.m_144002_(i) && this.f_143245_.m_144004_(i, this.f_8546_)) {
if (this.m_46469_().m_46207_(GameRules.f_46140_)) {
@@ -32,7 +32,7 @@
}
this.m_8804_();
@@ -278,7 +_,7 @@
@@ -281,7 +_,7 @@
this.m_8807_();
this.f_8557_ = false;
profilerfiller.m_7238_();
@@ -41,7 +41,7 @@
if (flag) {
this.m_8886_();
}
@@ -310,7 +_,9 @@
@@ -313,7 +_,9 @@
}
profilerfiller.m_6180_("tick");
@@ -52,15 +52,15 @@
profilerfiller.m_7238_();
}
}
@@ -399,6 +_,7 @@
@@ -402,6 +_,7 @@
BlockPos blockpos2 = this.m_5452_(Heightmap.Types.MOTION_BLOCKING, this.m_46496_(i, 0, j, 15));
BlockPos blockpos3 = blockpos2.m_7495_();
Biome biome = this.m_46857_(blockpos2);
Biome biome = this.m_204166_(blockpos2).m_203334_();
+ if (this.isAreaLoaded(blockpos2, 1)) // Forge: check area to avoid loading neighbors in unloaded chunks
if (biome.m_47477_(this, blockpos3)) {
this.m_46597_(blockpos3, Blocks.f_50126_.m_49966_());
}
@@ -589,15 +_,19 @@
@@ -592,15 +_,19 @@
this.f_8548_.m_6846_().m_11270_(new ClientboundGameEventPacket(ClientboundGameEventPacket.f_132161_, this.f_46440_), this.m_46472_());
}
@@ -84,7 +84,7 @@
}
}
@@ -653,9 +_,10 @@
@@ -656,9 +_,10 @@
++p_8664_.f_19797_;
ProfilerFiller profilerfiller = this.m_46473_();
profilerfiller.m_6521_(() -> {
@@ -96,7 +96,7 @@
p_8664_.m_6083_();
profilerfiller.m_7238_();
@@ -692,6 +_,7 @@
@@ -695,6 +_,7 @@
this.f_143244_.m_157554_();
}
@@ -104,7 +104,7 @@
}
}
@@ -764,7 +_,55 @@
@@ -767,7 +_,55 @@
this.m_8853_(p_8846_);
}
@@ -160,7 +160,7 @@
Entity entity = this.m_142646_().m_142694_(p_8854_.m_142081_());
if (entity != null) {
f_8566_.warn("Force-added player with duplicate UUID {}", (Object)p_8854_.m_142081_().toString());
@@ -772,7 +_,8 @@
@@ -775,7 +_,8 @@
this.m_143261_((ServerPlayer)entity, Entity.RemovalReason.DISCARDED);
}
@@ -170,7 +170,7 @@
}
private boolean m_8872_(Entity p_8873_) {
@@ -780,7 +_,12 @@
@@ -783,7 +_,12 @@
f_8566_.warn("Tried to add entity {} but it was marked as removed already", (Object)EntityType.m_20613_(p_8873_.m_6095_()));
return false;
} else {
@@ -184,7 +184,7 @@
}
}
@@ -817,10 +_,20 @@
@@ -820,10 +_,20 @@
}
public void m_6263_(@Nullable Player p_8675_, double p_8676_, double p_8677_, double p_8678_, SoundEvent p_8679_, SoundSource p_8680_, float p_8681_, float p_8682_) {
@@ -205,7 +205,7 @@
this.f_8548_.m_6846_().m_11241_(p_8689_, p_8690_.m_20185_(), p_8690_.m_20186_(), p_8690_.m_20189_(), p_8693_ > 1.0F ? (double)(16.0F * p_8693_) : 16.0D, this.m_46472_(), new ClientboundSoundEntityPacket(p_8691_, p_8692_, p_8690_, p_8693_, p_8694_));
}
@@ -837,6 +_,7 @@
@@ -840,6 +_,7 @@
}
public void m_142346_(@Nullable Entity p_143268_, GameEvent p_143269_, BlockPos p_143270_) {
@@ -213,7 +213,7 @@
this.m_151513_(p_143268_, p_143269_, p_143270_, p_143269_.m_157827_());
}
@@ -882,6 +_,7 @@
@@ -885,6 +_,7 @@
public Explosion m_7703_(@Nullable Entity p_8653_, @Nullable DamageSource p_8654_, @Nullable ExplosionDamageCalculator p_8655_, double p_8656_, double p_8657_, double p_8658_, float p_8659_, boolean p_8660_, Explosion.BlockInteraction p_8661_) {
Explosion explosion = new Explosion(this, p_8653_, p_8654_, p_8655_, p_8656_, p_8657_, p_8658_, p_8659_, p_8660_, p_8661_);
@@ -221,7 +221,7 @@
explosion.m_46061_();
explosion.m_46075_(false);
if (p_8661_ == Explosion.BlockInteraction.NONE) {
@@ -1409,6 +_,12 @@
@@ -1412,6 +_,12 @@
});
}
@@ -234,7 +234,7 @@
public LevelEntityGetter<Entity> m_142646_() {
return this.f_143244_.m_157567_();
}
@@ -1490,10 +_,8 @@
@@ -1497,10 +_,8 @@
ServerLevel.this.f_143246_.add(mob);
}
@@ -247,7 +247,7 @@
ServerLevel.this.f_143247_.put(enderdragonpart.m_142049_(), enderdragonpart);
}
}
@@ -1518,10 +_,8 @@
@@ -1525,10 +_,8 @@
ServerLevel.this.f_143246_.remove(mob);
}
@@ -260,7 +260,7 @@
ServerLevel.this.f_143247_.remove(enderdragonpart.m_142049_());
}
}
@@ -1531,6 +_,8 @@
@@ -1538,6 +_,8 @@
gameeventlistenerregistrar.m_157854_(p_143375_.f_19853_);
}
@@ -175,7 +175,7 @@
+ } else if (net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_9000_.m_46472_())) {
ServerLevel serverlevel = this.m_183503_();
LevelData leveldata = p_9000_.m_6106_();
this.f_8906_.m_141995_(new ClientboundRespawnPacket(p_9000_.m_6042_(), p_9000_.m_46472_(), BiomeManager.m_47877_(p_9000_.m_7328_()), this.f_8941_.m_9290_(), this.f_8941_.m_9293_(), p_9000_.m_46659_(), p_9000_.m_8584_(), true));
this.f_8906_.m_141995_(new ClientboundRespawnPacket(p_9000_.m_204156_(), p_9000_.m_46472_(), BiomeManager.m_47877_(p_9000_.m_7328_()), this.f_8941_.m_9290_(), this.f_8941_.m_9293_(), p_9000_.m_46659_(), p_9000_.m_8584_(), true));
this.f_8906_.m_141995_(new ClientboundChangeDifficultyPacket(leveldata.m_5472_(), leveldata.m_5474_()));
this.f_8924_.m_6846_().m_11289_(this);
serverlevel.m_143261_(this, Entity.RemovalReason.CHANGED_DIMENSION);
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -123,7 +_,15 @@
@@ -125,7 +_,15 @@
double d1 = this.f_9245_.m_20186_() - ((double)p_9282_.m_123342_() + 0.5D) + 1.5D;
double d2 = this.f_9245_.m_20189_() - ((double)p_9282_.m_123343_() + 0.5D);
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
@@ -14,10 +14,10 @@
+ }
+ dist *= dist;
+ if (d3 > dist) {
this.f_9245_.f_8906_.m_141995_(new ClientboundBlockBreakAckPacket(p_9282_, this.f_9244_.m_8055_(p_9282_), p_9283_, false, "too far"));
} else if (p_9282_.m_123342_() >= p_9285_) {
this.f_9245_.f_8906_.m_141995_(new ClientboundBlockBreakAckPacket(p_9282_, this.f_9244_.m_8055_(p_9282_), p_9283_, false, "too high"));
@@ -148,6 +_,7 @@
BlockState blockstate1;
if (this.f_9245_.f_19853_.m_142572_() != null && this.f_9245_.m_146902_().m_45594_(new ChunkPos(p_9282_)) < this.f_9245_.f_19853_.m_142572_().m_6846_().m_11312_()) {
blockstate1 = this.f_9244_.m_8055_(p_9282_);
@@ -157,6 +_,7 @@
float f = 1.0F;
BlockState blockstate = this.f_9244_.m_8055_(p_9282_);
if (!blockstate.m_60795_()) {
@@ -25,7 +25,7 @@
blockstate.m_60686_(this.f_9244_, p_9282_, this.f_9245_);
f = blockstate.m_60625_(this.f_9245_, this.f_9245_.f_19853_, p_9282_);
}
@@ -215,7 +_,8 @@
@@ -224,7 +_,8 @@
public boolean m_9280_(BlockPos p_9281_) {
BlockState blockstate = this.f_9244_.m_8055_(p_9281_);
@@ -35,7 +35,7 @@
return false;
} else {
BlockEntity blockentity = this.f_9244_.m_7702_(p_9281_);
@@ -223,30 +_,42 @@
@@ -232,30 +_,42 @@
if (block instanceof GameMasterBlock && !this.f_9245_.m_36337_()) {
this.f_9244_.m_7260_(p_9281_, blockstate, blockstate, 3);
return false;
@@ -85,7 +85,7 @@
}
public InteractionResult m_6261_(ServerPlayer p_9262_, Level p_9263_, ItemStack p_9264_, InteractionHand p_9265_) {
@@ -255,6 +_,8 @@
@@ -264,6 +_,8 @@
} else if (p_9262_.m_36335_().m_41519_(p_9264_.m_41720_())) {
return InteractionResult.PASS;
} else {
@@ -94,7 +94,7 @@
int i = p_9264_.m_41613_();
int j = p_9264_.m_41773_();
InteractionResultHolder<ItemStack> interactionresultholder = p_9264_.m_41682_(p_9263_, p_9262_, p_9265_);
@@ -288,6 +_,8 @@
@@ -297,6 +_,8 @@
public InteractionResult m_7179_(ServerPlayer p_9266_, Level p_9267_, ItemStack p_9268_, InteractionHand p_9269_, BlockHitResult p_9270_) {
BlockPos blockpos = p_9270_.m_82425_();
BlockState blockstate = p_9267_.m_8055_(blockpos);
@@ -103,7 +103,7 @@
if (this.f_9247_ == GameType.SPECTATOR) {
MenuProvider menuprovider = blockstate.m_60750_(p_9267_, blockpos);
if (menuprovider != null) {
@@ -297,10 +_,15 @@
@@ -306,10 +_,15 @@
return InteractionResult.PASS;
}
} else {
@@ -121,7 +121,7 @@
InteractionResult interactionresult = blockstate.m_60664_(p_9267_, p_9266_, p_9269_, p_9270_);
if (interactionresult.m_19077_()) {
CriteriaTriggers.f_10562_.m_45482_(p_9266_, blockpos, itemstack);
@@ -308,8 +_,8 @@
@@ -317,8 +_,8 @@
}
}
@@ -3,7 +3,7 @@
@@ -50,11 +_,12 @@
public class ServerConnectionListener {
private static final Logger f_9701_ = LogManager.getLogger();
private static final Logger f_9701_ = LogUtils.getLogger();
+ private static final int READ_TIMEOUT = Integer.parseInt(System.getProperty("forge.readTimeout", "30"));
public static final LazyLoadedValue<NioEventLoopGroup> f_9698_ = new LazyLoadedValue<>(() -> {
- return new NioEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Server IO #%d").setDaemon(true).build());
@@ -1,18 +1,18 @@
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -380,9 +_,11 @@
@@ -386,9 +_,11 @@
}
entity.m_19890_(d3, d4, d5, f, f1);
+ this.f_9743_.m_19890_(d3, d4, d5, this.f_9743_.m_146908_(), this.f_9743_.m_146909_()); // Forge - Resync player position on vehicle moving
boolean flag2 = serverlevel.m_45756_(entity, entity.m_142469_().m_82406_(0.0625D));
if (flag && (flag1 || !flag2)) {
boolean flag3 = serverlevel.m_45756_(entity, entity.m_142469_().m_82406_(0.0625D));
if (flag && (flag2 || !flag3)) {
entity.m_19890_(d0, d1, d2, f, f1);
+ this.f_9743_.m_19890_(d3, d4, d5, this.f_9743_.m_146908_(), this.f_9743_.m_146909_()); // Forge - Resync player position on vehicle moving
this.f_9742_.m_129512_(new ClientboundMoveVehiclePacket(entity));
return;
}
@@ -399,7 +_,7 @@
@@ -405,7 +_,7 @@
}
private boolean m_9793_(Entity p_9794_) {
@@ -21,18 +21,18 @@
}
public void m_7376_(ServerboundAcceptTeleportationPacket p_9835_) {
@@ -967,7 +_,9 @@
this.f_9743_.m_9243_();
int i = this.f_9743_.f_19853_.m_151558_();
if (blockpos.m_123342_() < i) {
- if (this.f_9766_ == null && this.f_9743_.m_20275_((double)blockpos.m_123341_() + 0.5D, (double)blockpos.m_123342_() + 0.5D, (double)blockpos.m_123343_() + 0.5D) < 64.0D && serverlevel.m_7966_(this.f_9743_, blockpos)) {
+ double dist = f_9743_.m_21051_(net.minecraftforge.common.ForgeMod.REACH_DISTANCE.get()).m_22135_() + 3;
+ dist *= dist;
+ if (this.f_9766_ == null && this.f_9743_.m_20275_((double)blockpos.m_123341_() + 0.5D, (double)blockpos.m_123342_() + 0.5D, (double)blockpos.m_123343_() + 0.5D) < dist && serverlevel.m_7966_(this.f_9743_, blockpos)) {
InteractionResult interactionresult = this.f_9743_.f_8941_.m_7179_(this.f_9743_, serverlevel, itemstack, interactionhand, blockhitresult);
if (direction == Direction.UP && !interactionresult.m_19077_() && blockpos.m_123342_() >= i - 1 && m_9790_(this.f_9743_, itemstack)) {
Component component = (new TranslatableComponent("build.tooHigh", i - 1)).m_130940_(ChatFormatting.RED);
@@ -1081,7 +_,7 @@
@@ -979,7 +_,9 @@
this.f_9743_.m_9243_();
int i = this.f_9743_.f_19853_.m_151558_();
if (blockpos.m_123342_() < i) {
- if (this.f_9766_ == null && this.f_9743_.m_20275_((double)blockpos.m_123341_() + 0.5D, (double)blockpos.m_123342_() + 0.5D, (double)blockpos.m_123343_() + 0.5D) < 64.0D && serverlevel.m_7966_(this.f_9743_, blockpos)) {
+ double dist = f_9743_.m_21051_(net.minecraftforge.common.ForgeMod.REACH_DISTANCE.get()).m_22135_() + 3;
+ dist *= dist;
+ if (this.f_9766_ == null && this.f_9743_.m_20275_((double)blockpos.m_123341_() + 0.5D, (double)blockpos.m_123342_() + 0.5D, (double)blockpos.m_123343_() + 0.5D) < dist && serverlevel.m_7966_(this.f_9743_, blockpos)) {
InteractionResult interactionresult = this.f_9743_.f_8941_.m_7179_(this.f_9743_, serverlevel, itemstack, interactionhand, blockhitresult);
if (direction == Direction.UP && !interactionresult.m_19077_() && blockpos.m_123342_() >= i - 1 && m_9790_(this.f_9743_, itemstack)) {
Component component = (new TranslatableComponent("build.tooHigh", i - 1)).m_130940_(ChatFormatting.RED);
@@ -1099,7 +_,7 @@
}
public void m_7388_(ServerboundChatPacket p_9841_) {
@@ -41,7 +41,7 @@
for(int i = 0; i < s.length(); ++i) {
if (!SharedConstants.m_136188_(s.charAt(i))) {
@@ -1111,8 +_,10 @@
@@ -1129,8 +_,10 @@
String s1 = p_143629_.m_143722_();
Component component = s1.isEmpty() ? null : new TranslatableComponent("chat.type.text", this.f_9743_.m_5446_(), s1);
Component component1 = new TranslatableComponent("chat.type.text", this.f_9743_.m_5446_(), s);
@@ -53,7 +53,7 @@
}, ChatType.CHAT, this.f_9743_.m_142081_());
}
@@ -1204,6 +_,7 @@
@@ -1222,6 +_,7 @@
private void m_143678_(InteractionHand p_143679_, ServerGamePacketListenerImpl.EntityInteraction p_143680_) {
ItemStack itemstack = ServerGamePacketListenerImpl.this.f_9743_.m_21120_(p_143679_).m_41777_();
InteractionResult interactionresult = p_143680_.m_143694_(ServerGamePacketListenerImpl.this.f_9743_, entity, p_143679_);
@@ -61,7 +61,7 @@
if (interactionresult.m_19077_()) {
CriteriaTriggers.f_10565_.m_61494_(ServerGamePacketListenerImpl.this.f_9743_, itemstack, entity);
if (interactionresult.m_19080_()) {
@@ -1405,6 +_,8 @@
@@ -1430,6 +_,8 @@
}
public void m_7423_(ServerboundCustomPayloadPacket p_9860_) {
@@ -15,7 +15,7 @@
this.m_10055_();
} else if (this.f_10019_ == ServerLoginPacketListenerImpl.State.DELAY_ACCEPT) {
ServerPlayer serverplayer = this.f_10018_.m_6846_().m_11259_(this.f_10021_.getId());
@@ -147,7 +_,7 @@
@@ -148,7 +_,7 @@
this.f_10019_ = ServerLoginPacketListenerImpl.State.KEY;
this.f_10013_.m_129512_(new ClientboundHelloPacket("", this.f_10018_.m_129790_().getPublic().getEncoded(), this.f_10017_));
} else {
@@ -24,7 +24,7 @@
}
}
@@ -172,7 +_,7 @@
@@ -179,7 +_,7 @@
throw new IllegalStateException("Protocol error", cryptexception);
}
@@ -33,7 +33,7 @@
public void run() {
GameProfile gameprofile = ServerLoginPacketListenerImpl.this.f_10021_;
@@ -180,11 +_,11 @@
@@ -187,11 +_,11 @@
ServerLoginPacketListenerImpl.this.f_10021_ = ServerLoginPacketListenerImpl.this.f_10018_.m_129925_().hasJoinedServer(new GameProfile((UUID)null, gameprofile.getName()), s, this.m_10064_());
if (ServerLoginPacketListenerImpl.this.f_10021_ != null) {
ServerLoginPacketListenerImpl.f_10015_.info("UUID of player {} is {}", ServerLoginPacketListenerImpl.this.f_10021_.getName(), ServerLoginPacketListenerImpl.this.f_10021_.getId());
@@ -47,7 +47,7 @@
} else {
ServerLoginPacketListenerImpl.this.m_10053_(new TranslatableComponent("multiplayer.disconnect.unverified_username"));
ServerLoginPacketListenerImpl.f_10015_.error("Username '{}' tried to join with an invalid session", (Object)gameprofile.getName());
@@ -193,7 +_,7 @@
@@ -200,7 +_,7 @@
if (ServerLoginPacketListenerImpl.this.f_10018_.m_129792_()) {
ServerLoginPacketListenerImpl.f_10015_.warn("Authentication servers are down but will let them in anyway!");
ServerLoginPacketListenerImpl.this.f_10021_ = ServerLoginPacketListenerImpl.this.m_10038_(gameprofile);
@@ -56,7 +56,7 @@
} else {
ServerLoginPacketListenerImpl.this.m_10053_(new TranslatableComponent("multiplayer.disconnect.authservers_down"));
ServerLoginPacketListenerImpl.f_10015_.error("Couldn't verify username because servers are unavailable");
@@ -213,6 +_,7 @@
@@ -220,6 +_,7 @@
}
public void m_7223_(ServerboundCustomQueryPacket p_10045_) {
@@ -1,14 +1,14 @@
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -117,6 +_,7 @@
@@ -118,6 +_,7 @@
private boolean f_11209_;
private static final boolean f_143988_ = false;
private int f_11210_;
+ private final List<ServerPlayer> playersView = java.util.Collections.unmodifiableList(f_11196_);
public PlayerList(MinecraftServer p_11213_, RegistryAccess.RegistryHolder p_11214_, PlayerDataStorage p_11215_, int p_11216_) {
this.f_11195_ = p_11213_;
@@ -152,6 +_,7 @@
public PlayerList(MinecraftServer p_203842_, RegistryAccess.Frozen p_203843_, PlayerDataStorage p_203844_, int p_203845_) {
this.f_11195_ = p_203842_;
@@ -153,6 +_,7 @@
LevelData leveldata = serverlevel1.m_6106_();
p_11263_.m_143427_(compoundtag);
ServerGamePacketListenerImpl servergamepacketlistenerimpl = new ServerGamePacketListenerImpl(this.f_11195_, p_11262_, p_11263_);
@@ -16,15 +16,15 @@
GameRules gamerules = serverlevel1.m_46469_();
boolean flag = gamerules.m_46207_(GameRules.f_46156_);
boolean flag1 = gamerules.m_46207_(GameRules.f_46145_);
@@ -160,6 +_,7 @@
@@ -161,6 +_,7 @@
servergamepacketlistenerimpl.m_141995_(new ClientboundChangeDifficultyPacket(leveldata.m_5472_(), leveldata.m_5474_()));
servergamepacketlistenerimpl.m_141995_(new ClientboundPlayerAbilitiesPacket(p_11263_.m_150110_()));
servergamepacketlistenerimpl.m_141995_(new ClientboundSetCarriedItemPacket(p_11263_.m_150109_().f_35977_));
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.OnDatapackSyncEvent(this, p_11263_));
servergamepacketlistenerimpl.m_141995_(new ClientboundUpdateRecipesPacket(this.f_11195_.m_129894_().m_44051_()));
servergamepacketlistenerimpl.m_141995_(new ClientboundUpdateTagsPacket(this.f_11195_.m_129895_().m_144442_(this.f_11206_)));
servergamepacketlistenerimpl.m_141995_(new ClientboundUpdateTagsPacket(TagNetworkSerialization.m_203950_(this.f_11206_)));
this.m_11289_(p_11263_);
@@ -176,7 +_,7 @@
@@ -177,7 +_,7 @@
this.m_11264_(mutablecomponent.m_130940_(ChatFormatting.YELLOW), ChatType.SYSTEM, Util.f_137441_);
servergamepacketlistenerimpl.m_9774_(p_11263_.m_20185_(), p_11263_.m_20186_(), p_11263_.m_20189_(), p_11263_.m_146908_(), p_11263_.m_146909_());
@@ -33,7 +33,7 @@
this.f_11197_.put(p_11263_.m_142081_(), p_11263_);
this.m_11268_(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, p_11263_));
@@ -231,6 +_,7 @@
@@ -232,6 +_,7 @@
}
p_11263_.m_143429_();
@@ -41,7 +41,7 @@
}
protected void m_11273_(ServerScoreboard p_11274_, ServerPlayer p_11275_) {
@@ -291,6 +_,7 @@
@@ -292,6 +_,7 @@
compoundtag1 = compoundtag;
p_11225_.m_20258_(compoundtag);
f_11188_.debug("loading single player");
@@ -49,7 +49,7 @@
} else {
compoundtag1 = this.f_11204_.m_78435_(p_11225_);
}
@@ -299,6 +_,7 @@
@@ -300,6 +_,7 @@
}
protected void m_6765_(ServerPlayer p_11277_) {
@@ -57,7 +57,7 @@
this.f_11204_.m_78433_(p_11277_);
ServerStatsCounter serverstatscounter = this.f_11202_.get(p_11277_.m_142081_());
if (serverstatscounter != null) {
@@ -313,6 +_,7 @@
@@ -314,6 +_,7 @@
}
public void m_11286_(ServerPlayer p_11287_) {
@@ -65,7 +65,7 @@
ServerLevel serverlevel = p_11287_.m_183503_();
p_11287_.m_36220_(Stats.f_12989_);
this.m_6765_(p_11287_);
@@ -449,10 +_,11 @@
@@ -450,10 +_,11 @@
this.m_11229_(serverplayer, serverlevel1);
this.m_11289_(serverplayer);
serverlevel1.m_8845_(serverplayer);
@@ -78,7 +78,7 @@
if (flag2) {
serverplayer.f_8906_.m_141995_(new ClientboundSoundPacket(SoundEvents.f_12377_, SoundSource.BLOCKS, (double)blockpos.m_123341_(), (double)blockpos.m_123342_(), (double)blockpos.m_123343_(), 1.0F, 1.0F));
}
@@ -537,6 +_,7 @@
@@ -538,6 +_,7 @@
}
public void m_5749_(GameProfile p_11254_) {
@@ -86,7 +86,7 @@
this.f_11200_.m_11381_(new ServerOpListEntry(p_11254_, this.f_11195_.m_7022_(), this.f_11200_.m_11351_(p_11254_)));
ServerPlayer serverplayer = this.m_11259_(p_11254_.getId());
if (serverplayer != null) {
@@ -546,6 +_,7 @@
@@ -547,6 +_,7 @@
}
public void m_5750_(GameProfile p_11281_) {
@@ -94,7 +94,7 @@
this.f_11200_.m_11393_(p_11281_);
ServerPlayer serverplayer = this.m_11259_(p_11281_.getId());
if (serverplayer != null) {
@@ -733,13 +_,6 @@
@@ -734,13 +_,6 @@
if (serverstatscounter == null) {
File file1 = this.f_11195_.m_129843_(LevelResource.f_78175_).toFile();
File file2 = new File(file1, uuid + ".json");
@@ -108,7 +108,7 @@
serverstatscounter = new ServerStatsCounter(this.f_11195_, file2);
this.f_11202_.put(uuid, serverstatscounter);
@@ -758,6 +_,8 @@
@@ -759,6 +_,8 @@
this.f_11203_.put(uuid, playeradvancements);
}
@@ -117,7 +117,7 @@
playeradvancements.m_135979_(p_11297_);
return playeradvancements;
}
@@ -787,7 +_,7 @@
@@ -788,7 +_,7 @@
}
public List<ServerPlayer> m_11314_() {
@@ -126,15 +126,15 @@
}
@Nullable
@@ -804,6 +_,7 @@
@@ -805,6 +_,7 @@
playeradvancements.m_135981_(this.f_11195_.m_129889_());
}
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.OnDatapackSyncEvent(this, null));
this.m_11268_(new ClientboundUpdateTagsPacket(this.f_11195_.m_129895_().m_144442_(this.f_11206_)));
this.m_11268_(new ClientboundUpdateTagsPacket(TagNetworkSerialization.m_203950_(this.f_11206_)));
ClientboundUpdateRecipesPacket clientboundupdaterecipespacket = new ClientboundUpdateRecipesPacket(this.f_11195_.m_129894_().m_44051_());
@@ -816,5 +_,13 @@
@@ -817,5 +_,13 @@
public boolean m_11316_() {
return this.f_11209_;
@@ -1,17 +1,11 @@
--- a/net/minecraft/tags/BlockTags.java
+++ b/net/minecraft/tags/BlockTags.java
@@ -145,6 +_,14 @@
return f_13053_.m_13244_(p_13117_);
@@ -145,4 +_,8 @@
private static TagKey<Block> m_203846_(String p_203847_) {
return TagKey.m_203882_(Registry.f_122901_, new ResourceLocation(p_203847_));
}
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<Block> createOptional(net.minecraft.resources.ResourceLocation name) {
+ return createOptional(name, null);
+ }
+
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<Block> createOptional(net.minecraft.resources.ResourceLocation name, @javax.annotation.Nullable java.util.Set<java.util.function.Supplier<Block>> defaults) {
+ return f_13053_.createOptional(name, defaults);
+ public static TagKey<Block> create(ResourceLocation name) {
+ return TagKey.m_203882_(Registry.f_122901_, name);
+ }
+
public static TagCollection<Block> m_13115_() {
return f_13053_.m_13246_();
}
}
@@ -1,17 +0,0 @@
--- a/net/minecraft/tags/EntityTypeTags.java
+++ b/net/minecraft/tags/EntityTypeTags.java
@@ -23,6 +_,14 @@
return f_13119_.m_13244_(p_13128_);
}
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<EntityType<?>> createOptional(net.minecraft.resources.ResourceLocation name) {
+ return createOptional(name, null);
+ }
+
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<EntityType<?>> createOptional(net.minecraft.resources.ResourceLocation name, @javax.annotation.Nullable java.util.Set<java.util.function.Supplier<EntityType<?>>> defaults) {
+ return f_13119_.createOptional(name, defaults);
+ }
+
public static TagCollection<EntityType<?>> m_13126_() {
return f_13119_.m_13246_();
}
@@ -1,15 +1,11 @@
--- a/net/minecraft/tags/FluidTags.java
+++ b/net/minecraft/tags/FluidTags.java
@@ -29,4 +_,12 @@
public static List<Tag<Fluid>> m_144300_() {
return f_144297_;
@@ -14,4 +_,8 @@
private static TagKey<Fluid> m_203850_(String p_203851_) {
return TagKey.m_203882_(Registry.f_122899_, new ResourceLocation(p_203851_));
}
+
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<Fluid> createOptional(net.minecraft.resources.ResourceLocation name) {
+ return createOptional(name, null);
+ }
+
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<Fluid> createOptional(net.minecraft.resources.ResourceLocation name, @javax.annotation.Nullable java.util.Set<java.util.function.Supplier<Fluid>> defaults) {
+ return f_13130_.createOptional(name, defaults);
+ public static TagKey<Fluid> create(ResourceLocation name) {
+ return TagKey.m_203882_(Registry.f_122899_, name);
+ }
}
@@ -1,17 +0,0 @@
--- a/net/minecraft/tags/GameEventTags.java
+++ b/net/minecraft/tags/GameEventTags.java
@@ -12,6 +_,14 @@
return f_144301_.m_13244_(p_144308_);
}
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<GameEvent> createOptional(net.minecraft.resources.ResourceLocation name) {
+ return createOptional(name, null);
+ }
+
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<GameEvent> createOptional(net.minecraft.resources.ResourceLocation name, @javax.annotation.Nullable java.util.Set<java.util.function.Supplier<GameEvent>> defaults) {
+ return f_144301_.createOptional(name, defaults);
+ }
+
public static TagCollection<GameEvent> m_144306_() {
return f_144301_.m_13246_();
}
@@ -1,17 +1,11 @@
--- a/net/minecraft/tags/ItemTags.java
+++ b/net/minecraft/tags/ItemTags.java
@@ -84,6 +_,14 @@
return f_13163_.m_13244_(p_13195_);
@@ -83,4 +_,8 @@
private static TagKey<Item> m_203854_(String p_203855_) {
return TagKey.m_203882_(Registry.f_122904_, new ResourceLocation(p_203855_));
}
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<Item> createOptional(net.minecraft.resources.ResourceLocation name) {
+ return createOptional(name, null);
+ }
+
+ public static net.minecraftforge.common.Tags.IOptionalNamedTag<Item> createOptional(net.minecraft.resources.ResourceLocation name, @javax.annotation.Nullable java.util.Set<java.util.function.Supplier<Item>> defaults) {
+ return f_13163_.createOptional(name, defaults);
+ public static TagKey<Item> create(final ResourceLocation name) {
+ return TagKey.m_203882_(Registry.f_122904_, name);
+ }
+
public static TagCollection<Item> m_13193_() {
return f_13163_.m_13246_();
}
}
@@ -1,134 +0,0 @@
--- a/net/minecraft/tags/StaticTagHelper.java
+++ b/net/minecraft/tags/StaticTagHelper.java
@@ -17,6 +_,7 @@
private final String f_144327_;
private TagCollection<T> f_13227_ = TagCollection.m_13410_();
private final List<StaticTagHelper.Wrapper<T>> f_13228_ = Lists.newArrayList();
+ @Nullable private static java.util.Map<ResourceLocation, List<StaticTagHelper.Wrapper<?>>> toAdd = com.google.common.collect.Maps.newHashMap();
public StaticTagHelper(ResourceKey<? extends Registry<T>> p_144329_, String p_144330_) {
this.f_144326_ = p_144329_;
@@ -24,9 +_,60 @@
}
public Tag.Named<T> m_13244_(String p_13245_) {
- StaticTagHelper.Wrapper<T> wrapper = new StaticTagHelper.Wrapper<>(new ResourceLocation(p_13245_));
- this.f_13228_.add(wrapper);
- return wrapper;
+ return add(new StaticTagHelper.Wrapper<>(new ResourceLocation(p_13245_)));
+ }
+
+ public net.minecraftforge.common.Tags.IOptionalNamedTag<T> createOptional(ResourceLocation key, @Nullable Set<java.util.function.Supplier<T>> defaults) {
+ return add(new StaticTagHelper.OptionalNamedTag<>(key, defaults));
+ }
+
+ /** Call via ForgeTagHandler#makeWrapperTag to avoid any exceptions due to calling this after it is safe to call {@link #bind(String)} */
+ public static <T> Tag.Named<T> createDelayedTag(ResourceLocation tagRegistry, ResourceLocation name) {
+ return delayedAdd(tagRegistry, new StaticTagHelper.Wrapper<>(name));
+ }
+
+ /** Call via ForgeTagHandler#createOptionalTag to avoid any exceptions due to calling this after it is safe to call {@link #createOptional(ResourceLocation, Set)} */
+ public static <T> net.minecraftforge.common.Tags.IOptionalNamedTag<T> createDelayedOptional(ResourceLocation tagRegistry, ResourceLocation key, @Nullable Set<java.util.function.Supplier<T>> defaults) {
+ return delayedAdd(tagRegistry, new StaticTagHelper.OptionalNamedTag<>(key, defaults));
+ }
+
+ private static synchronized <T, R extends StaticTagHelper.Wrapper<T>> R delayedAdd(ResourceLocation tagRegistry, R tag) {
+ if (toAdd == null) throw new RuntimeException("Creating delayed tags or optional tags, is only supported before custom tag types have been added.");
+ toAdd.computeIfAbsent(tagRegistry, registry -> Lists.newArrayList()).add(tag);
+ return tag;
+ }
+
+ public static void performDelayedAdd() {
+ if (toAdd != null) {
+ for (java.util.Map.Entry<ResourceLocation, List<StaticTagHelper.Wrapper<?>>> entry : toAdd.entrySet()) {
+ StaticTagHelper<?> tagRegistry = StaticTags.get(entry.getKey());
+ if (tagRegistry == null) throw new RuntimeException("A mod attempted to add a delayed tag for a registry that doesn't have custom tag support.");
+ for (StaticTagHelper.Wrapper<?> tag : entry.getValue()) {
+ tagRegistry.add((StaticTagHelper.Wrapper) tag);
+ }
+ }
+ toAdd = null;
+ }
+ }
+
+ private <R extends StaticTagHelper.Wrapper<T>> R add(R namedtag) {
+ namedtag.m_13260_(f_13227_::m_13404_);
+ this.f_13228_.add(namedtag);
+ return namedtag;
+ }
+
+ public TagCollection<T> reinjectOptionalTags(TagCollection<T> tagCollection) {
+ java.util.Map<ResourceLocation, Tag<T>> currentTags = tagCollection.m_5643_();
+ java.util.Map<ResourceLocation, Tag<T>> missingOptionals = this.f_13228_.stream().filter(e -> e instanceof OptionalNamedTag && !currentTags.containsKey(e.m_6979_())).collect(Collectors.toMap(Wrapper::m_6979_, namedTag -> {
+ OptionalNamedTag<T> optionalNamedTag = (OptionalNamedTag<T>) namedTag;
+ optionalNamedTag.defaulted = true;
+ return optionalNamedTag.resolveDefaulted();
+ }, (existingTag, newTag) -> SetTag.m_13222_(ImmutableSet.<T>builder().addAll(existingTag.m_6497_()).addAll(newTag.m_6497_()).build())));
+ if (!missingOptionals.isEmpty()) {
+ missingOptionals.putAll(currentTags);
+ return TagCollection.m_13396_(missingOptionals);
+ }
+ return tagCollection;
}
public void m_13232_() {
@@ -53,7 +_,7 @@
public Set<ResourceLocation> m_13247_(TagContainer p_13248_) {
TagCollection<T> tagcollection = p_13248_.m_144452_(this.f_144326_);
- Set<ResourceLocation> set = this.f_13228_.stream().map(StaticTagHelper.Wrapper::m_6979_).collect(Collectors.toSet());
+ Set<ResourceLocation> set = this.f_13228_.stream().filter(e -> !(e instanceof OptionalNamedTag)).map(StaticTagHelper.Wrapper::m_6979_).collect(Collectors.toSet());
ImmutableSet<ResourceLocation> immutableset = ImmutableSet.copyOf(tagcollection.m_13406_());
return Sets.difference(set, immutableset);
}
@@ -67,7 +_,7 @@
}
protected void m_144336_(TagContainer.Builder p_144337_) {
- p_144337_.m_144486_(this.f_144326_, TagCollection.m_13396_(this.f_13228_.stream().collect(Collectors.toMap(Tag.Named::m_6979_, (p_144332_) -> {
+ p_144337_.m_144486_(this.f_144326_, TagCollection.m_13396_(this.f_13228_.stream().distinct().collect(Collectors.toMap(Tag.Named::m_6979_, (p_144332_) -> {
return p_144332_;
}))));
}
@@ -103,6 +_,41 @@
public List<T> m_6497_() {
return this.m_13263_().m_6497_();
+ }
+
+ @Override
+ public String toString() {
+ return "NamedTag[" + m_6979_() + ']';
+ }
+ @Override public boolean equals(Object o) { return (o == this) || (o instanceof Tag.Named && java.util.Objects.equals(this.m_6979_(), ((Tag.Named<T>)o).m_6979_())); }
+ @Override public int hashCode() { return m_6979_().hashCode(); }
+ }
+
+ private static class OptionalNamedTag<T> extends Wrapper<T> implements net.minecraftforge.common.Tags.IOptionalNamedTag<T> {
+ @Nullable
+ private final Set<java.util.function.Supplier<T>> defaults;
+ private boolean defaulted = false;
+
+ private OptionalNamedTag(ResourceLocation name, @Nullable Set<java.util.function.Supplier<T>> defaults) {
+ super(name);
+ this.defaults = defaults;
+ }
+
+ @Override
+ public boolean isDefaulted() {
+ return defaulted;
+ }
+
+ SetTag<T> resolveDefaulted() {
+ if (defaults == null || defaults.isEmpty()) {
+ return SetTag.m_13216_();
+ }
+ return SetTag.m_13222_(ImmutableSet.copyOf(defaults.stream().map(java.util.function.Supplier::get).collect(Collectors.toSet())));
+ }
+
+ @Override
+ public String toString() {
+ return "OptionalNamedTag[" + m_6979_() + ']';
}
}
}
@@ -1,40 +0,0 @@
--- a/net/minecraft/tags/StaticTags.java
+++ b/net/minecraft/tags/StaticTags.java
@@ -14,15 +_,16 @@
import net.minecraft.resources.ResourceLocation;
public class StaticTags {
- private static final Set<ResourceKey<?>> f_144340_ = Sets.newHashSet();
- private static final List<StaticTagHelper<?>> f_13264_ = Lists.newArrayList();
+ private static final java.util.Map<ResourceKey<?>, StaticTagHelper<?>> HELPER_MAP = new java.util.HashMap<>(); // Forge: Minecraft separates this for no reason, lets make it a map again!
+ private static final Set<ResourceKey<?>> f_144340_ = HELPER_MAP.keySet();
+ private static final java.util.Collection<StaticTagHelper<?>> f_13264_ = HELPER_MAP.values();
public static <T> StaticTagHelper<T> m_144351_(ResourceKey<? extends Registry<T>> p_144352_, String p_144353_) {
- if (!f_144340_.add(p_144352_)) {
+ if (f_144340_.contains(p_144352_)) {
throw new IllegalStateException("Duplicate entry for static tag collection: " + p_144352_);
} else {
StaticTagHelper<T> statictaghelper = new StaticTagHelper<>(p_144352_, p_144353_);
- f_13264_.add(statictaghelper);
+ HELPER_MAP.put(p_144352_, statictaghelper);
return statictaghelper;
}
}
@@ -54,10 +_,16 @@
}
private static void m_144356_() {
+ if (true) { m_144355_(); return; } //FORGE this check is unnecessary as the 2 collections are patched back into a map above. Still need to 'clinit' them though.
Set<ResourceKey<?>> set = m_144355_().stream().map(StaticTagHelper::m_144338_).collect(Collectors.toSet());
if (!Sets.difference(f_144340_, set).isEmpty()) {
throw new IllegalStateException("Missing helper registrations");
}
+ }
+
+ @javax.annotation.Nullable
+ public static StaticTagHelper<?> get(ResourceLocation rl) {
+ return HELPER_MAP.get(ResourceKey.m_135788_(rl));
}
public static void m_144349_(Consumer<StaticTagHelper<?>> p_144350_) {
@@ -1,24 +1,24 @@
--- a/net/minecraft/tags/Tag.java
+++ b/net/minecraft/tags/Tag.java
@@ -47,8 +_,16 @@
return SetTag.m_13222_(p_13301_);
@@ -31,8 +_,16 @@
return (Tag<T>)f_203856_;
}
- public static class Builder {
+ public static class Builder implements net.minecraftforge.common.extensions.IForgeRawTagBuilder {
+ private final List<Tag.BuilderEntry> removeEntries = Lists.newArrayList(); // FORGE: internal field for tracking "remove" entries
+ private final List<Tag.BuilderEntry> removeEntries = new java.util.ArrayList<>(); // FORGE: internal field for tracking "remove" entries
+ /** FORGE: Gets a view of this builder's "remove" entries (only used during datagen) **/
+ public Stream<Tag.BuilderEntry> getRemoveEntries() { return this.removeEntries.stream(); }
+ public Tag.Builder remove(final Tag.BuilderEntry proxy) { // internal forge method for adding remove entries
+ this.removeEntries.add(proxy);
+ return this;
+ }
private final List<Tag.BuilderEntry> f_13302_ = Lists.newArrayList();
private final List<Tag.BuilderEntry> f_13302_ = new ArrayList<>();
+ private boolean replace = false;
public static Tag.Builder m_13304_() {
return new Tag.Builder();
@@ -79,6 +_,15 @@
@@ -63,6 +_,15 @@
return this.m_13307_(new Tag.OptionalTagEntry(p_144383_), p_144384_);
}
@@ -33,8 +33,8 @@
+
public <T> Either<Collection<Tag.BuilderEntry>, Tag<T>> m_144371_(Function<ResourceLocation, Tag<T>> p_144372_, Function<ResourceLocation, T> p_144373_) {
ImmutableSet.Builder<T> builder = ImmutableSet.builder();
List<Tag.BuilderEntry> list = Lists.newArrayList();
@@ -120,6 +_,7 @@
List<Tag.BuilderEntry> list = new ArrayList<>();
@@ -104,6 +_,7 @@
this.f_13302_.clear();
}
@@ -42,8 +42,8 @@
list.forEach((p_13319_) -> {
this.f_13302_.add(new Tag.BuilderEntry(p_13319_, p_13314_));
});
@@ -155,8 +_,9 @@
tag$builderentry.m_13347_().m_6383_(jsonarray);
@@ -139,8 +_,9 @@
tag$builderentry.f_13338_().m_6383_(jsonarray);
}
- jsonobject.addProperty("replace", false);
@@ -53,7 +53,7 @@
return jsonobject;
}
}
@@ -211,6 +_,7 @@
@@ -179,6 +_,7 @@
public String toString() {
return this.f_13349_.toString();
}
@@ -61,7 +61,7 @@
}
public interface Entry {
@@ -323,6 +_,8 @@
@@ -287,6 +_,8 @@
public String toString() {
return "#" + this.f_13383_;
}
@@ -1,26 +0,0 @@
--- a/net/minecraft/tags/TagContainer.java
+++ b/net/minecraft/tags/TagContainer.java
@@ -74,6 +_,7 @@
public void m_13431_() {
StaticTags.m_13269_(this);
Blocks.m_50758_();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.TagsUpdatedEvent(this));
}
public Map<ResourceKey<? extends Registry<?>>, TagCollection.NetworkPayload> m_144442_(final RegistryAccess p_144443_) {
@@ -81,6 +_,7 @@
this.m_144436_(new TagContainer.CollectionConsumer() {
public <T> void m_142574_(ResourceKey<? extends Registry<T>> p_144481_, TagCollection<T> p_144482_) {
Optional<? extends Registry<T>> optional = p_144443_.m_6632_(p_144481_);
+ optional = net.minecraftforge.common.ForgeTagHandler.getWrapperRegistry(p_144481_, optional);
if (optional.isPresent()) {
map.put(p_144481_, p_144482_.m_144411_(optional.get()));
} else {
@@ -102,6 +_,7 @@
private static <T> void m_144444_(RegistryAccess p_144445_, TagContainer.Builder p_144446_, ResourceKey<? extends Registry<? extends T>> p_144447_, TagCollection.NetworkPayload p_144448_) {
Optional<? extends Registry<? extends T>> optional = p_144445_.m_6632_(p_144447_);
+ optional = net.minecraftforge.common.ForgeTagHandler.getWrapperRegistry((ResourceKey<? extends Registry<T>>) p_144447_, (Optional<? extends Registry<T>>) optional);
if (optional.isPresent()) {
p_144446_.m_144486_(p_144447_, TagCollection.m_144408_(p_144448_, optional.get()));
} else {
@@ -1,27 +1,10 @@
--- a/net/minecraft/tags/TagManager.java
+++ b/net/minecraft/tags/TagManager.java
@@ -21,6 +_,7 @@
@@ -17,6 +_,7 @@
public class TagManager implements PreparableReloadListener {
private static final Logger f_144568_ = LogManager.getLogger();
private static final Map<ResourceKey<? extends Registry<?>>, String> f_203902_ = Map.of(Registry.f_122901_, "tags/blocks", Registry.f_122903_, "tags/entity_types", Registry.f_122899_, "tags/fluids", Registry.f_175423_, "tags/game_events", Registry.f_122904_, "tags/items");
private final RegistryAccess f_144569_;
+ protected java.util.Map<ResourceLocation, TagLoader<?>> customTagTypeReaders = net.minecraftforge.common.ForgeTagHandler.createCustomTagTypeReaders();
private TagContainer f_13478_ = TagContainer.f_13420_;
private List<TagManager.LoadResult<?>> f_203903_ = List.of();
public TagManager(RegistryAccess p_144572_) {
@@ -56,6 +_,7 @@
return p_144596_.getKey() + ":" + p_144596_.getValue();
}).sorted().collect(Collectors.joining(",")));
} else {
+ tagcontainer = net.minecraftforge.common.ForgeTagHandler.reinjectOptionalTags(tagcontainer);
SerializationTags.m_13202_(tagcontainer);
this.f_13478_ = tagcontainer;
}
@@ -73,6 +_,8 @@
}, p_144577_);
return new TagManager.LoaderInfo<>(p_144578_, completablefuture);
} else {
+ if (net.minecraftforge.common.ForgeTagHandler.getCustomTagTypeNames().contains(p_144578_.m_144338_().m_135782_()))
+ return new TagManager.LoaderInfo<>(p_144578_, CompletableFuture.supplyAsync(() -> ((TagLoader<T>) customTagTypeReaders.get(p_144578_.m_144338_().m_135782_())).m_144544_(p_144576_), p_144577_));
f_144568_.warn("Can't find registry for {}", (Object)p_144578_.m_144338_());
return null;
}
@@ -17,22 +17,12 @@
}
public void m_6742_(LivingEntity p_19467_, int p_19468_) {
@@ -179,4 +_,39 @@
@@ -179,4 +_,29 @@
public boolean m_19486_() {
return this.f_19447_ == MobEffectCategory.BENEFICIAL;
}
+
+ // FORGE START
+ private final net.minecraftforge.common.util.ReverseTagWrapper<MobEffect> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, () -> net.minecraft.tags.SerializationTags.m_13199_().m_144452_(Registry.f_122900_));
+
+ public java.util.Set<net.minecraft.resources.ResourceLocation> getTags() {
+ return reverseTags.getTagNames();
+ }
+
+ public boolean is(net.minecraft.tags.Tag<MobEffect> tag) {
+ return tag.m_8110_(this);
+ }
+
+ private Object effectRenderer;
+
+ /*
@@ -1,12 +1,12 @@
--- a/net/minecraft/world/effect/MobEffectInstance.java
+++ b/net/minecraft/world/effect/MobEffectInstance.java
@@ -7,7 +_,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import net.minecraft.world.entity.LivingEntity;
import org.slf4j.Logger;
-public class MobEffectInstance implements Comparable<MobEffectInstance> {
+public class MobEffectInstance implements Comparable<MobEffectInstance>, net.minecraftforge.common.extensions.IForgeMobEffectInstance {
private static final Logger f_19501_ = LogManager.getLogger();
private static final Logger f_19501_ = LogUtils.getLogger();
private final MobEffect f_19502_;
private int f_19503_;
@@ -60,6 +_,7 @@
@@ -1,15 +1,15 @@
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -114,7 +_,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -116,7 +_,7 @@
import net.minecraft.world.scores.Team;
import org.slf4j.Logger;
-public abstract class Entity implements Nameable, EntityAccess, CommandSource {
+public abstract class Entity extends net.minecraftforge.common.capabilities.CapabilityProvider<Entity> implements Nameable, EntityAccess, CommandSource, net.minecraftforge.common.extensions.IForgeEntity {
protected static final Logger f_19849_ = LogManager.getLogger();
private static final Logger f_19849_ = LogUtils.getLogger();
public static final String f_146815_ = "id";
public static final String f_146816_ = "Passengers";
@@ -133,6 +_,7 @@
@@ -135,6 +_,7 @@
private static final double f_146812_ = 0.0023333333333333335D;
public static final String f_146824_ = "UUID";
private static double f_19846_ = 1.0D;
@@ -17,7 +17,7 @@
private final EntityType<?> f_19847_;
private int f_19848_ = f_19843_.incrementAndGet();
public boolean f_19850_;
@@ -227,6 +_,7 @@
@@ -229,6 +_,7 @@
private BlockState f_185934_ = null;
public Entity(EntityType<?> p_19870_, Level p_19871_) {
@@ -25,7 +25,7 @@
this.f_19847_ = p_19870_;
this.f_19853_ = p_19871_;
this.f_19815_ = p_19870_.m_20680_();
@@ -245,7 +_,11 @@
@@ -247,7 +_,11 @@
this.f_19804_.m_135372_(f_146800_, 0);
this.m_8097_();
this.m_6034_(0.0D, 0.0D, 0.0D);
@@ -38,7 +38,7 @@
}
public boolean m_20039_(BlockPos p_20040_, BlockState p_20041_) {
@@ -341,6 +_,7 @@
@@ -343,6 +_,7 @@
if (p_146834_ == Entity.RemovalReason.KILLED) {
this.m_146850_(GameEvent.f_157809_);
}
@@ -46,30 +46,30 @@
}
@@ -612,13 +_,13 @@
double d0 = vec3.f_82479_;
double d1 = vec3.f_82480_;
double d2 = vec3.f_82481_;
- this.f_146794_ = (float)((double)this.f_146794_ + vec3.m_82553_() * 0.6D);
@@ -621,13 +_,13 @@
double d1 = vec3.f_82479_;
double d2 = vec3.f_82480_;
double d3 = vec3.f_82481_;
- this.f_146794_ += (float)(vec3.m_82553_() * 0.6D);
+ this.f_146794_ = (float) ((double) this.f_146794_ + vec3.m_82553_() * 0.6D);
if (!blockstate.m_60620_(BlockTags.f_13082_) && !blockstate.m_60713_(Blocks.f_152499_)) {
d1 = 0.0D;
if (!blockstate.m_204336_(BlockTags.f_13082_) && !blockstate.m_60713_(Blocks.f_152499_)) {
d2 = 0.0D;
}
- this.f_19787_ += (float)vec3.m_165924_() * 0.6F;
- this.f_19788_ += (float)Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 0.6F;
- this.f_19788_ += (float)Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3) * 0.6F;
+ this.f_19787_ += (float) vec3.m_165924_() * 0.6F;
+ this.f_19788_ += (float) Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 0.6F;
if (this.f_19788_ > this.f_19829_ && !blockstate.m_60795_()) {
this.f_19829_ = this.m_6059_();
if (this.m_20069_()) {
@@ -650,25 +_,23 @@
@@ -659,25 +_,23 @@
this.m_146872_();
float f2 = this.m_6041_();
- this.m_20256_(this.m_20184_().m_82542_((double)f2, 1.0D, (double)f2));
- if (this.f_19853_.m_46847_(this.m_142469_().m_82406_(1.0E-6D)).noneMatch((p_20127_) -> {
- return p_20127_.m_60620_(BlockTags.f_13076_) || p_20127_.m_60713_(Blocks.f_49991_);
- return p_20127_.m_204336_(BlockTags.f_13076_) || p_20127_.m_60713_(Blocks.f_49991_);
- })) {
- if (this.f_19831_ <= 0) {
- this.m_7311_(-this.m_6101_());
@@ -83,7 +83,7 @@
- if (this.m_6060_() && (this.f_146808_ || this.m_20071_())) {
+ this.m_20256_(this.m_20184_().m_82542_((double) f2, 1.0D, (double) f2));
+ }
+ if (this.f_19853_.m_46847_(this.m_142469_().m_82406_(1.0E-6D)).noneMatch((p_20127_) -> p_20127_.m_60620_(BlockTags.f_13076_) || p_20127_.m_60713_(Blocks.f_49991_))) {
+ if (this.f_19853_.m_46847_(this.m_142469_().m_82406_(1.0E-6D)).noneMatch((p_20127_) -> p_20127_.m_204336_(BlockTags.f_13076_) || p_20127_.m_60713_(Blocks.f_49991_))) {
+ if (this.f_19831_ <= 0) {
this.m_7311_(-this.m_6101_());
}
@@ -103,7 +103,7 @@
}
}
@@ -706,10 +_,10 @@
@@ -715,10 +_,10 @@
int j = Mth.m_14107_(this.f_19825_.f_82480_ - (double)0.2F);
int k = Mth.m_14107_(this.f_19825_.f_82481_);
BlockPos blockpos = new BlockPos(i, j, k);
@@ -111,21 +111,21 @@
+ if (this.f_19853_.m_46859_(blockpos)) {
BlockPos blockpos1 = blockpos.m_7495_();
BlockState blockstate = this.f_19853_.m_8055_(blockpos1);
- if (blockstate.m_60620_(BlockTags.f_13039_) || blockstate.m_60620_(BlockTags.f_13032_) || blockstate.m_60734_() instanceof FenceGateBlock) {
- if (blockstate.m_204336_(BlockTags.f_13039_) || blockstate.m_204336_(BlockTags.f_13032_) || blockstate.m_60734_() instanceof FenceGateBlock) {
+ if (blockstate.collisionExtendsVertically(this.f_19853_, blockpos1, this)) {
return blockpos1;
}
}
@@ -920,7 +_,7 @@
@@ -929,7 +_,7 @@
protected void m_7355_(BlockPos p_20135_, BlockState p_20136_) {
if (!p_20136_.m_60767_().m_76332_()) {
BlockState blockstate = this.f_19853_.m_8055_(p_20135_.m_7494_());
- SoundType soundtype = blockstate.m_60620_(BlockTags.f_144271_) ? blockstate.m_60827_() : p_20136_.m_60827_();
- SoundType soundtype = blockstate.m_204336_(BlockTags.f_144271_) ? blockstate.m_60827_() : p_20136_.m_60827_();
+ SoundType soundtype = blockstate.m_60713_(Blocks.f_50125_) ? blockstate.getSoundType(f_19853_, p_20135_, this) : p_20136_.getSoundType(f_19853_, p_20135_, this);
this.m_5496_(soundtype.m_56776_(), soundtype.m_56773_() * 0.15F, soundtype.m_56774_());
}
}
@@ -1142,9 +_,10 @@
@@ -1144,9 +_,10 @@
int k = Mth.m_14107_(this.m_20189_());
BlockPos blockpos = new BlockPos(i, j, k);
BlockState blockstate = this.f_19853_.m_8055_(blockpos);
@@ -137,7 +137,7 @@
}
}
@@ -1465,6 +_,7 @@
@@ -1467,6 +_,7 @@
if (this.f_146813_) {
p_20241_.m_128379_("HasVisualFire", this.f_146813_);
}
@@ -145,7 +145,7 @@
if (!this.f_19841_.isEmpty()) {
ListTag listtag = new ListTag();
@@ -1476,6 +_,10 @@
@@ -1478,6 +_,10 @@
p_20241_.m_128365_("Tags", listtag);
}
@@ -156,7 +156,7 @@
this.m_7380_(p_20241_);
if (this.m_20160_()) {
ListTag listtag1 = new ListTag();
@@ -1550,6 +_,9 @@
@@ -1552,6 +_,9 @@
this.m_146915_(p_20259_.m_128471_("Glowing"));
this.m_146917_(p_20259_.m_128451_("TicksFrozen"));
this.f_146813_ = p_20259_.m_128471_("HasVisualFire");
@@ -166,7 +166,7 @@
if (p_20259_.m_128425_("Tags", 9)) {
this.f_19841_.clear();
ListTag listtag3 = p_20259_.m_128437_("Tags", 8);
@@ -1638,6 +_,8 @@
@@ -1640,6 +_,8 @@
} else {
ItemEntity itementity = new ItemEntity(this.f_19853_, this.m_20185_(), this.m_20186_() + (double)p_19986_, this.m_20189_(), p_19985_);
itementity.m_32060_();
@@ -175,7 +175,7 @@
this.f_19853_.m_7967_(itementity);
return itementity;
}
@@ -1675,6 +_,7 @@
@@ -1676,6 +_,7 @@
public void m_6083_() {
this.m_20256_(Vec3.f_82478_);
@@ -183,7 +183,7 @@
this.m_8119_();
if (this.m_20159_()) {
this.m_20202_().m_7332_(this);
@@ -1721,6 +_,7 @@
@@ -1722,6 +_,7 @@
}
}
@@ -191,7 +191,7 @@
if (p_19967_ || this.m_7341_(p_19966_) && p_19966_.m_7310_(this)) {
if (this.m_20159_()) {
this.m_8127_();
@@ -1759,6 +_,7 @@
@@ -1760,6 +_,7 @@
public void m_6038_() {
if (this.f_19824_ != null) {
Entity entity = this.f_19824_;
@@ -199,7 +199,7 @@
this.f_19824_ = null;
entity.m_20351_(this);
}
@@ -1924,6 +_,7 @@
@@ -1936,6 +_,7 @@
return !this.f_19823_.isEmpty();
}
@@ -207,7 +207,7 @@
public boolean m_6146_() {
return true;
}
@@ -2081,7 +_,7 @@
@@ -2093,7 +_,7 @@
this.m_20254_(8);
}
@@ -216,7 +216,7 @@
}
public void m_6845_(boolean p_20313_) {
@@ -2169,7 +_,7 @@
@@ -2181,7 +_,7 @@
}
protected Component m_5677_() {
@@ -225,7 +225,7 @@
}
public boolean m_7306_(Entity p_20356_) {
@@ -2225,14 +_,19 @@
@@ -2237,14 +_,19 @@
@Nullable
public Entity m_5489_(ServerLevel p_20118_) {
@@ -246,7 +246,7 @@
this.f_19853_.m_46473_().m_6182_("reloading");
Entity entity = this.m_6095_().m_20615_(p_20118_);
if (entity != null) {
@@ -2240,17 +_,19 @@
@@ -2252,17 +_,19 @@
entity.m_7678_(portalinfo.f_77676_.f_82479_, portalinfo.f_77676_.f_82480_, portalinfo.f_77676_.f_82481_, portalinfo.f_77678_, entity.m_146909_());
entity.m_20256_(portalinfo.f_77677_);
p_20118_.m_143334_(entity);
@@ -268,7 +268,7 @@
}
} else {
return null;
@@ -2451,8 +_,10 @@
@@ -2463,8 +_,10 @@
EntityDimensions entitydimensions = this.f_19815_;
Pose pose = this.m_20089_();
EntityDimensions entitydimensions1 = this.m_6972_(pose);
@@ -280,7 +280,7 @@
this.m_20090_();
boolean flag = (double)entitydimensions1.f_20377_ <= 4.0D && (double)entitydimensions1.f_20378_ <= 4.0D;
if (!this.f_19853_.f_46443_ && !this.f_19803_ && !this.f_19794_ && flag && (entitydimensions1.f_20377_ > entitydimensions.f_20377_ || entitydimensions1.f_20378_ > entitydimensions.f_20378_) && !(this instanceof Player)) {
@@ -2460,8 +_,9 @@
@@ -2472,8 +_,9 @@
double d0 = (double)Math.max(0.0F, entitydimensions1.f_20377_ - entitydimensions.f_20377_) + 1.0E-6D;
double d1 = (double)Math.max(0.0F, entitydimensions1.f_20378_ - entitydimensions.f_20378_) + 1.0E-6D;
VoxelShape voxelshape = Shapes.m_83064_(AABB.m_165882_(vec3, d0, d1, d0));
@@ -291,7 +291,7 @@
});
}
@@ -2938,6 +_,7 @@
@@ -2950,6 +_,7 @@
gameeventlistenerregistrar.m_157862_(this.f_19853_);
}
}
@@ -299,7 +299,7 @@
}
@@ -3045,6 +_,76 @@
@@ -3061,6 +_,76 @@
public boolean m_142265_(Level p_146843_, BlockPos p_146844_) {
return true;
}
@@ -1,15 +1,15 @@
--- a/net/minecraft/world/entity/EntityType.java
+++ b/net/minecraft/world/entity/EntityType.java
@@ -146,7 +_,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -148,7 +_,7 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import org.slf4j.Logger;
-public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
+public class EntityType<T extends Entity> extends net.minecraftforge.registries.ForgeRegistryEntry<EntityType<?>> implements EntityTypeTest<Entity, T> {
private static final Logger f_20534_ = LogManager.getLogger();
private static final Logger f_20534_ = LogUtils.getLogger();
public static final String f_147037_ = "EntityTag";
private static final float f_147038_ = 1.3964844F;
@@ -280,6 +_,12 @@
private final Holder.Reference<EntityType<?>> f_204038_ = Registry.f_122826_.m_203693_(this);
@@ -283,6 +_,11 @@
private ResourceLocation f_20546_;
private final EntityDimensions f_20547_;
@@ -17,12 +17,11 @@
+ private final java.util.function.ToIntFunction<EntityType<?>> trackingRangeSupplier;
+ private final java.util.function.ToIntFunction<EntityType<?>> updateIntervalSupplier;
+ private final java.util.function.BiFunction<net.minecraftforge.network.PlayMessages.SpawnEntity, Level, T> customClientFactory;
+ private final net.minecraftforge.common.util.ReverseTagWrapper<EntityType<?>> reverseTags = new net.minecraftforge.common.util.ReverseTagWrapper<>(this, net.minecraft.tags.EntityTypeTags::m_13126_);
+
private static <T extends Entity> EntityType<T> m_20634_(String p_20635_, EntityType.Builder<T> p_20636_) {
return Registry.m_122961_(Registry.f_122826_, p_20635_, p_20636_.m_20712_(p_20635_));
}
@@ -293,6 +_,9 @@
@@ -296,6 +_,9 @@
}
public EntityType(EntityType.EntityFactory<T> p_20574_, MobCategory p_20575_, boolean p_20576_, boolean p_20577_, boolean p_20578_, boolean p_20579_, ImmutableSet<Block> p_20580_, EntityDimensions p_20581_, int p_20582_, int p_20583_) {
@@ -32,7 +31,7 @@
this.f_20535_ = p_20574_;
this.f_20536_ = p_20575_;
this.f_20541_ = p_20579_;
@@ -303,6 +_,10 @@
@@ -306,6 +_,10 @@
this.f_20547_ = p_20581_;
this.f_20542_ = p_20582_;
this.f_20543_ = p_20583_;
@@ -43,7 +42,7 @@
}
@Nullable
@@ -314,6 +_,7 @@
@@ -317,6 +_,7 @@
public T m_20600_(ServerLevel p_20601_, @Nullable CompoundTag p_20602_, @Nullable Component p_20603_, @Nullable Player p_20604_, BlockPos p_20605_, MobSpawnType p_20606_, boolean p_20607_, boolean p_20608_) {
T t = this.m_20655_(p_20601_, p_20602_, p_20603_, p_20604_, p_20605_, p_20606_, p_20607_, p_20608_);
if (t != null) {
@@ -51,7 +50,7 @@
p_20601_.m_47205_(t);
}
@@ -541,14 +_,23 @@
@@ -544,14 +_,23 @@
}
public int m_20681_() {
@@ -75,27 +74,20 @@
return this != f_20532_ && this != f_20467_ && this != f_20496_ && this != f_20549_ && this != f_20462_ && this != f_147033_ && this != f_20464_ && this != f_20506_ && this != f_20564_ && this != f_20569_;
}
@@ -565,6 +_,19 @@
return Entity.class;
@@ -574,6 +_,12 @@
return this.f_204038_;
}
+ public T customClientSpawn(net.minecraftforge.network.PlayMessages.SpawnEntity packet, Level world) {
+ if (customClientFactory == null) return this.m_20615_(world);
+ return customClientFactory.apply(packet, world);
+ }
+
+ /**
+ * Retrieves a list of tags names this is known to be associated with.
+ * This should be used in favor of TagCollection.getOwningTags, as this caches the result and automatically updates when the TagCollection changes.
+ */
+ public java.util.Set<ResourceLocation> getTags() {
+ return reverseTags.getTagNames();
+ }
+ public Stream<TagKey<EntityType<?>>> getTags() {return this.m_204041_().m_203616_();}
+
public static class Builder<T extends Entity> {
private final EntityType.EntityFactory<T> f_20685_;
private final MobCategory f_20686_;
@@ -577,6 +_,11 @@
@@ -586,6 +_,11 @@
private int f_20693_ = 3;
private EntityDimensions f_20694_ = EntityDimensions.m_20395_(0.6F, 1.8F);
@@ -107,7 +99,7 @@
private Builder(EntityType.EntityFactory<T> p_20696_, MobCategory p_20697_) {
this.f_20685_ = p_20696_;
this.f_20686_ = p_20697_;
@@ -633,12 +_,36 @@
@@ -642,12 +_,36 @@
return this;
}
@@ -17,8 +17,8 @@
+ if (this.f_19853_.f_46443_ || this.m_146910_()) return false; //Forge: Fixes MC-53850
if (this.m_6673_(p_20785_)) {
return false;
} else {
@@ -197,6 +_,7 @@
} else if (this.f_19853_.f_46443_) {
@@ -199,6 +_,7 @@
public void m_6123_(Player p_20792_) {
if (!this.f_19853_.f_46443_) {
if (p_20792_.f_36101_ == 0) {
@@ -26,7 +26,7 @@
p_20792_.f_36101_ = 2;
p_20792_.m_7938_(this, 1);
int i = this.m_147092_(p_20792_, this.f_20770_);
@@ -217,7 +_,7 @@
@@ -219,7 +_,7 @@
Entry<EquipmentSlot, ItemStack> entry = EnchantmentHelper.m_44839_(Enchantments.f_44962_, p_147093_, ItemStack::m_41768_);
if (entry != null) {
ItemStack itemstack = entry.getValue();
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -118,7 +_,9 @@
@@ -122,7 +_,9 @@
private static final UUID f_20929_ = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D");
private static final UUID f_20959_ = UUID.fromString("87f46a96-686f-4796-b035-22e16ee9e038");
private static final UUID f_147184_ = UUID.fromString("1eaf83ff-7207-4596-b37a-d7a07b3ec4ce");
@@ -10,7 +10,7 @@
public static final int f_147166_ = 2;
public static final int f_147167_ = 4;
public static final int f_147168_ = 98;
@@ -268,7 +_,7 @@
@@ -272,7 +_,7 @@
}
public static AttributeSupplier.Builder m_21183_() {
@@ -19,7 +19,7 @@
}
protected void m_7840_(double p_20990_, boolean p_20991_, BlockState p_20992_, BlockPos p_20993_) {
@@ -286,7 +_,8 @@
@@ -290,7 +_,8 @@
if (!p_20992_.m_60795_()) {
double d0 = Math.min((double)(0.2F + f / 15.0F), 2.5D);
int i = (int)(150.0D * d0);
@@ -29,7 +29,7 @@
}
}
@@ -350,7 +_,7 @@
@@ -354,7 +_,7 @@
}
}
@@ -38,7 +38,7 @@
this.m_8127_();
}
} else if (this.m_20146_() < this.m_6062_()) {
@@ -714,7 +_,7 @@
@@ -718,7 +_,7 @@
if (!mobeffectinstance.m_19552_(this, () -> {
this.m_141973_(mobeffectinstance, true, (Entity)null);
})) {
@@ -47,7 +47,7 @@
iterator.remove();
this.m_7285_(mobeffectinstance);
}
@@ -764,8 +_,10 @@
@@ -768,8 +_,10 @@
this.m_6842_(false);
} else {
Collection<MobEffectInstance> collection = this.f_20945_.values();
@@ -60,7 +60,7 @@
this.m_6842_(this.m_21023_(MobEffects.f_19609_));
}
@@ -801,7 +_,7 @@
@@ -805,7 +_,7 @@
d0 *= 0.5D;
}
}
@@ -69,7 +69,7 @@
return d0;
}
@@ -844,7 +_,9 @@
@@ -848,7 +_,9 @@
boolean flag;
for(flag = false; iterator.hasNext(); flag = true) {
@@ -80,7 +80,7 @@
iterator.remove();
}
@@ -878,6 +_,7 @@
@@ -882,6 +_,7 @@
return false;
} else {
MobEffectInstance mobeffectinstance = this.f_20945_.get(p_147208_.m_19544_());
@@ -88,7 +88,7 @@
if (mobeffectinstance == null) {
this.f_20945_.put(p_147208_.m_19544_(), p_147208_);
this.m_142540_(p_147208_, p_147209_);
@@ -892,6 +_,9 @@
@@ -896,6 +_,9 @@
}
public boolean m_7301_(MobEffectInstance p_21197_) {
@@ -98,7 +98,7 @@
if (this.m_6336_() == MobType.f_21641_) {
MobEffect mobeffect = p_21197_.m_19544_();
if (mobeffect == MobEffects.f_19605_ || mobeffect == MobEffects.f_19614_) {
@@ -924,6 +_,7 @@
@@ -928,6 +_,7 @@
}
public boolean m_21195_(MobEffect p_21196_) {
@@ -106,7 +106,7 @@
MobEffectInstance mobeffectinstance = this.m_6234_(p_21196_);
if (mobeffectinstance != null) {
this.m_7285_(mobeffectinstance);
@@ -960,6 +_,8 @@
@@ -964,6 +_,8 @@
}
public void m_5634_(float p_21116_) {
@@ -115,7 +115,7 @@
float f = this.m_21223_();
if (f > 0.0F) {
this.m_21153_(f + p_21116_);
@@ -980,6 +_,7 @@
@@ -984,6 +_,7 @@
}
public boolean m_6469_(DamageSource p_21016_, float p_21017_) {
@@ -123,7 +123,7 @@
if (this.m_6673_(p_21016_)) {
return false;
} else if (this.f_19853_.f_46443_) {
@@ -998,9 +_,11 @@
@@ -1002,9 +_,11 @@
boolean flag = false;
float f1 = 0.0F;
if (p_21017_ > 0.0F && this.m_21275_(p_21016_)) {
@@ -138,7 +138,7 @@
if (!p_21016_.m_19360_()) {
Entity entity = p_21016_.m_7640_();
if (entity instanceof LivingEntity) {
@@ -1010,6 +_,7 @@
@@ -1014,6 +_,7 @@
flag = true;
}
@@ -146,7 +146,7 @@
this.f_20924_ = 1.5F;
boolean flag1 = true;
@@ -1044,11 +_,11 @@
@@ -1048,11 +_,11 @@
if (entity1 instanceof Player) {
this.f_20889_ = 100;
this.f_20888_ = (Player)entity1;
@@ -162,7 +162,7 @@
if (livingentity != null && livingentity.m_6095_() == EntityType.f_20532_) {
this.f_20888_ = (Player)livingentity;
} else {
@@ -1121,7 +_,7 @@
@@ -1125,7 +_,7 @@
if (this instanceof ServerPlayer) {
CriteriaTriggers.f_10574_.m_35174_((ServerPlayer)this, p_21016_, f, p_21017_, flag);
if (f1 > 0.0F && f1 < 3.4028235E37F) {
@@ -171,7 +171,7 @@
}
}
@@ -1159,7 +_,7 @@
@@ -1163,7 +_,7 @@
if (itemstack != null) {
if (this instanceof ServerPlayer) {
ServerPlayer serverplayer = (ServerPlayer)this;
@@ -180,7 +180,7 @@
CriteriaTriggers.f_10551_.m_74431_(serverplayer, itemstack);
}
@@ -1229,6 +_,7 @@
@@ -1233,6 +_,7 @@
}
public void m_6667_(DamageSource p_21014_) {
@@ -188,7 +188,7 @@
if (!this.m_146910_() && !this.f_20890_) {
Entity entity = p_21014_.m_7639_();
LivingEntity livingentity = this.m_21232_();
@@ -1264,10 +_,10 @@
@@ -1268,10 +_,10 @@
if (!this.f_19853_.f_46443_) {
boolean flag = false;
if (p_21269_ instanceof WitherBoss) {
@@ -201,7 +201,7 @@
this.f_19853_.m_7731_(blockpos, blockstate, 3);
flag = true;
}
@@ -1284,12 +_,9 @@
@@ -1288,12 +_,9 @@
protected void m_6668_(DamageSource p_21192_) {
Entity entity = p_21192_.m_7639_();
@@ -217,7 +217,7 @@
boolean flag = this.f_20889_ > 0;
if (this.m_6125_() && this.f_19853_.m_46469_().m_46207_(GameRules.f_46135_)) {
@@ -1299,6 +_,10 @@
@@ -1303,6 +_,10 @@
this.m_5907_();
this.m_21226_();
@@ -228,7 +228,7 @@
}
protected void m_5907_() {
@@ -1306,7 +_,8 @@
@@ -1310,7 +_,8 @@
protected void m_21226_() {
if (this.f_19853_ instanceof ServerLevel && (this.m_6124_() || this.f_20889_ > 0 && this.m_6149_() && this.f_19853_.m_46469_().m_46207_(GameRules.f_46135_))) {
@@ -238,7 +238,7 @@
}
}
@@ -1322,7 +_,8 @@
@@ -1326,7 +_,8 @@
ResourceLocation resourcelocation = this.m_5743_();
LootTable loottable = this.f_19853_.m_142572_().m_129898_().m_79217_(resourcelocation);
LootContext.Builder lootcontext$builder = this.m_7771_(p_21022_, p_21021_);
@@ -248,7 +248,7 @@
}
protected LootContext.Builder m_7771_(boolean p_21105_, DamageSource p_21106_) {
@@ -1335,6 +_,11 @@
@@ -1339,6 +_,11 @@
}
public void m_147240_(double p_147241_, double p_147242_, double p_147243_) {
@@ -260,11 +260,11 @@
p_147241_ *= 1.0D - this.m_21133_(Attributes.f_22278_);
if (!(p_147241_ <= 0.0D)) {
this.f_19812_ = true;
@@ -1388,15 +_,9 @@
@@ -1392,15 +_,9 @@
} else {
BlockPos blockpos = this.m_142538_();
BlockState blockstate = this.m_146900_();
- if (blockstate.m_60620_(BlockTags.f_13082_)) {
- if (blockstate.m_204336_(BlockTags.f_13082_)) {
- this.f_20957_ = Optional.of(blockpos);
- return true;
- } else if (blockstate.m_60734_() instanceof TrapDoorBlock && this.m_21176_(blockpos, blockstate)) {
@@ -279,7 +279,7 @@
}
}
@@ -1416,6 +_,11 @@
@@ -1420,6 +_,11 @@
}
public boolean m_142535_(float p_147187_, float p_147188_, DamageSource p_147189_) {
@@ -291,7 +291,7 @@
boolean flag = super.m_142535_(p_147187_, p_147188_, p_147189_);
int i = this.m_5639_(p_147187_, p_147188_);
if (i > 0) {
@@ -1439,9 +_,10 @@
@@ -1443,9 +_,10 @@
int i = Mth.m_14107_(this.m_20185_());
int j = Mth.m_14107_(this.m_20186_() - (double)0.2F);
int k = Mth.m_14107_(this.m_20189_());
@@ -304,7 +304,7 @@
this.m_5496_(soundtype.m_56779_(), soundtype.m_56773_() * 0.5F, soundtype.m_56774_() * 0.75F);
}
@@ -1489,9 +_,9 @@
@@ -1493,9 +_,9 @@
float f2 = f1 - p_21194_;
if (f2 > 0.0F && f2 < 3.4028235E37F) {
if (this instanceof ServerPlayer) {
@@ -316,7 +316,7 @@
}
}
}
@@ -1511,19 +_,22 @@
@@ -1515,19 +_,22 @@
protected void m_6475_(DamageSource p_21240_, float p_21241_) {
if (!this.m_6673_(p_21240_)) {
@@ -341,7 +341,7 @@
this.m_7911_(this.m_6103_() - f2);
this.m_146852_(GameEvent.f_157808_, p_21240_.m_7639_());
}
@@ -1578,6 +_,8 @@
@@ -1582,6 +_,8 @@
}
public void m_21011_(InteractionHand p_21012_, boolean p_21013_) {
@@ -350,7 +350,7 @@
if (!this.f_20911_ || this.f_20913_ >= this.m_21304_() / 2 || this.f_20913_ < 0) {
this.f_20913_ = -1;
this.f_20911_ = true;
@@ -1937,14 +_,15 @@
@@ -1941,14 +_,15 @@
}
this.f_19812_ = true;
@@ -362,13 +362,13 @@
+ this.m_20256_(this.m_20184_().m_82520_(0.0D, (double)-0.04F * this.m_21051_(net.minecraftforge.common.ForgeMod.SWIM_SPEED.get()).m_22135_(), 0.0D));
}
protected void m_6197_(net.minecraft.tags.Tag<Fluid> p_21158_) {
protected void m_203347_(TagKey<Fluid> p_204043_) {
- this.m_20256_(this.m_20184_().m_82520_(0.0D, (double)0.04F, 0.0D));
+ this.m_20256_(this.m_20184_().m_82520_(0.0D, (double)0.04F * this.m_21051_(net.minecraftforge.common.ForgeMod.SWIM_SPEED.get()).m_22135_(), 0.0D));
}
protected float m_6108_() {
@@ -1958,11 +_,15 @@
@@ -1962,11 +_,15 @@
public void m_7023_(Vec3 p_21280_) {
if (this.m_6142_() || this.m_6109_()) {
double d0 = 0.08D;
@@ -384,25 +384,25 @@
+ d0 = gravity.m_22135_();
FluidState fluidstate = this.f_19853_.m_6425_(this.m_142538_());
if (this.m_20069_() && this.m_6129_() && !this.m_7479_(fluidstate.m_76152_())) {
@@ -1987,6 +_,7 @@
f5 = 0.96F;
if (this.m_20069_() && this.m_6129_() && !this.m_203441_(fluidstate)) {
@@ -1991,6 +_,7 @@
f4 = 0.96F;
}
+ f6 *= (float)this.m_21051_(net.minecraftforge.common.ForgeMod.SWIM_SPEED.get()).m_22135_();
this.m_19920_(f6, p_21280_);
this.m_19920_(f5, p_21280_);
this.m_6478_(MoverType.SELF, this.m_20184_());
Vec3 vec36 = this.m_20184_();
@@ -2065,7 +_,7 @@
@@ -2069,7 +_,7 @@
}
} else {
BlockPos blockpos = this.m_20099_();
- float f3 = this.f_19853_.m_8055_(blockpos).m_60734_().m_49958_();
+ float f3 = this.f_19853_.m_8055_(this.m_20099_()).getFriction(f_19853_, this.m_20099_(), this);
float f4 = this.f_19861_ ? f3 * 0.91F : 0.91F;
Vec3 vec35 = this.m_21074_(p_21280_, f3);
- float f2 = this.f_19853_.m_8055_(blockpos).m_60734_().m_49958_();
+ float f2 = this.f_19853_.m_8055_(this.m_20099_()).getFriction(f_19853_, this.m_20099_(), this);
float f3 = this.f_19861_ ? f2 * 0.91F : 0.91F;
Vec3 vec35 = this.m_21074_(p_21280_, f2);
double d2 = vec35.f_82480_;
@@ -2141,7 +_,7 @@
@@ -2145,7 +_,7 @@
double d0 = Mth.m_14008_(p_21298_.f_82479_, (double)-0.15F, (double)0.15F);
double d1 = Mth.m_14008_(p_21298_.f_82481_, (double)-0.15F, (double)0.15F);
double d2 = Math.max(p_21298_.f_82480_, (double)-0.15F);
@@ -411,7 +411,7 @@
d2 = 0.0D;
}
@@ -2169,6 +_,7 @@
@@ -2173,6 +_,7 @@
}
public void m_8119_() {
@@ -419,7 +419,7 @@
super.m_8119_();
this.m_21329_();
this.m_21333_();
@@ -2317,6 +_,7 @@
@@ -2321,6 +_,7 @@
ItemStack itemstack1 = this.m_6844_(equipmentslot);
if (!ItemStack.m_41728_(itemstack1, itemstack)) {
@@ -427,7 +427,7 @@
if (map == null) {
map = Maps.newEnumMap(EquipmentSlot.class);
}
@@ -2540,6 +_,8 @@
@@ -2544,6 +_,8 @@
boolean flag = this.m_20291_(7);
if (flag && !this.f_19861_ && !this.m_20159_() && !this.m_21023_(MobEffects.f_19620_)) {
ItemStack itemstack = this.m_6844_(EquipmentSlot.CHEST);
@@ -436,7 +436,7 @@
if (itemstack.m_150930_(Items.f_42741_) && ElytraItem.m_41140_(itemstack)) {
flag = true;
int i = this.f_20937_ + 1;
@@ -2783,8 +_,16 @@
@@ -2775,8 +_,16 @@
private void m_21329_() {
if (this.m_6117_()) {
@@ -455,7 +455,7 @@
this.m_142106_(this.f_20935_);
} else {
this.m_5810_();
@@ -2837,8 +_,10 @@
@@ -2829,8 +_,10 @@
public void m_6672_(InteractionHand p_21159_) {
ItemStack itemstack = this.m_21120_(p_21159_);
if (!itemstack.m_41619_() && !this.m_6117_()) {
@@ -467,7 +467,7 @@
if (!this.f_19853_.f_46443_) {
this.m_21155_(1, true);
this.m_21155_(2, p_21159_ == InteractionHand.OFF_HAND);
@@ -2898,6 +_,9 @@
@@ -2890,6 +_,9 @@
vec31 = vec31.m_82496_(-this.m_146909_() * ((float)Math.PI / 180F));
vec31 = vec31.m_82524_(-this.m_146908_() * ((float)Math.PI / 180F));
vec31 = vec31.m_82520_(this.m_20185_(), this.m_20188_(), this.m_20189_());
@@ -477,7 +477,7 @@
this.f_19853_.m_7106_(new ItemParticleOption(ParticleTypes.f_123752_, p_21061_), vec31.f_82479_, vec31.f_82480_, vec31.f_82481_, vec3.f_82479_, vec3.f_82480_ + 0.05D, vec3.f_82481_);
}
@@ -2911,7 +_,8 @@
@@ -2903,7 +_,8 @@
} else {
if (!this.f_20935_.m_41619_() && this.m_6117_()) {
this.m_21137_(this.f_20935_, 16);
@@ -487,7 +487,7 @@
if (itemstack != this.f_20935_) {
this.m_21008_(interactionhand, itemstack);
}
@@ -2937,7 +_,11 @@
@@ -2929,7 +_,11 @@
public void m_21253_() {
if (!this.f_20935_.m_41619_()) {
@@ -499,7 +499,7 @@
if (this.f_20935_.m_41781_()) {
this.m_21329_();
}
@@ -3084,8 +_,8 @@
@@ -3076,8 +_,8 @@
}
BlockState blockstate = this.f_19853_.m_8055_(p_21141_);
@@ -510,7 +510,7 @@
}
this.m_20124_(Pose.SLEEPING);
@@ -3101,15 +_,15 @@
@@ -3093,15 +_,15 @@
private boolean m_21334_() {
return this.m_21257_().map((p_147236_) -> {
@@ -529,7 +529,7 @@
Vec3 vec31 = BedBlock.m_49458_(this.m_6095_(), this.f_19853_, p_147228_, this.m_146908_()).orElseGet(() -> {
BlockPos blockpos = p_147228_.m_7494_();
return new Vec3((double)blockpos.m_123341_() + 0.5D, (double)blockpos.m_123342_() + 0.1D, (double)blockpos.m_123343_() + 0.5D);
@@ -3131,7 +_,9 @@
@@ -3123,7 +_,9 @@
@Nullable
public Direction m_21259_() {
BlockPos blockpos = this.m_21257_().orElse((BlockPos)null);
@@ -540,7 +540,7 @@
}
public boolean m_5830_() {
@@ -3204,6 +_,64 @@
@@ -3196,6 +_,64 @@
this.m_21166_(p_21191_ == InteractionHand.MAIN_HAND ? EquipmentSlot.MAINHAND : EquipmentSlot.OFFHAND);
}
@@ -605,7 +605,7 @@
public AABB m_6921_() {
if (this.m_6844_(EquipmentSlot.HEAD).m_150930_(Items.f_42683_)) {
float f = 0.5F;
@@ -3214,6 +_,8 @@
@@ -3206,6 +_,8 @@
}
public static EquipmentSlot m_147233_(ItemStack p_147234_) {
@@ -614,7 +614,7 @@
Item item = p_147234_.m_41720_();
if (!p_147234_.m_150930_(Items.f_42047_) && (!(item instanceof BlockItem) || !(((BlockItem)item).m_40614_() instanceof AbstractSkullBlock))) {
if (item instanceof ArmorItem) {
@@ -3221,7 +_,7 @@
@@ -3213,7 +_,7 @@
} else if (p_147234_.m_150930_(Items.f_42741_)) {
return EquipmentSlot.CHEST;
} else {
@@ -4,9 +4,9 @@
super.m_7638_();
} else {
if (this.f_26578_ != null) {
- if (!this.f_26578_.m_123306_(this.f_26494_.m_20182_(), (double)this.f_26494_.m_20205_()) && (!(this.f_26494_.m_20186_() > (double)this.f_26578_.m_123342_()) || !(new BlockPos((double)this.f_26578_.m_123341_(), this.f_26494_.m_20186_(), (double)this.f_26578_.m_123343_())).m_123306_(this.f_26494_.m_20182_(), (double)this.f_26494_.m_20205_()))) {
- if (!this.f_26578_.m_203195_(this.f_26494_.m_20182_(), (double)this.f_26494_.m_20205_()) && (!(this.f_26494_.m_20186_() > (double)this.f_26578_.m_123342_()) || !(new BlockPos((double)this.f_26578_.m_123341_(), this.f_26494_.m_20186_(), (double)this.f_26578_.m_123343_())).m_203195_(this.f_26494_.m_20182_(), (double)this.f_26494_.m_20205_()))) {
+ // FORGE: Fix MC-94054
+ if (!this.f_26578_.m_123306_(this.f_26494_.m_20182_(), Math.max((double)this.f_26494_.m_20205_(), 1.0D)) && (!(this.f_26494_.m_20186_() > (double)this.f_26578_.m_123342_()) || !(new BlockPos((double)this.f_26578_.m_123341_(), this.f_26494_.m_20186_(), (double)this.f_26578_.m_123343_())).m_123306_(this.f_26494_.m_20182_(), Math.max((double)this.f_26494_.m_20205_(), 1.0D)))) {
+ if (!this.f_26578_.m_203195_(this.f_26494_.m_20182_(), Math.max((double)this.f_26494_.m_20205_(), 1.0D)) && (!(this.f_26494_.m_20186_() > (double)this.f_26578_.m_123342_()) || !(new BlockPos((double)this.f_26578_.m_123341_(), this.f_26494_.m_20186_(), (double)this.f_26578_.m_123343_())).m_203195_(this.f_26494_.m_20182_(), Math.max((double)this.f_26494_.m_20205_(), 1.0D)))) {
this.f_26494_.m_21566_().m_6849_((double)this.f_26578_.m_123341_(), (double)this.f_26578_.m_123342_(), (double)this.f_26578_.m_123343_(), this.f_26497_);
} else {
this.f_26578_ = null;
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/Cat.java
+++ b/net/minecraft/world/entity/animal/Cat.java
@@ -416,7 +_,7 @@
@@ -425,7 +_,7 @@
}
} else if (this.m_6898_(itemstack)) {
this.m_142075_(p_28153_, p_28154_, itemstack);
Loaded 100 of 312 files, more files were not shown because too many files have changed in this diff. Show more