mirror of
https://github.com/MinecraftForge/MinecraftForge
synced 2026-08-22 04:26:10 -04:00
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 <sizableshrimp@sizableshrimp.me>
This commit is contained in:
parent
3c1126a7b4
commit
6845c094ab
98 changed files with 1025 additions and 733 deletions
29
build.gradle
29
build.gradle
|
|
@ -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,9 +36,10 @@ ext {
|
|||
]
|
||||
}
|
||||
MAPPING_CHANNEL = 'official'
|
||||
MAPPING_VERSION = '1.19'
|
||||
MC_VERSION = '1.19'
|
||||
MCP_VERSION = '20220607.102129'
|
||||
MAPPING_VERSION = '1.19.1'
|
||||
MC_VERSION = '1.19.1'
|
||||
MC_NEXT_VERSION = '1.20'
|
||||
MCP_VERSION = '20220727.212338'
|
||||
SPI_VERSION = '6.0.0'
|
||||
ACCESSTRANSFORMERS_VERSION = '8.0.4'
|
||||
COREMODS_VERSION = '5.0.1'
|
||||
|
|
@ -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
|
||||
|
|
@ -377,7 +378,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 +444,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 +464,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 +640,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 +1202,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 +1562,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'
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
|
@ -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
|
||||
|
|
|
|||
6
gradlew
vendored
6
gradlew
vendored
|
|
@ -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.
|
||||
|
|
|
|||
14
gradlew.bat
vendored
14
gradlew.bat
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 @@
|
||||
@@ -243,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 @@
|
||||
@@ -397,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 @@
|
||||
@@ -405,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 @@
|
||||
@@ -457,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 @@
|
||||
@@ -465,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 @@
|
||||
@@ -509,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 @@
|
||||
@@ -521,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 @@
|
||||
@@ -540,6 +_,19 @@
|
||||
TinyFileDialogs.tinyfd_messageBox("Minecraft", stringbuilder.toString(), "ok", "error", false);
|
||||
}
|
||||
|
||||
|
|
@ -85,29 +87,46 @@
|
|||
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 @@
|
||||
@@ -562,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 @@
|
||||
@@ -621,6 +_,8 @@
|
||||
|
||||
private UserApiService m_193585_(YggdrasilAuthenticationService p_193586_, GameConfig p_193587_) {
|
||||
try {
|
||||
|
|
@ -116,7 +135,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 @@
|
||||
@@ -633,7 +_,7 @@
|
||||
}
|
||||
|
||||
private void m_91239_(Throwable p_91240_) {
|
||||
|
|
@ -125,7 +144,7 @@
|
|||
this.m_91241_(p_91240_, (Component)null);
|
||||
} else {
|
||||
Util.m_137559_(p_91240_);
|
||||
@@ -762,13 +_,13 @@
|
||||
@@ -791,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 +161,7 @@
|
|||
}
|
||||
|
||||
}
|
||||
@@ -892,10 +_,6 @@
|
||||
@@ -921,10 +_,6 @@
|
||||
f_90982_.error("setScreen called from non-game thread");
|
||||
}
|
||||
|
||||
|
|
@ -153,7 +172,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 @@
|
||||
@@ -935,6 +_,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -173,7 +192,7 @@
|
|||
this.f_91080_ = p_91153_;
|
||||
BufferUploader.m_166835_();
|
||||
if (p_91153_ != null) {
|
||||
@@ -1049,11 +_,14 @@
|
||||
@@ -1078,11 +_,14 @@
|
||||
RenderSystem.m_69481_();
|
||||
this.f_91026_.m_7238_();
|
||||
if (!this.f_91079_) {
|
||||
|
|
@ -188,7 +207,7 @@
|
|||
}
|
||||
|
||||
if (this.f_91056_ != null) {
|
||||
@@ -1180,10 +_,12 @@
|
||||
@@ -1209,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 +220,7 @@
|
|||
this.f_91063_.m_109097_(this.f_90990_.m_85441_(), this.f_90990_.m_85442_());
|
||||
this.f_91067_.m_91599_();
|
||||
}
|
||||
@@ -1461,6 +_,7 @@
|
||||
@@ -1490,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_91395_() {
|
||||
|
|
@ -209,7 +228,7 @@
|
|||
this.f_91019_ = false;
|
||||
}
|
||||
|
||||
@@ -1490,10 +_,18 @@
|
||||
@@ -1519,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 +250,7 @@
|
|||
this.f_91074_.m_6674_(InteractionHand.MAIN_HAND);
|
||||
}
|
||||
}
|
||||
@@ -1518,14 +_,20 @@
|
||||
@@ -1547,14 +_,20 @@
|
||||
return false;
|
||||
} else {
|
||||
boolean flag = false;
|
||||
|
|
@ -254,7 +273,7 @@
|
|||
this.f_91072_.m_105269_(blockpos, blockhitresult.m_82434_());
|
||||
if (this.f_91073_.m_8055_(blockpos).m_60795_()) {
|
||||
flag = true;
|
||||
@@ -1538,8 +_,10 @@
|
||||
@@ -1567,8 +_,10 @@
|
||||
}
|
||||
|
||||
this.f_91074_.m_36334_();
|
||||
|
|
@ -265,7 +284,7 @@
|
|||
this.f_91074_.m_6674_(InteractionHand.MAIN_HAND);
|
||||
return flag;
|
||||
}
|
||||
@@ -1554,6 +_,11 @@
|
||||
@@ -1583,6 +_,11 @@
|
||||
}
|
||||
|
||||
for(InteractionHand interactionhand : InteractionHand.values()) {
|
||||
|
|
@ -277,7 +296,7 @@
|
|||
ItemStack itemstack = this.f_91074_.m_21120_(interactionhand);
|
||||
if (this.f_91077_ != null) {
|
||||
switch (this.f_91077_.m_6662_()) {
|
||||
@@ -1564,6 +_,7 @@
|
||||
@@ -1593,6 +_,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -285,7 +304,7 @@
|
|||
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 @@
|
||||
@@ -1600,6 +_,7 @@
|
||||
|
||||
if (interactionresult.m_19077_()) {
|
||||
if (interactionresult.m_19080_()) {
|
||||
|
|
@ -293,7 +312,7 @@
|
|||
this.f_91074_.m_6674_(interactionhand);
|
||||
}
|
||||
|
||||
@@ -1583,6 +_,7 @@
|
||||
@@ -1612,6 +_,7 @@
|
||||
InteractionResult interactionresult1 = this.f_91072_.m_233732_(this.f_91074_, interactionhand, blockhitresult);
|
||||
if (interactionresult1.m_19077_()) {
|
||||
if (interactionresult1.m_19080_()) {
|
||||
|
|
@ -301,7 +320,7 @@
|
|||
this.f_91074_.m_6674_(interactionhand);
|
||||
if (!itemstack.m_41619_() && (itemstack.m_41613_() != i || this.f_91072_.m_105290_())) {
|
||||
this.f_91063_.f_109055_.m_109320_(interactionhand);
|
||||
@@ -1598,6 +_,9 @@
|
||||
@@ -1627,6 +_,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -311,16 +330,16 @@
|
|||
if (!itemstack.m_41619_()) {
|
||||
InteractionResult interactionresult2 = this.f_91072_.m_233721_(this.f_91074_, interactionhand);
|
||||
if (interactionresult2.m_19077_()) {
|
||||
@@ -1624,6 +_,8 @@
|
||||
@@ -1653,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 @@
|
||||
@@ -1782,6 +_,8 @@
|
||||
this.f_91026_.m_6182_("keyboard");
|
||||
this.f_91068_.m_90931_();
|
||||
this.f_91026_.m_7238_();
|
||||
|
|
@ -329,18 +348,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 @@
|
||||
@@ -1976,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_91156_(ClientLevel p_91157_) {
|
||||
|
|
@ -348,20 +356,20 @@
|
|||
ProgressScreen progressscreen = new ProgressScreen(true);
|
||||
progressscreen.m_6309_(Component.m_237115_("connect.joining"));
|
||||
this.m_91362_(progressscreen);
|
||||
@@ -1978,10 +_,12 @@
|
||||
@@ -2009,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 @@
|
||||
@@ -2027,6 +_,7 @@
|
||||
this.f_91065_.m_93089_();
|
||||
this.f_91008_ = null;
|
||||
this.f_91010_ = false;
|
||||
|
|
@ -369,7 +377,7 @@
|
|||
this.f_91004_.m_90740_();
|
||||
}
|
||||
|
||||
@@ -2082,6 +_,7 @@
|
||||
@@ -2122,6 +_,7 @@
|
||||
|
||||
private void m_91280_() {
|
||||
if (this.f_91077_ != null && this.f_91077_.m_6662_() != HitResult.Type.MISS) {
|
||||
|
|
@ -377,7 +385,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 @@
|
||||
@@ -2134,10 +_,7 @@
|
||||
}
|
||||
|
||||
Block block = blockstate.m_60734_();
|
||||
|
|
@ -389,7 +397,7 @@
|
|||
|
||||
if (flag && Screen.m_96637_() && blockstate.m_155947_()) {
|
||||
blockentity = this.f_91073_.m_7702_(blockpos);
|
||||
@@ -2108,7 +_,7 @@
|
||||
@@ -2148,7 +_,7 @@
|
||||
}
|
||||
|
||||
Entity entity = ((EntityHitResult)this.f_91077_).m_82443_();
|
||||
|
|
@ -398,7 +406,7 @@
|
|||
if (itemstack == null) {
|
||||
return;
|
||||
}
|
||||
@@ -2632,8 +_,8 @@
|
||||
@@ -2686,8 +_,8 @@
|
||||
return this.f_90993_;
|
||||
}
|
||||
|
||||
|
|
@ -409,7 +417,7 @@
|
|||
Supplier<PackResources> supplier = p_167937_;
|
||||
if (i <= 3) {
|
||||
supplier = m_91330_(p_167937_);
|
||||
@@ -2643,7 +_,7 @@
|
||||
@@ -2697,7 +_,7 @@
|
||||
supplier = m_91352_(supplier);
|
||||
}
|
||||
|
||||
|
|
@ -418,7 +426,7 @@
|
|||
}
|
||||
|
||||
private static Supplier<PackResources> m_91330_(Supplier<PackResources> p_91331_) {
|
||||
@@ -2662,6 +_,14 @@
|
||||
@@ -2716,6 +_,14 @@
|
||||
this.f_91051_.m_119410_(p_91313_);
|
||||
}
|
||||
|
||||
|
|
@ -433,7 +441,7 @@
|
|||
public EntityModelSet m_167973_() {
|
||||
return this.f_167844_;
|
||||
}
|
||||
@@ -2719,4 +_,11 @@
|
||||
@@ -2789,4 +_,11 @@
|
||||
|
||||
public abstract boolean m_142594_(boolean p_168035_);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 @@
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,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_();
|
||||
|
|
|
|||
|
|
@ -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,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 @@
|
||||
@@ -84,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;
|
||||
@@ -70,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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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_);
|
||||
|
|
|
|||
|
|
@ -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,7 @@
|
|||
++this.f_109439_;
|
||||
if (entity.f_19797_ == 0) {
|
||||
entity.f_19790_ = entity.m_20185_();
|
||||
@@ -1225,6 +_,7 @@
|
||||
@@ -1226,6 +_,7 @@
|
||||
List<BlockEntity> list = levelrenderer$renderchunkinfo.f_109839_.m_112835_().m_112773_();
|
||||
if (!list.isEmpty()) {
|
||||
for(BlockEntity blockentity1 : list) {
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
BlockPos blockpos4 = blockentity1.m_58899_();
|
||||
MultiBufferSource multibuffersource1 = multibuffersource$buffersource;
|
||||
p_109600_.m_85836_();
|
||||
@@ -1250,6 +_,7 @@
|
||||
@@ -1251,6 +_,7 @@
|
||||
|
||||
synchronized(this.f_109468_) {
|
||||
for(BlockEntity blockentity : this.f_109468_) {
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
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 @@
|
||||
@@ -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 +77,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 +91,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 +101,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 +111,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 +119,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 +127,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 +135,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 +144,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 +153,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 +162,7 @@
|
|||
}
|
||||
|
||||
if (flag) {
|
||||
@@ -2399,7 +_,12 @@
|
||||
@@ -2400,7 +_,12 @@
|
||||
this.f_109469_.m_110859_(p_109502_, p_109503_, p_109504_, p_109505_);
|
||||
}
|
||||
|
||||
|
|
@ -175,7 +175,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 +184,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 +193,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 +202,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,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);
|
||||
|
|
|
|||
|
|
@ -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_) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -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_) {
|
||||
|
|
|
|||
|
|
@ -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,6 @@
|
|||
--- a/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -489,6 +_,7 @@
|
||||
@@ -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 +8,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 +23,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 +31,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 +39,7 @@
|
|||
}
|
||||
|
||||
}
|
||||
@@ -1104,7 +_,7 @@
|
||||
@@ -1105,7 +_,7 @@
|
||||
}
|
||||
|
||||
protected void m_140199_(Entity p_140200_) {
|
||||
|
|
@ -48,7 +48,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_);
|
||||
});
|
||||
@@ -1375,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_) -> {
|
||||
@@ -1524,11 +_,13 @@
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +91,7 @@
|
|||
if (interactionresult.m_19077_()) {
|
||||
CriteriaTriggers.f_10565_.m_61494_(ServerGamePacketListenerImpl.this.f_9743_, itemstack, entity);
|
||||
if (interactionresult.m_19080_()) {
|
||||
@@ -1409,7 +_,7 @@
|
||||
@@ -1550,7 +_,7 @@
|
||||
|
||||
public void m_141994_() {
|
||||
if (!(entity instanceof ItemEntity) && !(entity instanceof ExperienceOrb) && !(entity instanceof AbstractArrow) && entity != ServerGamePacketListenerImpl.this.f_9743_) {
|
||||
|
|
@ -76,7 +100,7 @@
|
|||
} 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 @@
|
||||
@@ -1749,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 @@
|
||||
@@ -69,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 @@
|
||||
@@ -194,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 @@
|
||||
@@ -238,7 +_,7 @@
|
||||
throw new IllegalStateException("Protocol error", cryptexception);
|
||||
}
|
||||
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
public void run() {
|
||||
GameProfile gameprofile = ServerLoginPacketListenerImpl.this.f_10021_;
|
||||
|
||||
@@ -243,11 +_,11 @@
|
||||
@@ -246,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 @@
|
||||
@@ -259,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 @@
|
||||
@@ -279,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 {
|
||||
|
|
|
|||
|
|
@ -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,7 @@
|
|||
if (this.f_20935_.m_41781_()) {
|
||||
this.m_21329_();
|
||||
}
|
||||
@@ -3112,8 +_,8 @@
|
||||
@@ -3115,8 +_,8 @@
|
||||
}
|
||||
|
||||
BlockState blockstate = this.f_19853_.m_8055_(p_21141_);
|
||||
|
|
@ -601,7 +601,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 +620,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 +631,7 @@
|
|||
}
|
||||
|
||||
public boolean m_5830_() {
|
||||
@@ -3175,7 +_,7 @@
|
||||
@@ -3178,7 +_,7 @@
|
||||
}
|
||||
|
||||
public ItemStack m_6298_(ItemStack p_21272_) {
|
||||
|
|
@ -640,7 +640,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 +649,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 +714,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 +723,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_);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
--- a/net/minecraft/world/entity/ai/village/poi/PoiTypes.java
|
||||
+++ b/net/minecraft/world/entity/ai/village/poi/PoiTypes.java
|
||||
@@ -47,8 +_,9 @@
|
||||
@@ -48,8 +_,9 @@
|
||||
private static final Set<BlockState> f_218069_ = ImmutableList.of(Blocks.f_50256_, Blocks.f_152477_, Blocks.f_152476_, Blocks.f_152478_).stream().flatMap((p_218093_) -> {
|
||||
return p_218093_.m_49965_().m_61056_().stream();
|
||||
}).collect(ImmutableSet.toImmutableSet());
|
||||
|
|
@ -12,14 +12,14 @@
|
|||
|
||||
private static Set<BlockState> m_218073_(Block p_218074_) {
|
||||
return ImmutableSet.copyOf(p_218074_.m_49965_().m_61056_());
|
||||
@@ -66,16 +_,10 @@
|
||||
@@ -67,16 +_,10 @@
|
||||
}
|
||||
|
||||
private static void m_218077_(Holder<PoiType> p_218078_) {
|
||||
- p_218078_.m_203334_().f_27325_().forEach((p_218081_) -> {
|
||||
- Holder<PoiType> holder = f_218070_.put(p_218081_, p_218078_);
|
||||
- if (holder != null) {
|
||||
- throw (IllegalStateException)Util.m_137570_(new IllegalStateException(String.format("%s is defined in more than one PoI type", p_218081_)));
|
||||
- throw (IllegalStateException)Util.m_137570_(new IllegalStateException(String.format(Locale.ROOT, "%s is defined in more than one PoI type", p_218081_)));
|
||||
- }
|
||||
- });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
+++ b/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
@@ -326,7 +_,7 @@
|
||||
|
||||
public boolean m_7243_(ItemStack p_218387_) {
|
||||
ItemStack itemstack = this.m_21120_(InteractionHand.MAIN_HAND);
|
||||
- return !itemstack.m_41619_() && itemstack.m_41726_(p_218387_) && this.f_218303_.m_19183_(p_218387_) && this.f_19853_.m_46469_().m_46207_(GameRules.f_46132_);
|
||||
+ return !itemstack.m_41619_() && itemstack.m_41726_(p_218387_) && this.f_218303_.m_19183_(p_218387_) && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.f_19853_, this);
|
||||
}
|
||||
|
||||
protected void m_7581_(ItemEntity p_218359_) {
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
}
|
||||
|
||||
private ItemEntity(ItemEntity p_31994_) {
|
||||
@@ -87,6 +_,7 @@
|
||||
@@ -86,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_8119_() {
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
if (this.m_32055_().m_41619_()) {
|
||||
this.m_146870_();
|
||||
} else {
|
||||
@@ -100,6 +_,9 @@
|
||||
@@ -99,6 +_,9 @@
|
||||
this.f_19856_ = this.m_20189_();
|
||||
Vec3 vec3 = this.m_20184_();
|
||||
float f = this.m_20192_() - 0.11111111F;
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
if (this.m_20069_() && this.m_204036_(FluidTags.f_13131_) > (double)f) {
|
||||
this.m_32067_();
|
||||
} else if (this.m_20077_() && this.m_204036_(FluidTags.f_13132_) > (double)f) {
|
||||
@@ -121,7 +_,7 @@
|
||||
@@ -120,7 +_,7 @@
|
||||
this.m_6478_(MoverType.SELF, this.m_20184_());
|
||||
float f1 = 0.98F;
|
||||
if (this.f_19861_) {
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
}
|
||||
|
||||
this.m_20256_(this.m_20184_().m_82542_((double)f1, 0.98D, (double)f1));
|
||||
@@ -151,7 +_,14 @@
|
||||
@@ -150,7 +_,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
this.m_146870_();
|
||||
}
|
||||
|
||||
@@ -209,6 +_,8 @@
|
||||
@@ -208,6 +_,8 @@
|
||||
return false;
|
||||
} else if (p_32028_.m_41782_() ^ p_32027_.m_41782_()) {
|
||||
return false;
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
} else {
|
||||
return !p_32028_.m_41782_() || p_32028_.m_41783_().equals(p_32027_.m_41783_());
|
||||
}
|
||||
@@ -242,6 +_,7 @@
|
||||
@@ -241,6 +_,7 @@
|
||||
}
|
||||
|
||||
public boolean m_6469_(DamageSource p_32013_, float p_32014_) {
|
||||
|
|
@ -79,7 +79,7 @@
|
|||
if (this.m_6673_(p_32013_)) {
|
||||
return false;
|
||||
} else if (!this.m_32055_().m_41619_() && this.m_32055_().m_150930_(Items.f_42686_) && p_32013_.m_19372_()) {
|
||||
@@ -255,7 +_,7 @@
|
||||
@@ -254,7 +_,7 @@
|
||||
this.f_31987_ = (int)((float)this.f_31987_ - p_32014_);
|
||||
this.m_146852_(GameEvent.f_223706_, p_32013_.m_7639_());
|
||||
if (this.f_31987_ <= 0) {
|
||||
|
|
@ -88,7 +88,7 @@
|
|||
this.m_146870_();
|
||||
}
|
||||
|
||||
@@ -267,6 +_,7 @@
|
||||
@@ -266,6 +_,7 @@
|
||||
p_32050_.m_128376_("Health", (short)this.f_31987_);
|
||||
p_32050_.m_128376_("Age", (short)this.f_31985_);
|
||||
p_32050_.m_128376_("PickupDelay", (short)this.f_31986_);
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
if (this.m_32057_() != null) {
|
||||
p_32050_.m_128362_("Thrower", this.m_32057_());
|
||||
}
|
||||
@@ -287,6 +_,7 @@
|
||||
@@ -286,6 +_,7 @@
|
||||
if (p_32034_.m_128441_("PickupDelay")) {
|
||||
this.f_31986_ = p_32034_.m_128448_("PickupDelay");
|
||||
}
|
||||
|
|
@ -104,7 +104,7 @@
|
|||
|
||||
if (p_32034_.m_128403_("Owner")) {
|
||||
this.f_31982_ = p_32034_.m_128342_("Owner");
|
||||
@@ -306,10 +_,18 @@
|
||||
@@ -305,10 +_,18 @@
|
||||
|
||||
public void m_6123_(Player p_32040_) {
|
||||
if (!this.f_19853_.f_46443_) {
|
||||
|
|
@ -124,7 +124,7 @@
|
|||
p_32040_.m_7938_(this, i);
|
||||
if (itemstack.m_41619_()) {
|
||||
this.m_146870_();
|
||||
@@ -333,8 +_,8 @@
|
||||
@@ -332,8 +_,8 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
|
@ -135,7 +135,7 @@
|
|||
if (!this.f_19853_.f_46443_ && entity instanceof ItemEntity) {
|
||||
((ItemEntity)entity).m_32069_();
|
||||
}
|
||||
@@ -410,7 +_,7 @@
|
||||
@@ -409,7 +_,7 @@
|
||||
|
||||
public void m_32065_() {
|
||||
this.m_32062_();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
this.m_34398_((ServerLevel)this.f_19853_);
|
||||
}
|
||||
}
|
||||
@@ -227,7 +_,7 @@
|
||||
@@ -228,7 +_,7 @@
|
||||
if (!this.m_20067_()) {
|
||||
p_34399_.m_5898_((Player)null, 1027, this.m_20183_(), 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
--- a/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/net/minecraft/world/entity/player/Player.java
|
||||
@@ -113,7 +_,8 @@
|
||||
@@ -114,7 +_,8 @@
|
||||
import net.minecraft.world.scores.Team;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
private static final Logger f_219722_ = LogUtils.getLogger();
|
||||
public static final int f_150082_ = 16;
|
||||
public static final int f_150083_ = 20;
|
||||
@@ -168,6 +_,9 @@
|
||||
@@ -169,6 +_,9 @@
|
||||
private Optional<GlobalPos> f_238176_ = Optional.empty();
|
||||
@Nullable
|
||||
public FishingHook f_36083_;
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
public Player(Level p_219727_, BlockPos p_219728_, float p_219729_, GameProfile p_219730_, @Nullable ProfilePublicKey p_219731_) {
|
||||
super(EntityType.f_20532_, p_219727_);
|
||||
@@ -194,7 +_,7 @@
|
||||
@@ -195,7 +_,7 @@
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder m_36340_() {
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
}
|
||||
|
||||
protected void m_8097_() {
|
||||
@@ -208,6 +_,7 @@
|
||||
@@ -209,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_8119_() {
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
this.f_19794_ = this.m_5833_();
|
||||
if (this.m_5833_()) {
|
||||
this.f_19861_ = false;
|
||||
@@ -223,7 +_,7 @@
|
||||
@@ -224,7 +_,7 @@
|
||||
this.f_36110_ = 100;
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
this.m_6145_(false, true);
|
||||
}
|
||||
} else if (this.f_36110_ > 0) {
|
||||
@@ -279,6 +_,7 @@
|
||||
@@ -280,6 +_,7 @@
|
||||
this.m_36372_();
|
||||
this.f_36087_.m_41518_();
|
||||
this.m_7594_();
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
}
|
||||
|
||||
public boolean m_36341_() {
|
||||
@@ -354,6 +_,10 @@
|
||||
@@ -355,6 +_,10 @@
|
||||
}
|
||||
|
||||
protected void m_7594_() {
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
if (this.m_20175_(Pose.SWIMMING)) {
|
||||
Pose pose;
|
||||
if (this.m_21255_()) {
|
||||
@@ -577,6 +_,7 @@
|
||||
@@ -578,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_6667_(DamageSource p_36152_) {
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
super.m_6667_(p_36152_);
|
||||
this.m_20090_();
|
||||
if (!this.m_5833_()) {
|
||||
@@ -634,7 +_,7 @@
|
||||
@@ -635,7 +_,7 @@
|
||||
|
||||
@Nullable
|
||||
public ItemEntity m_36176_(ItemStack p_36177_, boolean p_36178_) {
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
}
|
||||
|
||||
@Nullable
|
||||
@@ -672,7 +_,12 @@
|
||||
@@ -673,7 +_,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -95,7 +95,7 @@
|
|||
float f = this.f_36093_.m_36020_(p_36282_);
|
||||
if (f > 1.0F) {
|
||||
int i = EnchantmentHelper.m_44926_(this);
|
||||
@@ -714,11 +_,12 @@
|
||||
@@ -715,11 +_,12 @@
|
||||
f /= 5.0F;
|
||||
}
|
||||
|
||||
|
|
@ -109,7 +109,7 @@
|
|||
}
|
||||
|
||||
public void m_7378_(CompoundTag p_36215_) {
|
||||
@@ -813,6 +_,7 @@
|
||||
@@ -814,6 +_,7 @@
|
||||
}
|
||||
|
||||
public boolean m_6469_(DamageSource p_36154_, float p_36155_) {
|
||||
|
|
@ -117,7 +117,7 @@
|
|||
if (this.m_6673_(p_36154_)) {
|
||||
return false;
|
||||
} else if (this.f_36077_.f_35934_ && !p_36154_.m_19378_()) {
|
||||
@@ -847,7 +_,7 @@
|
||||
@@ -848,7 +_,7 @@
|
||||
|
||||
protected void m_6728_(LivingEntity p_36295_) {
|
||||
super.m_6728_(p_36295_);
|
||||
|
|
@ -126,7 +126,7 @@
|
|||
this.m_36384_(true);
|
||||
}
|
||||
|
||||
@@ -876,7 +_,7 @@
|
||||
@@ -877,7 +_,7 @@
|
||||
}
|
||||
|
||||
protected void m_7909_(float p_36383_) {
|
||||
|
|
@ -135,7 +135,7 @@
|
|||
if (!this.f_19853_.f_46443_) {
|
||||
this.m_36246_(Stats.f_12982_.m_12902_(this.f_20935_.m_41720_()));
|
||||
}
|
||||
@@ -886,6 +_,7 @@
|
||||
@@ -887,6 +_,7 @@
|
||||
InteractionHand interactionhand = this.m_7655_();
|
||||
this.f_20935_.m_41622_(i, this, (p_219739_) -> {
|
||||
p_219739_.m_21190_(interactionhand);
|
||||
|
|
@ -143,7 +143,7 @@
|
|||
});
|
||||
if (this.f_20935_.m_41619_()) {
|
||||
if (interactionhand == InteractionHand.MAIN_HAND) {
|
||||
@@ -904,10 +_,13 @@
|
||||
@@ -905,10 +_,13 @@
|
||||
|
||||
protected void m_6475_(DamageSource p_36312_, float p_36313_) {
|
||||
if (!this.m_6673_(p_36312_)) {
|
||||
|
|
@ -157,7 +157,7 @@
|
|||
float f = p_36313_ - f2;
|
||||
if (f > 0.0F && f < 3.4028235E37F) {
|
||||
this.m_36222_(Stats.f_12933_, Math.round(f * 10.0F));
|
||||
@@ -916,8 +_,8 @@
|
||||
@@ -917,8 +_,8 @@
|
||||
if (f2 != 0.0F) {
|
||||
this.m_36399_(p_36312_.m_19377_());
|
||||
float f1 = this.m_21223_();
|
||||
|
|
@ -167,7 +167,7 @@
|
|||
if (f2 < 3.4028235E37F) {
|
||||
this.m_36222_(Stats.f_12931_, Math.round(f2 * 10.0F));
|
||||
}
|
||||
@@ -966,6 +_,8 @@
|
||||
@@ -967,6 +_,8 @@
|
||||
|
||||
return InteractionResult.PASS;
|
||||
} else {
|
||||
|
|
@ -176,7 +176,7 @@
|
|||
ItemStack itemstack = this.m_21120_(p_36159_);
|
||||
ItemStack itemstack1 = itemstack.m_41777_();
|
||||
InteractionResult interactionresult = p_36158_.m_6096_(this, p_36159_);
|
||||
@@ -974,6 +_,9 @@
|
||||
@@ -975,6 +_,9 @@
|
||||
itemstack.m_41764_(itemstack1.m_41613_());
|
||||
}
|
||||
|
||||
|
|
@ -186,7 +186,7 @@
|
|||
return interactionresult;
|
||||
} else {
|
||||
if (!itemstack.m_41619_() && p_36158_ instanceof LivingEntity) {
|
||||
@@ -984,6 +_,7 @@
|
||||
@@ -985,6 +_,7 @@
|
||||
InteractionResult interactionresult1 = itemstack.m_41647_(this, (LivingEntity)p_36158_, p_36159_);
|
||||
if (interactionresult1.m_19077_()) {
|
||||
if (itemstack.m_41619_() && !this.f_36077_.f_35937_) {
|
||||
|
|
@ -194,7 +194,7 @@
|
|||
this.m_21008_(p_36159_, ItemStack.f_41583_);
|
||||
}
|
||||
|
||||
@@ -1019,7 +_,7 @@
|
||||
@@ -1020,7 +_,7 @@
|
||||
double d1 = p_36201_.f_82481_;
|
||||
double d2 = 0.05D;
|
||||
|
||||
|
|
@ -203,7 +203,7 @@
|
|||
if (d0 < 0.05D && d0 >= -0.05D) {
|
||||
d0 = 0.0D;
|
||||
} else if (d0 > 0.0D) {
|
||||
@@ -1029,7 +_,7 @@
|
||||
@@ -1030,7 +_,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -212,7 +212,7 @@
|
|||
if (d1 < 0.05D && d1 >= -0.05D) {
|
||||
d1 = 0.0D;
|
||||
} else if (d1 > 0.0D) {
|
||||
@@ -1039,7 +_,7 @@
|
||||
@@ -1040,7 +_,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -221,7 +221,7 @@
|
|||
if (d0 < 0.05D && d0 >= -0.05D) {
|
||||
d0 = 0.0D;
|
||||
} else if (d0 > 0.0D) {
|
||||
@@ -1064,10 +_,11 @@
|
||||
@@ -1065,10 +_,11 @@
|
||||
}
|
||||
|
||||
private boolean m_36386_() {
|
||||
|
|
@ -234,7 +234,7 @@
|
|||
if (p_36347_.m_6097_()) {
|
||||
if (!p_36347_.m_7313_(this)) {
|
||||
float f = (float)this.m_21133_(Attributes.f_22281_);
|
||||
@@ -1085,7 +_,7 @@
|
||||
@@ -1086,7 +_,7 @@
|
||||
if (f > 0.0F || f1 > 0.0F) {
|
||||
boolean flag = f2 > 0.9F;
|
||||
boolean flag1 = false;
|
||||
|
|
@ -243,7 +243,7 @@
|
|||
i += EnchantmentHelper.m_44894_(this);
|
||||
if (this.m_20142_() && flag) {
|
||||
this.f_19853_.m_6263_((Player)null, this.m_20185_(), this.m_20186_(), this.m_20189_(), SoundEvents.f_12314_, this.m_5720_(), 1.0F, 1.0F);
|
||||
@@ -1095,8 +_,10 @@
|
||||
@@ -1096,8 +_,10 @@
|
||||
|
||||
boolean flag2 = flag && this.f_19789_ > 0.0F && !this.f_19861_ && !this.m_6147_() && !this.m_20069_() && !this.m_21023_(MobEffects.f_19610_) && !this.m_20159_() && p_36347_ instanceof LivingEntity;
|
||||
flag2 = flag2 && !this.m_20142_();
|
||||
|
|
@ -255,7 +255,7 @@
|
|||
}
|
||||
|
||||
f += f1;
|
||||
@@ -1104,9 +_,7 @@
|
||||
@@ -1105,9 +_,7 @@
|
||||
double d0 = (double)(this.f_19787_ - this.f_19867_);
|
||||
if (flag && !flag2 && !flag1 && this.f_19861_ && d0 < (double)this.m_6113_()) {
|
||||
ItemStack itemstack = this.m_21120_(InteractionHand.MAIN_HAND);
|
||||
|
|
@ -266,7 +266,7 @@
|
|||
}
|
||||
|
||||
float f4 = 0.0F;
|
||||
@@ -1137,8 +_,8 @@
|
||||
@@ -1138,8 +_,8 @@
|
||||
if (flag3) {
|
||||
float f3 = 1.0F + EnchantmentHelper.m_44821_(this) * f;
|
||||
|
||||
|
|
@ -277,7 +277,7 @@
|
|||
livingentity.m_147240_((double)0.4F, (double)Mth.m_14031_(this.m_146908_() * ((float)Math.PI / 180F)), (double)(-Mth.m_14089_(this.m_146908_() * ((float)Math.PI / 180F))));
|
||||
livingentity.m_6469_(DamageSource.m_19344_(this), f3);
|
||||
}
|
||||
@@ -1179,13 +_,15 @@
|
||||
@@ -1180,13 +_,15 @@
|
||||
EnchantmentHelper.m_44896_(this, p_36347_);
|
||||
ItemStack itemstack1 = this.m_21205_();
|
||||
Entity entity = p_36347_;
|
||||
|
|
@ -295,7 +295,7 @@
|
|||
this.m_21008_(InteractionHand.MAIN_HAND, ItemStack.f_41583_);
|
||||
}
|
||||
}
|
||||
@@ -1227,7 +_,7 @@
|
||||
@@ -1228,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (this.f_19796_.m_188501_() < f) {
|
||||
|
|
@ -304,7 +304,7 @@
|
|||
this.m_5810_();
|
||||
this.f_19853_.m_7605_(this, (byte)30);
|
||||
}
|
||||
@@ -1292,6 +_,7 @@
|
||||
@@ -1297,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_6145_(boolean p_36226_, boolean p_36227_) {
|
||||
|
|
@ -312,7 +312,7 @@
|
|||
super.m_5796_();
|
||||
if (this.f_19853_ instanceof ServerLevel && p_36227_) {
|
||||
((ServerLevel)this.f_19853_).m_8878_();
|
||||
@@ -1317,7 +_,7 @@
|
||||
@@ -1322,7 +_,7 @@
|
||||
} else if (block instanceof BedBlock && BedBlock.m_49488_(p_36131_)) {
|
||||
return BedBlock.m_49458_(EntityType.f_20532_, p_36131_, p_36132_, p_36133_);
|
||||
} else if (!p_36134_) {
|
||||
|
|
@ -321,7 +321,7 @@
|
|||
} else {
|
||||
boolean flag = block.m_5568_();
|
||||
boolean flag1 = p_36131_.m_8055_(p_36132_.m_7494_()).m_60734_().m_5568_();
|
||||
@@ -1497,6 +_,7 @@
|
||||
@@ -1502,6 +_,7 @@
|
||||
|
||||
public boolean m_142535_(float p_150093_, float p_150094_, DamageSource p_150095_) {
|
||||
if (this.f_36077_.f_35936_) {
|
||||
|
|
@ -329,7 +329,7 @@
|
|||
return false;
|
||||
} else {
|
||||
if (p_150093_ >= 2.0F) {
|
||||
@@ -1510,7 +_,7 @@
|
||||
@@ -1519,7 +_,7 @@
|
||||
public boolean m_36319_() {
|
||||
if (!this.f_19861_ && !this.m_21255_() && !this.m_20069_() && !this.m_21023_(MobEffects.f_19620_)) {
|
||||
ItemStack itemstack = this.m_6844_(EquipmentSlot.CHEST);
|
||||
|
|
@ -338,7 +338,7 @@
|
|||
this.m_36320_();
|
||||
return true;
|
||||
}
|
||||
@@ -1552,6 +_,10 @@
|
||||
@@ -1561,6 +_,10 @@
|
||||
}
|
||||
|
||||
public void m_6756_(int p_36291_) {
|
||||
|
|
@ -349,7 +349,7 @@
|
|||
this.m_36401_(p_36291_);
|
||||
this.f_36080_ += (float)p_36291_ / (float)this.m_36323_();
|
||||
this.f_36079_ = Mth.m_14045_(this.f_36079_ + p_36291_, 0, Integer.MAX_VALUE);
|
||||
@@ -1580,7 +_,7 @@
|
||||
@@ -1589,7 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_7408_(ItemStack p_36172_, int p_36173_) {
|
||||
|
|
@ -358,7 +358,7 @@
|
|||
if (this.f_36078_ < 0) {
|
||||
this.f_36078_ = 0;
|
||||
this.f_36080_ = 0.0F;
|
||||
@@ -1591,6 +_,10 @@
|
||||
@@ -1600,6 +_,10 @@
|
||||
}
|
||||
|
||||
public void m_6749_(int p_36276_) {
|
||||
|
|
@ -369,7 +369,7 @@
|
|||
this.f_36078_ += p_36276_;
|
||||
if (this.f_36078_ < 0) {
|
||||
this.f_36078_ = 0;
|
||||
@@ -1782,7 +_,11 @@
|
||||
@@ -1791,7 +_,11 @@
|
||||
}
|
||||
|
||||
public Component m_5446_() {
|
||||
|
|
@ -382,7 +382,7 @@
|
|||
return this.m_36218_(mutablecomponent);
|
||||
}
|
||||
|
||||
@@ -1919,24 +_,24 @@
|
||||
@@ -1928,24 +_,24 @@
|
||||
Predicate<ItemStack> predicate = ((ProjectileWeaponItem)p_36349_.m_41720_()).m_6442_();
|
||||
ItemStack itemstack = ProjectileWeaponItem.m_43010_(this, predicate);
|
||||
if (!itemstack.m_41619_()) {
|
||||
|
|
@ -411,7 +411,7 @@
|
|||
this.m_36246_(Stats.f_12982_.m_12902_(p_36186_.m_41720_()));
|
||||
p_36185_.m_6263_((Player)null, this.m_20185_(), this.m_20186_(), this.m_20189_(), SoundEvents.f_12321_, SoundSource.PLAYERS, 0.5F, p_36185_.f_46441_.m_188501_() * 0.1F + 0.9F);
|
||||
if (this instanceof ServerPlayer) {
|
||||
@@ -2023,5 +_,63 @@
|
||||
@@ -2032,5 +_,63 @@
|
||||
public Component m_36423_() {
|
||||
return this.f_36413_;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
--- a/net/minecraft/world/item/RecordItem.java
|
||||
+++ b/net/minecraft/world/item/RecordItem.java
|
||||
@@ -19,15 +_,38 @@
|
||||
@@ -19,17 +_,42 @@
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public class RecordItem extends Item {
|
||||
|
|
@ -9,13 +9,15 @@
|
|||
private final int f_43033_;
|
||||
+ @Deprecated // Forge: refer to soundSupplier
|
||||
private final SoundEvent f_43034_;
|
||||
private final int f_238749_;
|
||||
+ private final java.util.function.Supplier<SoundEvent> soundSupplier;
|
||||
|
||||
+ @Deprecated // Forge: Use the constructor that takes a supplier instead
|
||||
public RecordItem(int p_43037_, SoundEvent p_43038_, Item.Properties p_43039_) {
|
||||
super(p_43039_);
|
||||
this.f_43033_ = p_43037_;
|
||||
this.f_43034_ = p_43038_;
|
||||
public RecordItem(int p_239614_, SoundEvent p_239615_, Item.Properties p_239616_, int p_239617_) {
|
||||
super(p_239616_);
|
||||
this.f_43033_ = p_239614_;
|
||||
this.f_43034_ = p_239615_;
|
||||
this.f_238749_ = p_239617_ * 20;
|
||||
f_43032_.put(this.f_43034_, this);
|
||||
+ this.soundSupplier = net.minecraftforge.registries.ForgeRegistries.SOUND_EVENTS.getDelegateOrThrow(this.f_43034_);
|
||||
+ }
|
||||
|
|
@ -29,21 +31,24 @@
|
|||
+ * {@link net.minecraftforge.registries.RegistryObject<SoundEvent>} or a
|
||||
+ * {@link net.minecraft.core.Holder<SoundEvent>} for this parameter.
|
||||
+ * @param builder A set of {@link Item.Properties} that describe this item.
|
||||
+ * @param lengthInTicks The length of the music disc track in ticks.
|
||||
+ */
|
||||
+ public RecordItem(int comparatorValue, java.util.function.Supplier<SoundEvent> soundSupplier, Item.Properties builder)
|
||||
+ public RecordItem(int comparatorValue, java.util.function.Supplier<SoundEvent> soundSupplier, Item.Properties builder, int lengthInTicks)
|
||||
+ {
|
||||
+ super(builder);
|
||||
+ this.f_43033_ = comparatorValue;
|
||||
+ this.f_43034_ = null;
|
||||
+ this.soundSupplier = soundSupplier;
|
||||
+ this.f_238749_ = lengthInTicks;
|
||||
}
|
||||
|
||||
public InteractionResult m_6225_(UseOnContext p_43048_) {
|
||||
@@ -70,6 +_,6 @@
|
||||
@@ -72,7 +_,7 @@
|
||||
}
|
||||
|
||||
public SoundEvent m_43051_() {
|
||||
- return this.f_43034_;
|
||||
+ return this.soundSupplier.get();
|
||||
}
|
||||
}
|
||||
|
||||
public int m_43036_() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
--- a/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -94,6 +_,17 @@
|
||||
@@ -95,6 +_,17 @@
|
||||
this.f_60449_ = p_60452_.f_60893_;
|
||||
this.f_60438_ = p_60452_.f_60903_;
|
||||
this.f_60439_ = p_60452_;
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
}
|
||||
|
||||
/** @deprecated */
|
||||
@@ -142,7 +_,7 @@
|
||||
@@ -143,7 +_,7 @@
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
public void m_6810_(BlockState p_60515_, Level p_60516_, BlockPos p_60517_, BlockState p_60518_, boolean p_60519_) {
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
p_60516_.m_46747_(p_60517_);
|
||||
}
|
||||
|
||||
@@ -219,7 +_,7 @@
|
||||
@@ -220,7 +_,7 @@
|
||||
/** @deprecated */
|
||||
@Deprecated
|
||||
public boolean m_6864_(BlockState p_60470_, BlockPlaceContext p_60471_) {
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
}
|
||||
|
||||
/** @deprecated */
|
||||
@@ -349,8 +_,8 @@
|
||||
@@ -350,8 +_,8 @@
|
||||
if (f == -1.0F) {
|
||||
return 0.0F;
|
||||
} else {
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
@@ -383,8 +_,7 @@
|
||||
@@ -384,8 +_,7 @@
|
||||
|
||||
public final ResourceLocation m_60589_() {
|
||||
if (this.f_60440_ == null) {
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
}
|
||||
|
||||
return this.f_60440_;
|
||||
@@ -407,6 +_,14 @@
|
||||
@@ -408,6 +_,14 @@
|
||||
return this.f_60439_.f_60888_;
|
||||
}
|
||||
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
public abstract static class BlockStateBase extends StateHolder<Block, BlockState> {
|
||||
private final int f_60594_;
|
||||
private final boolean f_60595_;
|
||||
@@ -491,18 +_,22 @@
|
||||
@@ -492,18 +_,22 @@
|
||||
return this.f_60595_;
|
||||
}
|
||||
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
public BlockState m_60717_(Rotation p_60718_) {
|
||||
return this.m_60734_().m_6843_(this.m_7160_(), p_60718_);
|
||||
}
|
||||
@@ -885,8 +_,9 @@
|
||||
@@ -886,8 +_,9 @@
|
||||
ResourceLocation f_60894_;
|
||||
boolean f_60895_ = true;
|
||||
boolean f_60896_;
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
};
|
||||
BlockBehaviour.StatePredicate f_60898_ = (p_60985_, p_60986_, p_60987_) -> {
|
||||
return p_60985_.m_60767_().m_76337_() && p_60985_.m_60838_(p_60986_, p_60987_);
|
||||
@@ -1017,9 +_,15 @@
|
||||
@@ -1018,9 +_,15 @@
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
--- a/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
|
||||
@@ -200,6 +_,10 @@
|
||||
@@ -201,6 +_,10 @@
|
||||
return m_74593_(p_74565_, p_74564_.m_74401_(), p_74564_.m_74404_(), p_74564_.m_74407_());
|
||||
}
|
||||
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
public boolean m_230328_(ServerLevelAccessor p_230329_, BlockPos p_230330_, BlockPos p_230331_, StructurePlaceSettings p_230332_, RandomSource p_230333_, int p_230334_) {
|
||||
if (this.f_74482_.isEmpty()) {
|
||||
return false;
|
||||
@@ -217,7 +_,7 @@
|
||||
@@ -218,7 +_,7 @@
|
||||
int i1 = Integer.MIN_VALUE;
|
||||
int j1 = Integer.MIN_VALUE;
|
||||
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
BlockPos blockpos = structuretemplate$structureblockinfo.f_74675_;
|
||||
if (boundingbox == null || boundingbox.m_71051_(blockpos)) {
|
||||
FluidState fluidstate = p_230332_.m_74413_() ? p_230329_.m_6425_(blockpos) : null;
|
||||
@@ -329,7 +_,7 @@
|
||||
@@ -330,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (!p_230332_.m_74408_()) {
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
}
|
||||
|
||||
return true;
|
||||
@@ -358,14 +_,19 @@
|
||||
@@ -359,14 +_,19 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
}
|
||||
|
||||
if (structuretemplate$structureblockinfo1 != null) {
|
||||
@@ -376,13 +_,29 @@
|
||||
@@ -377,13 +_,29 @@
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +86,7 @@
|
|||
ListTag listtag = new ListTag();
|
||||
listtag.add(DoubleTag.m_128500_(vec31.f_82479_));
|
||||
listtag.add(DoubleTag.m_128500_(vec31.f_82480_));
|
||||
@@ -390,10 +_,10 @@
|
||||
@@ -391,10 +_,10 @@
|
||||
compoundtag.m_128365_("Pos", listtag);
|
||||
compoundtag.m_128473_("UUID");
|
||||
m_74543_(p_74524_, compoundtag).ifPresent((p_205061_) -> {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
--- a/net/minecraft/world/level/lighting/SkyLightEngine.java
|
||||
+++ b/net/minecraft/world/level/lighting/SkyLightEngine.java
|
||||
@@ -174,4 +_,9 @@
|
||||
@@ -175,4 +_,9 @@
|
||||
public String m_6647_(long p_75853_) {
|
||||
return super.m_6647_(p_75853_) + (this.f_75632_.m_75890_(p_75853_) ? "*" : "");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
--- a/net/minecraft/world/level/storage/loot/LootContext.java
|
||||
+++ b/net/minecraft/world/level/storage/loot/LootContext.java
|
||||
@@ -107,17 +_,47 @@
|
||||
@@ -108,17 +_,47 @@
|
||||
return this.f_78909_;
|
||||
}
|
||||
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
public LootContext.Builder m_230911_(RandomSource p_230912_) {
|
||||
this.f_78958_ = p_230912_;
|
||||
return this;
|
||||
@@ -190,7 +_,7 @@
|
||||
@@ -191,7 +_,7 @@
|
||||
|
||||
public LootContext m_78975_(LootContextParamSet p_78976_) {
|
||||
Set<LootContextParam<?>> set = Sets.difference(this.f_78956_.keySet(), p_78976_.m_81398_());
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
throw new IllegalArgumentException("Parameters not allowed in this parameter set: " + set);
|
||||
} else {
|
||||
Set<LootContextParam<?>> set1 = Sets.difference(p_78976_.m_81394_(), this.f_78956_.keySet());
|
||||
@@ -203,7 +_,7 @@
|
||||
@@ -204,7 +_,7 @@
|
||||
}
|
||||
|
||||
MinecraftServer minecraftserver = this.f_78955_.m_7654_();
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
@@ -230,6 +_,11 @@
|
||||
@@ -231,6 +_,11 @@
|
||||
|
||||
public LootContextParam<? extends Entity> m_79003_() {
|
||||
return this.f_78995_;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import net.minecraft.client.color.block.BlockColors;
|
|||
import net.minecraft.client.color.item.ItemColors;
|
||||
import net.minecraft.client.gui.Font;
|
||||
import net.minecraft.client.gui.GuiComponent;
|
||||
import net.minecraft.client.gui.chat.NarratorChatListener;
|
||||
import net.minecraft.client.gui.components.LerpingBossEvent;
|
||||
import net.minecraft.client.gui.screens.ConfirmScreen;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
|
|
@ -74,6 +73,8 @@ import net.minecraft.network.chat.ChatType;
|
|||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.FormattedText;
|
||||
import net.minecraft.network.chat.MessageSigner;
|
||||
import net.minecraft.network.chat.PlayerChatMessage;
|
||||
import net.minecraft.network.protocol.status.ServerStatus;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.packs.resources.Resource;
|
||||
|
|
@ -217,7 +218,7 @@ public class ForgeHooksClient
|
|||
guiLayers.push(minecraft.screen);
|
||||
minecraft.screen = Objects.requireNonNull(screen);
|
||||
screen.init(minecraft, minecraft.getWindow().getGuiScaledWidth(), minecraft.getWindow().getGuiScaledHeight());
|
||||
NarratorChatListener.INSTANCE.sayNow(screen.getNarrationMessage());
|
||||
minecraft.getNarrator().sayNow(screen.getNarrationMessage());
|
||||
}
|
||||
|
||||
public static void popGuiLayer(Minecraft minecraft)
|
||||
|
|
@ -230,7 +231,7 @@ public class ForgeHooksClient
|
|||
|
||||
popGuiLayerInternal(minecraft);
|
||||
if (minecraft.screen != null)
|
||||
NarratorChatListener.INSTANCE.sayNow(minecraft.screen.getNarrationMessage());
|
||||
minecraft.getNarrator().sayNow(minecraft.screen.getNarrationMessage());
|
||||
}
|
||||
|
||||
public static float getGuiFarPlane()
|
||||
|
|
@ -940,9 +941,9 @@ public class ForgeHooksClient
|
|||
}
|
||||
|
||||
@Nullable
|
||||
public static Component onClientChat(ChatType type, Component message, ChatSender chatSender)
|
||||
public static Component onClientChat(ChatType.Bound boundChatType, Component message, PlayerChatMessage playerChatMessage, MessageSigner messageSigner)
|
||||
{
|
||||
ClientChatReceivedEvent event = new ClientChatReceivedEvent(type, message, chatSender);
|
||||
ClientChatReceivedEvent event = new ClientChatReceivedEvent(boundChatType, message, playerChatMessage, messageSigner);
|
||||
return MinecraftForge.EVENT_BUS.post(event) ? null : event.getMessage();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import org.jetbrains.annotations.ApiStatus;
|
|||
* Fired when the client is about to send a chat message to the server.
|
||||
*
|
||||
* <p>This event is {@linkplain Cancelable cancellable}, and does not {@linkplain HasResult have a result}.
|
||||
* If the event is cancelled, the chat message or command will not be sent to the server.</p>
|
||||
* If the event is cancelled, the chat message will not be sent to the server.</p>
|
||||
*
|
||||
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
|
||||
|
|
@ -24,13 +24,13 @@ import org.jetbrains.annotations.ApiStatus;
|
|||
@Cancelable
|
||||
public class ClientChatEvent extends Event
|
||||
{
|
||||
private String message;
|
||||
// private String message;
|
||||
private final String originalMessage;
|
||||
|
||||
@ApiStatus.Internal
|
||||
public ClientChatEvent(String message)
|
||||
{
|
||||
this.setMessage(message);
|
||||
// this.setMessage(message);
|
||||
this.originalMessage = Strings.nullToEmpty(message);
|
||||
}
|
||||
|
||||
|
|
@ -39,24 +39,24 @@ public class ClientChatEvent extends Event
|
|||
*/
|
||||
public String getMessage()
|
||||
{
|
||||
return message;
|
||||
return this.originalMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the new message to be sent to the server, if the event is not cancelled.
|
||||
*
|
||||
* @param message the new message to be sent
|
||||
*/
|
||||
public void setMessage(String message)
|
||||
{
|
||||
this.message = Strings.nullToEmpty(message);
|
||||
}
|
||||
// /**
|
||||
// * Sets the new message to be sent to the server, if the event is not cancelled.
|
||||
// *
|
||||
// * @param message the new message to be sent
|
||||
// */
|
||||
// public void setMessage(String message)
|
||||
// {
|
||||
// this.message = Strings.nullToEmpty(message);
|
||||
// }
|
||||
|
||||
/**
|
||||
* {@return the original message that was to be sent to the server}
|
||||
*/
|
||||
public String getOriginalMessage()
|
||||
{
|
||||
return originalMessage;
|
||||
return this.originalMessage;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,10 @@
|
|||
package net.minecraftforge.client.event;
|
||||
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.network.chat.ChatSender;
|
||||
import net.minecraft.network.chat.ChatType;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MessageSigner;
|
||||
import net.minecraft.network.chat.PlayerChatMessage;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.eventbus.api.Cancelable;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
|
|
@ -31,15 +32,17 @@ import org.jetbrains.annotations.ApiStatus;
|
|||
public class ClientChatReceivedEvent extends Event
|
||||
{
|
||||
private Component message;
|
||||
private final ChatType type;
|
||||
private final ChatSender chatSender;
|
||||
private final ChatType.Bound boundChatType;
|
||||
private final PlayerChatMessage playerChatMessage;
|
||||
private final MessageSigner messageSigner;
|
||||
|
||||
@ApiStatus.Internal
|
||||
public ClientChatReceivedEvent(ChatType type, Component message, ChatSender chatSender)
|
||||
public ClientChatReceivedEvent(ChatType.Bound boundChatType, Component message, PlayerChatMessage playerChatMessage, MessageSigner messageSigner)
|
||||
{
|
||||
this.type = type;
|
||||
this.boundChatType = boundChatType;
|
||||
this.message = message;
|
||||
this.chatSender = chatSender;
|
||||
this.playerChatMessage = playerChatMessage;
|
||||
this.messageSigner = messageSigner;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -53,7 +56,7 @@ public class ClientChatReceivedEvent extends Event
|
|||
/**
|
||||
* Sets the new message to be displayed in the chat message window, if the event is not cancelled.
|
||||
*
|
||||
* @param message the new message to be sent
|
||||
* @param message the new message to be displayed
|
||||
*/
|
||||
public void setMessage(Component message)
|
||||
{
|
||||
|
|
@ -61,20 +64,38 @@ public class ClientChatReceivedEvent extends Event
|
|||
}
|
||||
|
||||
/**
|
||||
* {@return the type of the chat message}
|
||||
* {@return the bound chat type of the chat message}.
|
||||
* This contains the chat type, display name of the sender, and nullable target name depending on the chat type.
|
||||
*/
|
||||
public ChatType getType()
|
||||
public ChatType.Bound getBoundChatType()
|
||||
{
|
||||
return type;
|
||||
return this.boundChatType;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return the sender of this chat message} This contains the UUID, name, and (optionally) the team name of the
|
||||
* entity which sent the chat message. For system messages, {@link ChatSender#uuid()} will be equal to
|
||||
* {@link Util#NIL_UUID}.
|
||||
* {@return the full player chat message}.
|
||||
* This contains the sender UUID, various signing data, and the optional unsigned contents.
|
||||
*/
|
||||
public ChatSender getChatSender()
|
||||
public PlayerChatMessage getPlayerChatMessage()
|
||||
{
|
||||
return chatSender;
|
||||
return this.playerChatMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return the message signer}.
|
||||
* This contains the sender UUID, timestamp of message creation, and signature salt.
|
||||
* The {@linkplain MessageSigner#profileId() sender UUID} will be {@link Util#NIL_UUID} if the message is a system message.
|
||||
*/
|
||||
public MessageSigner getMessageSigner()
|
||||
{
|
||||
return this.messageSigner;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return {@code true} if the message was sent by the system, {@code false} otherwise}
|
||||
*/
|
||||
public boolean isSystem()
|
||||
{
|
||||
return this.messageSigner.isSystem();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@ import net.minecraftforge.client.event.RegisterGuiOverlaysEvent;
|
|||
@FunctionalInterface
|
||||
public interface IGuiOverlay
|
||||
{
|
||||
void render(ForgeGui gui, PoseStack poseStack, float partialTick, int width, int height);
|
||||
void render(ForgeGui gui, PoseStack poseStack, float partialTick, int screenWidth, int screenHeight);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ package net.minecraftforge.common;
|
|||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.regex.Matcher;
|
||||
|
|
@ -32,6 +33,7 @@ import net.minecraft.ResourceLocationException;
|
|||
import net.minecraft.advancements.Advancement;
|
||||
import net.minecraft.core.*;
|
||||
import net.minecraft.network.chat.*;
|
||||
import net.minecraft.network.chat.contents.LiteralContents;
|
||||
import net.minecraft.server.packs.PackType;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.TagEntry;
|
||||
|
|
@ -395,15 +397,74 @@ public class ForgeHooks
|
|||
return !MinecraftForge.EVENT_BUS.post(new VanillaGameEvent(level, vanillaEvent, pos, context));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Component onServerChatEvent(@Nullable ServerPlayer player, String raw, Component comp)
|
||||
private static String getRawText(Component message)
|
||||
{
|
||||
ServerChatEvent event = new ServerChatEvent(player, raw, comp);
|
||||
if (MinecraftForge.EVENT_BUS.post(event))
|
||||
return message.getContents() instanceof LiteralContents literalContents ? literalContents.text() : "";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Component onServerChatSubmittedEvent(ServerPlayer player, String plain, Component decorated, boolean canChangeMessage)
|
||||
{
|
||||
ServerChatEvent.Submitted event = new ServerChatEvent.Submitted(player, plain, decorated, canChangeMessage);
|
||||
return MinecraftForge.EVENT_BUS.post(event) ? null : event.getMessage();
|
||||
}
|
||||
|
||||
private static final ChatDecorator SERVER_CHAT_SUBMITTED_DECORATOR = new ChatDecorator()
|
||||
{
|
||||
@NotNull
|
||||
@Override
|
||||
public CompletableFuture<Component> decorate(@Nullable ServerPlayer sender, Component message)
|
||||
{
|
||||
return null;
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
if (sender == null)
|
||||
return message; // Vanilla should never get here with the patches we use, but let's be safe with dumb mods
|
||||
|
||||
return onServerChatSubmittedEvent(sender, getRawText(message), message, true);
|
||||
});
|
||||
}
|
||||
return event.getComponent();
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public CompletableFuture<PlayerChatMessage> decorate(@Nullable ServerPlayer sender, PlayerChatMessage message)
|
||||
{
|
||||
if (message.signedContent().isDecorated())
|
||||
{
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
if (sender != null)
|
||||
return onServerChatSubmittedEvent(sender, message.signedContent().plain(), message.signedContent().decorated(), false) == null;
|
||||
|
||||
return false;
|
||||
}).thenApply(canceled -> canceled == Boolean.TRUE ? null : message);
|
||||
}
|
||||
|
||||
return this.decorate(sender, message.serverContent()).thenApply(component -> component == null ? null : message.withUnsignedContent(component));
|
||||
}
|
||||
};
|
||||
|
||||
@NotNull
|
||||
public static ChatDecorator getServerChatSubmittedDecorator()
|
||||
{
|
||||
return SERVER_CHAT_SUBMITTED_DECORATOR;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Component onServerChatPreviewEvent(@NotNull ServerPlayer player, @NotNull Component message)
|
||||
{
|
||||
ServerChatEvent.Preview event = new ServerChatEvent.Preview(player, getRawText(message), message);
|
||||
return MinecraftForge.EVENT_BUS.post(event) ? null : event.getMessage();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static ChatDecorator getServerChatPreviewDecorator()
|
||||
{
|
||||
return (player, message) -> CompletableFuture.supplyAsync(() -> {
|
||||
if (player == null)
|
||||
return message; // Vanilla should never get here with the patches we use, but let's be safe with dumb mods
|
||||
|
||||
Component preview = onServerChatPreviewEvent(player, message);
|
||||
// Send the input message back to the client if the event was cancelled
|
||||
return preview == null ? message : preview;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ import net.minecraftforge.common.world.ForgeBiomeModifiers.RemoveSpawnsBiomeModi
|
|||
import net.minecraftforge.common.world.NoneBiomeModifier;
|
||||
import net.minecraftforge.common.world.NoneStructureModifier;
|
||||
import net.minecraftforge.common.world.StructureModifier;
|
||||
import net.minecraftforge.event.ServerChatEvent;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.fluids.FluidType;
|
||||
import net.minecraftforge.fluids.ForgeFlowingFluid;
|
||||
|
|
@ -351,6 +352,7 @@ public class ForgeMod
|
|||
});
|
||||
|
||||
private static boolean enableMilkFluid = false;
|
||||
private static boolean serverChatPreviewEnabled = false;
|
||||
public static final RegistryObject<FluidType> MILK_TYPE = RegistryObject.createOptional(new ResourceLocation("milk"), ForgeRegistries.Keys.FLUID_TYPES.location(), "minecraft");
|
||||
public static final RegistryObject<Fluid> MILK = RegistryObject.create(new ResourceLocation("milk"), ForgeRegistries.FLUIDS);
|
||||
public static final RegistryObject<Fluid> FLOWING_MILK = RegistryObject.create(new ResourceLocation("flowing_milk"), ForgeRegistries.FLUIDS);
|
||||
|
|
@ -369,6 +371,25 @@ public class ForgeMod
|
|||
enableMilkFluid = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this method during mod constructor to enable chat previews for the server.
|
||||
* Recommended for mods which modify the chat message in {@link ServerChatEvent}.
|
||||
*
|
||||
* @see ServerChatEvent
|
||||
*/
|
||||
public static void enableServerChatPreview()
|
||||
{
|
||||
serverChatPreviewEnabled = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if server chat previews are enabled
|
||||
*/
|
||||
public static boolean isServerChatPreviewEnabled()
|
||||
{
|
||||
return serverChatPreviewEnabled;
|
||||
}
|
||||
|
||||
public ForgeMod()
|
||||
{
|
||||
LOGGER.info(FORGEMOD,"Forge mod loading, version {}, for MC {} with MCP {}", ForgeVersion.getVersion(), MCPVersion.getMCVersion(), MCPVersion.getMCPVersion());
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
package net.minecraftforge.common.util;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import io.netty.util.concurrent.Future;
|
||||
import io.netty.util.concurrent.GenericFutureListener;
|
||||
import java.util.Set;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.network.Connection;
|
||||
import net.minecraft.network.PacketSendListener;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.network.protocol.PacketFlow;
|
||||
|
|
@ -69,10 +70,9 @@ import net.minecraft.world.phys.Vec3;
|
|||
import net.minecraftforge.server.ServerLifecycleHooks;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import java.util.Set;
|
||||
|
||||
//Preliminary, simple Fake Player class
|
||||
/**
|
||||
* A basic fake server player implementation that can be used to simulate player actions.
|
||||
*/
|
||||
public class FakePlayer extends ServerPlayer
|
||||
{
|
||||
public FakePlayer(ServerLevel level, GameProfile name)
|
||||
|
|
@ -81,16 +81,15 @@ public class FakePlayer extends ServerPlayer
|
|||
this.connection = new FakePlayerNetHandler(level.getServer(), this);
|
||||
}
|
||||
|
||||
@Override public Vec3 position(){ return new Vec3(0, 0, 0); }
|
||||
@Override public BlockPos blockPosition(){ return BlockPos.ZERO; }
|
||||
@Override public void displayClientMessage(Component chatComponent, boolean actionBar){}
|
||||
@Override public void awardStat(Stat par1StatBase, int par2){}
|
||||
//@Override public void openGui(Object mod, int modGuiId, World world, int x, int y, int z){}
|
||||
@Override public boolean isInvulnerableTo(DamageSource source){ return true; }
|
||||
@Override public boolean canHarmPlayer(Player player){ return false; }
|
||||
@Override public void die(DamageSource source){ return; }
|
||||
@Override public void tick(){ return; }
|
||||
@Override public void updateOptions(ServerboundClientInformationPacket pkt){ return; }
|
||||
@Override public Vec3 position() { return new Vec3(0, 0, 0); }
|
||||
@Override public BlockPos blockPosition() { return BlockPos.ZERO; }
|
||||
@Override public void displayClientMessage(Component chatComponent, boolean actionBar) { }
|
||||
@Override public void awardStat(Stat stat, int amount) { }
|
||||
@Override public boolean isInvulnerableTo(DamageSource source) { return true; }
|
||||
@Override public boolean canHarmPlayer(Player player) { return false; }
|
||||
@Override public void die(DamageSource source) { }
|
||||
@Override public void tick() { }
|
||||
@Override public void updateOptions(ServerboundClientInformationPacket packet) { }
|
||||
@Override @Nullable public MinecraftServer getServer() { return ServerLifecycleHooks.getCurrentServer(); }
|
||||
|
||||
@ParametersAreNonnullByDefault
|
||||
|
|
@ -134,7 +133,7 @@ public class FakePlayer extends ServerPlayer
|
|||
@Override public void handlePaddleBoat(ServerboundPaddleBoatPacket packet) { }
|
||||
@Override public void onDisconnect(Component message) { }
|
||||
@Override public void send(Packet<?> packet) { }
|
||||
@Override public void send(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> listener) { }
|
||||
@Override public void send(Packet<?> packet, @Nullable PacketSendListener sendListener) { }
|
||||
@Override public void handleSetCarriedItem(ServerboundSetCarriedItemPacket packet) { }
|
||||
@Override public void handleChat(ServerboundChatPacket packet) { }
|
||||
@Override public void handleAnimate(ServerboundSwingPacket packet) { }
|
||||
|
|
|
|||
|
|
@ -11,25 +11,24 @@ import net.minecraft.commands.Commands;
|
|||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.eventbus.api.Cancelable;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.fml.LogicalSide;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* CommandEvent is fired after a command is parsed, but before it is executed.
|
||||
* This event is fired during the invocation of {@link Commands#performCommand(CommandSourceStack, String)}. <br>
|
||||
* <br>
|
||||
* {@link #parse} contains the instance of {@link ParseResults} for the parsed command.<br>
|
||||
* {@link #exception} begins null, but can be populated with an exception to be thrown within the command.<br>
|
||||
* <br>
|
||||
* This event is {@link Cancelable}. <br>
|
||||
* If the event is canceled, the execution of the command does not occur.<br>
|
||||
* <br>
|
||||
* This event does not have a result. {@link HasResult}<br>
|
||||
* <br>
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
||||
* This event is fired during the invocation of {@link Commands#performCommand(ParseResults, String)}.
|
||||
* <p>
|
||||
* This event is {@linkplain Cancelable cancellable}, and does not {@linkplain HasResult have a result}.
|
||||
* If the event is cancelled, the command will not be executed.
|
||||
* <p>
|
||||
* This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#SERVER logical server}.
|
||||
**/
|
||||
@Cancelable
|
||||
public class CommandEvent extends Event
|
||||
{
|
||||
private ParseResults<CommandSourceStack> parse;
|
||||
@Nullable
|
||||
private Throwable exception;
|
||||
|
||||
public CommandEvent(ParseResults<CommandSourceStack> parse)
|
||||
|
|
@ -37,8 +36,30 @@ public class CommandEvent extends Event
|
|||
this.parse = parse;
|
||||
}
|
||||
|
||||
public ParseResults<CommandSourceStack> getParseResults() { return parse; }
|
||||
public void setParseResults(ParseResults<CommandSourceStack> parse) { this.parse = parse; }
|
||||
public Throwable getException() { return exception; }
|
||||
public void setException(Throwable exception) { this.exception = exception; }
|
||||
/**
|
||||
* {@return the parsed command results}
|
||||
*/
|
||||
public ParseResults<CommandSourceStack> getParseResults()
|
||||
{
|
||||
return this.parse;
|
||||
}
|
||||
|
||||
public void setParseResults(ParseResults<CommandSourceStack> parse)
|
||||
{
|
||||
this.parse = parse;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return an exception to be thrown when performing the command, starts null}
|
||||
*/
|
||||
@Nullable
|
||||
public Throwable getException()
|
||||
{
|
||||
return this.exception;
|
||||
}
|
||||
|
||||
public void setException(@Nullable Throwable exception)
|
||||
{
|
||||
this.exception = exception;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,63 +5,170 @@
|
|||
|
||||
package net.minecraftforge.event;
|
||||
|
||||
import net.minecraft.network.protocol.game.ServerboundChatPacket;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import java.util.Objects;
|
||||
import net.minecraft.client.Options;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraft.network.protocol.game.ServerboundChatPacket;
|
||||
import net.minecraft.network.protocol.game.ServerboundChatPreviewPacket;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraftforge.common.ForgeMod;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.eventbus.api.Cancelable;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import net.minecraftforge.fml.LogicalSide;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* ServerChatEvent is fired whenever a C01PacketChatMessage is processed. <br>
|
||||
* This event is fired via {@link ForgeHooks#onServerChatEvent(ServerPlayer, String, Component)},
|
||||
* which is executed by the {@link ServerGamePacketListenerImpl#handleChat(ServerboundChatPacket)}<br>
|
||||
* <br>
|
||||
* {@link #username} contains the username of the player sending the chat message, unless fired from the server, where it is null.<br>
|
||||
* {@link #message} contains the message being sent.<br>
|
||||
* {@link #player} the instance of ServerPlayer for the player sending the chat message, or null when fired from the server.<br>
|
||||
* {@link #component} contains the instance of Component for the sent message.<br>
|
||||
* <br>
|
||||
* This event is {@link Cancelable}. <br>
|
||||
* If this event is canceled, the chat message is never distributed to all clients.<br>
|
||||
* <br>
|
||||
* This event does not have a result. {@link HasResult}<br>
|
||||
* <br>
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
|
||||
* This event is fired whenever a {@link ServerboundChatPreviewPacket} or {@link ServerboundChatPacket} is received.
|
||||
* <p>
|
||||
* Mods that modify chat messages from this event should call {@link ForgeMod#enableServerChatPreview()}
|
||||
* from their mod constructor to enable the chat preview and allow signing by clients.
|
||||
* It is recommended to listen to this event class when modifying chat messages
|
||||
* rather than a subclass to ensure clients with {@link Options#onlyShowSecureChat()}
|
||||
* enabled can see the modified messages.
|
||||
* <p>
|
||||
* This event is {@linkplain Cancelable cancellable}, and does not {@linkplain HasResult have a result}.
|
||||
* If the event is cancelled, the message will not be sent to clients.
|
||||
* <p>
|
||||
* This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#SERVER logical server}.
|
||||
*
|
||||
* @see ForgeMod#enableServerChatPreview()
|
||||
**/
|
||||
@Cancelable
|
||||
public class ServerChatEvent extends Event
|
||||
{
|
||||
private final String message;
|
||||
@Nullable
|
||||
private final String username;
|
||||
@Nullable
|
||||
private final ServerPlayer player;
|
||||
private Component component;
|
||||
private final String username;
|
||||
private final String rawText;
|
||||
private final boolean canChangeMessage;
|
||||
private Component message;
|
||||
|
||||
public ServerChatEvent(@Nullable ServerPlayer player, String message, Component component)
|
||||
@ApiStatus.Internal
|
||||
protected ServerChatEvent(ServerPlayer player, String rawText, Component message, boolean canChangeMessage)
|
||||
{
|
||||
super();
|
||||
this.message = message;
|
||||
this.player = player;
|
||||
this.username = player != null ? player.getGameProfile().getName() : null;
|
||||
this.component = component;
|
||||
this.username = player.getGameProfile().getName();
|
||||
this.rawText = rawText;
|
||||
this.canChangeMessage = canChangeMessage;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public void setComponent(Component e)
|
||||
/**
|
||||
* {@return the player who initiated the chat action}
|
||||
*/
|
||||
public ServerPlayer getPlayer()
|
||||
{
|
||||
this.component = e;
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public Component getComponent()
|
||||
/**
|
||||
* {@return the username of the player who initiated the chat action}
|
||||
*/
|
||||
public String getUsername()
|
||||
{
|
||||
return this.component;
|
||||
return this.username;
|
||||
}
|
||||
|
||||
public String getMessage() { return this.message; }
|
||||
public @Nullable String getUsername() { return this.username; }
|
||||
public @Nullable ServerPlayer getPlayer() { return this.player; }
|
||||
/**
|
||||
* {@return the original raw text of the player chat message}
|
||||
*/
|
||||
public String getRawText()
|
||||
{
|
||||
return this.rawText;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return whether the message can be changed or not}.
|
||||
* In vanilla, this will be false if a {@link ServerboundChatPacket} is received
|
||||
* with signed decorated content already included by the sending player.
|
||||
* Players who submit a chat message with chat previews disabled will cause this to be true.
|
||||
*/
|
||||
public boolean canChangeMessage()
|
||||
{
|
||||
return this.canChangeMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the message to be sent to the relevant clients.
|
||||
* <p>
|
||||
* If {@link #canChangeMessage()} is false, this call will be ignored.
|
||||
* <p>
|
||||
* It is recommended to listen to {@link ServerChatEvent} when modifying chat messages
|
||||
* rather than a subclass to ensure clients with {@link Options#onlyShowSecureChat()}
|
||||
* enabled can see the modified messages.
|
||||
*
|
||||
* @see ForgeMod#enableServerChatPreview()
|
||||
*/
|
||||
public void setMessage(Component message)
|
||||
{
|
||||
if (!this.canChangeMessage)
|
||||
return;
|
||||
|
||||
this.message = Objects.requireNonNull(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return the message that will be sent to the relevant clients, if the event is not cancelled}
|
||||
*/
|
||||
public Component getMessage()
|
||||
{
|
||||
return this.message;
|
||||
}
|
||||
|
||||
/**
|
||||
* This event is fired whenever a {@link ServerboundChatPreviewPacket} is received from a client typing a message.
|
||||
* <p>
|
||||
* This event is {@linkplain Cancelable cancellable}, and does not {@linkplain HasResult have a result}.
|
||||
* If the event is cancelled, the chat preview sent back to the client will match the original message.
|
||||
* <p>
|
||||
* This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#SERVER logical server}.
|
||||
**/
|
||||
public static class Preview extends ServerChatEvent
|
||||
{
|
||||
@ApiStatus.Internal
|
||||
public Preview(ServerPlayer player, String rawText, Component message)
|
||||
{
|
||||
super(player, rawText, message, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the chat preview to be sent back to the client.
|
||||
*/
|
||||
@Override
|
||||
public void setMessage(Component message)
|
||||
{
|
||||
super.setMessage(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return the chat preview that will be sent back to the client, if the event is not cancelled}
|
||||
*/
|
||||
@Override
|
||||
public Component getMessage()
|
||||
{
|
||||
return super.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This event is fired whenever a {@link ServerboundChatPacket} is received from a client
|
||||
* who has submitted their chat message.
|
||||
* <p>
|
||||
* This event is {@linkplain Cancelable cancellable}, and does not {@linkplain HasResult have a result}.
|
||||
* If the event is cancelled, the message will not be sent to clients.
|
||||
* <p>
|
||||
* This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
|
||||
* only on the {@linkplain LogicalSide#SERVER logical server}.
|
||||
**/
|
||||
public static class Submitted extends ServerChatEvent
|
||||
{
|
||||
@ApiStatus.Internal
|
||||
public Submitted(ServerPlayer player, String rawText, Component message, boolean canChangeMessage)
|
||||
{
|
||||
super(player, rawText, message, canChangeMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@
|
|||
package net.minecraftforge.event;
|
||||
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
import net.minecraft.network.protocol.game.ClientGamePacketListener;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.server.ServerLifecycleHooks;
|
||||
|
||||
/**
|
||||
* Fired when tags are updated on either server or client. This event can be used to refresh data that depends on tags.
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ package net.minecraftforge.network.filters;
|
|||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import net.minecraft.network.Connection;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
|
@ -27,11 +28,15 @@ public class NetworkFilters
|
|||
|
||||
public static void injectIfNecessary(Connection manager)
|
||||
{
|
||||
ChannelPipeline pipeline = manager.channel().pipeline();
|
||||
if (pipeline.get("packet_handler") == null)
|
||||
return; // Realistically this can only ever be null if the connection was prematurely closed due to an error. We return early here to reduce further log spam.
|
||||
|
||||
instances.forEach((key, filterFactory) -> {
|
||||
VanillaPacketFilter filter = filterFactory.apply(manager);
|
||||
if (filter.isNecessary(manager))
|
||||
{
|
||||
manager.channel().pipeline().addBefore("packet_handler", key, filter);
|
||||
pipeline.addBefore("packet_handler", key, filter);
|
||||
LOGGER.debug("Injected {} into {}", filter, manager);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ import net.minecraft.commands.synchronization.ArgumentTypeInfo;
|
|||
import net.minecraft.commands.synchronization.ArgumentTypeInfos;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
import net.minecraft.gametest.framework.TestClassNameArgument;
|
||||
import net.minecraft.gametest.framework.TestFunctionArgument;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.network.Connection;
|
||||
import net.minecraft.network.protocol.game.ClientboundCommandsPacket;
|
||||
|
|
@ -91,6 +93,9 @@ public class VanillaConnectionNetworkFilter extends VanillaPacketFilter
|
|||
commandBuildContext.missingTagAccessPolicy(CommandBuildContext.MissingTagAccessPolicy.RETURN_EMPTY);
|
||||
RootCommandNode<SharedSuggestionProvider> root = packet.getRoot(commandBuildContext);
|
||||
RootCommandNode<SharedSuggestionProvider> newRoot = CommandTreeCleaner.cleanArgumentTypes(root, argType -> {
|
||||
if (argType instanceof TestFunctionArgument || argType instanceof TestClassNameArgument)
|
||||
return false; // Vanilla connections should not have gametest on, so we should filter these out always
|
||||
|
||||
ArgumentTypeInfo<?, ?> info = ArgumentTypeInfos.byClass(argType);
|
||||
ResourceLocation id = Registry.COMMAND_ARGUMENT_TYPE.getKey(info);
|
||||
return id != null && (id.getNamespace().equals("minecraft") || id.getNamespace().equals("brigadier"));
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
package net.minecraftforge.registries;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import net.minecraft.commands.synchronization.ArgumentTypeInfo;
|
||||
import net.minecraft.network.syncher.EntityDataSerializer;
|
||||
import net.minecraft.world.entity.decoration.PaintingVariant;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
|
|
@ -74,6 +75,7 @@ public class ForgeRegistries
|
|||
public static final IForgeRegistry<RecipeSerializer<?>> RECIPE_SERIALIZERS = RegistryManager.ACTIVE.getRegistry(Keys.RECIPE_SERIALIZERS);
|
||||
public static final IForgeRegistry<Attribute> ATTRIBUTES = RegistryManager.ACTIVE.getRegistry(Keys.ATTRIBUTES);
|
||||
public static final IForgeRegistry<StatType<?>> STAT_TYPES = RegistryManager.ACTIVE.getRegistry(Keys.STAT_TYPES);
|
||||
public static final IForgeRegistry<ArgumentTypeInfo<?, ?>> COMMAND_ARGUMENT_TYPES = RegistryManager.ACTIVE.getRegistry(Keys.COMMAND_ARGUMENT_TYPES);
|
||||
|
||||
// Villages
|
||||
public static final IForgeRegistry<VillagerProfession> VILLAGER_PROFESSIONS = RegistryManager.ACTIVE.getRegistry(Keys.VILLAGER_PROFESSIONS);
|
||||
|
|
@ -112,13 +114,13 @@ public class ForgeRegistries
|
|||
* Calling {@link Supplier#get()} before {@link NewRegistryEvent} is fired will result in a null registry returned.
|
||||
* Use {@link Keys#BIOME_MODIFIER_SERIALIZERS} to create a {@link DeferredRegister}.
|
||||
*/
|
||||
public static final Supplier<IForgeRegistry<Codec<? extends BiomeModifier>>> BIOME_MODIFIER_SERIALIZERS = DEFERRED_BIOME_MODIFIER_SERIALIZERS.makeRegistry(() -> new RegistryBuilder<Codec<? extends BiomeModifier>>().disableSaving().disableSync());
|
||||
public static final Supplier<IForgeRegistry<Codec<? extends BiomeModifier>>> BIOME_MODIFIER_SERIALIZERS = DEFERRED_BIOME_MODIFIER_SERIALIZERS.makeRegistry(GameData::getBiomeModifierSerializersRegistryBuilder);
|
||||
static final DeferredRegister<Codec<? extends StructureModifier>> DEFERRED_STRUCTURE_MODIFIER_SERIALIZERS = DeferredRegister.create(Keys.STRUCTURE_MODIFIER_SERIALIZERS, Keys.STRUCTURE_MODIFIER_SERIALIZERS.location().getNamespace());
|
||||
/**
|
||||
* Calling {@link Supplier#get()} before {@link NewRegistryEvent} is fired will result in a null registry returned.
|
||||
* Use {@link Keys#STRUCTURE_MODIFIER_SERIALIZERS} to create a {@link DeferredRegister}.
|
||||
*/
|
||||
public static final Supplier<IForgeRegistry<Codec<? extends StructureModifier>>> STRUCTURE_MODIFIER_SERIALIZERS = DEFERRED_STRUCTURE_MODIFIER_SERIALIZERS.makeRegistry(() -> new RegistryBuilder<Codec<? extends StructureModifier>>().disableSaving().disableSync());
|
||||
public static final Supplier<IForgeRegistry<Codec<? extends StructureModifier>>> STRUCTURE_MODIFIER_SERIALIZERS = DEFERRED_STRUCTURE_MODIFIER_SERIALIZERS.makeRegistry(GameData::getStructureModifierSerializersRegistryBuilder);
|
||||
static final DeferredRegister<FluidType> DEFERRED_FLUID_TYPES = DeferredRegister.create(Keys.FLUID_TYPES, Keys.FLUID_TYPES.location().getNamespace());
|
||||
/**
|
||||
* Calling {@link Supplier#get()} before {@link NewRegistryEvent} is fired will result in a null registry returned.
|
||||
|
|
@ -141,6 +143,7 @@ public class ForgeRegistries
|
|||
public static final ResourceKey<Registry<Potion>> POTIONS = key("potion");
|
||||
public static final ResourceKey<Registry<Attribute>> ATTRIBUTES = key("attribute");
|
||||
public static final ResourceKey<Registry<StatType<?>>> STAT_TYPES = key("stat_type");
|
||||
public static final ResourceKey<Registry<ArgumentTypeInfo<?, ?>>> COMMAND_ARGUMENT_TYPES = key("command_argument_type");
|
||||
public static final ResourceKey<Registry<SoundEvent>> SOUND_EVENTS = key("sound_event");
|
||||
public static final ResourceKey<Registry<Enchantment>> ENCHANTMENTS = key("enchantment");
|
||||
public static final ResourceKey<Registry<EntityType<?>>> ENTITY_TYPES = key("entity_type");
|
||||
|
|
@ -167,8 +170,8 @@ public class ForgeRegistries
|
|||
public static final ResourceKey<Registry<Biome>> BIOMES = key("worldgen/biome");
|
||||
|
||||
// Forge
|
||||
public static final ResourceKey<Registry<EntityDataSerializer<?>>> ENTITY_DATA_SERIALIZERS = key("forge:data_serializers");
|
||||
public static final ResourceKey<Registry<Codec<? extends IGlobalLootModifier>>> GLOBAL_LOOT_MODIFIER_SERIALIZERS = key("forge:loot_modifier_serializers");
|
||||
public static final ResourceKey<Registry<EntityDataSerializer<?>>> ENTITY_DATA_SERIALIZERS = key("forge:entity_data_serializers");
|
||||
public static final ResourceKey<Registry<Codec<? extends IGlobalLootModifier>>> GLOBAL_LOOT_MODIFIER_SERIALIZERS = key("forge:global_loot_modifier_serializers");
|
||||
public static final ResourceKey<Registry<Codec<? extends BiomeModifier>>> BIOME_MODIFIER_SERIALIZERS = key("forge:biome_modifier_serializers");
|
||||
public static final ResourceKey<Registry<Codec<? extends StructureModifier>>> STRUCTURE_MODIFIER_SERIALIZERS = key("forge:structure_modifier_serializers");
|
||||
public static final ResourceKey<Registry<FluidType>> FLUID_TYPES = key("forge:fluid_type");
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ import net.minecraftforge.common.ForgeHooks;
|
|||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.loot.IGlobalLootModifier;
|
||||
import net.minecraftforge.common.util.LogMessageAdapter;
|
||||
import net.minecraftforge.common.world.BiomeModifier;
|
||||
import net.minecraftforge.common.world.StructureModifier;
|
||||
import net.minecraftforge.fluids.FluidType;
|
||||
import net.minecraftforge.fml.ModLoader;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
|
|
@ -104,7 +106,6 @@ public class GameData
|
|||
makeRegistry(FLUIDS, "empty").vanillaHolder(Fluid::builtInRegistryHolder).create();
|
||||
makeRegistry(ITEMS, "air").addCallback(ItemCallbacks.INSTANCE).legacyName("items").vanillaHolder(Item::builtInRegistryHolder).create();
|
||||
makeRegistry(MOB_EFFECTS).legacyName("potions").create();
|
||||
//makeRegistry(BIOMES, Biome.class).legacyName("biomes").create();
|
||||
makeRegistry(SOUND_EVENTS).legacyName("soundevents").create();
|
||||
makeRegistry(POTIONS, "empty").legacyName("potiontypes").create();
|
||||
makeRegistry(ENCHANTMENTS).legacyName("enchantments").create();
|
||||
|
|
@ -117,6 +118,7 @@ public class GameData
|
|||
makeRegistry(RECIPE_SERIALIZERS).disableSaving().create();
|
||||
makeRegistry(ATTRIBUTES).onValidate(AttributeCallbacks.INSTANCE).disableSaving().disableSync().create();
|
||||
makeRegistry(STAT_TYPES).create();
|
||||
makeRegistry(COMMAND_ARGUMENT_TYPES).disableSaving().create();
|
||||
|
||||
// Villagers
|
||||
makeRegistry(VILLAGER_PROFESSIONS, "none").create();
|
||||
|
|
@ -148,6 +150,16 @@ public class GameData
|
|||
return makeRegistry(GLOBAL_LOOT_MODIFIER_SERIALIZERS).disableSaving().disableSync();
|
||||
}
|
||||
|
||||
static RegistryBuilder<Codec<? extends BiomeModifier>> getBiomeModifierSerializersRegistryBuilder()
|
||||
{
|
||||
return new RegistryBuilder<Codec<? extends BiomeModifier>>().disableSaving().disableSync();
|
||||
}
|
||||
|
||||
static RegistryBuilder<Codec<? extends StructureModifier>> getStructureModifierSerializersRegistryBuilder()
|
||||
{
|
||||
return new RegistryBuilder<Codec<? extends StructureModifier>>().disableSaving().disableSync();
|
||||
}
|
||||
|
||||
static RegistryBuilder<FluidType> getFluidTypeRegistryBuilder()
|
||||
{
|
||||
return makeRegistry(FLUID_TYPES).disableSaving();
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ protected net.minecraft.client.gui.Gui f_92975_ # lastHealthTime
|
|||
protected net.minecraft.client.gui.Gui f_92976_ # healthBlinkTime
|
||||
protected net.minecraft.client.gui.Gui f_92977_ # screenWidth
|
||||
protected net.minecraft.client.gui.Gui f_92978_ # screenHeight
|
||||
protected net.minecraft.client.gui.Gui f_92979_ # chatListeners
|
||||
protected net.minecraft.client.gui.Gui f_92981_ # VIGNETTE_LOCATION
|
||||
protected net.minecraft.client.gui.Gui f_92982_ # WIDGETS_LOCATION
|
||||
protected net.minecraft.client.gui.Gui f_92983_ # PUMPKIN_BLUR_LOCATION
|
||||
|
|
@ -309,10 +308,12 @@ protected net.minecraft.world.entity.monster.AbstractSkeleton m_7878_()Lnet/mine
|
|||
protected net.minecraft.world.entity.monster.Skeleton m_7878_()Lnet/minecraft/sounds/SoundEvent; # getStepSound - make AbstractSkeletonEntity implementable
|
||||
protected net.minecraft.world.entity.monster.Stray m_7878_()Lnet/minecraft/sounds/SoundEvent; # getStepSound - make AbstractSkeletonEntity implementable
|
||||
protected net.minecraft.world.entity.monster.WitherSkeleton m_7878_()Lnet/minecraft/sounds/SoundEvent; # getStepSound - make AbstractSkeletonEntity implementable
|
||||
public net.minecraft.world.entity.npc.VillagerType <init>(Ljava/lang/String;)V # constructor
|
||||
public net.minecraft.world.entity.player.Player m_6915_()V # closeContainer
|
||||
protected net.minecraft.world.entity.projectile.Projectile <init>(Lnet/minecraft/world/entity/EntityType;Lnet/minecraft/world/level/Level;)V # constructor
|
||||
private-f net.minecraft.world.entity.raid.Raid$RaiderType f_37813_ # VALUES
|
||||
public net.minecraft.world.entity.schedule.Activity <init>(Ljava/lang/String;)V # constructor
|
||||
protected net.minecraft.world.entity.vehicle.AbstractMinecart m_213728_()Lnet/minecraft/world/item/Item; # getDropItem - make AbstractMinecart implementable
|
||||
public net.minecraft.world.inventory.AnvilMenu f_39000_ # repairItemCountCost
|
||||
public net.minecraft.world.inventory.MenuType <init>(Lnet/minecraft/world/inventory/MenuType$MenuSupplier;)V # constructor
|
||||
public net.minecraft.world.inventory.MenuType$MenuSupplier
|
||||
|
|
@ -322,7 +323,7 @@ public net.minecraft.world.item.AxeItem <init>(Lnet/minecraft/world/item/Tier;FF
|
|||
public net.minecraft.world.item.DiggerItem <init>(FFLnet/minecraft/world/item/Tier;Lnet/minecraft/tags/TagKey;Lnet/minecraft/world/item/Item$Properties;)V # constructor
|
||||
public net.minecraft.world.item.HoeItem <init>(Lnet/minecraft/world/item/Tier;IFLnet/minecraft/world/item/Item$Properties;)V # constructor
|
||||
public net.minecraft.world.item.PickaxeItem <init>(Lnet/minecraft/world/item/Tier;IFLnet/minecraft/world/item/Item$Properties;)V # constructor
|
||||
public net.minecraft.world.item.RecordItem <init>(ILnet/minecraft/sounds/SoundEvent;Lnet/minecraft/world/item/Item$Properties;)V # constructor
|
||||
public net.minecraft.world.item.RecordItem <init>(ILnet/minecraft/sounds/SoundEvent;Lnet/minecraft/world/item/Item$Properties;I)V # constructor
|
||||
#endgroup
|
||||
public net.minecraft.world.item.alchemy.PotionBrewing$Mix
|
||||
public net.minecraft.world.item.alchemy.PotionBrewing$Mix f_43533_ # ingredient
|
||||
|
|
@ -507,9 +508,12 @@ public net.minecraft.world.level.levelgen.NoiseGeneratorSettings m_64474_(Lcom/m
|
|||
#endgroup
|
||||
public net.minecraft.world.level.levelgen.WorldGenSettings <init>(JZZLnet/minecraft/core/Registry;Ljava/util/Optional;)V # constructor
|
||||
public net.minecraft.world.level.levelgen.WorldGenSettings f_64606_ # legacyCustomOptions
|
||||
public net.minecraft.world.level.levelgen.feature.featuresize.FeatureSizeType <init>(Lcom/mojang/serialization/Codec;)V # constructor
|
||||
public net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacerType <init>(Lcom/mojang/serialization/Codec;)V # constructor
|
||||
public net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacerType <init>(Lcom/mojang/serialization/Codec;)V # constructor
|
||||
public net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProviderType <init>(Lcom/mojang/serialization/Codec;)V # constructor
|
||||
public net.minecraft.world.level.levelgen.feature.treedecorators.TreeDecoratorType <init>(Lcom/mojang/serialization/Codec;)V # constructor
|
||||
public net.minecraft.world.level.levelgen.feature.trunkplacers.TrunkPlacerType <init>(Lcom/mojang/serialization/Codec;)V # constructor
|
||||
protected net.minecraft.world.level.portal.PortalForcer f_77648_ # level
|
||||
public net.minecraft.world.level.storage.LevelResource <init>(Ljava/lang/String;)V # constructor
|
||||
private-f net.minecraft.world.level.storage.loot.LootPool f_79028_ # rolls
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# Please keep this file organized. And use the forge:checkSAS task to generate/validate inheretance.
|
||||
# So only add the root function that needs to have the annotation stripped.
|
||||
# checkSAS will populate all overrides as nessasary. Prefixing added lines with \t
|
||||
# checkSAS also supports names using . so simplest way to find the correct line to add is to get the AT line from the bot
|
||||
# checkSAS also supports names using . so simplest way to find the correct line to add is to get the AT line from the bot
|
||||
# and remove the access modifier.
|
||||
#==================================================================================================================================
|
||||
net/minecraft/client/resources/model/ModelResourceLocation # ModelResourceLocation class, TODO: Remove in 1.19
|
||||
#==================================================================================================================================
|
||||
|
|
@ -128,8 +128,7 @@ public class CapabilitiesTest
|
|||
{
|
||||
while(messages.size() > 0)
|
||||
{
|
||||
final ChatType system = Minecraft.getInstance().level.registryAccess().registryOrThrow(Registry.CHAT_TYPE_REGISTRY).getOrThrow(ChatType.SYSTEM);
|
||||
Minecraft.getInstance().gui.handleSystemChat(system, Component.literal(Objects.requireNonNull(messages.poll())));
|
||||
Minecraft.getInstance().getChatListener().handleSystemMessage(Component.literal(Objects.requireNonNull(messages.poll())), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public class MusicDiscTest
|
|||
() -> new SoundEvent(new ResourceLocation(MOD_ID, "test_sound_event")));
|
||||
|
||||
private static final RegistryObject<Item> TEST_MUSIC_DISC = ITEMS.register("test_music_disc",
|
||||
() -> new RecordItem(1, TEST_SOUND_EVENT, new Item.Properties().stacksTo(1).rarity(Rarity.EPIC)));
|
||||
() -> new RecordItem(1, TEST_SOUND_EVENT, new Item.Properties().stacksTo(1).rarity(Rarity.EPIC), 20));
|
||||
|
||||
public MusicDiscTest()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue