Compare commits

...
34 Commits
Author SHA1 Message Date
LexManos 4f2f5c02a0 1.19.2 RB 2022-08-17 14:58:14 -07:00
agnor99 7a6843fa4a Added ItemDecorator API (#8794) 2022-08-17 23:39:56 +02:00
한현빈 f0ecf16c6b [1.19.x] Custom usage animations for items (#8932) 2022-08-17 23:08:13 +02:00
Take Weiland 8998fa71b2 Allow registering custom ColorResolvers (#8880) 2022-08-17 22:51:05 +02:00
Dennis C 4e677a7558 [1.19] Allow custom outline rendering on EntityRenderers and BlockEntityRenderers (#8938) 2022-08-17 00:01:33 +02:00
sciwhiz12 07254b36d7 Redirect checks for entity selector use to a permission (#8947)
This allows greater flexibility for configuring servers with
operator-like permissions to user groups through the permissions API and
their permissions handler of choice without needing to grant the
vanilla operator permission to any player.

The new permission is "forge:use_entity_selectors", which is granted by
default to players with permission level 2 (GAMEMASTERS) and above.

The hook falls back to checking the permission level if the source of
the command is not a ServerPlayer, such as for command blocks and
functions.
2022-08-16 14:11:54 -07:00
Brennan Ward a51b8d256d Allow FakePlayer to report its position (#8963) 2022-08-16 14:09:09 -07:00
Sara Freimer 75fcd9448e Add alternate version of renderEntityInInventory to allow for directly specifying the angles (#8961) 2022-08-16 13:57:30 -07:00
eerussianguy 6b45999702 Add cancellable ToastAddEvent (#8952) 2022-08-16 13:48:55 -07:00
eerussianguy a4f52f4057 Modify ScreenEvent.RenderInventoryMobEffects to allow moving the effect stack left or right (#8951) 2022-08-16 13:47:57 -07:00
Brennan Ward b8b3201372 Fix Enchantment#doPostHurt and Enchantment#doPostAttack being called twice for players. Fixes MC-248272 (#8948) 2022-08-16 13:40:10 -07:00
LexManos 41deadc1e2 Remove reflective implementation of ICustomPacket. (#8973)
Make vanilla custom packets able to be sent multiple times. Closes #8969
2022-08-16 13:17:25 -07:00
LexManos 82e8d06e54 Filter name spaces to directories only. Closes #8413 2022-08-14 12:22:38 -07:00
Marc Hermans 51db5f2ff7 Fix a corner case where the UMLB can not extract a version from a library. (#8967) 2022-08-14 12:18:22 -07:00
Alex O'Neill 2ec9e515ff Fix worlds with removed dimension types unable to load. (#8959) Closes #8800 2022-08-14 12:17:22 -07:00
Alex O'Neill 0579572148 Fix issue where unknown chunk generators would cause DFU to fail. (#8957) 2022-08-10 23:13:44 -07:00
TheMuso 83f4e6353c Fix comments and documentation that were missed during the review of #8712 (#8945) 2022-08-09 12:49:00 -07:00
Luis 130953e519 Make AnvilUpdateEvent fire even if the second input is empty, which means it fires even if only changing the item name. (#8905) 2022-08-09 12:48:46 -07:00
Sirttas 7981093591 Fix LivingEntity#isBlocking to use ToolActions#SHIELD_BLOCK instead of UseAnim#BLOCK (#8933) 2022-08-09 12:27:26 -07:00
Joseph B 79112d6208 Add Custom HolderSet Types allowing for logical combining of sets. (#8928) 2022-08-09 12:25:12 -07:00
Sara Freimer a3eb6263f4 Add values to VersionSupportMatrix to support loading mods that restrict versions to 1.19.1 on 1.19.2 (#8946) 2022-08-09 12:15:58 -07:00
Redstone_Dubstep d91bc9c73d Fix certain particles not updating their bounding box when their position changes (#8925) 2022-08-08 15:09:13 +02:00
LexManos c807665ab9 Update EventBus to address concurrency issue in ModLauncher Factory. Closes #8924 2022-08-07 17:35:15 -07:00
LexManos 7b97c181b9 1.19.2 2022-08-05 16:35:02 -07:00
Brennan Ward c42b0847d2 Remove calls to getStepHeight in Player#maybeBackOffFromEdge (#8927) 2022-08-05 11:35:47 -07:00
Sirttas f182cb00c1 Add forge tags for tools and armors, these DO NOT replace ToolActions, and are designed just for Recipes. (#8914) 2022-08-05 11:32:53 -07:00
J.T. McQuigg 3181b5da23 Add Biomes.BEACH to Tags (#8892) 2022-08-05 11:31:32 -07:00
Mysticdrew 983c119477 Let NetworkInstance.isRemotePresent check minecraft:register for channel IDs. (#8921) 2022-08-05 11:31:11 -07:00
Sara Freimer 874ff1bba2 Add an event for when the chunk ticket level is updated (#8909) 2022-08-05 11:21:14 -07:00
TheMuso 06d9d89f98 Re-add PotentialSpawns event (#8712) 2022-08-05 09:29:02 -07:00
Dennis C c713bad8c3 Fix misplaced patch in ItemEntityRenderer breaking ItemEntityRenderer#shouldBob() (#8919) 2022-08-04 22:14:28 -07:00
Marc Hermans fe19491822 [1.19] [HotFix] Fix the dedicated server not having access to the JiJ filesystems. (#8931) 2022-08-03 22:32:32 +01:00
SizableShrimp c80e8a1aca Match Mojang's action bar fix for MC-72687 (#8917) 2022-07-29 01:09:33 -07:00
SizableShrimp 6845c094ab Forge 1.19.1
Load natives from classpath
Make command argument types a forge registry
Add `EntityMobGriefingEvent` to `Allay#wantsToPickUp`
Overhaul `ServerChatEvent` to use `ChatDecorator` system
Remove `ClientChatEvent#setMessage` for now
Gradle 7.5

Signed-off-by: SizableShrimp <[email protected]>
2022-07-28 00:20:31 -05:00
200 changed files with 3534 additions and 913 deletions

No files matched your search

+20 -17
View File
@@ -20,8 +20,8 @@ plugins {
id 'net.minecraftforge.gradleutils' version '2.+'
id 'eclipse'
id 'de.undercouch.download' version '4.1.2'
id 'net.minecraftforge.gradle.patcher' version '[5.1.43,)' apply false
id 'net.minecraftforge.gradle.mcp' version '[5.1.43,)' apply false
id 'net.minecraftforge.gradle.patcher' version '[5.1.50,5.2.0)' apply false
id 'net.minecraftforge.gradle.mcp' version '[5.1.50,5.2.0)' apply false
}
Util.init() //Init all our extension methods!
@@ -36,13 +36,14 @@ ext {
]
}
MAPPING_CHANNEL = 'official'
MAPPING_VERSION = '1.19'
MC_VERSION = '1.19'
MCP_VERSION = '20220607.102129'
MAPPING_VERSION = '1.19.2'
MC_VERSION = '1.19.2'
MC_NEXT_VERSION = '1.20'
MCP_VERSION = '20220805.130853'
SPI_VERSION = '6.0.0'
ACCESSTRANSFORMERS_VERSION = '8.0.4'
COREMODS_VERSION = '5.0.1'
EVENTBUS_VERSION = '6.0.0'
EVENTBUS_VERSION = '6.0.3'
MODLAUNCHER_VERSION = '10.0.8'
SECUREJARHANDLER_VERSION = '2.1.4'
BOOTSTRAPLAUNCHER_VERSION = '1.1.2'
@@ -65,7 +66,7 @@ ext {
APACHE_COMMONS_LANG3_VERSION = '3.12.0'
JOPT_SIMPLE_VERSION = '5.0.4'
COMMONS_IO_VERSION = '2.11.0'
JARJAR_VERSION = '0.3.9'
JARJAR_VERSION = '0.3.16'
GIT_INFO = gradleutils.gitInfo
VERSION = gradleutils.getFilteredMCTagOffsetBranchVersion(true, '[0-9]', MC_VERSION)
@@ -95,7 +96,7 @@ def extraTxts = [
]
task downloadVersionManifest(type: Download) {
src 'https://launchermeta.mojang.com/mc/game/version_manifest_v2.json'
src 'https://piston-meta.mojang.com/mc/game/version_manifest_v2.json'
dest file('build/versions/version_manifest.json')
useETag 'all'
onlyIfModified true
@@ -261,6 +262,7 @@ def sharedDeps = {
moduleonly "org.ow2.asm:asm-util:${ASM_VERSION}"
moduleonly "org.ow2.asm:asm-analysis:${ASM_VERSION}"
moduleonly "cpw.mods:bootstraplauncher:${BOOTSTRAPLAUNCHER_VERSION}"
moduleonly "net.minecraftforge:JarJarFileSystems:${JARJAR_VERSION}"
installer "cpw.mods:securejarhandler:${SECUREJARHANDLER_VERSION}"
installer "org.ow2.asm:asm:${ASM_VERSION}"
@@ -284,7 +286,8 @@ def sharedDeps = {
installer "org.jline:jline-terminal:${JLINE_VERSION}" // Dep of TerminalConsoleAppender
installer "org.spongepowered:mixin:${MIXIN_VERSION}"
installer 'org.openjdk.nashorn:nashorn-core:15.3'
installer "net.minecraftforge:JarJar:${JARJAR_VERSION}"
installer "net.minecraftforge:JarJarSelector:${JARJAR_VERSION}"
installer "net.minecraftforge:JarJarMetadata:${JARJAR_VERSION}"
/*
installer 'org.lwjgl:lwjgl:3.2.2'
@@ -377,7 +380,8 @@ def sharedFmlonlyForge = { Project prj ->
environment 'MOD_CLASSES', '{source_roots}'
environment 'MCP_MAPPINGS', '{mcp_mappings}'
property 'nativesDirectory', '{natives}'
// Natives are loaded from the classpath now in all cases
// property 'nativesDirectory', '{natives}'
if (prj.name == 'forge') {
property 'forge.enableGameTest', 'true'
}
@@ -442,7 +446,7 @@ def sharedFmlonlyForge = { Project prj ->
// SecureJarHandler bootstrap values.
run.property 'ignoreList', prj.configurations.moduleonly.files.collect {it.name.replaceAll(/([-_]([.\d]*\d+)|\.jar$)/, '') }.join(',') + ",client-extra,fmlcore,javafmllanguage,lowcodelanguage,mclanguage,${prj.name}-"
// FIXME: Without this jna doesn't work at runtime. Someone figure out why please?
run.property 'mergeModules', 'jna-5.10.0.jar,jna-platform-5.10.0.jar,java-objc-bridge-1.0.0.jar'
run.property 'mergeModules', 'jna-5.10.0.jar,jna-platform-5.10.0.jar'
if (userdevRuns.contains(run)) {
run.property 'legacyClassPath.file', '{minecraft_classpath_file}'
run.jvmArgs '-p', '{modules}'
@@ -462,7 +466,8 @@ def sharedFmlonlyForge = { Project prj ->
run.workingDirectory prj.file('run')
if (run.name.contains('client') || run.name.contains('data')) {
run.property 'nativesDirectory', prj.extractNatives.output.get().asFile
// Natives are loaded from the classpath now in all cases
// run.property 'nativesDirectory', prj.extractNatives.output.get().asFile
run.args '--assetsDir', prj.downloadAssets.output
run.args '--assetIndex', "{asset_index}"
}
@@ -637,8 +642,7 @@ project(':fmlonly') {
'--fml.mcVersion', MC_VERSION,
'--fml.forgeGroup', project.group,
'--fml.mcpVersion', MCP_VERSION],
jvm: ['-Djava.net.preferIPv6Addresses=system',
"-DignoreList=${fmlonly_client.properties.ignoreList},\${version_name}.jar",
jvm: ["-DignoreList=${fmlonly_client.properties.ignoreList},\${version_name}.jar",
"-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}'),
@@ -1200,8 +1204,7 @@ project(':forge') {
def baseForgeVersion = System.getProperty("forge.compatibility_check_version")
if (baseForgeVersion == null)
// FIXME: Restore commented out portion when next tagged (41.1 or 42.0), assuming that a .0 build is published
baseForgeVersion = "1.19-41.0.1" // "${MC_VERSION}-${GIT_INFO.tag}.0"
baseForgeVersion = "${MC_VERSION}-${GIT_INFO.tag}.0"
if (baseForgeVersion == "null")
baseForgeVersion = null // Allow disabling from system property if not wanted
def baseForgeUniversal = null
@@ -1561,7 +1564,7 @@ project(':forge') {
MAPPING_CHANNEL: MAPPING_CHANNEL,
MAPPING_VERSION: MAPPING_VERSION,
FORGE_SPEC_VERSION: SPEC_VERSION.split("\\.")[0],
MC_NEXT_VERSION: "1."+((MC_VERSION.split("[\\.-]")[1] as int)+1)
MC_NEXT_VERSION: MC_NEXT_VERSION
])
rename 'gitignore\\.txt', '.gitignore'
rename 'gitattributes\\.txt', '.gitattributes'
+2 -2
View File
@@ -2,8 +2,8 @@
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.19-&query=$.promos["1.19-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.19-&query=$.promos["1.19-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.19-&query=$.promos["1.19.2-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.19.2-&query=$.promos["1.19.2-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!
+2 -1
View File
@@ -28,7 +28,8 @@ dependencies {
api("cpw.mods:modlauncher:${MODLAUNCHER_VERSION}")
api("net.minecraftforge:coremods:${COREMODS_VERSION}")
api("com.mojang:logging:${MOJANG_LOGGING_VERSION}")
api "net.minecraftforge:JarJar:${JARJAR_VERSION}"
api "net.minecraftforge:JarJarSelector:${JARJAR_VERSION}"
api "net.minecraftforge:JarJarMetadata:${JARJAR_VERSION}"
implementation("net.sf.jopt-simple:jopt-simple:${JOPT_SIMPLE_VERSION}")
implementation("cpw.mods:securejarhandler:${SECUREJARHANDLER_VERSION}")
@@ -106,16 +106,17 @@ public class UniqueModListBuilder
if (modInfoList.size() > 1) {
LOGGER.debug("Found {} mods for first modid {}, selecting most recent based on version data", modInfoList.size(), fullList.getKey());
modInfoList.sort(Comparator.comparing(this::getVersion).reversed());
LOGGER.debug("Selected file {} for modid {} with version {}", modInfoList.get(0).getFileName(), fullList.getKey(), modInfoList.get(0).getModInfos().get(0).getVersion());
LOGGER.debug("Selected file {} for modid {} with version {}", modInfoList.get(0).getFileName(), fullList.getKey(), this.getVersion(modInfoList.get(0)));
}
return modInfoList.get(0);
}
private ArtifactVersion getVersion(final ModFile mf)
{
if (mf.getModFileInfo() == null) {
if (mf.getModFileInfo() == null || mf.getModInfos() == null || mf.getModInfos().isEmpty()) {
return mf.getJarVersion();
}
return mf.getModInfos().get(0).getVersion();
}
@@ -5,6 +5,7 @@
package net.minecraftforge.fml.loading;
import net.minecraftforge.forgespi.language.MavenVersionAdapter;
import org.apache.maven.artifact.versioning.ArtifactVersion;
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
import org.apache.maven.artifact.versioning.VersionRange;
@@ -18,16 +19,12 @@ public class VersionSupportMatrix {
private static final HashMap<String, List<ArtifactVersion>> overrideVersions = new HashMap<>();
static {
final ArtifactVersion version = new DefaultArtifactVersion(FMLLoader.versionInfo().mcVersion());
// if (MavenVersionAdapter.createFromVersionSpec("[1.16.4,1.16.5]").containsVersion(version)) {
// // 1.16.4 is Compatible with 1.16.3
// add("languageloader.javafml", "34");
// add("mod.minecraft", "1.16.3");
// add("mod.forge", "34.1.42");
// // 1.16.5 is Compatible with 1.16.4, and thus 1.16.3
// add("languageloader.javafml", "35");
// add("mod.minecraft", "1.16.4");
// add("mod.forge", "35.1.37");
// }
if (MavenVersionAdapter.createFromVersionSpec("[1.19.2]").containsVersion(version)) {
// 1.19.2 is Compatible with 1.19.1
add("languageloader.javafml", "42");
add("mod.minecraft", "1.19.1");
add("mod.forge", "42.0.9");
}
}
private static void add(String key, String value) {
overrideVersions.computeIfAbsent(key, k -> new ArrayList<>()).add(new DefaultArtifactVersion(value));
@@ -46,7 +46,6 @@ public class JarInJarDependencyLocator extends AbstractJarFileDependencyLocator
final List<IModFile> sources = Lists.newArrayList();
loadedMods.forEach(sources::add);
final List<IModFile> dependenciesToLoad = JarSelector.detectAndSelect(sources, this::loadResourceFromModFile, this::loadModFileFrom, this::identifyMod, this::exception);
if (dependenciesToLoad.isEmpty())
@@ -5,7 +5,6 @@
package net.minecraftforge.fml.loading.targets;
import com.google.common.base.Strings;
import cpw.mods.jarhandling.SecureJar;
import java.io.File;
@@ -50,8 +49,6 @@ public abstract class CommonDevLaunchHandler extends CommonLaunchHandler {
if (getDist().isDedicatedServer())
return arguments;
fixNatives();
if (isData())
return arguments;
@@ -119,18 +116,4 @@ public abstract class CommonDevLaunchHandler extends CommonLaunchHandler {
// Generate a time-based random number, to mimic how n.m.client.Main works
return Long.toString(System.nanoTime() % (int) Math.pow(10, length));
}
private static void fixNatives() {
String paths = System.getProperty("java.library.path");
String nativesDir = System.getProperty("nativesDirectory");
if (nativesDir == null)
return;
if (Strings.isNullOrEmpty(paths))
paths = nativesDir;
else
paths += File.pathSeparator + nativesDir;
System.setProperty("java.library.path", paths);
}
}
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+6
View File
@@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Vendored
+8 -6
View File
@@ -14,7 +14,7 @@
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
@@ -38,7 +38,7 @@ public class FMLModContainer extends ModContainer
LOGGER.debug(LOADING,"Creating FMLModContainer instance for {}", className);
this.scanResults = modFileScanResults;
activityMap.put(ModLoadingStage.CONSTRUCT, this::constructMod);
this.eventBus = BusBuilder.builder().setExceptionHandler(this::onEventFailed).setTrackPhases(false).markerType(IModBusEvent.class).build();
this.eventBus = BusBuilder.builder().setExceptionHandler(this::onEventFailed).setTrackPhases(false).markerType(IModBusEvent.class).useModLauncher().build();
this.configHandler = Optional.of(ce->this.eventBus.post(ce.self()));
final FMLJavaModLoadingContext contextExtension = new FMLJavaModLoadingContext(this);
this.contextExtension = () -> contextExtension;
+2 -1
View File
@@ -12,7 +12,8 @@ dependencyUpdates.rejectVersionIf { isNonStable(it.candidate.version) }
java.withSourcesJar()
dependencies {
compileOnly('org.jetbrains:annotations:21.0.1')
compileOnly("org.jetbrains:annotations:${JETBRAINS_ANNOTATIONS_VERSION}")
implementation(project(':fmlloader'))
implementation(project(':fmlcore'))
}
@@ -1,6 +1,6 @@
--- a/com/mojang/blaze3d/platform/Window.java
+++ b/com/mojang/blaze3d/platform/Window.java
@@ -80,7 +_,7 @@
@@ -82,7 +_,7 @@
GLFW.glfwWindowHint(139267, 2);
GLFW.glfwWindowHint(139272, 204801);
GLFW.glfwWindowHint(139270, 1);
@@ -9,7 +9,7 @@
if (monitor != null) {
VideoMode videomode = monitor.m_84948_(this.f_85355_ ? this.f_85354_ : Optional.empty());
this.f_85350_ = this.f_85357_ = monitor.m_84951_() + videomode.m_85332_() / 2 - this.f_85359_ / 2;
@@ -298,6 +_,7 @@
@@ -303,6 +_,7 @@
GLFW.glfwGetFramebufferSize(this.f_85349_, aint, aint1);
this.f_85361_ = aint[0] > 0 ? aint[0] : 1;
this.f_85362_ = aint1[0] > 0 ? aint1[0] : 1;
@@ -1,6 +1,6 @@
--- a/net/minecraft/CrashReport.java
+++ b/net/minecraft/CrashReport.java
@@ -55,14 +_,8 @@
@@ -57,14 +_,8 @@
if (this.f_127506_ != null && this.f_127506_.length > 0) {
p_127520_.append("-- Head --\n");
p_127520_.append("Thread: ").append(Thread.currentThread().getName()).append("\n");
@@ -17,7 +17,7 @@
}
for(CrashReportCategory crashreportcategory : this.f_127503_) {
@@ -70,6 +_,7 @@
@@ -72,6 +_,7 @@
p_127520_.append("\n\n");
}
@@ -25,7 +25,7 @@
this.f_178624_.m_143525_(p_127520_);
}
@@ -89,23 +_,13 @@
@@ -91,23 +_,13 @@
throwable.setStackTrace(this.f_127501_.getStackTrace());
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/SharedConstants.java
+++ b/net/minecraft/SharedConstants.java
@@ -203,6 +_,7 @@
@@ -211,6 +_,7 @@
}
static {
@@ -1,18 +1,18 @@
--- a/net/minecraft/Util.java
+++ b/net/minecraft/Util.java
@@ -164,6 +_,11 @@
@@ -170,6 +_,11 @@
return 255;
}
+ // We add these inner classes to compensate for Mojang's missing inner classes and shift the anonymous class index.
+ // This allows us to obfuscate subsequent anonymous inner classes correctly.
+ @SuppressWarnings("unused") private static LongSupplier INNER_CLASS_SHIFT1 = new LongSupplier() { public long getAsLong() { return 0; } };
+ @SuppressWarnings("unused") private static LongSupplier INNER_CLASS_SHIFT2 = new LongSupplier() { public long getAsLong() { return 0; } };
+ @SuppressWarnings("unused") private static java.util.function.LongSupplier INNER_CLASS_SHIFT1 = new java.util.function.LongSupplier() { public long getAsLong() { return 0; } };
+ @SuppressWarnings("unused") private static java.util.function.LongSupplier INNER_CLASS_SHIFT2 = new java.util.function.LongSupplier() { public long getAsLong() { return 0; } };
+
public static ExecutorService m_183988_() {
return f_137443_;
}
@@ -242,7 +_,7 @@
@@ -248,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/client/KeyboardHandler.java
+++ b/net/minecraft/client/KeyboardHandler.java
@@ -300,7 +_,9 @@
@@ -299,7 +_,9 @@
}
Screen screen = this.f_90867_.f_91080_;
@@ -11,7 +11,7 @@
if (this.f_90867_.f_91066_.f_92105_.m_90832_(p_90895_, p_90896_)) {
this.f_90867_.m_91268_().m_85438_();
this.f_90867_.f_91066_.m_231829_().m_231514_(this.f_90867_.m_91268_().m_85440_());
@@ -318,6 +_,8 @@
@@ -317,6 +_,8 @@
});
return;
}
@@ -19,8 +19,8 @@
+ ((KeyBindsScreen)this.f_90867_.f_91080_).f_193975_ = null; //Forge: Unset pure modifiers.
}
if (NarratorChatListener.f_93311_.m_93316_()) {
@@ -340,11 +_,15 @@
if (this.f_90867_.m_240477_().m_93316_()) {
@@ -339,11 +_,15 @@
Screen.m_96579_(() -> {
if (p_90897_ != 1 && (p_90897_ != 2 || !this.f_90868_)) {
if (p_90897_ == 0) {
@@ -38,7 +38,7 @@
}
}, "keyPressed event handler", screen.getClass().getCanonicalName());
@@ -397,22 +_,26 @@
@@ -396,22 +_,26 @@
}
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/Minecraft.java
+++ b/net/minecraft/client/Minecraft.java
@@ -236,7 +_,7 @@
@@ -244,7 +_,7 @@
import org.slf4j.Logger;
@OnlyIn(Dist.CLIENT)
@@ -9,7 +9,7 @@
static Minecraft f_90981_;
private static final Logger f_90982_ = LogUtils.getLogger();
public static final boolean f_91002_ = Util.m_137581_() == Util.OS.OSX;
@@ -385,7 +_,7 @@
@@ -398,7 +_,7 @@
this.f_91029_ = p_91084_.f_101908_.f_101928_;
this.f_90986_ = p_91084_.f_101905_.f_101944_;
this.f_91037_ = new ClientPackSource(new File(this.f_91069_, "server-resource-packs"), p_91084_.f_101907_.m_101925_());
@@ -18,7 +18,7 @@
this.f_91030_ = p_91084_.f_101905_.f_101945_;
this.f_231338_ = new YggdrasilAuthenticationService(this.f_91030_);
this.f_91048_ = this.f_231338_.createMinecraftSessionService();
@@ -393,7 +_,6 @@
@@ -406,7 +_,6 @@
this.f_231339_ = SignatureValidator.m_216358_(this.f_231338_.getServicesKey());
this.f_90998_ = p_91084_.f_101905_.f_101942_;
f_90982_.info("Setting user: {}", (Object)this.f_90998_.m_92546_());
@@ -26,15 +26,16 @@
this.f_91033_ = p_91084_.f_101908_.f_101926_;
this.f_91034_ = !p_91084_.f_101908_.f_101929_;
this.f_91035_ = !p_91084_.f_101908_.f_101930_;
@@ -445,7 +_,6 @@
@@ -458,7 +_,7 @@
this.f_90990_.m_85380_(this.f_91066_.m_232035_().m_231551_());
this.f_91067_ = new MouseHandler(this);
- this.f_91067_.m_91524_(this.f_90990_.m_85439_());
+ // FORGE: Move mouse handler setup further below
this.f_91068_ = new KeyboardHandler(this);
this.f_91068_.m_90887_(this.f_90990_.m_85439_());
RenderSystem.m_69580_(this.f_91066_.f_92035_, false);
@@ -453,6 +_,7 @@
@@ -466,6 +_,7 @@
this.f_91042_.m_83931_(0.0F, 0.0F, 0.0F, 0.0F);
this.f_91042_.m_83954_(f_91002_);
this.f_91036_ = new ReloadableResourceManager(PackType.CLIENT_RESOURCES);
@@ -42,7 +43,7 @@
this.f_91038_.m_10506_();
this.f_91066_.m_92145_(this.f_91038_);
this.f_91039_ = new LanguageManager(this.f_91066_.f_92075_);
@@ -496,10 +_,12 @@
@@ -510,10 +_,12 @@
this.f_91063_ = new GameRenderer(this, this.f_90994_.m_234586_(), this.f_91036_, this.f_90993_);
this.f_91036_.m_7217_(this.f_91063_);
this.f_91060_ = new LevelRenderer(this, this.f_90994_, this.f_167845_, this.f_90993_);
@@ -55,17 +56,18 @@
this.f_91036_.m_7217_(this.f_91061_);
this.f_91053_ = new PaintingTextureManager(this.f_90987_);
this.f_91036_.m_7217_(this.f_91053_);
@@ -508,7 +_,8 @@
@@ -522,7 +_,9 @@
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_90995_);
+ this.f_91065_ = new net.minecraftforge.client.gui.overlay.ForgeGui(this);
+ this.f_91067_.m_91524_(this.f_90990_.m_85439_()); //Forge: Moved below ingameGUI setting to prevent NPEs in handeler.
+ // FORGE: Moved mouse handler setup below ingame gui creation to prevent NPEs in mouse handler.
+ this.f_91067_.m_91524_(this.f_90990_.m_85439_());
this.f_91064_ = new DebugRenderer(this);
this.f_238717_ = new RealmsDataFetcher(RealmsClient.m_239151_(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_()) {
@@ -526,6 +_,19 @@
@@ -541,6 +_,21 @@
TinyFileDialogs.tinyfd_messageBox("Minecraft", stringbuilder.toString(), "ok", "error", false);
}
@@ -81,33 +83,52 @@
+ net.minecraftforge.client.gui.overlay.GuiOverlayManager.init();
+ net.minecraftforge.client.DimensionSpecialEffectsManager.init();
+ net.minecraftforge.client.NamedRenderTypeManager.init();
+ net.minecraftforge.client.ColorResolverManager.init();
+ net.minecraftforge.client.ItemDecoratorHandler.init();
+
this.f_90990_.m_85409_(this.f_91066_.m_231817_().m_231551_());
this.f_90990_.m_85424_(this.f_91066_.m_232123_().m_231551_());
this.f_90990_.m_85426_();
@@ -543,13 +_,16 @@
@@ -563,23 +_,23 @@
}
this.f_167847_.m_168556_();
+ if (net.minecraftforge.client.loading.ClientModLoader.completeModLoading()) return; // Do not overwrite the error screen
+ // FORGE: Move opening initial screen to after startup and events are enabled.
+ // Also Fixes MC-145102
+ if (s != null) {
+ ConnectScreen.m_169267_(new TitleScreen(), this, new ServerAddress(s, i), (ServerData)null);
+ ConnectScreen.m_169267_(new TitleScreen(), this, new ServerAddress(s, i), (ServerData)null);
+ } else if (this.m_239929_()) {
+ this.m_91152_(BanNoticeScreen.m_239967_((p_238185_) -> {
+ if (p_238185_) {
+ Util.m_137581_().m_137646_("https://aka.ms/mcjavamoderation");
+ }
+
+ this.m_91152_(new TitleScreen(true));
+ }, this.m_239210_()));
+ } else {
+ this.m_91152_(new TitleScreen(true));
+ this.m_91152_(new TitleScreen(true));
+ }
});
}, false));
- if (s != null) {
- ConnectScreen.m_169267_(new TitleScreen(), this, new ServerAddress(s, i), (ServerData)null);
- reloadinstance.m_7237_().thenRunAsync(() -> {
- ConnectScreen.m_169267_(new TitleScreen(), this, new ServerAddress(s, i), (ServerData)null);
- }, this);
- } else if (this.m_239929_()) {
- this.m_91152_(BanNoticeScreen.m_239967_((p_238185_) -> {
- if (p_238185_) {
- Util.m_137581_().m_137646_("https://aka.ms/mcjavamoderation");
- }
-
- this.m_91152_(new TitleScreen(true));
- }, this.m_239210_()));
- } else {
- this.m_91152_(new TitleScreen(true));
- }
}
@@ -592,6 +_,8 @@
@@ -622,6 +_,8 @@
private UserApiService m_193585_(YggdrasilAuthenticationService p_193586_, GameConfig p_193587_) {
try {
@@ -116,7 +137,7 @@
return p_193586_.createUserApiService(p_193587_.f_101905_.f_101942_.m_92547_());
} catch (AuthenticationException authenticationexception) {
f_90982_.error("Failed to verify authentication", (Throwable)authenticationexception);
@@ -604,7 +_,7 @@
@@ -634,7 +_,7 @@
}
private void m_91239_(Throwable p_91240_) {
@@ -125,7 +146,7 @@
this.m_91241_(p_91240_, (Component)null);
} else {
Util.m_137559_(p_91240_);
@@ -762,13 +_,13 @@
@@ -792,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_());
@@ -142,7 +163,7 @@
}
}
@@ -892,10 +_,6 @@
@@ -922,10 +_,6 @@
f_90982_.error("setScreen called from non-game thread");
}
@@ -153,7 +174,7 @@
if (p_91153_ == null && this.f_91073_ == null) {
p_91153_ = new TitleScreen();
} else if (p_91153_ == null && this.f_91074_.m_21224_()) {
@@ -906,6 +_,19 @@
@@ -936,6 +_,19 @@
}
}
@@ -173,7 +194,7 @@
this.f_91080_ = p_91153_;
BufferUploader.m_166835_();
if (p_91153_ != null) {
@@ -1049,11 +_,14 @@
@@ -1079,11 +_,14 @@
RenderSystem.m_69481_();
this.f_91026_.m_7238_();
if (!this.f_91079_) {
@@ -188,7 +209,7 @@
}
if (this.f_91056_ != null) {
@@ -1180,10 +_,12 @@
@@ -1210,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_());
@@ -201,7 +222,7 @@
this.f_91063_.m_109097_(this.f_90990_.m_85441_(), this.f_90990_.m_85442_());
this.f_91067_.m_91599_();
}
@@ -1461,6 +_,7 @@
@@ -1491,6 +_,7 @@
}
public void m_91395_() {
@@ -209,7 +230,7 @@
this.f_91019_ = false;
}
@@ -1490,10 +_,18 @@
@@ -1520,10 +_,18 @@
if (p_91387_ && this.f_91077_ != null && this.f_91077_.m_6662_() == HitResult.Type.BLOCK) {
BlockHitResult blockhitresult = (BlockHitResult)this.f_91077_;
BlockPos blockpos = blockhitresult.m_82425_();
@@ -231,7 +252,7 @@
this.f_91074_.m_6674_(InteractionHand.MAIN_HAND);
}
}
@@ -1518,14 +_,20 @@
@@ -1548,14 +_,20 @@
return false;
} else {
boolean flag = false;
@@ -250,22 +271,22 @@
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)) {
+ 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;
@@ -1538,8 +_,10 @@
@@ -1568,8 +_,10 @@
}
this.f_91074_.m_36334_();
+ net.minecraftforge.common.ForgeHooks.onEmptyLeftClick(this.f_91074_);
+ net.minecraftforge.common.ForgeHooks.onEmptyLeftClick(this.f_91074_);
}
+ if (inputEvent.shouldSwingHand())
this.f_91074_.m_6674_(InteractionHand.MAIN_HAND);
return flag;
}
@@ -1554,6 +_,11 @@
@@ -1584,6 +_,11 @@
}
for(InteractionHand interactionhand : InteractionHand.values()) {
@@ -277,31 +298,32 @@
ItemStack itemstack = this.f_91074_.m_21120_(interactionhand);
if (this.f_91077_ != null) {
switch (this.f_91077_.m_6662_()) {
@@ -1564,6 +_,7 @@
@@ -1594,13 +_,14 @@
return;
}
+ if(!this.f_91074_.canInteractWith(entityhitresult.m_82443_(), 0)) return; //Forge: Entity may be traced via attack range, but the player may not have sufficient reach. No padding in client code.
+ if(!this.f_91074_.canInteractWith(entityhitresult.m_82443_(), 0)) return; //Forge: Entity may be traced via attack range, but the player may not have sufficient reach. No padding in client code.
InteractionResult interactionresult = this.f_91072_.m_105230_(this.f_91074_, entity, entityhitresult, interactionhand);
if (!interactionresult.m_19077_()) {
interactionresult = this.f_91072_.m_105226_(this.f_91074_, entity, interactionhand);
@@ -1571,6 +_,7 @@
}
if (interactionresult.m_19077_()) {
if (interactionresult.m_19080_()) {
+ if (inputEvent.shouldSwingHand())
- if (interactionresult.m_19080_()) {
+ if (interactionresult.m_19080_() && inputEvent.shouldSwingHand()) {
this.f_91074_.m_6674_(interactionhand);
}
@@ -1583,6 +_,7 @@
@@ -1612,7 +_,7 @@
int i = itemstack.m_41613_();
InteractionResult interactionresult1 = this.f_91072_.m_233732_(this.f_91074_, interactionhand, blockhitresult);
if (interactionresult1.m_19077_()) {
if (interactionresult1.m_19080_()) {
+ if (inputEvent.shouldSwingHand())
- if (interactionresult1.m_19080_()) {
+ if (interactionresult1.m_19080_() && inputEvent.shouldSwingHand()) {
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);
@@ -1598,6 +_,9 @@
@@ -1628,6 +_,9 @@
}
}
@@ -311,16 +333,16 @@
if (!itemstack.m_41619_()) {
InteractionResult interactionresult2 = this.f_91072_.m_233721_(this.f_91074_, interactionhand);
if (interactionresult2.m_19077_()) {
@@ -1624,6 +_,8 @@
@@ -1654,6 +_,8 @@
--this.f_91011_;
}
+ net.minecraftforge.event.ForgeEventFactory.onPreClientTick();
+
this.f_91026_.m_6180_("gui");
this.f_240378_.m_240688_();
this.f_91065_.m_193832_(this.f_91012_);
this.f_91026_.m_7238_();
@@ -1752,6 +_,8 @@
@@ -1783,6 +_,8 @@
this.f_91026_.m_6182_("keyboard");
this.f_91068_.m_90931_();
this.f_91026_.m_7238_();
@@ -329,18 +351,7 @@
}
private boolean m_91278_() {
@@ -1894,8 +_,8 @@
SkullBlockEntity.m_222885_(services, this);
GameProfileCache.m_11004_(false);
this.f_91007_ = MinecraftServer.m_129872_((p_231361_) -> {
- return new IntegratedServer(p_231361_, this, p_231382_, p_231383_, p_231384_, services, (p_231447_) -> {
- StoringChunkProgressListener storingchunkprogresslistener = new StoringChunkProgressListener(p_231447_ + 0);
+ return new IntegratedServer(p_231361_, this, p_231382_, p_231383_, p_231384_, services, (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);
});
@@ -1945,6 +_,7 @@
@@ -1978,6 +_,7 @@
}
public void m_91156_(ClientLevel p_91157_) {
@@ -348,20 +359,20 @@
ProgressScreen progressscreen = new ProgressScreen(true);
progressscreen.m_6309_(Component.m_237115_("connect.joining"));
this.m_91362_(progressscreen);
@@ -1978,10 +_,12 @@
@@ -2011,10 +_,12 @@
IntegratedServer integratedserver = this.f_91007_;
this.f_91007_ = null;
this.f_91063_.m_109150_();
+ net.minecraftforge.client.ForgeHooksClient.firePlayerLogout(this.f_91072_, this.f_91074_);
this.f_91072_ = null;
NarratorChatListener.f_93311_.m_93328_();
this.f_240365_.m_93328_();
this.m_91362_(p_91321_);
if (this.f_91073_ != null) {
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.level.LevelEvent.Unload(f_91073_));
if (integratedserver != null) {
this.f_91026_.m_6180_("waitForServer");
@@ -1996,6 +_,7 @@
@@ -2029,6 +_,7 @@
this.f_91065_.m_93089_();
this.f_91008_ = null;
this.f_91010_ = false;
@@ -369,7 +380,7 @@
this.f_91004_.m_90740_();
}
@@ -2082,6 +_,7 @@
@@ -2124,6 +_,7 @@
private void m_91280_() {
if (this.f_91077_ != null && this.f_91077_.m_6662_() != HitResult.Type.MISS) {
@@ -377,7 +388,7 @@
boolean flag = this.f_91074_.m_150110_().f_35937_;
BlockEntity blockentity = null;
HitResult.Type hitresult$type = this.f_91077_.m_6662_();
@@ -2094,10 +_,7 @@
@@ -2136,10 +_,7 @@
}
Block block = blockstate.m_60734_();
@@ -389,7 +400,7 @@
if (flag && Screen.m_96637_() && blockstate.m_155947_()) {
blockentity = this.f_91073_.m_7702_(blockpos);
@@ -2108,7 +_,7 @@
@@ -2150,7 +_,7 @@
}
Entity entity = ((EntityHitResult)this.f_91077_).m_82443_();
@@ -398,7 +409,7 @@
if (itemstack == null) {
return;
}
@@ -2632,8 +_,8 @@
@@ -2688,8 +_,8 @@
return this.f_90993_;
}
@@ -409,7 +420,7 @@
Supplier<PackResources> supplier = p_167937_;
if (i <= 3) {
supplier = m_91330_(p_167937_);
@@ -2643,7 +_,7 @@
@@ -2699,7 +_,7 @@
supplier = m_91352_(supplier);
}
@@ -418,10 +429,12 @@
}
private static Supplier<PackResources> m_91330_(Supplier<PackResources> p_91331_) {
@@ -2662,6 +_,14 @@
this.f_91051_.m_119410_(p_91313_);
}
@@ -2716,6 +_,19 @@
public void m_91312_(int p_91313_) {
this.f_91051_.m_119410_(p_91313_);
+ }
+
+ public ItemColors getItemColors() {
+ return this.f_91041_;
+ }
@@ -430,18 +443,9 @@
+ return this.f_90997_;
+ }
+
public EntityModelSet m_167973_() {
return this.f_167844_;
}
@@ -2719,4 +_,11 @@
public abstract boolean m_142594_(boolean p_168035_);
}
+
+ // FORGE START
+ private float realPartialTick;
+ public float getPartialTick() {
+ return realPartialTick;
+ }
+ // FORGE END
}
}
public EntityModelSet m_167973_() {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/Options.java
+++ b/net/minecraft/client/Options.java
@@ -515,7 +_,8 @@
@@ -539,7 +_,8 @@
}, new OptionInstance.LazyEnum<>(() -> {
return Stream.concat(Stream.of(""), Minecraft.m_91087_().m_91106_().m_194525_().stream()).toList();
}, (p_232011_) -> {
@@ -10,7 +10,7 @@
}, Codec.STRING), "", (p_231994_) -> {
SoundManager soundmanager = Minecraft.m_91087_().m_91106_();
soundmanager.m_194526_();
@@ -772,6 +_,7 @@
@@ -796,6 +_,7 @@
}
public Options(Minecraft p_92138_, File p_92139_) {
@@ -18,7 +18,7 @@
this.f_92060_ = p_92138_;
this.f_92110_ = new File(p_92139_, "options.txt");
boolean flag = p_92138_.m_91103_();
@@ -886,11 +_,20 @@
@@ -910,11 +_,20 @@
p_168428_.m_213982_("chatPreview", this.f_231796_);
p_168428_.m_213982_("onlyShowSecureChat", this.f_231798_);
@@ -41,7 +41,7 @@
}
}
@@ -911,6 +_,9 @@
@@ -935,6 +_,9 @@
}
public void m_92140_() {
@@ -51,7 +51,7 @@
try {
if (!this.f_92110_.exists()) {
return;
@@ -955,7 +_,8 @@
@@ -979,7 +_,8 @@
}
}
@@ -61,7 +61,7 @@
@Nullable
private String m_168458_(String p_168459_) {
return compoundtag1.m_128441_(p_168459_) ? compoundtag1.m_128461_(p_168459_) : null;
@@ -1058,6 +_,7 @@
@@ -1082,6 +_,7 @@
}
public void m_92169_() {
@@ -69,7 +69,7 @@
try {
final PrintWriter printwriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(this.f_92110_), StandardCharsets.UTF_8));
@@ -1205,6 +_,23 @@
@@ -1229,6 +_,23 @@
}
p_92146_.m_10509_(set);
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/Screenshot.java
+++ b/net/minecraft/client/Screenshot.java
@@ -59,13 +_,23 @@
@@ -55,13 +_,23 @@
file2 = new File(file1, p_92307_);
}
@@ -23,19 +23,10 @@
this.f_92535_ = p_193799_;
this.f_92536_ = p_193800_;
this.f_92537_ = p_193801_;
@@ -58,10 +_,22 @@
public GameProfile m_92548_() {
try {
UUID uuid = UUIDTypeAdapter.fromString(this.m_92545_());
- return new GameProfile(uuid, this.m_92546_());
+ GameProfile ret = new GameProfile(uuid, this.m_92546_()); //Forge: Adds cached GameProfile properties to returned GameProfile.
+ if (properties != null) ret.getProperties().putAll(properties); // Helps to cut down on calls to the session service,
+ return ret; // which helps to fix MC-52974.
} catch (IllegalArgumentException illegalargumentexception) {
return new GameProfile((UUID)null, this.m_92546_());
@@ -64,8 +_,22 @@
}
+ }
+
}
+ //For internal use only. Modders should never need to use this.
+ public void setProperties(com.mojang.authlib.properties.PropertyMap properties) {
+ if (this.properties == null)
@@ -44,6 +35,15 @@
+
+ public boolean hasCachedProperties() {
+ return properties != null;
+ }
+
public GameProfile m_92548_() {
- return new GameProfile(this.m_240411_(), this.m_92546_());
+ // FORGE: Add cached GameProfile properties to returned GameProfile. This helps to cut down on calls to the session service.
+ GameProfile ret = new GameProfile(this.m_240411_(), this.m_92546_());
+ if (this.properties != null)
+ ret.getProperties().putAll(this.properties);
+ return ret;
}
public User.Type m_168638_() {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/Gui.java
+++ b/net/minecraft/client/gui/Gui.java
@@ -400,6 +_,7 @@
@@ -389,6 +_,7 @@
if (this.f_92986_.f_91076_ != null && this.f_92986_.f_91076_ instanceof LivingEntity && f >= 1.0F) {
flag = this.f_92986_.f_91074_.m_36333_() > 5.0F;
flag &= this.f_92986_.f_91076_.m_6084_();
@@ -8,7 +8,7 @@
}
int j = this.f_92978_ / 2 - 7 + 16;
@@ -452,6 +_,10 @@
@@ -441,6 +_,10 @@
for(MobEffectInstance mobeffectinstance : Ordering.natural().reverse().sortedCopy(collection)) {
MobEffect mobeffect = mobeffectinstance.m_19544_();
@@ -19,7 +19,7 @@
if (mobeffectinstance.m_19575_()) {
int i = this.f_92977_;
int j = 1;
@@ -480,6 +_,7 @@
@@ -469,6 +_,7 @@
}
}
@@ -27,7 +27,7 @@
TextureAtlasSprite textureatlassprite = mobeffecttexturemanager.m_118732_(mobeffect);
int l = i;
int i1 = j;
@@ -609,12 +_,13 @@
@@ -598,12 +_,13 @@
public void m_93069_(PoseStack p_93070_) {
this.f_92986_.m_91307_().m_6180_("selectedItemName");
if (this.f_92993_ > 0 && !this.f_92994_.m_41619_()) {
@@ -43,7 +43,7 @@
int j = (this.f_92977_ - i) / 2;
int k = this.f_92978_ - 59;
if (!this.f_92986_.f_91072_.m_105205_()) {
@@ -630,7 +_,13 @@
@@ -619,7 +_,13 @@
RenderSystem.m_69478_();
RenderSystem.m_69453_();
m_93172_(p_93070_, j - 2, k - 2, j + i + 2, k + 9 + 2, this.f_92986_.f_91066_.m_92143_(0));
@@ -58,7 +58,7 @@
RenderSystem.m_69461_();
}
}
@@ -1144,7 +_,7 @@
@@ -1133,7 +_,7 @@
ItemStack itemstack = this.f_92986_.f_91074_.m_150109_().m_36056_();
if (itemstack.m_41619_()) {
this.f_92993_ = 0;
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/components/AbstractSelectionList.java
+++ b/net/minecraft/client/gui/components/AbstractSelectionList.java
@@ -532,6 +_,13 @@
@@ -536,6 +_,13 @@
}
@@ -0,0 +1,10 @@
--- a/net/minecraft/client/gui/components/toasts/ToastComponent.java
+++ b/net/minecraft/client/gui/components/toasts/ToastComponent.java
@@ -103,6 +_,7 @@
}
public void m_94922_(Toast p_94923_) {
+ if (net.minecraftforge.client.ForgeHooksClient.onToastAdd(p_94923_)) return;
this.f_94916_.add(p_94923_);
}
@@ -101,7 +101,7 @@
if (j2 + i > this.f_96543_) {
j2 -= 28 + i;
}
@@ -231,15 +_,16 @@
@@ -227,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_();
@@ -253,7 +_,7 @@
@@ -249,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);
}
@@ -263,7 +_,7 @@
@@ -259,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);
}
@@ -363,9 +_,19 @@
@@ -361,9 +_,19 @@
this.f_96547_ = p_96607_.f_91062_;
this.f_96543_ = p_96608_;
this.f_96544_ = p_96609_;
@@ -165,7 +165,7 @@
}
protected void m_232761_() {
@@ -394,6 +_,7 @@
@@ -392,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);
@@ -173,7 +173,7 @@
} else {
this.m_96626_(p_96560_);
}
@@ -413,6 +_,7 @@
@@ -411,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_();
@@ -181,7 +181,7 @@
}
public boolean m_7043_() {
@@ -498,6 +_,10 @@
@@ -496,6 +_,10 @@
}
public void m_7400_(List<Path> p_96591_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/TitleScreen.java
+++ b/net/minecraft/client/gui/screens/TitleScreen.java
@@ -66,6 +_,7 @@
@@ -68,6 +_,7 @@
private long f_96715_;
@Nullable
private TitleScreen.WarningLabel f_232768_;
@@ -8,7 +8,7 @@
public TitleScreen() {
this(false);
@@ -110,11 +_,16 @@
@@ -112,11 +_,16 @@
int j = this.f_96543_ - i - 2;
int k = 24;
int l = this.f_96544_ / 4 + 48;
@@ -25,7 +25,7 @@
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_()));
@@ -169,7 +_,7 @@
@@ -167,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;
@@ -34,7 +34,7 @@
this.m_96793_();
}, button$ontooltip))).f_93623_ = flag;
}
@@ -298,6 +_,7 @@
@@ -310,6 +_,7 @@
this.f_232768_.m_232790_(p_96739_, l);
}
@@ -42,7 +42,7 @@
if (this.f_96721_ != null) {
p_96739_.m_85836_();
p_96739_.m_85837_((double)(this.f_96543_ / 2 + 90), 70.0D, 0.0D);
@@ -320,7 +_,14 @@
@@ -332,7 +_,14 @@
s = s + I18n.m_118938_("menu.modded");
}
@@ -58,8 +58,8 @@
for(GuiEventListener guieventlistener : this.m_6702_()) {
if (guieventlistener instanceof AbstractWidget) {
@@ -332,6 +_,7 @@
if (this.m_96789_() && f1 >= 1.0F) {
@@ -345,6 +_,7 @@
RenderSystem.m_69482_();
this.f_96726_.m_6305_(p_96739_, p_96740_, p_96741_, p_96742_);
}
+ if (f1 >= 1.0f) modUpdateNotification.m_6305_(p_96739_, p_96740_, p_96741_, p_96742_);
@@ -7,7 +7,7 @@
+ private static int tabPage, maxPages;
public AdvancementsScreen(ClientAdvancements p_97340_) {
super(NarratorChatListener.f_93310_);
super(GameNarrator.f_93310_);
@@ -57,7 +_,13 @@
} else {
this.f_97334_.m_104401_(this.f_97336_ == null ? null : this.f_97336_.m_97182_(), true);
@@ -251,7 +251,7 @@
this.m_93228_(p_98582_, l, i1, j, k, 28, 32);
this.f_96542_.f_115093_ = 100.0F;
l += 6;
@@ -907,6 +_,22 @@
@@ -909,6 +_,22 @@
public boolean m_8010_(Player p_98665_) {
return this.f_98655_.m_8010_(p_98665_);
@@ -1,12 +1,13 @@
--- a/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java
@@ -42,12 +_,16 @@
@@ -42,12 +_,17 @@
if (!collection.isEmpty() && j >= 32) {
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
boolean flag = j >= 120;
+ var event = net.minecraftforge.client.ForgeHooksClient.onScreenPotionSize(this, j, !flag);
+ if (event == 0) return; // 0 = cancel rendering
+ flag = event == 2; // 2 = full-size / 1 = compact
+ var event = net.minecraftforge.client.ForgeHooksClient.onScreenPotionSize(this, j, !flag, i);
+ if (event.isCanceled()) return;
+ flag = !event.isCompact();
+ i = event.getHorizontalOffset();
int k = 33;
if (collection.size() > 5) {
k = 132 / (collection.size() - 1);
@@ -0,0 +1,14 @@
--- a/net/minecraft/client/gui/screens/inventory/InventoryScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/InventoryScreen.java
@@ -100,6 +_,11 @@
public static void m_98850_(int p_98851_, int p_98852_, int p_98853_, float p_98854_, float p_98855_, LivingEntity p_98856_) {
float f = (float)Math.atan((double)(p_98854_ / 40.0F));
float f1 = (float)Math.atan((double)(p_98855_ / 40.0F));
+ renderEntityInInventoryRaw(p_98851_, p_98852_, p_98853_, f, f1, p_98856_);
+ }
+ public static void renderEntityInInventoryRaw(int p_98851_, int p_98852_, int p_98853_, float angleXComponent, float angleYComponent, LivingEntity p_98856_) {
+ float f = angleXComponent;
+ float f1 = angleYComponent;
PoseStack posestack = RenderSystem.m_157191_();
posestack.m_85836_();
posestack.m_85837_((double)p_98851_, (double)p_98852_, 1050.0D);
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java
+++ b/net/minecraft/client/gui/screens/worldselection/WorldSelectionList.java
@@ -68,6 +_,7 @@
@@ -65,6 +_,7 @@
static final DateFormat f_101646_ = new SimpleDateFormat();
static final ResourceLocation f_101647_ = new ResourceLocation("textures/misc/unknown_server.png");
static final ResourceLocation f_101648_ = new ResourceLocation("textures/gui/world_selection.png");
@@ -8,7 +8,7 @@
static final Component f_101649_ = Component.m_237115_("selectWorld.tooltip.fromNewerVersion1").m_130940_(ChatFormatting.RED);
static final Component f_101650_ = Component.m_237115_("selectWorld.tooltip.fromNewerVersion2").m_130940_(ChatFormatting.RED);
static final Component f_101651_ = Component.m_237115_("selectWorld.tooltip.snapshot1").m_130940_(ChatFormatting.GOLD);
@@ -326,6 +_,7 @@
@@ -325,6 +_,7 @@
RenderSystem.m_69478_();
GuiComponent.m_93133_(p_101721_, p_101724_, p_101723_, 0.0F, 0.0F, 32, 32, 32, 32);
RenderSystem.m_69461_();
@@ -16,17 +16,19 @@
if (this.f_101693_.f_91066_.m_231828_().m_231551_() || p_101729_) {
RenderSystem.m_157456_(0, WorldSelectionList.f_101648_);
GuiComponent.m_93172_(p_101721_, p_101724_, p_101723_, p_101724_ + 32, p_101723_ + 32, -1601138544);
@@ -647,6 +_,19 @@
@@ -646,6 +_,21 @@
public boolean m_214209_() {
return !this.f_101695_.m_164916_();
+ }
+
+ // FORGE: Patch in experimental warning icon for worlds in the world selection screen
+ private void renderExperimentalWarning(PoseStack stack, int mouseX, int mouseY, int top, int left) {
+ if (this.f_101695_.isExperimental()) {
+ int leftStart = left + WorldSelectionList.this.m_5759_();
+ RenderSystem.m_157456_(0, WorldSelectionList.FORGE_EXPERIMENTAL_WARNING_ICON);
+ GuiComponent.m_93133_(stack, leftStart - 36, top, 0.0F, 0.0F, 32, 32, 32, 32);
+ //Reset texture to what it was before
+ // Reset texture to what it was before
+ RenderSystem.m_157456_(0, this.f_101698_ != null ? this.f_101696_ : WorldSelectionList.f_101647_);
+ if (WorldSelectionList.this.m_93412_(mouseX, mouseY) == this && mouseX > leftStart - 36 && mouseX < leftStart) {
+ List<net.minecraft.util.FormattedCharSequence> tooltip = Minecraft.m_91087_().f_91062_.m_92923_(Component.m_237115_("forge.experimentalsettings.tooltip"), 200);
@@ -1,14 +1,15 @@
--- a/net/minecraft/client/main/Main.java
+++ b/net/minecraft/client/main/Main.java
@@ -49,6 +_,7 @@
@@ -48,7 +_,7 @@
@DontObfuscate
public static void main(String[] p_129642_) {
SharedConstants.m_142977_();
+ if (!net.minecraftforge.fml.loading.FMLConfig.isOptimizedDFUDisabled())
SharedConstants.m_214358_();
OptionParser optionparser = new OptionParser();
optionparser.allowsUnrecognizedOptions();
@@ -135,7 +_,7 @@
- m_239872_(p_129642_, true);
+ m_239872_(p_129642_, !net.minecraftforge.fml.loading.FMLConfig.isOptimizedDFUDisabled());
}
public static void m_239872_(String[] p_239873_, boolean p_239874_) {
@@ -142,7 +_,7 @@
}
CrashReport.m_127529_();
@@ -0,0 +1,60 @@
--- a/net/minecraft/client/model/HumanoidModel.java
+++ b/net/minecraft/client/model/HumanoidModel.java
@@ -264,6 +_,8 @@
case TOOT_HORN:
this.f_102811_.f_104203_ = Mth.m_14036_(this.f_102808_.f_104203_, -1.2F, 1.2F) - 1.4835298F;
this.f_102811_.f_104204_ = this.f_102808_.f_104204_ - ((float)Math.PI / 6F);
+ default:
+ this.f_102816_.applyTransform(this, p_102876_, net.minecraft.world.entity.HumanoidArm.RIGHT);
}
}
@@ -304,6 +_,8 @@
case TOOT_HORN:
this.f_102812_.f_104203_ = Mth.m_14036_(this.f_102808_.f_104203_, -1.2F, 1.2F) - 1.4835298F;
this.f_102812_.f_104204_ = this.f_102808_.f_104204_ + ((float)Math.PI / 6F);
+ default:
+ this.f_102815_.applyTransform(this, p_102879_, net.minecraft.world.entity.HumanoidArm.LEFT);
}
}
@@ -396,7 +_,7 @@
}
@OnlyIn(Dist.CLIENT)
- public static enum ArmPose {
+ public static enum ArmPose implements net.minecraftforge.common.IExtensibleEnum {
EMPTY(false),
ITEM(false),
BLOCK(false),
@@ -411,10 +_,30 @@
private ArmPose(boolean p_102896_) {
this.f_102890_ = p_102896_;
+ this.forgeArmPose = null;
}
public boolean m_102897_() {
return this.f_102890_;
}
+ // FORGE START
+ @javax.annotation.Nullable
+ private final net.minecraftforge.client.IArmPoseTransformer forgeArmPose;
+
+ private ArmPose(boolean twoHanded, @javax.annotation.Nonnull net.minecraftforge.client.IArmPoseTransformer forgeArmPose) {
+ this.f_102890_ = twoHanded;
+ com.google.common.base.Preconditions.checkNotNull(forgeArmPose, "Cannot create new ArmPose with null transformer!");
+ this.forgeArmPose = forgeArmPose;
+ }
+
+ public static ArmPose create(String name, boolean twoHanded, @javax.annotation.Nonnull net.minecraftforge.client.IArmPoseTransformer forgeArmPose) {
+ throw new IllegalStateException("Enum not extended");
+ }
+
+ public <T extends LivingEntity> void applyTransform(HumanoidModel<T> model, T entity, net.minecraft.world.entity.HumanoidArm arm) {
+ com.google.common.base.Preconditions.checkNotNull(this.forgeArmPose, "applyTransform() must not be called on a vanilla ArmPose!");
+ this.forgeArmPose.applyTransform(model, entity, arm);
+ }
+ // FORGE END
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/multiplayer/ClientHandshakePacketListenerImpl.java
+++ b/net/minecraft/client/multiplayer/ClientHandshakePacketListenerImpl.java
@@ -126,6 +_,7 @@
@@ -130,6 +_,7 @@
this.f_104521_.accept(Component.m_237115_("connect.joining"));
this.f_104523_ = p_104547_.m_134774_();
this.f_104522_.m_129498_(ConnectionProtocol.PLAY);
@@ -8,7 +8,7 @@
this.f_104522_.m_129505_(new ClientPacketListener(this.f_104519_, this.f_104520_, this.f_104522_, this.f_104523_, this.f_104519_.m_193590_()));
}
@@ -133,7 +_,7 @@
@@ -137,7 +_,7 @@
if (this.f_104520_ != null && this.f_104520_ instanceof RealmsScreen) {
this.f_104519_.m_91152_(new DisconnectedRealmsScreen(this.f_104520_, CommonComponents.f_130661_, p_104543_));
} else {
@@ -17,7 +17,7 @@
}
}
@@ -154,6 +_,7 @@
@@ -158,6 +_,7 @@
}
public void m_7254_(ClientboundCustomQueryPacket p_104545_) {
@@ -1,6 +1,13 @@
--- a/net/minecraft/client/multiplayer/ClientLevel.java
+++ b/net/minecraft/client/multiplayer/ClientLevel.java
@@ -121,6 +_,8 @@
@@ -115,12 +_,15 @@
p_194170_.put(BiomeColors.f_108791_, new BlockTintCache((p_194168_) -> {
return this.m_104762_(p_194168_, BiomeColors.f_108791_);
}));
+ net.minecraftforge.client.ColorResolverManager.registerBlockTintCaches(ClientLevel.this, p_194170_);
});
private final ClientChunkCache f_104559_;
private final Deque<Runnable> f_194122_ = Queues.newArrayDeque();
private int f_194123_;
private final BlockStatePredictionHandler f_233599_ = new BlockStatePredictionHandler();
private static final Set<Item> f_194124_ = Set.of(Items.f_42127_, Items.f_151033_);
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/multiplayer/ClientPacketListener.java
+++ b/net/minecraft/client/multiplayer/ClientPacketListener.java
@@ -361,6 +_,7 @@
@@ -375,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_);
@@ -373,6 +_,7 @@
@@ -387,6 +_,7 @@
this.f_104888_.f_91074_.m_219749_(p_105030_.f_238174_());
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,16 +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_();
@@ -768,6 +_,8 @@
}
Component component = flag ? p_233693_.f_237213_() : p_233693_.m_237220_();
+ component = net.minecraftforge.client.ForgeHooksClient.onClientChat(p_233692_, component, p_233694_);
+ if (component == null) return;
this.f_104888_.f_91065_.m_232360_(p_233692_, component, p_233694_);
}
@@ -931,8 +_,10 @@
@@ -941,8 +_,10 @@
localplayer1.m_21204_().m_22159_(localplayer.m_21204_());
}
@@ -36,7 +27,7 @@
this.f_104889_.m_104630_(i, localplayer1);
localplayer1.m_146922_(-180.0F);
localplayer1.f_108618_ = new KeyboardInput(this.f_104888_.f_91066_);
@@ -1036,10 +_,7 @@
@@ -1046,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_205557_) -> {
@@ -48,7 +39,7 @@
if (p_205557_ instanceof CommandBlockEntity && this.f_104888_.f_91080_ instanceof CommandBlockEditScreen) {
((CommandBlockEditScreen)this.f_104888_.f_91080_).m_98398_();
@@ -1184,7 +_,9 @@
@@ -1194,7 +_,9 @@
public void m_7443_(ClientboundCommandsPacket p_104990_) {
PacketUtils.m_131363_(p_104990_, this, this.f_104888_);
@@ -59,7 +50,7 @@
}
public void m_7183_(ClientboundStopSoundPacket p_105116_) {
@@ -1203,6 +_,7 @@
@@ -1213,6 +_,7 @@
ClientRecipeBook clientrecipebook = this.f_104888_.f_91074_.m_108631_();
clientrecipebook.m_90625_(this.f_104900_.m_44051_());
this.f_104888_.m_231374_(SearchRegistry.f_119943_, clientrecipebook.m_90639_());
@@ -67,7 +58,7 @@
}
public void m_7244_(ClientboundPlayerLookAtPacket p_105054_) {
@@ -1304,6 +_,7 @@
@@ -1314,6 +_,7 @@
this.f_104888_.m_231374_(SearchRegistry.f_119941_, nonnulllist);
this.f_104888_.m_231374_(SearchRegistry.f_119942_, nonnulllist);
@@ -75,7 +66,7 @@
}
private <T> void m_205560_(ResourceKey<? extends Registry<? extends T>> p_205561_, TagNetworkSerialization.NetworkPayload p_205562_) {
@@ -1646,6 +_,7 @@
@@ -1666,6 +_,7 @@
}
public void m_7413_(ClientboundCustomPayloadPacket p_105004_) {
@@ -83,7 +74,7 @@
PacketUtils.m_131363_(p_105004_, this, this.f_104888_);
ResourceLocation resourcelocation = p_105004_.m_132042_();
FriendlyByteBuf friendlybytebuf = null;
@@ -1843,7 +_,7 @@
@@ -1863,7 +_,7 @@
int j5 = friendlybytebuf.m_130242_();
this.f_104888_.f_91064_.f_173815_.m_173830_(positionsource, j5);
} else {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/multiplayer/PlayerInfo.java
+++ b/net/minecraft/client/multiplayer/PlayerInfo.java
@@ -77,6 +_,7 @@
@@ -82,6 +_,7 @@
}
protected void m_105317_(GameType p_105318_) {
@@ -1,11 +1,11 @@
--- a/net/minecraft/client/multiplayer/ProfileKeyPairManager.java
+++ b/net/minecraft/client/multiplayer/ProfileKeyPairManager.java
@@ -64,6 +_,8 @@
this.m_233776_(profilekeypair);
return Optional.of(profilekeypair);
} catch (CryptException | MinecraftClientException | IOException ioexception) {
+ // Forge: The offline user api service always returns a null profile key pair, so let's hide this useless exception if in dev
+ if (net.minecraftforge.fml.loading.FMLLoader.isProduction() || p_233781_ != UserApiService.OFFLINE)
f_233765_.error("Failed to retrieve profile key pair", (Throwable)ioexception);
this.m_233776_((ProfileKeyPair)null);
return optional;
@@ -76,6 +_,8 @@
this.m_233776_(profilekeypair);
return Optional.of(profilekeypair);
} catch (CryptException | MinecraftClientException | IOException ioexception) {
+ // Forge: The offline user api service always returns a null profile key pair, so let's hide this useless exception if in dev
+ if (net.minecraftforge.fml.loading.FMLLoader.isProduction() || this.f_243348_ != UserApiService.OFFLINE)
f_233765_.error("Failed to retrieve profile key pair", (Throwable)ioexception);
this.m_233776_((ProfileKeyPair)null);
return p_243401_;
@@ -1,9 +1,9 @@
--- a/net/minecraft/client/multiplayer/ServerData.java
+++ b/net/minecraft/client/multiplayer/ServerData.java
@@ -35,6 +_,7 @@
@Nullable
@@ -36,6 +_,7 @@
private ServerData.ChatPreview f_233800_;
private boolean f_233801_ = true;
private boolean f_242950_;
+ public net.minecraftforge.client.ExtendedServerListData forgeData = null;
public ServerData(String p_105375_, String p_105376_, boolean p_105377_) {
@@ -0,0 +1,21 @@
--- a/net/minecraft/client/multiplayer/chat/ChatListener.java
+++ b/net/minecraft/client/multiplayer/chat/ChatListener.java
@@ -175,12 +_,16 @@
MessageSignature messagesignature = p_242317_.f_240893_();
FilterMask filtermask = p_242317_.f_242992_();
if (filtermask.m_243095_()) {
- this.f_240348_.f_91065_.m_93076_().m_240964_(p_243337_, messagesignature, guimessagetag);
+ Component forgeComponent = net.minecraftforge.client.ForgeHooksClient.onClientChat(p_242290_, p_243337_, p_242317_, p_242317_.m_241067_());
+ if (forgeComponent == null) return false;
+ this.f_240348_.f_91065_.m_93076_().m_240964_(forgeComponent, messagesignature, guimessagetag);
this.m_241119_(p_242290_, p_242317_.m_237220_());
} else {
Component component = filtermask.m_243081_(p_242317_.m_241775_());
if (component != null) {
- this.f_240348_.f_91065_.m_93076_().m_240964_(p_242290_.m_240977_(component), messagesignature, guimessagetag);
+ Component forgeComponent = net.minecraftforge.client.ForgeHooksClient.onClientChat(p_242290_, p_242290_.m_240977_(component), p_242317_, p_242317_.m_241067_());
+ if (forgeComponent == null) return false;
+ this.f_240348_.f_91065_.m_93076_().m_240964_(forgeComponent, messagesignature, guimessagetag);
this.m_241119_(p_242290_, component);
}
}
@@ -0,0 +1,10 @@
--- a/net/minecraft/client/particle/EnchantmentTableParticle.java
+++ b/net/minecraft/client/particle/EnchantmentTableParticle.java
@@ -73,6 +_,7 @@
this.f_107212_ = this.f_106461_ + this.f_107215_ * (double)f;
this.f_107213_ = this.f_106462_ + this.f_107216_ * (double)f - (double)(f1 * 1.2F);
this.f_107214_ = this.f_106460_ + this.f_107217_ * (double)f;
+ this.m_107264_(this.f_107212_, this.f_107213_, this.f_107214_); // FORGE: update the particle's bounding box
}
}
@@ -0,0 +1,10 @@
--- a/net/minecraft/client/particle/PortalParticle.java
+++ b/net/minecraft/client/particle/PortalParticle.java
@@ -75,6 +_,7 @@
this.f_107212_ = this.f_107548_ + this.f_107215_ * (double)f2;
this.f_107213_ = this.f_107549_ + this.f_107216_ * (double)f2 + (double)(1.0F - f);
this.f_107214_ = this.f_107547_ + this.f_107217_ * (double)f2;
+ this.m_107264_(this.f_107212_, this.f_107213_, this.f_107214_); // FORGE: update the particle's bounding box
}
}
@@ -0,0 +1,10 @@
--- a/net/minecraft/client/particle/ReversePortalParticle.java
+++ b/net/minecraft/client/particle/ReversePortalParticle.java
@@ -29,6 +_,7 @@
this.f_107212_ += this.f_107215_ * (double)f;
this.f_107213_ += this.f_107216_ * (double)f;
this.f_107214_ += this.f_107217_ * (double)f;
+ this.m_107264_(this.f_107212_, this.f_107213_, this.f_107214_); // FORGE: update the particle's bounding box
}
}
@@ -0,0 +1,10 @@
--- a/net/minecraft/client/particle/VibrationSignalParticle.java
+++ b/net/minecraft/client/particle/VibrationSignalParticle.java
@@ -100,6 +_,7 @@
this.f_107212_ = Mth.m_14139_(d0, this.f_107212_, vec3.m_7096_());
this.f_107213_ = Mth.m_14139_(d0, this.f_107213_, vec3.m_7098_());
this.f_107214_ = Mth.m_14139_(d0, this.f_107214_, vec3.m_7094_());
+ this.m_107264_(this.f_107212_, this.f_107213_, this.f_107214_); // FORGE: update the particle's bounding box
this.f_172460_ = this.f_172462_;
this.f_172462_ = (float)Mth.m_14136_(this.f_107212_ - vec3.m_7096_(), this.f_107214_ - vec3.m_7094_());
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/player/AbstractClientPlayer.java
+++ b/net/minecraft/client/player/AbstractClientPlayer.java
@@ -146,6 +_,6 @@
@@ -137,6 +_,6 @@
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/player/LocalPlayer.java
+++ b/net/minecraft/client/player/LocalPlayer.java
@@ -159,6 +_,7 @@
@@ -162,6 +_,7 @@
}
public boolean m_6469_(DamageSource p_108662_, float p_108663_) {
@@ -8,25 +8,24 @@
return false;
}
@@ -290,6 +_,9 @@
@@ -289,6 +_,8 @@
}
public void m_234125_(String p_234126_, @Nullable Component p_234127_) {
+ // TODO-PATCHING: If the chat preview component is not null and the message is changed by this event, it looks like the signatures will de-sync and the server will skip the message. Fix? -SS
+ p_234126_ = net.minecraftforge.client.ForgeHooksClient.onClientSendMessage(p_234126_);
+ if (p_234126_.isEmpty()) return;
MessageSigner messagesigner = MessageSigner.m_237183_(this.m_20148_());
this.m_234141_(messagesigner, p_234126_, p_234127_);
}
@@ -328,6 +_,7 @@
public void m_240287_(String p_240288_, @Nullable Component p_240289_) {
+ p_240288_ = net.minecraftforge.client.ForgeHooksClient.onClientSendMessage(p_240288_);
+ if (p_240288_.isEmpty()) return;
this.m_240966_(p_240288_, p_240289_);
}
private void m_234151_(MessageSigner p_234152_, String p_234153_, @Nullable Component p_234154_) {
+ if (net.minecraftforge.client.ClientCommandHandler.runCommand(p_234153_)) return;
ParseResults<SharedSuggestionProvider> parseresults = this.f_108617_.m_105146_().parse(p_234153_, this.f_108617_.m_105137_());
ArgumentSignatures argumentsignatures = this.m_234137_(p_234152_, parseresults, p_234154_);
this.f_108617_.m_104955_(new ServerboundChatCommandPacket(p_234153_, p_234152_.f_237170_(), argumentsignatures, p_234154_ != null));
@@ -544,7 +_,13 @@
@@ -333,6 +_,7 @@
}
private void m_241110_(String p_241331_, @Nullable Component p_241563_) {
+ if (net.minecraftforge.client.ClientCommandHandler.runCommand(p_241331_)) return;
ParseResults<SharedSuggestionProvider> parseresults = this.f_108617_.m_105146_().parse(p_241331_, this.f_108617_.m_105137_());
MessageSigner messagesigner = this.m_241001_();
LastSeenMessages.Update lastseenmessages$update = this.f_108617_.m_241918_();
@@ -547,7 +_,13 @@
}
public void m_5496_(SoundEvent p_108651_, float p_108652_, float p_108653_) {
@@ -41,7 +40,7 @@
}
public void m_6330_(SoundEvent p_108655_, SoundSource p_108656_, float p_108657_, float p_108658_) {
@@ -700,6 +_,7 @@
@@ -703,6 +_,7 @@
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));
float f = Mth.m_14036_(0.3F + EnchantmentHelper.m_220302_(this), 0.0F, 1.0F);
this.f_108618_.m_214106_(this.m_108635_(), f);
@@ -49,7 +48,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;
@@ -726,7 +_,7 @@
@@ -729,7 +_,7 @@
}
boolean flag4 = (float)this.m_36324_().m_38702_() > 6.0F || this.m_150110_().f_35936_;
@@ -58,7 +57,7 @@
if (this.f_108583_ <= 0 && !this.f_108619_.f_91066_.f_92091_.m_90857_()) {
this.f_108583_ = 7;
} else {
@@ -734,15 +_,15 @@
@@ -737,15 +_,15 @@
}
}
@@ -77,7 +76,7 @@
this.m_6858_(false);
}
} else if (flag6) {
@@ -772,14 +_,15 @@
@@ -775,14 +_,15 @@
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);
@@ -96,7 +95,7 @@
}
if (this.m_204029_(FluidTags.f_13131_)) {
@@ -890,6 +_,7 @@
@@ -893,6 +_,7 @@
public void m_6083_() {
super.m_6083_();
@@ -104,7 +103,7 @@
this.f_108611_ = false;
if (this.m_20202_() instanceof Boat) {
Boat boat = (Boat)this.m_20202_();
@@ -1103,6 +_,18 @@
@@ -1106,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
@@ -182,6 +_,12 @@
@@ -190,6 +_,12 @@
f_109012_ = f_109012_ * (1.0F - f7) + f_109012_ * f9 * f7;
}
@@ -13,7 +13,7 @@
RenderSystem.m_69424_(f_109010_, f_109011_, f_109012_, 0.0F);
}
@@ -263,6 +_,7 @@
@@ -271,6 +_,7 @@
RenderSystem.m_157445_(fogrenderer$fogdata.f_234200_);
RenderSystem.m_157443_(fogrenderer$fogdata.f_234201_);
RenderSystem.m_202160_(fogrenderer$fogdata.f_234202_);
@@ -24,6 +24,14 @@
boolean flag1 = CrossbowItem.m_40932_(p_109377_);
boolean flag2 = humanoidarm == HumanoidArm.RIGHT;
int i = flag2 ? 1 : -1;
@@ -384,6 +_,7 @@
this.m_109322_(p_109372_, p_109377_, flag2 ? ItemTransforms.TransformType.FIRST_PERSON_RIGHT_HAND : ItemTransforms.TransformType.FIRST_PERSON_LEFT_HAND, !flag2, p_109379_, p_109380_, p_109381_);
} else {
boolean flag3 = humanoidarm == HumanoidArm.RIGHT;
+ if (!net.minecraftforge.client.extensions.common.IClientItemExtensions.of(p_109377_).applyForgeHandTransform(p_109379_, f_109299_.f_91074_, humanoidarm, p_109377_, p_109373_, p_109378_, p_109376_)) // FORGE: Allow items to define custom arm animation
if (p_109372_.m_6117_() && p_109372_.m_21212_() > 0 && p_109372_.m_7655_() == p_109375_) {
int k = flag3 ? 1 : -1;
switch (p_109377_.m_41780_()) {
@@ -487,8 +_,16 @@
this.f_109304_ = Mth.m_14036_(this.f_109304_ - 0.4F, 0.0F, 1.0F);
} else {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/LevelRenderer.java
+++ b/net/minecraft/client/renderer/LevelRenderer.java
@@ -263,6 +_,8 @@
@@ -264,6 +_,8 @@
}
private void m_109703_(LightTexture p_109704_, float p_109705_, double p_109706_, double p_109707_, double p_109708_) {
@@ -9,7 +9,7 @@
float f = this.f_109461_.f_91073_.m_46722_(p_109705_);
if (!(f <= 0.0F)) {
p_109704_.m_109896_();
@@ -383,6 +_,8 @@
@@ -384,6 +_,8 @@
}
public void m_109693_(Camera p_109694_) {
@@ -18,7 +18,7 @@
float f = this.f_109461_.f_91073_.m_46722_(1.0F) / (Minecraft.m_91405_() ? 1.0F : 2.0F);
if (!(f <= 0.0F)) {
RandomSource randomsource = RandomSource.m_216335_((long)this.f_109477_ * 312987231L);
@@ -1140,11 +_,13 @@
@@ -1141,11 +_,13 @@
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_();
@@ -32,7 +32,7 @@
profilerfiller.m_6182_("fog");
FogRenderer.m_234172_(p_109604_, FogRenderer.FogMode.FOG_TERRAIN, Math.max(f, 32.0F), flag2, p_109601_);
profilerfiller.m_6182_("terrain_setup");
@@ -1153,7 +_,9 @@
@@ -1154,7 +_,9 @@
this.m_194370_(p_109604_);
profilerfiller.m_6182_("terrain");
this.m_172993_(RenderType.m_110451_(), p_109600_, d0, d1, d2, p_109607_);
@@ -42,7 +42,7 @@
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_());
@@ -1185,7 +_,7 @@
@@ -1186,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_)) {
BlockPos blockpos = entity.m_20183_();
@@ -51,7 +51,17 @@
++this.f_109439_;
if (entity.f_19797_ == 0) {
entity.f_19790_ = entity.m_20185_();
@@ -1225,6 +_,7 @@
@@ -1206,6 +_,9 @@
int i1 = i & 255;
outlinebuffersource.m_109929_(k, l, i1, 255);
} else {
+ if (this.m_109817_() && entity.hasCustomOutlineRendering(this.f_109461_.f_91074_)) { // FORGE: allow custom outline rendering
+ flag3 = true;
+ }
multibuffersource = multibuffersource$buffersource;
}
@@ -1226,6 +_,7 @@
List<BlockEntity> list = levelrenderer$renderchunkinfo.f_109839_.m_112835_().m_112773_();
if (!list.isEmpty()) {
for(BlockEntity blockentity1 : list) {
@@ -59,7 +69,17 @@
BlockPos blockpos4 = blockentity1.m_58899_();
MultiBufferSource multibuffersource1 = multibuffersource$buffersource;
p_109600_.m_85836_();
@@ -1250,6 +_,7 @@
@@ -1242,6 +_,9 @@
};
}
}
+ if (this.m_109817_() && blockentity1.hasCustomOutlineRendering(this.f_109461_.f_91074_)) { // FORGE: allow custom outline rendering
+ flag3 = true;
+ }
this.f_172946_.m_112267_(blockentity1, p_109601_, p_109600_, multibuffersource1);
p_109600_.m_85849_();
@@ -1251,9 +_,13 @@
synchronized(this.f_109468_) {
for(BlockEntity blockentity : this.f_109468_) {
@@ -67,7 +87,13 @@
BlockPos blockpos3 = blockentity.m_58899_();
p_109600_.m_85836_();
p_109600_.m_85837_((double)blockpos3.m_123341_() - d0, (double)blockpos3.m_123342_() - d1, (double)blockpos3.m_123343_() - d2);
@@ -1289,7 +_,8 @@
+ if (this.m_109817_() && blockentity.hasCustomOutlineRendering(this.f_109461_.f_91074_)) { // FORGE: allow custom outline rendering
+ flag3 = true;
+ }
this.f_172946_.m_112267_(blockentity, p_109601_, p_109600_, multibuffersource$buffersource);
p_109600_.m_85849_();
}
@@ -1290,7 +_,8 @@
p_109600_.m_85837_((double)blockpos2.m_123341_() - d0, (double)blockpos2.m_123342_() - d1, (double)blockpos2.m_123343_() - d2);
PoseStack.Pose posestack$pose = p_109600_.m_85850_();
VertexConsumer vertexconsumer1 = new SheetedDecalTextureGenerator(this.f_109464_.m_110108_().m_6299_(ModelBakery.f_119229_.get(k1)), posestack$pose.m_85861_(), posestack$pose.m_85864_());
@@ -77,7 +103,7 @@
p_109600_.m_85849_();
}
}
@@ -1301,10 +_,13 @@
@@ -1302,10 +_,13 @@
profilerfiller.m_6182_("outline");
BlockPos blockpos1 = ((BlockHitResult)hitresult).m_82425_();
BlockState blockstate = this.f_109465_.m_8055_(blockpos1);
@@ -91,7 +117,7 @@
}
PoseStack posestack = RenderSystem.m_157191_();
@@ -1339,7 +_,8 @@
@@ -1340,7 +_,8 @@
this.f_109415_.m_83945_(this.f_109461_.m_91385_());
RenderStateShard.f_110126_.m_110185_();
profilerfiller.m_6182_("particles");
@@ -101,7 +127,7 @@
RenderStateShard.f_110126_.m_110188_();
} else {
profilerfiller.m_6182_("translucent");
@@ -1353,7 +_,8 @@
@@ -1354,7 +_,8 @@
profilerfiller.m_6182_("string");
this.m_172993_(RenderType.m_110503_(), p_109600_, d0, d1, d2, p_109607_);
profilerfiller.m_6182_("particles");
@@ -111,7 +137,7 @@
}
posestack.m_85836_();
@@ -1377,6 +_,7 @@
@@ -1378,6 +_,7 @@
RenderStateShard.f_110127_.m_110185_();
profilerfiller.m_6182_("weather");
this.m_109703_(p_109606_, p_109601_, d0, d1, d2);
@@ -119,7 +145,7 @@
this.m_173012_(p_109604_);
RenderStateShard.f_110127_.m_110188_();
this.f_109418_.m_110023_(p_109601_);
@@ -1385,6 +_,7 @@
@@ -1386,6 +_,7 @@
RenderSystem.m_69458_(false);
profilerfiller.m_6182_("weather");
this.m_109703_(p_109606_, p_109601_, d0, d1, d2);
@@ -127,7 +153,7 @@
this.m_173012_(p_109604_);
RenderSystem.m_69458_(true);
}
@@ -1519,6 +_,7 @@
@@ -1520,6 +_,7 @@
shaderinstance.m_173362_();
VertexBuffer.m_85931_();
this.f_109461_.m_91307_().m_7238_();
@@ -135,7 +161,7 @@
p_172994_.m_110188_();
}
@@ -1780,6 +_,8 @@
@@ -1781,6 +_,8 @@
}
public void m_202423_(PoseStack p_202424_, Matrix4f p_202425_, float p_202426_, Camera p_202427_, boolean p_202428_, Runnable p_202429_) {
@@ -144,7 +170,7 @@
p_202429_.run();
if (!p_202428_) {
FogType fogtype = p_202427_.m_167685_();
@@ -1912,6 +_,8 @@
@@ -1913,6 +_,8 @@
}
public void m_172954_(PoseStack p_172955_, Matrix4f p_172956_, float p_172957_, double p_172958_, double p_172959_, double p_172960_) {
@@ -153,7 +179,7 @@
float f = this.f_109465_.m_104583_().m_108871_();
if (!Float.isNaN(f)) {
RenderSystem.m_69464_();
@@ -2102,7 +_,7 @@
@@ -2103,7 +_,7 @@
}
} else {
BlockPos blockpos1 = chunkrenderdispatcher$renderchunk.m_112839_().m_7918_(8, 8, 8);
@@ -162,7 +188,7 @@
}
if (flag) {
@@ -2399,7 +_,12 @@
@@ -2400,7 +_,12 @@
this.f_109469_.m_110859_(p_109502_, p_109503_, p_109504_, p_109505_);
}
@@ -175,7 +201,7 @@
SoundInstance soundinstance = this.f_109410_.get(p_109516_);
if (soundinstance != null) {
this.f_109461_.m_91106_().m_120399_(soundinstance);
@@ -2407,7 +_,7 @@
@@ -2408,7 +_,7 @@
}
if (p_109515_ != null) {
@@ -184,7 +210,7 @@
if (recorditem != null) {
this.f_109461_.f_91065_.m_93055_(recorditem.m_43050_());
}
@@ -2559,7 +_,7 @@
@@ -2560,7 +_,7 @@
break;
case 1010:
if (Item.m_41445_(p_234307_) instanceof RecordItem) {
@@ -193,7 +219,7 @@
} else {
this.m_109514_((SoundEvent)null, p_234306_);
}
@@ -2729,7 +_,7 @@
@@ -2730,7 +_,7 @@
case 2001:
BlockState blockstate = Block.m_49803_(p_234307_);
if (!blockstate.m_60795_()) {
@@ -202,7 +228,7 @@
this.f_109465_.m_104677_(p_234306_, soundtype.m_56775_(), SoundSource.BLOCKS, (soundtype.m_56773_() + 1.0F) / 2.0F, soundtype.m_56774_() * 0.8F, false);
}
@@ -2944,7 +_,7 @@
@@ -2945,7 +_,7 @@
} else {
int i = p_109538_.m_45517_(LightLayer.SKY, p_109540_);
int j = p_109538_.m_45517_(LightLayer.BLOCK, p_109540_);
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java
+++ b/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java
@@ -77,12 +_,15 @@
@@ -78,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);
@@ -418,7 +_,7 @@
@@ -419,7 +_,7 @@
if (!chunkrenderdispatcher$compiledchunk.f_112749_.contains(p_112810_)) {
return false;
} else {
@@ -26,7 +26,7 @@
p_112811_.m_112709_(this.f_112788_);
return true;
}
@@ -450,7 +_,7 @@
@@ -451,7 +_,7 @@
this.f_202433_.incrementAndGet();
}
@@ -35,7 +35,7 @@
return this.f_112787_;
}
@@ -483,10 +_,20 @@
@@ -484,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_);
@@ -498,6 +_,10 @@
@@ -499,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)
@@ -505,8 +_,13 @@
@@ -506,8 +_,13 @@
@Nullable
protected RenderChunkRegion f_112858_;
@@ -82,7 +82,7 @@
this.f_112858_ = p_194428_;
}
@@ -603,7 +_,10 @@
@@ -604,7 +_,10 @@
}
if (blockstate.m_60799_() != RenderShape.INVISIBLE) {
@@ -94,7 +94,7 @@
BufferBuilder bufferbuilder2 = p_234471_.m_108839_(rendertype2);
if (set.add(rendertype2)) {
RenderChunk.this.m_112805_(bufferbuilder2);
@@ -611,8 +_,9 @@
@@ -612,8 +_,9 @@
posestack.m_85836_();
posestack.m_85837_((double)(blockpos2.m_123341_() & 15), (double)(blockpos2.m_123342_() & 15), (double)(blockpos2.m_123343_() & 15));
@@ -105,7 +105,7 @@
}
}
@@ -641,10 +_,10 @@
@@ -642,10 +_,10 @@
private <E extends BlockEntity> void m_234476_(ChunkRenderDispatcher.RenderChunk.RebuildTask.CompileResults p_234477_, E p_234478_) {
BlockEntityRenderer<E> blockentityrenderer = Minecraft.m_91087_().m_167982_().m_112265_(p_234478_);
if (blockentityrenderer != null) {
@@ -117,7 +117,7 @@
}
}
@@ -672,8 +_,13 @@
@@ -673,8 +_,13 @@
class ResortTransparencyTask extends ChunkRenderDispatcher.RenderChunk.ChunkCompileTask {
private final ChunkRenderDispatcher.CompiledChunk f_112886_;
@@ -1,11 +1,12 @@
--- a/net/minecraft/client/renderer/entity/ItemEntityRenderer.java
+++ b/net/minecraft/client/renderer/entity/ItemEntityRenderer.java
@@ -62,17 +_,14 @@
@@ -61,18 +_,15 @@
boolean flag = bakedmodel.m_7539_();
int j = this.m_115042_(itemstack);
float f = 0.25F;
float f1 = Mth.m_14031_(((float)p_115036_.m_32059_() + p_115038_) / 10.0F + p_115036_.f_31983_) * 0.1F + 0.1F;
- float f2 = bakedmodel.m_7442_().m_111808_(ItemTransforms.TransformType.GROUND).f_111757_.m_122260_();
+ float f2 = shouldBob() ? bakedmodel.m_7442_().m_111808_(ItemTransforms.TransformType.GROUND).f_111757_.m_122260_() : 0;
- float f1 = Mth.m_14031_(((float)p_115036_.m_32059_() + p_115038_) / 10.0F + p_115036_.f_31983_) * 0.1F + 0.1F;
+ float f1 = shouldBob() ? Mth.m_14031_(((float)p_115036_.m_32059_() + p_115038_) / 10.0F + p_115036_.f_31983_) * 0.1F + 0.1F : 0;
float f2 = bakedmodel.m_7442_().m_111808_(ItemTransforms.TransformType.GROUND).f_111757_.m_122260_();
p_115039_.m_85837_(0.0D, (double)(f1 + 0.25F * f2), 0.0D);
float f3 = p_115036_.m_32008_(p_115038_);
p_115039_.m_85845_(Vector3f.f_122225_.m_122270_(f3));
@@ -60,6 +60,14 @@
crashreportcategory.m_128165_("Item Damage", () -> {
return String.valueOf(p_174237_.m_41773_());
});
@@ -362,6 +_,7 @@
RenderSystem.m_69482_();
}
+ net.minecraftforge.client.ItemDecoratorHandler.of(p_115176_).render(p_115175_, p_115176_, p_115177_, p_115178_, f_115093_);
}
}
@@ -377,5 +_,9 @@
public void m_6213_(ResourceManager p_115105_) {
@@ -10,7 +10,7 @@
}
public Vec3 m_7860_(AbstractClientPlayer p_117785_, float p_117786_) {
@@ -126,7 +_,7 @@
@@ -126,10 +_,13 @@
if (useanim == UseAnim.TOOT_HORN) {
return HumanoidModel.ArmPose.TOOT_HORN;
}
@@ -19,6 +19,12 @@
return HumanoidModel.ArmPose.CROSSBOW_HOLD;
}
+ HumanoidModel.ArmPose forgeArmPose = net.minecraftforge.client.extensions.common.IClientItemExtensions.of(itemstack).getArmPose(p_117795_, p_117796_, itemstack);
+ if (forgeArmPose != null) return forgeArmPose;
+
return HumanoidModel.ArmPose.ITEM;
}
}
@@ -161,10 +_,12 @@
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/texture/TextureAtlas.java
+++ b/net/minecraft/client/renderer/texture/TextureAtlas.java
@@ -87,6 +_,7 @@
@@ -88,6 +_,7 @@
}
}
@@ -8,7 +8,7 @@
}
public TextureAtlas.Preparations m_118307_(ResourceManager p_118308_, Stream<ResourceLocation> p_118309_, ProfilerFiller p_118310_, int p_118311_) {
@@ -101,6 +_,7 @@
@@ -102,6 +_,7 @@
int j = Integer.MAX_VALUE;
int k = 1 << p_118311_;
p_118310_.m_6182_("extracting_frames");
@@ -16,7 +16,7 @@
for(TextureAtlasSprite.Info textureatlassprite$info : this.m_118304_(p_118308_, set)) {
j = Math.min(j, Math.min(textureatlassprite$info.m_118434_(), textureatlassprite$info.m_118437_()));
@@ -115,7 +_,8 @@
@@ -116,7 +_,8 @@
int i1 = Math.min(j, k);
int j1 = Mth.m_14173_(i1);
@@ -26,7 +26,7 @@
if (j1 < p_118311_) {
f_118261_.warn("{}: dropping miplevel from {} to {}, because of minimum power of two: {}", this.f_118265_, p_118311_, j1, i1);
k1 = j1;
@@ -232,11 +_,14 @@
@@ -233,11 +_,14 @@
ResourceLocation resourcelocation = this.m_118324_(p_118289_.m_118431_());
try {
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/resources/language/ClientLanguage.java
+++ b/net/minecraft/client/resources/language/ClientLanguage.java
@@ -94,4 +_,9 @@
@@ -95,4 +_,9 @@
public FormattedCharSequence m_5536_(FormattedText p_118925_) {
return FormattedBidiReorder.m_118931_(p_118925_, this.f_118911_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/resources/language/LanguageInfo.java
+++ b/net/minecraft/client/resources/language/LanguageInfo.java
@@ -16,6 +_,12 @@
@@ -17,6 +_,12 @@
this.f_118944_ = p_118949_;
this.f_118945_ = p_118950_;
this.f_118946_ = p_118951_;
@@ -13,7 +13,7 @@
}
public String getCode() {
@@ -53,4 +_,8 @@
@@ -54,4 +_,8 @@
public int compareTo(LanguageInfo p_118954_) {
return this.f_118943_.compareTo(p_118954_.f_118943_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/resources/model/ModelBakery.java
+++ b/net/minecraft/client/resources/model/ModelBakery.java
@@ -151,6 +_,8 @@
@@ -152,6 +_,8 @@
public ModelBakery(ResourceManager p_119247_, BlockColors p_119248_, ProfilerFiller p_119249_, int p_119250_) {
this.f_119243_ = p_119247_;
this.f_119209_ = p_119248_;
@@ -9,7 +9,7 @@
p_119249_.m_6180_("missing_model");
try {
@@ -184,12 +_,20 @@
@@ -185,12 +_,20 @@
p_119249_.m_6182_("special");
this.m_119306_(new ModelResourceLocation("minecraft:trident_in_hand#inventory"));
this.m_119306_(new ModelResourceLocation("minecraft:spyglass_in_hand#inventory"));
@@ -30,7 +30,7 @@
set.stream().filter((p_119357_) -> {
return !p_119357_.getSecond().equals(f_119236_);
}).forEach((p_119292_) -> {
@@ -228,6 +_,7 @@
@@ -229,6 +_,7 @@
try {
bakedmodel = this.m_119349_(p_119369_, BlockModelRotation.X0_Y0);
} catch (Exception exception) {
@@ -38,7 +38,7 @@
f_119235_.warn("Unable to bake model: '{}': {}", p_119369_, exception);
}
@@ -472,7 +_,13 @@
@@ -473,7 +_,13 @@
}
@Nullable
@@ -52,7 +52,7 @@
Triple<ResourceLocation, Transformation, Boolean> triple = Triple.of(p_119350_, p_119351_.m_6189_(), p_119351_.m_7538_());
if (this.f_119213_.containsKey(triple)) {
return this.f_119213_.get(triple);
@@ -483,11 +_,11 @@
@@ -484,11 +_,11 @@
if (unbakedmodel instanceof BlockModel) {
BlockModel blockmodel = (BlockModel)unbakedmodel;
if (blockmodel.m_111490_() == f_119232_) {
@@ -66,7 +66,7 @@
this.f_119213_.put(triple, bakedmodel);
return bakedmodel;
}
@@ -542,6 +_,10 @@
@@ -543,6 +_,10 @@
public BlockStateDefinitionException(String p_119373_) {
super(p_119373_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/commands/CommandSourceStack.java
+++ b/net/minecraft/commands/CommandSourceStack.java
@@ -33,7 +_,7 @@
@@ -36,7 +_,7 @@
import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3;
@@ -1,6 +1,6 @@
--- a/net/minecraft/commands/Commands.java
+++ b/net/minecraft/commands/Commands.java
@@ -175,7 +_,7 @@
@@ -178,7 +_,7 @@
JfrCommand.m_183645_(this.f_82090_);
}
@@ -9,7 +9,7 @@
TestCommand.m_127946_(this.f_82090_);
}
@@ -199,6 +_,7 @@
@@ -202,6 +_,7 @@
if (p_230943_.f_82144_) {
PublishCommand.m_138184_(this.f_82090_);
}
@@ -17,13 +17,12 @@
this.f_82090_.setConsumer((p_230954_, p_230955_, p_230956_) -> {
p_230954_.getSource().m_81342_(p_230954_, p_230955_, p_230956_);
@@ -217,7 +_,17 @@
@@ -227,7 +_,16 @@
try {
try {
- return this.f_82090_.execute(stringreader, p_82118_);
+ ParseResults<CommandSourceStack> parse = this.f_82090_.parse(stringreader, p_82118_);
+ net.minecraftforge.event.CommandEvent event = new net.minecraftforge.event.CommandEvent(parse);
- return this.f_82090_.execute(p_242844_);
+ net.minecraftforge.event.CommandEvent event = new net.minecraftforge.event.CommandEvent(p_242844_);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) {
+ if (event.getException() instanceof Exception exception) {
+ throw exception;
@@ -34,9 +33,9 @@
+ }
+ return this.f_82090_.execute(event.getParseResults());
} catch (CommandRuntimeException commandruntimeexception) {
p_82118_.m_81352_(commandruntimeexception.m_79226_());
commandsourcestack.m_81352_(commandruntimeexception.m_79226_());
return 0;
@@ -273,7 +_,8 @@
@@ -283,7 +_,8 @@
Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> map = Maps.newHashMap();
RootCommandNode<SharedSuggestionProvider> rootcommandnode = new RootCommandNode<>();
map.put(this.f_82090_.getRoot(), rootcommandnode);
@@ -0,0 +1,11 @@
--- a/net/minecraft/commands/arguments/EntityArgument.java
+++ b/net/minecraft/commands/arguments/EntityArgument.java
@@ -115,7 +_,7 @@
if (s instanceof SharedSuggestionProvider sharedsuggestionprovider) {
StringReader stringreader = new StringReader(p_91483_.getInput());
stringreader.setCursor(p_91483_.getStart());
- EntitySelectorParser entityselectorparser = new EntitySelectorParser(stringreader, sharedsuggestionprovider.m_6761_(2));
+ EntitySelectorParser entityselectorparser = new EntitySelectorParser(stringreader, net.minecraftforge.common.ForgeHooks.canUseEntitySelectors(sharedsuggestionprovider));
try {
entityselectorparser.m_121377_();
@@ -0,0 +1,11 @@
--- a/net/minecraft/commands/arguments/MessageArgument.java
+++ b/net/minecraft/commands/arguments/MessageArgument.java
@@ -134,7 +_,7 @@
}
Component m_232196_(CommandSourceStack p_232197_) throws CommandSyntaxException {
- return this.m_96849_(p_232197_, p_232197_.m_6761_(2));
+ return this.m_96849_(p_232197_, net.minecraftforge.common.ForgeHooks.canUseEntitySelectors(p_232197_));
}
public Component m_96849_(CommandSourceStack p_96850_, boolean p_96851_) throws CommandSyntaxException {
@@ -0,0 +1,11 @@
--- a/net/minecraft/commands/arguments/selector/EntitySelector.java
+++ b/net/minecraft/commands/arguments/selector/EntitySelector.java
@@ -87,7 +_,7 @@
}
private void m_121168_(CommandSourceStack p_121169_) throws CommandSyntaxException {
- if (this.f_121123_ && !p_121169_.m_6761_(2)) {
+ if (this.f_121123_ && !net.minecraftforge.common.ForgeHooks.canUseEntitySelectors(p_121169_)) {
throw EntityArgument.f_91441_.create();
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/commands/synchronization/ArgumentTypeInfos.java
+++ b/net/minecraft/commands/synchronization/ArgumentTypeInfos.java
@@ -63,6 +_,20 @@
@@ -64,6 +_,20 @@
public class ArgumentTypeInfos {
private static final Map<Class<?>, ArgumentTypeInfo<?, ?>> f_235379_ = Maps.newHashMap();
@@ -21,12 +21,20 @@
private static <A extends ArgumentType<?>, T extends ArgumentTypeInfo.Template<A>> ArgumentTypeInfo<A, T> m_235386_(Registry<ArgumentTypeInfo<?, ?>> p_235387_, String p_235388_, Class<? extends A> p_235389_, ArgumentTypeInfo<A, T> p_235390_) {
f_235379_.put(p_235389_, p_235390_);
return Registry.m_122961_(p_235387_, p_235388_, p_235390_);
@@ -116,7 +_,7 @@
@@ -117,12 +_,14 @@
m_235386_(p_235385_, "resource", m_235395_(ResourceKeyArgument.class), new ResourceKeyArgument.Info<Object>());
m_235386_(p_235385_, "template_mirror", TemplateMirrorArgument.class, SingletonArgumentInfo.m_235451_(TemplateMirrorArgument::m_234343_));
m_235386_(p_235385_, "template_rotation", TemplateRotationArgument.class, SingletonArgumentInfo.m_235451_(TemplateRotationArgument::m_234414_));
- if (SharedConstants.f_136183_) {
+ if (net.minecraftforge.gametest.ForgeGameTestHooks.isGametestEnabled()) {
+ // Forge: Register before gametest arguments to provide forge server <-> vanilla client interop and matching int ids
+ var uuidInfo = m_235386_(p_235385_, "uuid", UuidArgument.class, SingletonArgumentInfo.m_235451_(UuidArgument::m_113850_));
+ if (true) { // Forge: Always register gametest arguments to prevent issues when connecting from gametest-enabled client/server to non-gametest-enabled client/server
m_235386_(p_235385_, "test_argument", TestFunctionArgument.class, SingletonArgumentInfo.m_235451_(TestFunctionArgument::m_128088_));
m_235386_(p_235385_, "test_class", TestClassNameArgument.class, SingletonArgumentInfo.m_235451_(TestClassNameArgument::m_127917_));
}
- return m_235386_(p_235385_, "uuid", UuidArgument.class, SingletonArgumentInfo.m_235451_(UuidArgument::m_113850_));
+ return uuidInfo;
}
private static <T extends ArgumentType<?>> Class<T> m_235395_(Class<? super T> p_235396_) {
@@ -0,0 +1,33 @@
--- a/net/minecraft/core/HolderSet.java
+++ b/net/minecraft/core/HolderSet.java
@@ -14,7 +_,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-public interface HolderSet<T> extends Iterable<Holder<T>> {
+public interface HolderSet<T> extends Iterable<Holder<T>>, net.minecraftforge.common.extensions.IForgeHolderSet<T> {
Stream<Holder<T>> m_203614_();
int m_203632_();
@@ -120,6 +_,9 @@
public void m_205835_(List<Holder<T>> p_205836_) {
this.f_205830_ = List.copyOf(p_205836_);
+ for (Runnable runnable : this.invalidationCallbacks) {
+ runnable.run(); // FORGE: invalidate listeners when tags rebind
+ }
}
public TagKey<T> m_205839_() {
@@ -144,6 +_,11 @@
public boolean m_207277_(Registry<T> p_211049_) {
return this.f_211044_ == p_211049_;
+ }
+ // FORGE: Keep a list of invalidation callbacks so they can be run when tags rebind
+ private List<Runnable> invalidationCallbacks = new java.util.ArrayList<>();
+ public void addInvalidationListener(Runnable runnable) {
+ invalidationCallbacks.add(runnable);
}
}
}
@@ -88,8 +88,9 @@
public static final Registry<PositionSourceType<?>> f_175420_ = m_206008_(f_175408_, (p_235761_) -> {
return PositionSourceType.f_157871_;
});
public static final Registry<ArgumentTypeInfo<?, ?>> f_235729_ = m_206008_(f_235724_, (RegistryBootstrap)ArgumentTypeInfos::m_235384_);
- public static final Registry<ArgumentTypeInfo<?, ?>> f_235729_ = m_206008_(f_235724_, (RegistryBootstrap)ArgumentTypeInfos::m_235384_);
- public static final Registry<StatType<?>> f_122867_ = m_206008_(f_122917_, (p_235759_) -> {
+ @Deprecated public static final Registry<ArgumentTypeInfo<?, ?>> f_235729_ = forge(f_235724_, (RegistryBootstrap)ArgumentTypeInfos::m_235384_);
+ @Deprecated public static final Registry<StatType<?>> f_122867_ = forge(f_122917_, (registry) -> {
return Stats.f_12982_;
});
@@ -1,6 +1,6 @@
--- a/net/minecraft/data/loot/BlockLoot.java
+++ b/net/minecraft/data/loot/BlockLoot.java
@@ -264,7 +_,7 @@
@@ -265,7 +_,7 @@
return LootTable.m_79147_();
}
@@ -9,7 +9,7 @@
this.m_124288_(Blocks.f_50122_);
this.m_124288_(Blocks.f_50175_);
this.m_124288_(Blocks.f_50228_);
@@ -1311,9 +_,13 @@
@@ -1312,9 +_,13 @@
this.m_124165_(Blocks.f_152499_, m_124125_());
this.m_124165_(Blocks.f_220862_, m_124125_());
this.m_124165_(Blocks.f_220863_, m_124125_());
@@ -24,7 +24,7 @@
ResourceLocation resourcelocation = block.m_60589_();
if (resourcelocation != BuiltInLootTables.f_78712_ && set.add(resourcelocation)) {
LootTable.Builder loottable$builder = this.f_124070_.remove(resourcelocation);
@@ -1338,6 +_,10 @@
@@ -1339,6 +_,10 @@
public static LootTable.Builder m_124137_(Block p_124138_) {
return m_124161_(p_124138_, DoorBlock.f_52730_, DoubleBlockHalf.LOWER);
@@ -1,6 +1,6 @@
--- a/net/minecraft/data/loot/EntityLoot.java
+++ b/net/minecraft/data/loot/EntityLoot.java
@@ -54,7 +_,7 @@
@@ -55,7 +_,7 @@
return LootTable.m_79147_().m_79161_(LootPool.m_79043_().m_165133_(ConstantValue.m_165692_(1.0F)).m_79076_(LootItem.m_79579_(p_124375_))).m_79161_(LootPool.m_79043_().m_165133_(ConstantValue.m_165692_(1.0F)).m_79076_(LootTableReference.m_79776_(EntityType.f_20520_.m_20677_())));
}
@@ -9,7 +9,7 @@
this.m_124371_(EntityType.f_217014_, LootTable.m_79147_());
this.m_124371_(EntityType.f_20529_, LootTable.m_79147_());
this.m_124371_(EntityType.f_147039_, LootTable.m_79147_());
@@ -150,11 +_,15 @@
@@ -151,11 +_,15 @@
this.m_124371_(EntityType.f_20511_, LootTable.m_79147_());
this.m_124371_(EntityType.f_20512_, LootTable.m_79147_());
this.m_124371_(EntityType.f_20530_, LootTable.m_79147_().m_79161_(LootPool.m_79043_().m_165133_(ConstantValue.m_165692_(1.0F)).m_79076_(LootItem.m_79579_(Items.f_42583_).m_79078_(SetItemCountFunction.m_165412_(UniformGenerator.m_165780_(0.0F, 2.0F))).m_79078_(LootingEnchantFunction.m_165229_(UniformGenerator.m_165780_(0.0F, 1.0F))))).m_79161_(LootPool.m_79043_().m_165133_(ConstantValue.m_165692_(1.0F)).m_79076_(LootItem.m_79579_(Items.f_42416_)).m_79076_(LootItem.m_79579_(Items.f_42619_)).m_79076_(LootItem.m_79579_(Items.f_42620_).m_79078_(SmeltItemFunction.m_81271_().m_79080_(LootItemEntityPropertyCondition.m_81864_(LootContext.EntityTarget.THIS, f_124366_)))).m_79080_(LootItemKilledByPlayerCondition.m_81901_()).m_79080_(LootItemRandomChanceWithLootingCondition.m_81963_(0.025F, 0.01F))));
@@ -25,9 +25,9 @@
- if (!f_124367_.contains(entitytype) && entitytype.m_20674_() == MobCategory.MISC) {
+ if (isNonLiving(entitytype)) {
if (resourcelocation != BuiltInLootTables.f_78712_ && this.f_124368_.remove(resourcelocation) != null) {
throw new IllegalStateException(String.format("Weird loottable '%s' for '%s', not a LivingEntity so should not have loot", resourcelocation, Registry.f_122826_.m_7981_(entitytype)));
throw new IllegalStateException(String.format(Locale.ROOT, "Weird loottable '%s' for '%s', not a LivingEntity so should not have loot", resourcelocation, Registry.f_122826_.m_7981_(entitytype)));
}
@@ -169,6 +_,14 @@
@@ -170,6 +_,14 @@
}
this.f_124368_.forEach(p_124377_);
@@ -1,8 +1,8 @@
--- a/net/minecraft/data/tags/GameEventTagsProvider.java
+++ b/net/minecraft/data/tags/GameEventTagsProvider.java
@@ -8,8 +_,13 @@
public class GameEventTagsProvider extends TagsProvider<GameEvent> {
private static final GameEvent[] f_236425_ = new GameEvent[]{GameEvent.f_157791_, GameEvent.f_157792_, GameEvent.f_157793_, GameEvent.f_157794_, GameEvent.f_157795_, GameEvent.f_157796_, GameEvent.f_157797_, GameEvent.f_223702_, GameEvent.f_223703_, GameEvent.f_157802_, GameEvent.f_157803_, GameEvent.f_157804_, GameEvent.f_223704_, GameEvent.f_157806_, GameEvent.f_223705_, GameEvent.f_223706_, GameEvent.f_223707_, GameEvent.f_223708_, GameEvent.f_157810_, GameEvent.f_223709_, GameEvent.f_223710_, GameEvent.f_157811_, GameEvent.f_157812_, GameEvent.f_157816_, GameEvent.f_157769_, GameEvent.f_157770_, GameEvent.f_223696_, GameEvent.f_223697_, GameEvent.f_157772_, GameEvent.f_223699_, GameEvent.f_157774_, GameEvent.f_157775_, GameEvent.f_157776_, GameEvent.f_157777_, GameEvent.f_157778_, GameEvent.f_157781_, GameEvent.f_157784_, GameEvent.f_157785_, GameEvent.f_157786_, GameEvent.f_238175_};
@@ -10,8 +_,13 @@
@VisibleForTesting
static final GameEvent[] f_236425_ = new GameEvent[]{GameEvent.f_157791_, GameEvent.f_157792_, GameEvent.f_157793_, GameEvent.f_157794_, GameEvent.f_157795_, GameEvent.f_157796_, GameEvent.f_157797_, GameEvent.f_223702_, GameEvent.f_223703_, GameEvent.f_157802_, GameEvent.f_157803_, GameEvent.f_157804_, GameEvent.f_223704_, GameEvent.f_157806_, GameEvent.f_223705_, GameEvent.f_223706_, GameEvent.f_223707_, GameEvent.f_223708_, GameEvent.f_157810_, GameEvent.f_223709_, GameEvent.f_223710_, GameEvent.f_157811_, GameEvent.f_157812_, GameEvent.f_157816_, GameEvent.f_157769_, GameEvent.f_157770_, GameEvent.f_223696_, GameEvent.f_223697_, GameEvent.f_157772_, GameEvent.f_223699_, GameEvent.f_157774_, GameEvent.f_157775_, GameEvent.f_157776_, GameEvent.f_157777_, GameEvent.f_157778_, GameEvent.f_157781_, GameEvent.f_157784_, GameEvent.f_157785_, GameEvent.f_157786_, GameEvent.f_238175_};
+ /** @deprecated Forge: Use the {@link #GameEventTagsProvider(DataGenerator, String, net.minecraftforge.common.data.ExistingFileHelper) mod id variant} */
+ @Deprecated
@@ -1,6 +1,6 @@
--- a/net/minecraft/data/tags/TagsProvider.java
+++ b/net/minecraft/data/tags/TagsProvider.java
@@ -29,10 +_,32 @@
@@ -30,10 +_,32 @@
protected final DataGenerator.PathProvider f_236439_;
protected final Registry<T> f_126540_;
protected final Map<ResourceLocation, TagBuilder> f_126543_ = Maps.newLinkedHashMap();
@@ -33,14 +33,14 @@
}
public String m_6055_() {
@@ -48,12 +_,13 @@
@@ -49,12 +_,13 @@
List<TagEntry> list = p_236450_.m_215904_();
List<TagEntry> list1 = list.stream().filter((p_236444_) -> {
return !p_236444_.m_215940_(this.f_126540_::m_7804_, this.f_126543_::containsKey);
- }).toList();
+ }).filter(this::missing).collect(Collectors.toList()); // Forge: Add validation via existing resources
if (!list1.isEmpty()) {
throw new IllegalArgumentException(String.format("Couldn't define tag %s as it is missing following references: %s", p_236449_, list1.stream().map(Objects::toString).collect(Collectors.joining(","))));
throw new IllegalArgumentException(String.format(Locale.ROOT, "Couldn't define tag %s as it is missing following references: %s", p_236449_, list1.stream().map(Objects::toString).collect(Collectors.joining(","))));
} else {
JsonElement jsonelement = TagFile.f_215958_.encodeStart(JsonOps.INSTANCE, new TagFile(list, false)).getOrThrow(false, f_126541_::error);
- Path path = this.f_236439_.m_236048_(p_236449_);
@@ -49,7 +49,7 @@
try {
DataProvider.m_236072_(p_236446_, jsonelement, path);
@@ -65,24 +_,36 @@
@@ -66,24 +_,36 @@
});
}
@@ -89,7 +89,7 @@
}
public TagsProvider.TagAppender<T> m_126582_(T p_126583_) {
@@ -120,6 +_,19 @@
@@ -121,6 +_,19 @@
this.f_126568_.m_215900_(p_126587_);
});
return this;
@@ -1,6 +1,6 @@
--- a/net/minecraft/network/Connection.java
+++ b/net/minecraft/network/Connection.java
@@ -86,6 +_,7 @@
@@ -82,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_;
@@ -95,6 +_,7 @@
@@ -91,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);
@@ -190,7 +_,7 @@
@@ -186,7 +_,7 @@
++this.f_129475_;
if (connectionprotocol1 != connectionprotocol) {
f_129465_.debug("Disabled auto read");
@@ -25,7 +25,7 @@
}
if (this.f_129468_.eventLoop().inEventLoop()) {
@@ -288,7 +_,9 @@
@@ -292,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_) {
@@ -314,6 +_,7 @@
@@ -318,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);
@@ -400,6 +_,14 @@
@@ -404,6 +_,14 @@
public float m_129543_() {
return this.f_129477_;
@@ -1,11 +0,0 @@
--- a/net/minecraft/network/chat/ChatDecorator.java
+++ b/net/minecraft/network/chat/ChatDecorator.java
@@ -29,7 +_,7 @@
default CompletableFuture<FilteredText<PlayerChatMessage>> m_236964_(@Nullable ServerPlayer p_236965_, FilteredText<Component> p_236966_, MessageSignature p_236967_, boolean p_236968_) {
return this.m_236969_(p_236965_, p_236966_).thenApply((p_236956_) -> {
- return PlayerChatMessage.m_237223_(p_236966_, p_236956_, p_236967_, p_236968_);
+ return PlayerChatMessage.filteredSigned(p_236966_, p_236956_, p_236967_, p_236968_, p_236965_);
});
}
}
@@ -1,21 +0,0 @@
--- a/net/minecraft/network/chat/PlayerChatMessage.java
+++ b/net/minecraft/network/chat/PlayerChatMessage.java
@@ -24,10 +_,17 @@
}
}
+ // Forge: Bouncer for the version with player context
public static FilteredText<PlayerChatMessage> m_237223_(FilteredText<Component> p_237224_, FilteredText<Component> p_237225_, MessageSignature p_237226_, boolean p_237227_) {
+ return filteredSigned(p_237224_, p_237225_, p_237226_, p_237227_, null);
+ }
+
+ public static FilteredText<PlayerChatMessage> filteredSigned(FilteredText<Component> p_237224_, FilteredText<Component> p_237225_, MessageSignature p_237226_, boolean p_237227_, @org.jetbrains.annotations.Nullable ServerPlayer player) {
Component component = p_237224_.f_215168_();
Component component1 = p_237225_.f_215168_();
- PlayerChatMessage playerchatmessage = m_237237_(component, component1, p_237226_, p_237227_);
+ Component forgeComponent = net.minecraftforge.common.ForgeHooks.onServerChatEvent(player, p_237224_.f_215168_().getString(), component);
+ // TODO: this overrides the signed ("normal") component from the player, but ignores the unsigned component. What do we do here? This is a mess. -C
+ PlayerChatMessage playerchatmessage = m_237237_(forgeComponent, component1, p_237226_, p_237227_);
if (p_237225_.m_215174_()) {
PlayerChatMessage playerchatmessage1 = Util.m_214614_(p_237225_.f_215169_(), PlayerChatMessage::m_237235_);
return new FilteredText<>(playerchatmessage, playerchatmessage1);
@@ -25,7 +25,7 @@
}
public ClientboundCustomPayloadPacket(FriendlyByteBuf p_178836_) {
@@ -43,6 +_,7 @@
@@ -43,15 +_,17 @@
} else {
throw new IllegalArgumentException("Payload may not be larger than 1048576 bytes");
}
@@ -33,7 +33,10 @@
}
public void m_5779_(FriendlyByteBuf p_132044_) {
@@ -52,6 +_,7 @@
p_132044_.m_130085_(this.f_132029_);
- p_132044_.writeBytes(this.f_132030_.copy());
+ p_132044_.writeBytes(this.f_132030_.slice()); // Use Slice instead of copy, to not update the read index, allowing packet to be sent multiple times.
}
public void m_5797_(ClientGamePacketListener p_132041_) {
p_132041_.m_7413_(this);
@@ -41,3 +44,12 @@
}
public ResourceLocation m_132042_() {
@@ -61,4 +_,8 @@
public FriendlyByteBuf m_132045_() {
return new FriendlyByteBuf(this.f_132030_.copy());
}
+
+ @Override public int getIndex() { return Integer.MAX_VALUE; }
+ @Override public ResourceLocation getName() { return m_132042_(); }
+ @org.jetbrains.annotations.Nullable @Override public FriendlyByteBuf getInternalData() { return this.f_132030_; }
}
@@ -14,7 +14,16 @@
public void m_5779_(FriendlyByteBuf p_133994_) {
p_133994_.m_130085_(this.f_133980_);
- p_133994_.writeBytes((ByteBuf)this.f_133981_);
+ p_133994_.writeBytes((ByteBuf)this.f_133981_.copy()); //This may be access multiple times, from multiple threads, lets be safe like the S->C packet
+ p_133994_.writeBytes((ByteBuf)this.f_133981_.slice()); // Use Slice instead of copy, to not update the read index, allowing packet to be sent multiple times.
}
public void m_5797_(ServerGamePacketListener p_133992_) {
@@ -43,4 +_,8 @@
public FriendlyByteBuf m_179590_() {
return this.f_133981_;
}
+
+ @Override public int getIndex() { return Integer.MAX_VALUE; }
+ @Override public ResourceLocation getName() { return m_179589_(); }
+ @org.jetbrains.annotations.Nullable @Override public FriendlyByteBuf getInternalData() { return m_179590_(); }
}
@@ -9,3 +9,21 @@
private static final int f_179804_ = 1048576;
private final int f_134745_;
private final ResourceLocation f_134746_;
@@ -30,7 +_,7 @@
public void m_5779_(FriendlyByteBuf p_134757_) {
p_134757_.m_130130_(this.f_134745_);
p_134757_.m_130085_(this.f_134746_);
- p_134757_.writeBytes(this.f_134747_.copy());
+ p_134757_.writeBytes(this.f_134747_.slice()); // Use Slice instead of copy, to not update the read index, allowing packet to be sent multiple times.
}
public void m_5797_(ClientLoginPacketListener p_134754_) {
@@ -48,4 +_,8 @@
public FriendlyByteBuf m_179812_() {
return this.f_134747_;
}
+
+ @Override public int getIndex() { return m_134755_(); }
+ @Override public ResourceLocation getName() { return m_179811_(); }
+ @org.jetbrains.annotations.Nullable @Override public FriendlyByteBuf getInternalData() { return m_179812_(); }
}
@@ -10,3 +10,12 @@
private static final int f_179821_ = 1048576;
private final int f_134825_;
@Nullable
@@ -46,4 +_,8 @@
public FriendlyByteBuf m_179825_() {
return this.f_134826_;
}
+
+ @Override public int getIndex() { return m_179824_(); }
+ @Override public net.minecraft.resources.ResourceLocation getName() { return net.minecraftforge.network.LoginWrapper.WRAPPER; }
+ @org.jetbrains.annotations.Nullable @Override public FriendlyByteBuf getInternalData() { return m_179825_(); }
}
@@ -1,23 +1,24 @@
--- a/net/minecraft/network/protocol/status/ServerStatus.java
+++ b/net/minecraft/network/protocol/status/ServerStatus.java
@@ -27,6 +_,16 @@
@Nullable
@@ -28,6 +_,17 @@
private String f_134903_;
private boolean f_238077_;
private boolean f_242955_;
+ private transient net.minecraftforge.network.ServerStatusPing forgeData;
+
+ @Nullable
+ public net.minecraftforge.network.ServerStatusPing getForgeData() {
+ return this.forgeData;
+ }
+
+ public void setForgeData(net.minecraftforge.network.ServerStatusPing data){
+ public void setForgeData(net.minecraftforge.network.ServerStatusPing data) {
+ this.forgeData = data;
+ invalidateJson();
+ }
@Nullable
public Component m_134905_() {
@@ -35,6 +_,7 @@
@@ -36,6 +_,7 @@
public void m_134908_(Component p_134909_) {
this.f_134900_ = p_134909_;
@@ -25,7 +26,7 @@
}
@Nullable
@@ -44,6 +_,7 @@
@@ -45,6 +_,7 @@
public void m_134910_(ServerStatus.Players p_134911_) {
this.f_134901_ = p_134911_;
@@ -33,7 +34,7 @@
}
@Nullable
@@ -53,10 +_,12 @@
@@ -54,10 +_,12 @@
public void m_134912_(ServerStatus.Version p_134913_) {
this.f_134902_ = p_134913_;
@@ -46,8 +47,23 @@
}
@Nullable
@@ -72,6 +_,39 @@
return this.f_238077_;
@@ -67,6 +_,7 @@
public void m_238078_(boolean p_238079_) {
this.f_238077_ = p_238079_;
+ invalidateJson();
}
public boolean m_238080_() {
@@ -75,12 +_,46 @@
public void m_242958_(boolean p_242968_) {
this.f_242955_ = p_242968_;
+ invalidateJson();
}
public boolean m_242963_() {
return this.f_242955_;
}
+ private java.util.concurrent.Semaphore mutex = new java.util.concurrent.Semaphore(1);
@@ -86,8 +102,8 @@
public static class Players {
private final int f_134917_;
private final int f_134918_;
@@ -170,6 +_,10 @@
serverstatus.m_238078_(GsonHelper.m_13912_(jsonobject, "previewsChat"));
@@ -183,6 +_,10 @@
serverstatus.m_242958_(GsonHelper.m_13912_(jsonobject, "enforcesSecureChat"));
}
+ if (jsonobject.has("forgeData")) {
@@ -97,13 +113,13 @@
return serverstatus;
}
@@ -190,6 +_,10 @@
@@ -204,6 +_,10 @@
if (p_134951_.m_134916_() != null) {
jsonobject.addProperty("favicon", p_134951_.m_134916_());
+ }
+
+ if(p_134951_.getForgeData() != null){
+ if (p_134951_.getForgeData() != null) {
+ jsonobject.add("forgeData", net.minecraftforge.network.ServerStatusPing.Serializer.serialize(p_134951_.getForgeData()));
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/network/syncher/SynchedEntityData.java
+++ b/net/minecraft/network/syncher/SynchedEntityData.java
@@ -37,11 +_,13 @@
@@ -38,11 +_,13 @@
}
public static <T> EntityDataAccessor<T> m_135353_(Class<? extends Entity> p_135354_, EntityDataSerializer<T> p_135355_) {
@@ -0,0 +1,45 @@
--- a/net/minecraft/resources/HolderSetCodec.java
+++ b/net/minecraft/resources/HolderSetCodec.java
@@ -20,6 +_,8 @@
private final Codec<Holder<E>> f_206656_;
private final Codec<List<Holder<E>>> f_206657_;
private final Codec<Either<TagKey<E>, List<Holder<E>>>> f_206658_;
+ private final Codec<net.minecraftforge.registries.holdersets.ICustomHolderSet<E>> forgeDispatchCodec;
+ private final Codec<Either<net.minecraftforge.registries.holdersets.ICustomHolderSet<E>, Either<TagKey<E>, List<Holder<E>>>>> combinedCodec;
private static <E> Codec<List<Holder<E>>> m_206667_(Codec<Holder<E>> p_206668_, boolean p_206669_) {
Function<List<Holder<E>>, DataResult<List<Holder<E>>>> function = ExtraCodecs.m_203984_(Holder::m_203376_);
@@ -42,6 +_,10 @@
this.f_206656_ = p_206661_;
this.f_206657_ = m_206667_(p_206661_, p_206662_);
this.f_206658_ = Codec.either(TagKey.m_203886_(p_206660_), this.f_206657_);
+ // FORGE: make registry-specific dispatch codec and make forge-or-vanilla either codec
+ this.forgeDispatchCodec = ExtraCodecs.m_184415_(() -> net.minecraftforge.registries.ForgeRegistries.HOLDER_SET_TYPES.get().getCodec())
+ .dispatch(net.minecraftforge.registries.holdersets.ICustomHolderSet::type, type -> type.makeCodec(p_206660_, p_206661_, p_206662_));
+ this.combinedCodec = new ExtraCodecs.EitherCodec<>(this.forgeDispatchCodec, this.f_206658_);
}
public <T> DataResult<Pair<HolderSet<E>, T>> decode(DynamicOps<T> p_206696_, T p_206697_) {
@@ -49,9 +_,10 @@
Optional<? extends Registry<E>> optional = registryops.m_206826_(this.f_206655_);
if (optional.isPresent()) {
Registry<E> registry = optional.get();
- return this.f_206658_.decode(p_206696_, p_206697_).map((p_206682_) -> {
+ // FORGE: use the wrapped codec to decode custom/tag/list instead of just tag/list
+ return this.combinedCodec.decode(p_206696_, p_206697_).map((p_206682_) -> {
return p_206682_.mapFirst((p_206679_) -> {
- return p_206679_.map(registry::m_203561_, HolderSet::m_205800_);
+ return p_206679_.map(java.util.function.Function.identity(), tagOrList -> tagOrList.map(registry::m_203561_, HolderSet::m_205800_));
});
});
}
@@ -68,6 +_,9 @@
return DataResult.error("HolderSet " + p_206674_ + " is not valid in current registry set");
}
+ // FORGE: use the dispatch codec to encode custom holdersets, otherwise fall back to vanilla tag/list
+ if (p_206674_ instanceof net.minecraftforge.registries.holdersets.ICustomHolderSet<E> customHolderSet)
+ return this.forgeDispatchCodec.encode(customHolderSet, p_206675_, p_206676_);
return this.f_206658_.encode(p_206674_.m_203440_().mapRight(List::copyOf), p_206675_, p_206676_);
}
}
@@ -0,0 +1,16 @@
--- a/net/minecraft/resources/RegistryLoader.java
+++ b/net/minecraft/resources/RegistryLoader.java
@@ -48,7 +_,12 @@
if (dataresult != null) {
return dataresult;
} else {
- Holder<E> holder = p_214229_.m_214121_(p_214232_);
+ // Prevents an exception from disrupting codec decoding when calling this with prematurely frozen registries - see comment in LevelStorageSource
+ DataResult<Holder<E>> maybeHolder = p_214229_.m_214185_(p_214232_);
+ if (maybeHolder.error().isPresent()) {
+ return maybeHolder;
+ }
+ Holder<E> holder = maybeHolder.result().get();
readcache.f_206803_.put(p_214232_, DataResult.success(holder));
DataResult<Holder<E>> dataresult1;
if (p_214233_.isEmpty()) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -241,7 +_,7 @@
@@ -240,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_) -> {
@@ -333,6 +_,7 @@
@@ -332,6 +_,7 @@
this.m_129841_(dimensiondatastorage);
this.f_129732_ = new CommandStorage(dimensiondatastorage);
WorldBorder worldborder = serverlevel.m_6857_();
@@ -17,7 +17,7 @@
if (!serverleveldata.m_6535_()) {
try {
m_177896_(serverlevel, serverleveldata, worldgensettings.m_64660_(), flag);
@@ -367,6 +_,7 @@
@@ -366,6 +_,7 @@
ServerLevel serverlevel1 = new ServerLevel(this, this.f_129738_, this.f_129744_, derivedleveldata, resourcekey1, entry.getValue(), p_129816_, flag, j, ImmutableList.of(), false);
worldborder.m_61929_(new BorderChangeListener.DelegateBorderChangeListener(serverlevel1.m_6857_()));
this.f_129762_.put(resourcekey1, serverlevel1);
@@ -25,7 +25,7 @@
}
}
@@ -378,6 +_,7 @@
@@ -377,6 +_,7 @@
p_177898_.m_7250_(BlockPos.f_121853_.m_6630_(80), 0.0F);
} else {
ServerChunkCache serverchunkcache = p_177897_.m_7726_();
@@ -33,7 +33,7 @@
ChunkPos chunkpos = new ChunkPos(serverchunkcache.m_214994_().m_224579_().m_183230_());
int i = serverchunkcache.m_8481_().m_142051_(p_177897_);
if (i < p_177897_.m_141937_()) {
@@ -458,6 +_,7 @@
@@ -457,6 +_,7 @@
ChunkPos chunkpos = new ChunkPos(i);
serverlevel1.m_7726_().m_6692_(chunkpos, true);
}
@@ -41,7 +41,7 @@
}
}
@@ -528,6 +_,8 @@
@@ -527,6 +_,8 @@
}
public void m_7041_() {
@@ -50,7 +50,7 @@
if (this.f_177872_.m_142763_()) {
this.m_236737_();
}
@@ -572,6 +_,7 @@
@@ -571,6 +_,7 @@
for(ServerLevel serverlevel2 : this.m_129785_()) {
if (serverlevel2 != null) {
try {
@@ -58,7 +58,7 @@
serverlevel2.close();
} catch (IOException ioexception1) {
f_129750_.error("Exception closing the level", (Throwable)ioexception1);
@@ -620,6 +_,7 @@
@@ -619,6 +_,7 @@
throw new IllegalStateException("Failed to initialize server");
}
@@ -162,6 +162,15 @@
}
public SystemReport m_177935_(SystemReport p_177936_) {
@@ -1121,7 +_,7 @@
}
public boolean m_214000_() {
- return false;
+ return net.minecraftforge.common.ForgeMod.isServerChatPreviewEnabled();
}
public boolean m_129918_() {
@@ -1287,6 +_,7 @@
this.m_6846_().m_11315_();
this.f_129734_.m_136120_(this.f_129740_.f_206585_.m_206860_());
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/PlayerAdvancements.java
+++ b/net/minecraft/server/PlayerAdvancements.java
@@ -179,6 +_,10 @@
@@ -178,6 +_,10 @@
}
this.m_136002_(p_136007_);
@@ -11,7 +11,7 @@
this.m_136001_();
this.m_135994_(p_136007_);
}
@@ -237,6 +_,8 @@
@@ -236,6 +_,8 @@
}
public boolean m_135988_(Advancement p_135989_, String p_135990_) {
@@ -20,9 +20,9 @@
boolean flag = false;
AdvancementProgress advancementprogress = this.m_135996_(p_135989_);
boolean flag1 = advancementprogress.m_8193_();
@@ -249,6 +_,7 @@
@@ -248,6 +_,7 @@
if (p_135989_.m_138320_() != null && p_135989_.m_138320_().m_14996_() && this.f_135968_.f_19853_.m_46469_().m_46207_(GameRules.f_46153_)) {
this.f_135962_.m_215627_(Component.m_237110_("chat.type.advancement." + p_135989_.m_138320_().m_14992_().m_15548_(), this.f_135968_.m_5446_(), p_135989_.m_138330_()), ChatType.f_130599_);
this.f_135962_.m_240416_(Component.m_237110_("chat.type.advancement." + p_135989_.m_138320_().m_14992_().m_15548_(), this.f_135968_.m_5446_(), p_135989_.m_138330_()), false);
}
+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.f_135968_, p_135989_);
}
@@ -37,3 +37,12 @@
}
}
@@ -318,7 +_,7 @@
}
public boolean m_214000_() {
- return this.m_7913_().f_214803_;
+ return super.m_214000_() || this.m_7913_().f_214803_;
}
public DedicatedPlayerList m_6846_() {
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/dedicated/ServerWatchdog.java
+++ b/net/minecraft/server/dedicated/ServerWatchdog.java
@@ -42,7 +_,7 @@
@@ -40,7 +_,7 @@
ThreadMXBean threadmxbean = ManagementFactory.getThreadMXBean();
ThreadInfo[] athreadinfo = threadmxbean.dumpAllThreads(true, true);
StringBuilder stringbuilder = new StringBuilder();
@@ -1,6 +1,14 @@
--- a/net/minecraft/server/level/ChunkMap.java
+++ b/net/minecraft/server/level/ChunkMap.java
@@ -489,6 +_,7 @@
@@ -385,6 +_,7 @@
this.f_140140_ = true;
}
+ net.minecraftforge.event.ForgeEventFactory.fireChunkTicketLevelUpdated(this.f_140133_, p_140177_, p_140180_, p_140178_, p_140179_);
return p_140179_;
}
}
@@ -490,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);
@@ -8,7 +16,7 @@
}
this.m_140258_(p_203002_);
@@ -688,8 +_,14 @@
@@ -689,8 +_,14 @@
levelchunk.m_62952_();
if (this.f_140132_.add(chunkpos.m_45588_())) {
levelchunk.m_62913_(true);
@@ -23,7 +31,7 @@
}
return levelchunk;
@@ -792,6 +_,7 @@
@@ -793,6 +_,7 @@
this.f_140133_.m_46473_().m_6174_("chunkSave");
CompoundTag compoundtag = ChunkSerializer.m_63454_(this.f_140133_, p_140259_);
@@ -31,7 +39,7 @@
this.m_63502_(chunkpos, compoundtag);
this.m_140229_(chunkpos, chunkstatus.m_62494_());
return true;
@@ -862,6 +_,7 @@
@@ -863,6 +_,7 @@
if (!p_183759_ && p_183758_) {
p_183755_.m_9088_(p_183756_);
@@ -39,7 +47,7 @@
}
}
@@ -1104,7 +_,7 @@
@@ -1105,7 +_,7 @@
}
protected void m_140199_(Entity p_140200_) {
@@ -48,7 +56,7 @@
EntityType<?> entitytype = p_140200_.m_6095_();
int i = entitytype.m_20681_() * 16;
if (i != 0) {
@@ -1230,6 +_,7 @@
@@ -1231,6 +_,7 @@
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -183,10 +_,11 @@
@@ -184,10 +_,11 @@
private final List<CustomSpawner> f_8558_;
@Nullable
private final EndDragonFight f_8559_;
@@ -13,7 +13,7 @@
public ServerLevel(MinecraftServer p_214999_, Executor p_215000_, LevelStorageSource.LevelStorageAccess p_215001_, ServerLevelData p_215002_, ResourceKey<Level> p_215003_, LevelStem p_215004_, ChunkProgressListener p_215005_, boolean p_215006_, long p_215007_, List<CustomSpawner> p_215008_, boolean p_215009_) {
super(p_215002_, p_215003_, p_215004_.m_204521_(), p_214999_::m_129905_, false, p_215006_, p_215007_, p_214999_.m_213994_());
@@ -226,6 +_,7 @@
@@ -227,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_) {
@@ -254,8 +_,8 @@
@@ -255,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_();
@@ -284,7 +_,7 @@
@@ -285,7 +_,7 @@
this.m_8807_();
this.f_8557_ = false;
profilerfiller.m_7238_();
@@ -41,7 +41,7 @@
if (flag) {
this.m_8886_();
}
@@ -316,7 +_,9 @@
@@ -317,7 +_,9 @@
}
profilerfiller.m_6180_("tick");
@@ -52,7 +52,7 @@
profilerfiller.m_7238_();
}
}
@@ -407,6 +_,7 @@
@@ -408,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_204166_(blockpos2).m_203334_();
@@ -60,7 +60,7 @@
if (biome.m_47477_(this, blockpos3)) {
this.m_46597_(blockpos3, Blocks.f_50126_.m_49966_());
}
@@ -597,15 +_,19 @@
@@ -598,15 +_,19 @@
this.f_8548_.m_6846_().m_11270_(new ClientboundGameEventPacket(ClientboundGameEventPacket.f_132161_, this.f_46440_), this.m_46472_());
}
@@ -84,7 +84,7 @@
}
}
@@ -664,6 +_,7 @@
@@ -665,6 +_,7 @@
return Registry.f_122826_.m_7981_(p_8664_.m_6095_()).toString();
});
profilerfiller.m_6174_("tickPassenger");
@@ -92,7 +92,7 @@
p_8664_.m_6083_();
profilerfiller.m_7238_();
@@ -700,6 +_,7 @@
@@ -701,6 +_,7 @@
this.f_143244_.m_157554_();
}
@@ -100,7 +100,7 @@
}
}
@@ -773,6 +_,7 @@
@@ -774,6 +_,7 @@
}
private void m_8853_(ServerPlayer p_8854_) {
@@ -108,7 +108,7 @@
Entity entity = this.m_142646_().m_142694_(p_8854_.m_20148_());
if (entity != null) {
f_8566_.warn("Force-added player with duplicate UUID {}", (Object)p_8854_.m_20148_().toString());
@@ -780,7 +_,8 @@
@@ -781,7 +_,8 @@
this.m_143261_((ServerPlayer)entity, Entity.RemovalReason.DISCARDED);
}
@@ -118,7 +118,7 @@
}
private boolean m_8872_(Entity p_8873_) {
@@ -788,7 +_,12 @@
@@ -789,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 {
@@ -132,7 +132,7 @@
}
}
@@ -825,10 +_,22 @@
@@ -826,10 +_,22 @@
}
public void m_214150_(@Nullable Player p_215017_, double p_215018_, double p_215019_, double p_215020_, SoundEvent p_215021_, SoundSource p_215022_, float p_215023_, float p_215024_, long p_215025_) {
@@ -155,7 +155,7 @@
this.f_8548_.m_6846_().m_11241_(p_215027_, p_215028_.m_20185_(), p_215028_.m_20186_(), p_215028_.m_20189_(), (double)p_215029_.m_215668_(p_215031_), this.m_46472_(), new ClientboundSoundEntityPacket(p_215029_, p_215030_, p_215028_, p_215031_, p_215032_, p_215033_));
}
@@ -845,6 +_,7 @@
@@ -846,6 +_,7 @@
}
public void m_214171_(GameEvent p_215041_, Vec3 p_215042_, GameEvent.Context p_215043_) {
@@ -163,7 +163,7 @@
int i = p_215041_.m_157827_();
BlockPos blockpos = new BlockPos(p_215042_);
int j = SectionPos.m_123171_(blockpos.m_123341_() - i);
@@ -930,10 +_,15 @@
@@ -931,10 +_,15 @@
}
public void m_46672_(BlockPos p_215045_, Block p_215046_) {
@@ -179,7 +179,7 @@
this.f_220350_.m_214152_(p_215052_, p_215053_, p_215054_);
}
@@ -955,6 +_,7 @@
@@ -956,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_);
@@ -187,7 +187,7 @@
explosion.m_46061_();
explosion.m_46075_(false);
if (p_8661_ == Explosion.BlockInteraction.NONE) {
@@ -1461,6 +_,12 @@
@@ -1462,6 +_,12 @@
});
}
@@ -200,7 +200,7 @@
public LevelEntityGetter<Entity> m_142646_() {
return this.f_143244_.m_157567_();
}
@@ -1544,8 +_,8 @@
@@ -1545,8 +_,8 @@
ServerLevel.this.f_143246_.add(mob);
}
@@ -211,7 +211,7 @@
ServerLevel.this.f_143247_.put(enderdragonpart.m_19879_(), enderdragonpart);
}
}
@@ -1569,17 +_,26 @@
@@ -1570,17 +_,25 @@
ServerLevel.this.f_143246_.remove(mob);
}
@@ -229,7 +229,6 @@
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityLeaveLevelEvent(p_143375_, ServerLevel.this));
}
+ @Override
public void m_214006_(Entity p_215086_) {
p_215086_.m_213651_(DynamicGameEventListener::m_223641_);
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -549,6 +_,7 @@
@@ -550,6 +_,7 @@
public void m_6667_(DamageSource p_9035_) {
this.m_146850_(GameEvent.f_223707_);
@@ -8,7 +8,7 @@
boolean flag = this.f_19853_.m_46469_().m_46207_(GameRules.f_46142_);
if (flag) {
Component component = this.m_21231_().m_19293_();
@@ -694,11 +_,12 @@
@@ -692,11 +_,12 @@
}
@Nullable
@@ -23,7 +23,7 @@
this.m_19877_();
this.m_9236_().m_143261_(this, Entity.RemovalReason.CHANGED_DIMENSION);
if (!this.f_8944_) {
@@ -715,13 +_,14 @@
@@ -713,13 +_,14 @@
PlayerList playerlist = this.f_8924_.m_6846_();
playerlist.m_11289_(this);
serverlevel.m_143261_(this, Entity.RemovalReason.CHANGED_DIMENSION);
@@ -41,7 +41,7 @@
this.m_9006_(p_9180_, new BlockPos(portalinfo.f_77676_));
}
@@ -733,6 +_,9 @@
@@ -731,6 +_,9 @@
this.m_6027_(portalinfo.f_77676_.f_82479_, portalinfo.f_77676_.f_82480_, portalinfo.f_77676_.f_82481_);
serverlevel.m_46473_().m_7238_();
this.m_9209_(serverlevel);
@@ -51,7 +51,7 @@
this.f_8906_.m_9829_(new ClientboundPlayerAbilitiesPacket(this.m_150110_()));
playerlist.m_11229_(this, p_9180_);
playerlist.m_11292_(this);
@@ -741,10 +_,12 @@
@@ -739,10 +_,12 @@
this.f_8906_.m_9829_(new ClientboundUpdateMobEffectPacket(this.m_19879_(), mobeffectinstance));
}
@@ -64,7 +64,7 @@
}
return this;
@@ -808,6 +_,9 @@
@@ -806,6 +_,9 @@
}
public Either<Player.BedSleepingProblem, Unit> m_7720_(BlockPos p_9115_) {
@@ -74,7 +74,7 @@
Direction direction = this.f_19853_.m_8055_(p_9115_).m_61143_(HorizontalDirectionalBlock.f_54117_);
if (!this.m_5803_() && this.m_6084_()) {
if (!this.f_19853_.m_6042_().f_63858_()) {
@@ -818,7 +_,7 @@
@@ -816,7 +_,7 @@
return Either.left(Player.BedSleepingProblem.OBSTRUCTED);
} else {
this.m_9158_(this.f_19853_.m_46472_(), p_9115_, this.m_146908_(), false, true);
@@ -83,7 +83,7 @@
return Either.left(Player.BedSleepingProblem.NOT_POSSIBLE_NOW);
} else {
if (!this.m_7500_()) {
@@ -856,6 +_,7 @@
@@ -854,6 +_,7 @@
}
private boolean m_9116_(BlockPos p_9117_, Direction p_9118_) {
@@ -91,7 +91,7 @@
return this.m_9222_(p_9117_) || this.m_9222_(p_9117_.m_121945_(p_9118_.m_122424_()));
}
@@ -964,6 +_,7 @@
@@ -962,6 +_,7 @@
this.f_8906_.m_9829_(new ClientboundOpenScreenPacket(abstractcontainermenu.f_38840_, abstractcontainermenu.m_6772_(), p_9033_.m_5446_()));
this.m_143399_(abstractcontainermenu);
this.f_36096_ = abstractcontainermenu;
@@ -99,7 +99,7 @@
return OptionalInt.of(this.f_8940_);
}
}
@@ -982,6 +_,7 @@
@@ -980,6 +_,7 @@
this.f_8906_.m_9829_(new ClientboundHorseScreenOpenPacket(this.f_8940_, p_9060_.m_6643_(), p_9059_.m_19879_()));
this.f_36096_ = new HorseInventoryMenu(this.f_8940_, this.m_150109_(), p_9060_, p_9059_);
this.m_143399_(this.f_36096_);
@@ -107,7 +107,7 @@
}
public void m_6986_(ItemStack p_9082_, InteractionHand p_9083_) {
@@ -1007,6 +_,7 @@
@@ -1005,6 +_,7 @@
public void m_9230_() {
this.f_36096_.m_6877_(this);
this.f_36095_.m_150414_(this.f_36096_);
@@ -115,7 +115,7 @@
this.f_36096_ = this.f_36095_;
}
@@ -1133,6 +_,15 @@
@@ -1131,6 +_,15 @@
this.m_36362_(p_9016_.m_36331_());
this.m_36364_(p_9016_.m_36332_());
this.m_219749_(p_9016_.m_219759_());
@@ -131,7 +131,7 @@
}
protected void m_142540_(MobEffectInstance p_143393_, @Nullable Entity p_143394_) {
@@ -1191,6 +_,8 @@
@@ -1189,6 +_,8 @@
}
public boolean m_143403_(GameType p_143404_) {
@@ -140,7 +140,7 @@
if (!this.f_8941_.m_143473_(p_143404_)) {
return false;
} else {
@@ -1266,6 +_,7 @@
@@ -1260,6 +_,7 @@
this.f_184127_ = p_9157_.f_195812_();
this.m_20088_().m_135381_(f_36089_, (byte)p_9157_.f_133867_());
this.m_20088_().m_135381_(f_36090_, (byte)(p_9157_.f_133868_() == HumanoidArm.LEFT ? 0 : 1));
@@ -148,7 +148,7 @@
}
public boolean m_143432_() {
@@ -1329,6 +_,7 @@
@@ -1319,6 +_,7 @@
public void m_9213_(@Nullable Entity p_9214_) {
Entity entity = this.m_8954_();
this.f_8926_ = (Entity)(p_9214_ == null ? this : p_9214_);
@@ -156,7 +156,7 @@
if (entity != this.f_8926_) {
this.f_8906_.m_9829_(new ClientboundSetCameraPacket(this.f_8926_));
this.m_6021_(this.f_8926_.m_20185_(), this.f_8926_.m_20186_(), this.f_8926_.m_20189_());
@@ -1358,7 +_,11 @@
@@ -1348,7 +_,11 @@
@Nullable
public Component m_8957_() {
@@ -169,7 +169,7 @@
}
public void m_6674_(InteractionHand p_9031_) {
@@ -1383,21 +_,23 @@
@@ -1373,21 +_,23 @@
this.m_8127_();
if (p_9000_ == this.f_19853_) {
this.f_8906_.m_9774_(p_9001_, p_9002_, p_9003_, p_9004_, p_9005_);
@@ -195,7 +195,7 @@
}
}
@@ -1420,6 +_,7 @@
@@ -1410,6 +_,7 @@
}
public void m_9158_(ResourceKey<Level> p_9159_, @Nullable BlockPos p_9160_, float p_9161_, boolean p_9162_, boolean p_9163_) {
@@ -203,7 +203,7 @@
if (p_9160_ != null) {
boolean flag = p_9160_.equals(this.f_8936_) && p_9159_.equals(this.f_8935_);
if (p_9163_ && !flag) {
@@ -1471,6 +_,8 @@
@@ -1461,6 +_,8 @@
if (itementity == null) {
return null;
} else {
@@ -212,7 +212,7 @@
this.f_19853_.m_7967_(itementity);
ItemStack itemstack = itementity.m_32055_();
if (p_9087_) {
@@ -1485,6 +_,76 @@
@@ -1475,6 +_,76 @@
}
}
@@ -289,7 +289,7 @@
public TextFilter m_8967_() {
return this.f_8939_;
}
@@ -1544,11 +_,13 @@
@@ -1534,11 +_,13 @@
public boolean m_182294_(boolean p_182295_) {
Inventory inventory = this.m_150109_();
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/network/ServerConnectionListener.java
+++ b/net/minecraft/server/network/ServerConnectionListener.java
@@ -49,11 +_,12 @@
@@ -50,11 +_,12 @@
public class ServerConnectionListener {
private static final Logger f_9701_ = LogUtils.getLogger();
@@ -15,7 +15,7 @@
});
final MinecraftServer f_9702_;
public volatile boolean f_9700_;
@@ -66,6 +_,8 @@
@@ -67,6 +_,8 @@
}
public void m_9711_(@Nullable InetAddress p_9712_, int p_9713_) throws IOException {
@@ -24,7 +24,7 @@
synchronized(this.f_9703_) {
Class<? extends ServerSocketChannel> oclass;
LazyLoadedValue<? extends EventLoopGroup> lazyloadedvalue;
@@ -86,7 +_,7 @@
@@ -87,7 +_,7 @@
} catch (ChannelException channelexception) {
}
@@ -1,7 +1,7 @@
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -171,6 +_,12 @@
public class ServerGamePacketListenerImpl implements ServerPlayerConnection, ServerGamePacketListener {
@@ -183,6 +_,12 @@
public class ServerGamePacketListenerImpl implements ServerPlayerConnection, TickablePacketListener, ServerGamePacketListener {
static final Logger f_9744_ = LogUtils.getLogger();
private static final int f_143608_ = 15000;
+ /**
@@ -12,8 +12,8 @@
+ @Deprecated
public static final double f_215198_ = Mth.m_144952_(6.0D);
private static final int f_215199_ = -1;
public final Connection f_9742_;
@@ -413,9 +_,11 @@
private static final int f_241635_ = 4096;
@@ -432,9 +_,11 @@
}
entity.m_19890_(d3, d4, d5, f, f1);
@@ -25,7 +25,7 @@
this.f_9742_.m_129512_(new ClientboundMoveVehiclePacket(entity));
return;
}
@@ -432,7 +_,7 @@
@@ -451,7 +_,7 @@
}
private boolean m_9793_(Entity p_9794_) {
@@ -34,7 +34,7 @@
}
public void m_7376_(ServerboundAcceptTeleportationPacket p_9835_) {
@@ -1004,7 +_,7 @@
@@ -1040,7 +_,7 @@
Vec3 vec3 = blockhitresult.m_82450_();
BlockPos blockpos = blockhitresult.m_82425_();
Vec3 vec31 = Vec3.m_82512_(blockpos);
@@ -43,7 +43,7 @@
Vec3 vec32 = vec3.m_82546_(vec31);
double d0 = 1.0000001D;
if (Math.abs(vec32.m_7096_()) < 1.0000001D && Math.abs(vec32.m_7098_()) < 1.0000001D && Math.abs(vec32.m_7094_()) < 1.0000001D) {
@@ -1012,7 +_,7 @@
@@ -1048,7 +_,7 @@
this.f_9743_.m_9243_();
int i = this.f_9743_.f_19853_.m_151558_();
if (blockpos.m_123342_() < i) {
@@ -52,7 +52,31 @@
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 = Component.m_237110_("build.tooHigh", i - 1).m_130940_(ChatFormatting.RED);
@@ -1383,11 +_,13 @@
@@ -1184,10 +_,12 @@
if (this.m_242598_(playerchatmessage)) {
this.f_241681_.m_241849_(() -> {
CompletableFuture<FilteredText> completablefuture = this.m_243132_(playerchatmessage.m_241775_().f_241656_());
- CompletableFuture<PlayerChatMessage> completablefuture1 = this.f_9745_.m_236742_().m_243107_(this.f_9743_, playerchatmessage);
+ CompletableFuture<PlayerChatMessage> completablefuture1 = net.minecraftforge.common.ForgeHooks.getServerChatSubmittedDecorator().m_243107_(this.f_9743_, playerchatmessage);
return CompletableFuture.allOf(completablefuture, completablefuture1).thenAcceptAsync((p_243197_) -> {
FilterMask filtermask = completablefuture.join().f_243010_();
- PlayerChatMessage playerchatmessage1 = completablefuture1.join().m_243072_(filtermask);
+ PlayerChatMessage playerchatmessage1 = completablefuture1.join();
+ if (playerchatmessage1 == null) return; // Forge: ServerChatEvent was canceled if this is null.
+ playerchatmessage1 = playerchatmessage1.m_243072_(filtermask);
this.m_243086_(playerchatmessage1);
}, this.f_9745_);
});
@@ -1383,7 +_,7 @@
private CompletableFuture<Component> m_215246_(String p_215247_) {
Component component = Component.m_237113_(p_215247_);
- CompletableFuture<Component> completablefuture = this.f_9745_.m_236742_().m_236961_(this.f_9743_, component).thenApply((p_238202_) -> {
+ CompletableFuture<Component> completablefuture = net.minecraftforge.common.ForgeHooks.getServerChatPreviewDecorator().m_236961_(this.f_9743_, component).thenApply((p_238202_) -> {
return !component.equals(p_238202_) ? p_238202_ : null;
});
completablefuture.thenAcceptAsync((p_242747_) -> {
@@ -1532,11 +_,13 @@
return;
}
@@ -67,16 +91,16 @@
if (interactionresult.m_19077_()) {
CriteriaTriggers.f_10565_.m_61494_(ServerGamePacketListenerImpl.this.f_9743_, itemstack, entity);
if (interactionresult.m_19080_()) {
@@ -1409,7 +_,7 @@
@@ -1558,6 +_,8 @@
public void m_141994_() {
if (!(entity instanceof ItemEntity) && !(entity instanceof ExperienceOrb) && !(entity instanceof AbstractArrow) && entity != ServerGamePacketListenerImpl.this.f_9743_) {
- ServerGamePacketListenerImpl.this.f_9743_.m_5706_(entity);
+ if(ServerGamePacketListenerImpl.this.f_9743_.canHit(entity, 3)) ServerGamePacketListenerImpl.this.f_9743_.m_5706_(entity); //Forge: Perform attack range check. Original check was dist < 6, range is 3, so vanilla used padding=3
+ //Forge: Perform attack range check. Original check was dist < 6, range is 3, so vanilla used padding=3
+ if(ServerGamePacketListenerImpl.this.f_9743_.canHit(entity, 3))
ServerGamePacketListenerImpl.this.f_9743_.m_5706_(entity);
} else {
ServerGamePacketListenerImpl.this.m_9942_(Component.m_237115_("multiplayer.disconnect.invalid_entity_attacked"));
ServerGamePacketListenerImpl.f_9744_.warn("Player {} tried to attack an invalid entity", (Object)ServerGamePacketListenerImpl.this.f_9743_.m_7755_().getString());
@@ -1596,6 +_,7 @@
@@ -1757,6 +_,7 @@
}
public void m_7423_(ServerboundCustomPayloadPacket p_9860_) {
@@ -1,9 +1,9 @@
--- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -68,7 +_,13 @@
@@ -65,7 +_,13 @@
}
public void m_10050_() {
public void m_9933_() {
- if (this.f_10019_ == ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT) {
+ if (this.f_10019_ == State.NEGOTIATING) {
+ // We force the state into "NEGOTIATING" which is otherwise unused. Once we're completed we move the negotiation onto "READY_TO_ACCEPT"
@@ -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());
@@ -192,14 +_,14 @@
@@ -178,14 +_,14 @@
GameProfile gameprofile = this.f_10018_.m_236731_();
if (gameprofile != null && p_10047_.f_238040_().equalsIgnoreCase(gameprofile.getName())) {
this.f_10021_ = gameprofile;
@@ -32,7 +32,7 @@
}
}
@@ -235,7 +_,7 @@
@@ -222,7 +_,7 @@
throw new IllegalStateException("Protocol error", cryptexception);
}
@@ -41,7 +41,7 @@
public void run() {
GameProfile gameprofile = ServerLoginPacketListenerImpl.this.f_10021_;
@@ -243,11 +_,11 @@
@@ -230,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());
@@ -49,22 +49,22 @@
+ ServerLoginPacketListenerImpl.this.f_10019_ = ServerLoginPacketListenerImpl.State.NEGOTIATING; // FORGE: continue NEGOTIATING, we move to READY_TO_ACCEPT after Forge is ready
} else if (ServerLoginPacketListenerImpl.this.f_10018_.m_129792_()) {
ServerLoginPacketListenerImpl.f_10015_.warn("Failed to verify username but will let them in anyway!");
ServerLoginPacketListenerImpl.this.f_10021_ = ServerLoginPacketListenerImpl.this.m_10038_(gameprofile);
ServerLoginPacketListenerImpl.this.f_10021_ = gameprofile;
- ServerLoginPacketListenerImpl.this.f_10019_ = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT;
+ ServerLoginPacketListenerImpl.this.f_10019_ = ServerLoginPacketListenerImpl.State.NEGOTIATING; // FORGE: continue NEGOTIATING, we move to READY_TO_ACCEPT after Forge is ready
} else {
ServerLoginPacketListenerImpl.this.m_10053_(Component.m_237115_("multiplayer.disconnect.unverified_username"));
ServerLoginPacketListenerImpl.f_10015_.error("Username '{}' tried to join with an invalid session", (Object)gameprofile.getName());
@@ -256,7 +_,7 @@
@@ -243,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);
ServerLoginPacketListenerImpl.this.f_10021_ = gameprofile;
- ServerLoginPacketListenerImpl.this.f_10019_ = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT;
+ ServerLoginPacketListenerImpl.this.f_10019_ = ServerLoginPacketListenerImpl.State.NEGOTIATING; // FORGE: continue NEGOTIATING, we move to READY_TO_ACCEPT after Forge is ready
} else {
ServerLoginPacketListenerImpl.this.m_10053_(Component.m_237115_("multiplayer.disconnect.authservers_down"));
ServerLoginPacketListenerImpl.f_10015_.error("Couldn't verify username because servers are unavailable");
@@ -276,6 +_,7 @@
@@ -263,6 +_,7 @@
}
public void m_7223_(ServerboundCustomQueryPacket p_10045_) {
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/packs/AbstractPackResources.java
+++ b/net/minecraft/server/packs/AbstractPackResources.java
@@ -119,4 +_,10 @@
@@ -120,4 +_,10 @@
public String m_8017_() {
return this.f_10203_.getName();
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/packs/VanillaPackResources.java
+++ b/net/minecraft/server/packs/VanillaPackResources.java
@@ -147,6 +_,9 @@
@@ -148,6 +_,9 @@
try {
Path path = f_182296_.get(p_215346_);
if (path != null) {
@@ -10,7 +10,7 @@
m_215357_(set, p_215347_, path, p_215348_, p_215349_);
} else {
f_10315_.error("Can't access assets root for type: {}", (Object)p_215346_);
@@ -209,7 +_,7 @@
@@ -210,7 +_,7 @@
try {
URL url = VanillaPackResources.class.getResource(s);
@@ -19,7 +19,7 @@
} catch (IOException ioexception) {
return VanillaPackResources.class.getResourceAsStream(s);
}
@@ -225,7 +_,7 @@
@@ -226,7 +_,7 @@
@Nullable
protected InputStream m_5539_(String p_10334_) {
@@ -28,7 +28,7 @@
}
public boolean m_7211_(PackType p_10355_, ResourceLocation p_10356_) {
@@ -300,11 +_,39 @@
@@ -301,11 +_,39 @@
public void close() {
}
@@ -7,4 +7,4 @@
+ p_203798_.forEach(resourcePack -> resourcePack.init(p_203797_));
List<String> list = p_203798_.stream().flatMap((p_215471_) -> {
return p_215471_.m_5698_(p_203797_).stream();
}).toList();
}).distinct().toList();
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -122,6 +_,7 @@
@@ -125,6 +_,7 @@
private boolean f_11209_;
private static final boolean f_143988_ = false;
private int f_11210_;
@@ -8,7 +8,7 @@
public PlayerList(MinecraftServer p_203842_, RegistryAccess.Frozen p_203843_, PlayerDataStorage p_203844_, int p_203845_) {
this.f_11195_ = p_203842_;
@@ -157,6 +_,7 @@
@@ -160,6 +_,7 @@
LevelData leveldata = serverlevel1.m_6106_();
p_11263_.m_143427_(compoundtag);
ServerGamePacketListenerImpl servergamepacketlistenerimpl = new ServerGamePacketListenerImpl(this.f_11195_, p_11262_, p_11263_);
@@ -16,7 +16,7 @@
GameRules gamerules = serverlevel1.m_46469_();
boolean flag = gamerules.m_46207_(GameRules.f_46156_);
boolean flag1 = gamerules.m_46207_(GameRules.f_46145_);
@@ -165,6 +_,7 @@
@@ -168,6 +_,7 @@
servergamepacketlistenerimpl.m_9829_(new ClientboundChangeDifficultyPacket(leveldata.m_5472_(), leveldata.m_5474_()));
servergamepacketlistenerimpl.m_9829_(new ClientboundPlayerAbilitiesPacket(p_11263_.m_150110_()));
servergamepacketlistenerimpl.m_9829_(new ClientboundSetCarriedItemPacket(p_11263_.m_150109_().f_35977_));
@@ -24,16 +24,7 @@
servergamepacketlistenerimpl.m_9829_(new ClientboundUpdateRecipesPacket(this.f_11195_.m_129894_().m_44051_()));
servergamepacketlistenerimpl.m_9829_(new ClientboundUpdateTagsPacket(TagNetworkSerialization.m_203950_(this.f_11206_)));
this.m_11289_(p_11263_);
@@ -181,7 +_,7 @@
this.m_215627_(mutablecomponent.m_130940_(ChatFormatting.YELLOW), ChatType.f_130599_);
servergamepacketlistenerimpl.m_9774_(p_11263_.m_20185_(), p_11263_.m_20186_(), p_11263_.m_20189_(), p_11263_.m_146908_(), p_11263_.m_146909_());
- this.f_11196_.add(p_11263_);
+ this.addPlayer(p_11263_);
this.f_11197_.put(p_11263_.m_20148_(), p_11263_);
this.m_11268_(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, p_11263_));
@@ -237,6 +_,7 @@
@@ -240,6 +_,7 @@
}
p_11263_.m_143429_();
@@ -41,7 +32,7 @@
}
protected void m_11273_(ServerScoreboard p_11274_, ServerPlayer p_11275_) {
@@ -297,6 +_,7 @@
@@ -300,6 +_,7 @@
compoundtag1 = compoundtag;
p_11225_.m_20258_(compoundtag);
f_11188_.debug("loading single player");
@@ -49,7 +40,7 @@
} else {
compoundtag1 = this.f_11204_.m_78435_(p_11225_);
}
@@ -305,6 +_,7 @@
@@ -308,6 +_,7 @@
}
protected void m_6765_(ServerPlayer p_11277_) {
@@ -57,7 +48,7 @@
this.f_11204_.m_78433_(p_11277_);
ServerStatsCounter serverstatscounter = this.f_11202_.get(p_11277_.m_20148_());
if (serverstatscounter != null) {
@@ -319,6 +_,7 @@
@@ -322,6 +_,7 @@
}
public void m_11286_(ServerPlayer p_11287_) {
@@ -65,12 +56,7 @@
ServerLevel serverlevel = p_11287_.m_9236_();
p_11287_.m_36220_(Stats.f_12989_);
this.m_6765_(p_11287_);
@@ -455,10 +_,11 @@
this.m_11229_(serverplayer, serverlevel1);
this.m_11289_(serverplayer);
serverlevel1.m_8845_(serverplayer);
- this.f_11196_.add(serverplayer);
+ this.addPlayer(serverplayer);
@@ -462,6 +_,7 @@
this.f_11197_.put(serverplayer.m_20148_(), serverplayer);
serverplayer.m_143429_();
serverplayer.m_21153_(serverplayer.m_21223_());
@@ -78,7 +64,7 @@
if (flag2) {
serverplayer.f_8906_.m_9829_(new ClientboundSoundPacket(SoundEvents.f_12377_, SoundSource.BLOCKS, (double)blockpos.m_123341_(), (double)blockpos.m_123342_(), (double)blockpos.m_123343_(), 1.0F, 1.0F, serverlevel1.m_213780_().m_188505_()));
}
@@ -543,6 +_,7 @@
@@ -546,6 +_,7 @@
}
public void m_5749_(GameProfile p_11254_) {
@@ -86,7 +72,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) {
@@ -552,6 +_,7 @@
@@ -555,6 +_,7 @@
}
public void m_5750_(GameProfile p_11281_) {
@@ -94,7 +80,7 @@
this.f_11200_.m_11393_(p_11281_);
ServerPlayer serverplayer = this.m_11259_(p_11281_.getId());
if (serverplayer != null) {
@@ -770,13 +_,6 @@
@@ -784,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 +94,7 @@
serverstatscounter = new ServerStatsCounter(this.f_11195_, file2);
this.f_11202_.put(uuid, serverstatscounter);
@@ -795,6 +_,8 @@
@@ -809,6 +_,8 @@
this.f_11203_.put(uuid, playeradvancements);
}
@@ -117,7 +103,7 @@
playeradvancements.m_135979_(p_11297_);
return playeradvancements;
}
@@ -824,7 +_,7 @@
@@ -838,7 +_,7 @@
}
public List<ServerPlayer> m_11314_() {
@@ -126,7 +112,7 @@
}
@Nullable
@@ -841,6 +_,7 @@
@@ -855,6 +_,7 @@
playeradvancements.m_135981_(this.f_11195_.m_129889_());
}
@@ -134,17 +120,3 @@
this.m_11268_(new ClientboundUpdateTagsPacket(TagNetworkSerialization.m_203950_(this.f_11206_)));
ClientboundUpdateRecipesPacket clientboundupdaterecipespacket = new ClientboundUpdateRecipesPacket(this.f_11195_.m_129894_().m_44051_());
@@ -853,5 +_,13 @@
public boolean m_11316_() {
return this.f_11209_;
+ }
+
+ public boolean addPlayer(ServerPlayer player) {
+ return f_11196_.add(player);
+ }
+
+ public boolean removePlayer(ServerPlayer player) {
+ return this.f_11196_.remove(player);
}
}
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/rcon/thread/RconClient.java
+++ b/net/minecraft/server/rcon/thread/RconClient.java
@@ -125,13 +_,14 @@
@@ -126,13 +_,14 @@
}
private void m_11594_(int p_11595_, String p_11596_) throws IOException {
@@ -0,0 +1,20 @@
--- a/net/minecraft/util/datafix/schemas/V2832.java
+++ b/net/minecraft/util/datafix/schemas/V2832.java
@@ -19,7 +_,7 @@
return DSL.fields("Level", DSL.optionalFields("Entities", DSL.list(References.f_16785_.in(p_185234_)), "TileEntities", DSL.list(DSL.or(References.f_16781_.in(p_185234_), DSL.remainder())), "TileTicks", DSL.list(DSL.fields("i", References.f_16787_.in(p_185234_))), "Sections", DSL.list(DSL.optionalFields("biomes", DSL.optionalFields("palette", DSL.list(References.f_16794_.in(p_185234_))), "block_states", DSL.optionalFields("palette", DSL.list(References.f_16783_.in(p_185234_))))), "Structures", DSL.optionalFields("Starts", DSL.compoundList(References.f_16790_.in(p_185234_)))));
});
p_185234_.registerType(false, References.f_16795_, () -> {
- return DSL.fields("dimensions", DSL.compoundList(DSL.constType(m_17310_()), DSL.fields("generator", DSL.taggedChoiceLazy("type", DSL.string(), ImmutableMap.of("minecraft:debug", DSL::remainder, "minecraft:flat", () -> {
+ return DSL.fields("dimensions", DSL.compoundList(DSL.constType(m_17310_()), DSL.fields("generator", DSL.or(DSL.taggedChoiceLazy("type", DSL.string(), ImmutableMap.of("minecraft:debug", DSL::remainder, "minecraft:flat", () -> {
return DSL.optionalFields("settings", DSL.optionalFields("biome", References.f_16794_.in(p_185234_), "layers", DSL.list(DSL.optionalFields("block", References.f_16787_.in(p_185234_)))));
}, "minecraft:noise", () -> {
return DSL.optionalFields("biome_source", DSL.taggedChoiceLazy("type", DSL.string(), ImmutableMap.of("minecraft:fixed", () -> {
@@ -29,7 +_,7 @@
}, "minecraft:checkerboard", () -> {
return DSL.fields("biomes", DSL.list(References.f_16794_.in(p_185234_)));
}, "minecraft:the_end", DSL::remainder)), "settings", DSL.or(DSL.constType(DSL.string()), DSL.optionalFields("default_block", References.f_16787_.in(p_185234_), "default_fluid", References.f_16787_.in(p_185234_))));
- })))));
+ })), DSL.remainder()))));
});
}
}
@@ -160,7 +160,7 @@
this.m_5496_(soundtype.m_56776_(), soundtype.m_56773_() * 0.15F, soundtype.m_56774_());
}
}
@@ -1068,19 +_,22 @@
@@ -1063,19 +_,22 @@
public void m_5844_() {
if (this.m_6069_()) {
@@ -188,7 +188,7 @@
}
void m_20074_() {
@@ -1103,6 +_,7 @@
@@ -1098,6 +_,7 @@
private void m_20323_() {
this.f_19800_ = this.m_204029_(FluidTags.f_13131_);
this.f_19801_.clear();
@@ -196,7 +196,7 @@
double d0 = this.m_20188_() - (double)0.11111111F;
Entity entity = this.m_20202_();
if (entity instanceof Boat boat) {
@@ -1115,7 +_,7 @@
@@ -1110,7 +_,7 @@
FluidState fluidstate = this.f_19853_.m_6425_(blockpos);
double d1 = (double)((float)blockpos.m_123342_() + fluidstate.m_76155_(this.f_19853_, blockpos));
if (d1 > d0) {
@@ -205,7 +205,7 @@
}
}
@@ -1159,7 +_,7 @@
@@ -1154,7 +_,7 @@
}
public boolean m_5843_() {
@@ -214,7 +214,7 @@
}
protected void m_20076_() {
@@ -1168,19 +_,23 @@
@@ -1163,19 +_,23 @@
int k = Mth.m_14107_(this.m_20189_());
BlockPos blockpos = new BlockPos(i, j, k);
BlockState blockstate = this.f_19853_.m_8055_(blockpos);
@@ -240,7 +240,7 @@
}
public void m_19920_(float p_19921_, Vec3 p_19922_) {
@@ -1494,6 +_,8 @@
@@ -1489,6 +_,8 @@
p_20241_.m_128379_("HasVisualFire", this.f_146813_);
}
@@ -249,7 +249,7 @@
if (!this.f_19841_.isEmpty()) {
ListTag listtag = new ListTag();
@@ -1504,6 +_,10 @@
@@ -1499,6 +_,10 @@
p_20241_.m_128365_("Tags", listtag);
}
@@ -260,7 +260,7 @@
this.m_7380_(p_20241_);
if (this.m_20160_()) {
ListTag listtag1 = new ListTag();
@@ -1578,6 +_,9 @@
@@ -1574,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");
@@ -270,7 +270,7 @@
if (p_20259_.m_128425_("Tags", 9)) {
this.f_19841_.clear();
ListTag listtag3 = p_20259_.m_128437_("Tags", 8);
@@ -1666,6 +_,8 @@
@@ -1662,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_();
@@ -279,7 +279,7 @@
this.f_19853_.m_7967_(itementity);
return itementity;
}
@@ -1702,6 +_,7 @@
@@ -1698,6 +_,7 @@
public void m_6083_() {
this.m_20256_(Vec3.f_82478_);
@@ -287,7 +287,7 @@
this.m_8119_();
if (this.m_20159_()) {
this.m_20202_().m_7332_(this);
@@ -1748,6 +_,7 @@
@@ -1744,6 +_,7 @@
}
}
@@ -295,7 +295,7 @@
if (p_19967_ || this.m_7341_(p_19966_) && p_19966_.m_7310_(this)) {
if (this.m_20159_()) {
this.m_8127_();
@@ -1786,6 +_,7 @@
@@ -1782,6 +_,7 @@
public void m_6038_() {
if (this.f_19824_ != null) {
Entity entity = this.f_19824_;
@@ -303,7 +303,7 @@
this.f_19824_ = null;
entity.m_20351_(this);
}
@@ -1961,6 +_,8 @@
@@ -1957,6 +_,8 @@
return !this.f_19823_.isEmpty();
}
@@ -312,7 +312,7 @@
public boolean m_6146_() {
return true;
}
@@ -2010,7 +_,7 @@
@@ -2006,7 +_,7 @@
}
public boolean m_20143_() {
@@ -321,7 +321,7 @@
}
public void m_20282_(boolean p_20283_) {
@@ -2116,7 +_,7 @@
@@ -2112,7 +_,7 @@
this.m_20254_(8);
}
@@ -330,7 +330,7 @@
}
public void m_6845_(boolean p_20313_) {
@@ -2205,7 +_,7 @@
@@ -2201,7 +_,7 @@
}
protected Component m_5677_() {
@@ -339,7 +339,7 @@
}
public boolean m_7306_(Entity p_20356_) {
@@ -2261,14 +_,20 @@
@@ -2257,14 +_,20 @@
@Nullable
public Entity m_5489_(ServerLevel p_20118_) {
@@ -361,7 +361,7 @@
this.f_19853_.m_46473_().m_6182_("reloading");
Entity entity = this.m_6095_().m_20615_(p_20118_);
if (entity != null) {
@@ -2276,17 +_,19 @@
@@ -2272,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);
@@ -383,7 +383,7 @@
}
} else {
return null;
@@ -2408,6 +_,7 @@
@@ -2404,6 +_,7 @@
return this.f_19821_;
}
@@ -391,7 +391,7 @@
public boolean m_6063_() {
return true;
}
@@ -2487,8 +_,10 @@
@@ -2483,8 +_,10 @@
EntityDimensions entitydimensions = this.f_19815_;
Pose pose = this.m_20089_();
EntityDimensions entitydimensions1 = this.m_6972_(pose);
@@ -403,7 +403,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)) {
@@ -2496,8 +_,9 @@
@@ -2492,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));
@@ -414,7 +414,7 @@
});
}
@@ -2772,9 +_,17 @@
@@ -2768,9 +_,17 @@
this.f_19859_ = this.m_146908_();
}
@@ -433,7 +433,7 @@
} else {
AABB aabb = this.m_20191_().m_82406_(0.001D);
int i = Mth.m_14107_(aabb.f_82288_);
@@ -2789,25 +_,28 @@
@@ -2785,25 +_,28 @@
Vec3 vec3 = Vec3.f_82478_;
int k1 = 0;
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
@@ -469,7 +469,7 @@
}
}
}
@@ -2815,27 +_,28 @@
@@ -2811,27 +_,28 @@
}
}
@@ -508,7 +508,7 @@
}
}
@@ -2848,7 +_,10 @@
@@ -2844,7 +_,10 @@
return !this.f_19853_.m_151572_(i, k, j, l);
}
@@ -519,7 +519,7 @@
return this.f_19799_.getDouble(p_204037_);
}
@@ -2974,6 +_,7 @@
@@ -2970,6 +_,7 @@
this.f_146801_.m_142044_();
}
@@ -527,7 +527,7 @@
}
@@ -3089,6 +_,103 @@
@@ -3085,6 +_,103 @@
public boolean m_142265_(Level p_146843_, BlockPos p_146844_) {
return true;
}
@@ -472,7 +472,7 @@
super.m_8119_();
this.m_21329_();
this.m_21333_();
@@ -2352,6 +_,7 @@
@@ -2355,6 +_,7 @@
ItemStack itemstack1 = this.m_6844_(equipmentslot);
if (!ItemStack.m_41728_(itemstack1, itemstack)) {
@@ -480,7 +480,7 @@
if (map == null) {
map = Maps.newEnumMap(EquipmentSlot.class);
}
@@ -2502,6 +_,8 @@
@@ -2505,6 +_,8 @@
this.f_19853_.m_46473_().m_6180_("jump");
if (this.f_20899_ && this.m_6129_()) {
double d7;
@@ -489,7 +489,7 @@
if (this.m_20077_()) {
d7 = this.m_204036_(FluidTags.f_13132_);
} else {
@@ -2512,15 +_,17 @@
@@ -2515,15 +_,17 @@
double d8 = this.m_20204_();
if (!flag1 || this.f_19861_ && !(d7 > d8)) {
if (!this.m_20077_() || this.f_19861_ && !(d7 > d8)) {
@@ -509,7 +509,7 @@
}
} else {
this.f_20954_ = 0;
@@ -2575,6 +_,8 @@
@@ -2578,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);
@@ -518,7 +518,7 @@
if (itemstack.m_150930_(Items.f_42741_) && ElytraItem.m_41140_(itemstack)) {
flag = true;
int i = this.f_20937_ + 1;
@@ -2806,8 +_,16 @@
@@ -2809,8 +_,16 @@
private void m_21329_() {
if (this.m_6117_()) {
@@ -537,7 +537,7 @@
this.m_142106_(this.f_20935_);
} else {
this.m_5810_();
@@ -2830,7 +_,7 @@
@@ -2833,7 +_,7 @@
private boolean m_21332_() {
int i = this.m_21212_();
@@ -546,7 +546,7 @@
boolean flag = foodproperties != null && foodproperties.m_38748_();
flag |= i <= this.f_20935_.m_41779_() - 7;
return flag && i % 4 == 0;
@@ -2860,8 +_,10 @@
@@ -2863,8 +_,10 @@
public void m_6672_(InteractionHand p_21159_) {
ItemStack itemstack = this.m_21120_(p_21159_);
if (!itemstack.m_41619_() && !this.m_6117_()) {
@@ -558,7 +558,7 @@
if (!this.f_19853_.f_46443_) {
this.m_21155_(1, true);
this.m_21155_(2, p_21159_ == InteractionHand.OFF_HAND);
@@ -2922,6 +_,9 @@
@@ -2925,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_());
@@ -568,7 +568,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_);
}
@@ -2935,7 +_,8 @@
@@ -2938,7 +_,8 @@
} else {
if (!this.f_20935_.m_41619_() && this.m_6117_()) {
this.m_21137_(this.f_20935_, 16);
@@ -578,7 +578,7 @@
if (itemstack != this.f_20935_) {
this.m_21008_(interactionhand, itemstack);
}
@@ -2961,7 +_,11 @@
@@ -2964,7 +_,11 @@
public void m_21253_() {
if (!this.f_20935_.m_41619_()) {
@@ -590,7 +590,16 @@
if (this.f_20935_.m_41781_()) {
this.m_21329_();
}
@@ -3112,8 +_,8 @@
@@ -2989,7 +_,7 @@
public boolean m_21254_() {
if (this.m_6117_() && !this.f_20935_.m_41619_()) {
Item item = this.f_20935_.m_41720_();
- if (item.m_6164_(this.f_20935_) != UseAnim.BLOCK) {
+ if (item.m_6164_(this.f_20935_) != UseAnim.BLOCK && !this.f_20935_.canPerformAction(net.minecraftforge.common.ToolActions.SHIELD_BLOCK)) { // TODO 1.20 only use the tool action
return false;
} else {
return item.m_8105_(this.f_20935_) - this.f_20936_ >= 5;
@@ -3115,8 +_,8 @@
}
BlockState blockstate = this.f_19853_.m_8055_(p_21141_);
@@ -601,7 +610,7 @@
}
this.m_20124_(Pose.SLEEPING);
@@ -3129,15 +_,15 @@
@@ -3132,15 +_,15 @@
private boolean m_21334_() {
return this.m_21257_().map((p_147236_) -> {
@@ -620,7 +629,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);
@@ -3159,7 +_,9 @@
@@ -3162,7 +_,9 @@
@Nullable
public Direction m_21259_() {
BlockPos blockpos = this.m_21257_().orElse((BlockPos)null);
@@ -631,7 +640,7 @@
}
public boolean m_5830_() {
@@ -3175,7 +_,7 @@
@@ -3178,7 +_,7 @@
}
public ItemStack m_6298_(ItemStack p_21272_) {
@@ -640,7 +649,7 @@
}
public ItemStack m_5584_(Level p_21067_, ItemStack p_21068_) {
@@ -3195,7 +_,7 @@
@@ -3198,7 +_,7 @@
private void m_21063_(ItemStack p_21064_, Level p_21065_, LivingEntity p_21066_) {
Item item = p_21064_.m_41720_();
if (item.m_41472_()) {
@@ -649,7 +658,7 @@
if (!p_21065_.f_46443_ && pair.getFirst() != null && p_21065_.f_46441_.m_188501_() < pair.getSecond()) {
p_21066_.m_7292_(new MobEffectInstance(pair.getFirst()));
}
@@ -3231,6 +_,64 @@
@@ -3234,6 +_,64 @@
this.m_21166_(p_21191_ == InteractionHand.MAIN_HAND ? EquipmentSlot.MAINHAND : EquipmentSlot.OFFHAND);
}
@@ -714,7 +723,7 @@
public AABB m_6921_() {
if (this.m_6844_(EquipmentSlot.HEAD).m_150930_(Items.f_42683_)) {
float f = 0.5F;
@@ -3241,6 +_,8 @@
@@ -3244,6 +_,8 @@
}
public static EquipmentSlot m_147233_(ItemStack p_147234_) {
@@ -723,7 +732,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) {
@@ -3248,7 +_,7 @@
@@ -3251,7 +_,7 @@
} else if (p_147234_.m_150930_(Items.f_42741_)) {
return EquipmentSlot.CHEST;
} else {
@@ -1,7 +1,7 @@
--- a/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java
+++ b/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java
@@ -81,11 +_,12 @@
private static final Map<EntityType<? extends LivingEntity>, AttributeSupplier> f_22294_ = ImmutableMap.<EntityType<? extends LivingEntity>, AttributeSupplier>builder().put(EntityType.f_217014_, Allay.m_218388_().m_22265_()).put(EntityType.f_20529_, LivingEntity.m_21183_().m_22265_()).put(EntityType.f_147039_, Axolotl.m_149176_().m_22265_()).put(EntityType.f_20549_, Bat.m_27455_().m_22265_()).put(EntityType.f_20550_, Bee.m_27858_().m_22265_()).put(EntityType.f_20551_, Blaze.m_32238_().m_22265_()).put(EntityType.f_20553_, Cat.m_28168_().m_22265_()).put(EntityType.f_20554_, CaveSpider.m_32267_().m_22265_()).put(EntityType.f_20555_, Chicken.m_28263_().m_22265_()).put(EntityType.f_20556_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20557_, Cow.m_28307_().m_22265_()).put(EntityType.f_20558_, Creeper.m_32318_().m_22265_()).put(EntityType.f_20559_, Dolphin.m_28379_().m_22265_()).put(EntityType.f_20560_, AbstractChestedHorse.m_30501_().m_22265_()).put(EntityType.f_20562_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20563_, ElderGuardian.m_32471_().m_22265_()).put(EntityType.f_20566_, EnderMan.m_32541_().m_22265_()).put(EntityType.f_20567_, Endermite.m_32619_().m_22265_()).put(EntityType.f_20565_, EnderDragon.m_31167_().m_22265_()).put(EntityType.f_20568_, Evoker.m_32657_().m_22265_()).put(EntityType.f_20452_, Fox.m_28553_().m_22265_()).put(EntityType.f_217012_, Frog.m_218525_().m_22265_()).put(EntityType.f_20453_, Ghast.m_32752_().m_22265_()).put(EntityType.f_20454_, Giant.m_32796_().m_22265_()).put(EntityType.f_147034_, GlowSquid.m_29988_().m_22265_()).put(EntityType.f_147035_, Goat.m_149401_().m_22265_()).put(EntityType.f_20455_, Guardian.m_32471_().m_22265_()).put(EntityType.f_20456_, Hoglin.m_34551_().m_22265_()).put(EntityType.f_20457_, AbstractHorse.m_30627_().m_22265_()).put(EntityType.f_20458_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20459_, Illusioner.m_32931_().m_22265_()).put(EntityType.f_20460_, IronGolem.m_28883_().m_22265_()).put(EntityType.f_20466_, Llama.m_30824_().m_22265_()).put(EntityType.f_20468_, MagmaCube.m_33000_().m_22265_()).put(EntityType.f_20504_, Cow.m_28307_().m_22265_()).put(EntityType.f_20503_, AbstractChestedHorse.m_30501_().m_22265_()).put(EntityType.f_20505_, Ocelot.m_29036_().m_22265_()).put(EntityType.f_20507_, Panda.m_29157_().m_22265_()).put(EntityType.f_20508_, Parrot.m_29438_().m_22265_()).put(EntityType.f_20509_, Monster.m_33035_().m_22265_()).put(EntityType.f_20510_, Pig.m_29503_().m_22265_()).put(EntityType.f_20511_, Piglin.m_34770_().m_22265_()).put(EntityType.f_20512_, PiglinBrute.m_35075_().m_22265_()).put(EntityType.f_20513_, Pillager.m_33307_().m_22265_()).put(EntityType.f_20532_, Player.m_36340_().m_22265_()).put(EntityType.f_20514_, PolarBear.m_29560_().m_22265_()).put(EntityType.f_20516_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20517_, Rabbit.m_29717_().m_22265_()).put(EntityType.f_20518_, Ravager.m_33371_().m_22265_()).put(EntityType.f_20519_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20520_, Sheep.m_29873_().m_22265_()).put(EntityType.f_20521_, Shulker.m_33477_().m_22265_()).put(EntityType.f_20523_, Silverfish.m_33551_().m_22265_()).put(EntityType.f_20524_, AbstractSkeleton.m_32166_().m_22265_()).put(EntityType.f_20525_, SkeletonHorse.m_30918_().m_22265_()).put(EntityType.f_20526_, Monster.m_33035_().m_22265_()).put(EntityType.f_20528_, SnowGolem.m_29934_().m_22265_()).put(EntityType.f_20479_, Spider.m_33815_().m_22265_()).put(EntityType.f_20480_, Squid.m_29988_().m_22265_()).put(EntityType.f_20481_, AbstractSkeleton.m_32166_().m_22265_()).put(EntityType.f_20482_, Strider.m_33937_().m_22265_()).put(EntityType.f_217013_, Tadpole.m_27495_().m_22265_()).put(EntityType.f_20488_, Llama.m_30824_().m_22265_()).put(EntityType.f_20489_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20490_, Turtle.m_30207_().m_22265_()).put(EntityType.f_20491_, Vex.m_34040_().m_22265_()).put(EntityType.f_20492_, Villager.m_35503_().m_22265_()).put(EntityType.f_20493_, Vindicator.m_34104_().m_22265_()).put(EntityType.f_217015_, Warden.m_219463_().m_22265_()).put(EntityType.f_20494_, Mob.m_21552_().m_22265_()).put(EntityType.f_20495_, Witch.m_34155_().m_22265_()).put(EntityType.f_20496_, WitherBoss.m_31501_().m_22265_()).put(EntityType.f_20497_, AbstractSkeleton.m_32166_().m_22265_()).put(EntityType.f_20499_, Wolf.m_30425_().m_22265_()).put(EntityType.f_20500_, Zoglin.m_34257_().m_22265_()).put(EntityType.f_20501_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20502_, ZombieHorse.m_31008_().m_22265_()).put(EntityType.f_20530_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20531_, ZombifiedPiglin.m_34328_().m_22265_()).build();
private static final Map<EntityType<? extends LivingEntity>, AttributeSupplier> f_22294_ = ImmutableMap.<EntityType<? extends LivingEntity>, AttributeSupplier>builder().put(EntityType.f_217014_, Allay.m_218388_().m_22265_()).put(EntityType.f_20529_, LivingEntity.m_21183_().m_22265_()).put(EntityType.f_147039_, Axolotl.m_149176_().m_22265_()).put(EntityType.f_20549_, Bat.m_27455_().m_22265_()).put(EntityType.f_20550_, Bee.m_27858_().m_22265_()).put(EntityType.f_20551_, Blaze.m_32238_().m_22265_()).put(EntityType.f_20553_, Cat.m_28168_().m_22265_()).put(EntityType.f_20554_, CaveSpider.m_32267_().m_22265_()).put(EntityType.f_20555_, Chicken.m_28263_().m_22265_()).put(EntityType.f_20556_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20557_, Cow.m_28307_().m_22265_()).put(EntityType.f_20558_, Creeper.m_32318_().m_22265_()).put(EntityType.f_20559_, Dolphin.m_28379_().m_22265_()).put(EntityType.f_20560_, AbstractChestedHorse.m_30501_().m_22265_()).put(EntityType.f_20562_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20563_, ElderGuardian.m_32471_().m_22265_()).put(EntityType.f_20566_, EnderMan.m_32541_().m_22265_()).put(EntityType.f_20567_, Endermite.m_32619_().m_22265_()).put(EntityType.f_20565_, EnderDragon.m_31167_().m_22265_()).put(EntityType.f_20568_, Evoker.m_32657_().m_22265_()).put(EntityType.f_20452_, Fox.m_28553_().m_22265_()).put(EntityType.f_217012_, Frog.m_218525_().m_22265_()).put(EntityType.f_20453_, Ghast.m_32752_().m_22265_()).put(EntityType.f_20454_, Giant.m_32796_().m_22265_()).put(EntityType.f_147034_, GlowSquid.m_29988_().m_22265_()).put(EntityType.f_147035_, Goat.m_149401_().m_22265_()).put(EntityType.f_20455_, Guardian.m_32853_().m_22265_()).put(EntityType.f_20456_, Hoglin.m_34551_().m_22265_()).put(EntityType.f_20457_, AbstractHorse.m_30627_().m_22265_()).put(EntityType.f_20458_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20459_, Illusioner.m_32931_().m_22265_()).put(EntityType.f_20460_, IronGolem.m_28883_().m_22265_()).put(EntityType.f_20466_, Llama.m_30824_().m_22265_()).put(EntityType.f_20468_, MagmaCube.m_33000_().m_22265_()).put(EntityType.f_20504_, Cow.m_28307_().m_22265_()).put(EntityType.f_20503_, AbstractChestedHorse.m_30501_().m_22265_()).put(EntityType.f_20505_, Ocelot.m_29036_().m_22265_()).put(EntityType.f_20507_, Panda.m_29157_().m_22265_()).put(EntityType.f_20508_, Parrot.m_29438_().m_22265_()).put(EntityType.f_20509_, Monster.m_33035_().m_22265_()).put(EntityType.f_20510_, Pig.m_29503_().m_22265_()).put(EntityType.f_20511_, Piglin.m_34770_().m_22265_()).put(EntityType.f_20512_, PiglinBrute.m_35075_().m_22265_()).put(EntityType.f_20513_, Pillager.m_33307_().m_22265_()).put(EntityType.f_20532_, Player.m_36340_().m_22265_()).put(EntityType.f_20514_, PolarBear.m_29560_().m_22265_()).put(EntityType.f_20516_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20517_, Rabbit.m_29717_().m_22265_()).put(EntityType.f_20518_, Ravager.m_33371_().m_22265_()).put(EntityType.f_20519_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20520_, Sheep.m_29873_().m_22265_()).put(EntityType.f_20521_, Shulker.m_33477_().m_22265_()).put(EntityType.f_20523_, Silverfish.m_33551_().m_22265_()).put(EntityType.f_20524_, AbstractSkeleton.m_32166_().m_22265_()).put(EntityType.f_20525_, SkeletonHorse.m_30918_().m_22265_()).put(EntityType.f_20526_, Monster.m_33035_().m_22265_()).put(EntityType.f_20528_, SnowGolem.m_29934_().m_22265_()).put(EntityType.f_20479_, Spider.m_33815_().m_22265_()).put(EntityType.f_20480_, Squid.m_29988_().m_22265_()).put(EntityType.f_20481_, AbstractSkeleton.m_32166_().m_22265_()).put(EntityType.f_20482_, Strider.m_33937_().m_22265_()).put(EntityType.f_217013_, Tadpole.m_218720_().m_22265_()).put(EntityType.f_20488_, Llama.m_30824_().m_22265_()).put(EntityType.f_20489_, AbstractFish.m_27495_().m_22265_()).put(EntityType.f_20490_, Turtle.m_30207_().m_22265_()).put(EntityType.f_20491_, Vex.m_34040_().m_22265_()).put(EntityType.f_20492_, Villager.m_35503_().m_22265_()).put(EntityType.f_20493_, Vindicator.m_34104_().m_22265_()).put(EntityType.f_217015_, Warden.m_219463_().m_22265_()).put(EntityType.f_20494_, Mob.m_21552_().m_22265_()).put(EntityType.f_20495_, Witch.m_34155_().m_22265_()).put(EntityType.f_20496_, WitherBoss.m_31501_().m_22265_()).put(EntityType.f_20497_, AbstractSkeleton.m_32166_().m_22265_()).put(EntityType.f_20499_, Wolf.m_30425_().m_22265_()).put(EntityType.f_20500_, Zoglin.m_34257_().m_22265_()).put(EntityType.f_20501_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20502_, ZombieHorse.m_31008_().m_22265_()).put(EntityType.f_20530_, Zombie.m_34328_().m_22265_()).put(EntityType.f_20531_, ZombifiedPiglin.m_34470_().m_22265_()).build();
public static AttributeSupplier m_22297_(EntityType<? extends LivingEntity> p_22298_) {
- return f_22294_.get(p_22298_);
Loaded 100 of 200 files, more files were not shown because too many files have changed in this diff. Show more