mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 09:05:17 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40a174310d |
No files matched your search
+3
-2
@@ -24,7 +24,7 @@
|
||||
/projects/clean/
|
||||
/projects/forge/
|
||||
/projects/fmlonly/
|
||||
#/patches/
|
||||
#/patches/*
|
||||
|
||||
#occupational hazards
|
||||
/projects/**/build/
|
||||
@@ -36,7 +36,7 @@ src/generated/resources/.cache/
|
||||
|
||||
#Patch rejects
|
||||
/patches-/
|
||||
#*.patch.rej
|
||||
*.patch.rej
|
||||
/projects/*/rejects/
|
||||
|
||||
# FML changelog
|
||||
@@ -44,3 +44,4 @@ changelog.txt
|
||||
*.py
|
||||
*.7z
|
||||
/logs/
|
||||
|
||||
+24
-30
@@ -43,9 +43,9 @@ ext {
|
||||
]
|
||||
}
|
||||
MAPPING_CHANNEL = 'official'
|
||||
MAPPING_VERSION = '1.17.1'
|
||||
MC_VERSION = '1.17.1'
|
||||
MCP_VERSION = '20210706.113038'
|
||||
MAPPING_VERSION = '1.18'
|
||||
MC_VERSION = '1.18'
|
||||
MCP_VERSION = '20211130.085255'
|
||||
SPI_VERSION = '4.0.10'
|
||||
ACCESSTRANSFORMERS_VERSION = '8.0.4'
|
||||
COREMODS_VERSION = '5.0.1'
|
||||
@@ -63,10 +63,10 @@ ext {
|
||||
FORGE_VERSION = VERSION.substring(MC_VERSION.length() + 1)
|
||||
|
||||
SPECIAL_SOURCE = 'net.md-5:SpecialSource:1.10.0'
|
||||
VIGNETTE = 'net.minecraftforge.lex:vignette:0.2.0.16'
|
||||
BINPATCH_TOOL = 'net.minecraftforge:binarypatcher:1.0.12:fatjar'
|
||||
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.2.7'
|
||||
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.1.4'
|
||||
FART = 'net.minecraftforge:ForgeAutoRenamingTool:0.1.17:all'
|
||||
}
|
||||
|
||||
println('Version: ' + VERSION +
|
||||
@@ -109,7 +109,7 @@ subprojects {
|
||||
}
|
||||
}
|
||||
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(16)
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
||||
|
||||
tasks.withType(Javadoc).configureEach {
|
||||
options.tags = [
|
||||
@@ -285,18 +285,16 @@ def sharedFmlonlyForge = { Project prj ->
|
||||
}
|
||||
} else {
|
||||
prj.task([type: RenameJar, dependsOn: prj.tasks.createMcp2Srg], "create${side}SRG") {
|
||||
tool = VIGNETTE
|
||||
tool = FART
|
||||
args = [
|
||||
'--jar-in', '{input}',
|
||||
'--jar-out', '{output}',
|
||||
'--mapping-format', 'tsrg2',
|
||||
'--mappings', '{mappings}',
|
||||
// '--stable',
|
||||
'--create-inits', '--fix-param-annotations', '--fernflower-meta'
|
||||
'--input', '{input}',
|
||||
'--output', '{output}',
|
||||
'--names', '{mappings}',
|
||||
'--ann-fix', '--ids-fix', '--src-fix', '--record-fix'
|
||||
]
|
||||
mappings = prj.tasks.createMcp2Srg.srg
|
||||
input = prj.tasks.getByName("download${side}Slim").output
|
||||
output = file("build/create${side}SRG/output.jar")
|
||||
output = prj.file("build/create${side}SRG/output.jar")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -726,15 +724,13 @@ project(':fmlonly') {
|
||||
'{MC_EXTRA}': '{MC_EXTRA_SHA}'
|
||||
]
|
||||
], [
|
||||
jar: VIGNETTE,
|
||||
classpath: getClasspath(project, libs, VIGNETTE),
|
||||
jar: FART,
|
||||
classpath: getClasspath(project, libs, FART),
|
||||
args: [
|
||||
'--jar-in', '{MC_SLIM}',
|
||||
'--jar-out', '{MC_SRG}',
|
||||
'--mapping-format', 'tsrg2',
|
||||
'--mappings', '{MERGED_MAPPINGS}',
|
||||
// '--stable',
|
||||
'--create-inits', '--fix-param-annotations', '--fernflower-meta'
|
||||
'--input', '{MC_SLIM}',
|
||||
'--output', '{MC_SRG}',
|
||||
'--names', '{MERGED_MAPPINGS}',
|
||||
'--ann-fix', '--ids-fix', '--src-fix', '--record-fix'
|
||||
]/*,
|
||||
outputs: [
|
||||
'{MC_SRG}': '{MC_SRG_SHA}'
|
||||
@@ -1250,15 +1246,13 @@ project(':forge') {
|
||||
'{MC_EXTRA}': '{MC_EXTRA_SHA}'
|
||||
]
|
||||
], [
|
||||
jar: VIGNETTE,
|
||||
classpath: getClasspath(project, libs, VIGNETTE),
|
||||
jar: FART,
|
||||
classpath: getClasspath(project, libs, FART),
|
||||
args: [
|
||||
'--jar-in', '{MC_SLIM}',
|
||||
'--jar-out', '{MC_SRG}',
|
||||
'--mapping-format', 'tsrg2',
|
||||
'--mappings', '{MERGED_MAPPINGS}',
|
||||
// '--stable',
|
||||
'--create-inits', '--fix-param-annotations', '--fernflower-meta'
|
||||
'--input', '{MC_SLIM}',
|
||||
'--output', '{MC_SRG}',
|
||||
'--names', '{MERGED_MAPPINGS}',
|
||||
'--ann-fix', '--ids-fix', '--src-fix', '--record-fix'
|
||||
]/*,
|
||||
outputs: [
|
||||
'{MC_SRG}': '{MC_SRG_SHA}'
|
||||
@@ -1341,7 +1335,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: "1."+((MC_VERSION.split("[\\.-]")[1] as int)+1)
|
||||
])
|
||||
rename 'gitignore\\.txt', '.gitignore'
|
||||
rename 'gitattributes\\.txt', '.gitattributes'
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package net.minecraftforge.fml;
|
||||
|
||||
import cpw.mods.modlauncher.util.ServiceLoaderUtils;
|
||||
import net.minecraftforge.eventbus.api.BusBuilder;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.fml.config.IConfigEvent;
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
|
||||
@@ -28,13 +28,13 @@ public interface IExtensionPoint<T extends Record>
|
||||
* Compatibility display test for the mod.
|
||||
* Used for displaying compatibility with remote servers with the same mod, and on disk saves.
|
||||
*
|
||||
* The supplier provides my "local" version for sending across the network or writing to disk
|
||||
* The predicate tests the version from a remote instance or save for acceptability (Boolean is true for network, false for local save)
|
||||
* The supplier provides my "local" version for sending across the impl or writing to disk
|
||||
* The predicate tests the version from a remote instance or save for acceptability (Boolean is true for impl, false for local save)
|
||||
* and returns true if the version is compatible.
|
||||
*
|
||||
* <p>Return {@code net.minecraftforge.fmllegacy.network.FMLNetworkConstants#IGNORESERVERONLY} in the supplier, if you wish to be ignored
|
||||
* <p>Return {@code net.minecraftforge.impl.impl.FMLNetworkConstants#IGNORESERVERONLY} in the supplier, if you wish to be ignored
|
||||
* as a server side only mod.</p>
|
||||
* <p>Return true in the predicate for all values of the input string (when network boolean is true) if you are client side,
|
||||
* <p>Return true in the predicate for all values of the input string (when impl boolean is true) if you are client side,
|
||||
* and don't care about matching any potential server version.</p>
|
||||
*
|
||||
* <p>
|
||||
|
||||
@@ -34,7 +34,6 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package net.minecraftforge.fml;
|
||||
|
||||
import com.google.common.graph.GraphBuilder;
|
||||
import com.google.common.graph.MutableGraph;
|
||||
import cpw.mods.modlauncher.util.ServiceLoaderUtils;
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
import net.minecraftforge.fml.loading.toposort.TopologicalSort;
|
||||
|
||||
@@ -43,7 +43,6 @@ import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2021.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.common.asm;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import org.objectweb.asm.Opcodes;
|
||||
import org.objectweb.asm.Type;
|
||||
import org.objectweb.asm.tree.AnnotationNode;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
import cpw.mods.modlauncher.serviceapi.ILaunchPluginService;
|
||||
|
||||
/**
|
||||
* Removes the final modifier from fields with the @CapabilityInject annotation, prevents the JITer from in lining them so our runtime replacements can work.
|
||||
*/
|
||||
@Deprecated(since = "1.18", forRemoval = true)
|
||||
public class CapabilityInjectDefinalize implements ILaunchPluginService {
|
||||
|
||||
private final String CAP = "Lnet/minecraftforge/common/capabilities/Capability;"; //Don't directly reference this to prevent class loading.
|
||||
private final String CAP_INJECT = "Lnet/minecraftforge/common/capabilities/CapabilityInject;"; //Don't directly reference this to prevent class loading.
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "capability_inject_definalize";
|
||||
}
|
||||
|
||||
private static final EnumSet<Phase> YAY = EnumSet.of(Phase.AFTER);
|
||||
private static final EnumSet<Phase> NAY = EnumSet.noneOf(Phase.class);
|
||||
|
||||
@Override
|
||||
public EnumSet<Phase> handlesClass(Type classType, boolean isEmpty)
|
||||
{
|
||||
return isEmpty ? NAY : YAY;
|
||||
}
|
||||
|
||||
private boolean hasHolder(List<AnnotationNode> lst)
|
||||
{
|
||||
return lst != null && lst.stream().anyMatch(n -> n.desc.equals(CAP_INJECT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int processClassWithFlags(final Phase phase, final ClassNode classNode, final Type classType, final String reason)
|
||||
{
|
||||
final int flags = Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC | Opcodes.ACC_FINAL;
|
||||
final AtomicBoolean changed = new AtomicBoolean();
|
||||
classNode.fields.stream().filter(f -> ((f.access & flags) == flags) && f.desc.equals(CAP) && hasHolder(f.visibleAnnotations)).forEach(f ->
|
||||
{
|
||||
int prev = f.access;
|
||||
f.access &= ~Opcodes.ACC_FINAL; //Strip final
|
||||
f.access |= Opcodes.ACC_SYNTHETIC; //Add Synthetic so we can check in runtime.
|
||||
changed.compareAndSet(false, prev != f.access);
|
||||
});
|
||||
|
||||
return changed.get() ? ComputeFlags.SIMPLE_REWRITE : ComputeFlags.NO_REWRITE;
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.common.asm;
|
||||
package net.minecraftforge.fml.common.asm;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Deque;
|
||||
+1
-2
@@ -17,9 +17,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.common.asm;
|
||||
package net.minecraftforge.fml.common.asm;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
+1
-2
@@ -17,9 +17,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.common.asm;
|
||||
package net.minecraftforge.fml.common.asm;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -24,15 +24,12 @@ import com.electronwill.nightconfig.core.file.CommentedFileConfig;
|
||||
import com.electronwill.nightconfig.core.file.FileNotFoundAction;
|
||||
import com.electronwill.nightconfig.core.io.ParsingException;
|
||||
import com.electronwill.nightconfig.core.io.WritingMode;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.CORE;
|
||||
|
||||
|
||||
@@ -23,9 +23,12 @@ import cpw.mods.modlauncher.Launcher;
|
||||
import cpw.mods.modlauncher.api.*;
|
||||
import cpw.mods.modlauncher.serviceapi.ILaunchPluginService;
|
||||
import cpw.mods.modlauncher.util.ServiceLoaderUtils;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.BackgroundScanHandler;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ModFile;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ModValidator;
|
||||
import net.minecraftforge.accesstransformer.service.AccessTransformerService;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.*;
|
||||
import net.minecraftforge.fml.loading.progress.EarlyProgressVisualization;
|
||||
import net.minecraftforge.fml.loading.progress.StartupMessageManager;
|
||||
import net.minecraftforge.fml.loading.targets.CommonLaunchHandler;
|
||||
|
||||
@@ -78,7 +78,7 @@ public class FMLServiceProvider implements ITransformationService
|
||||
LOGGER.debug(CORE, "Loading configuration");
|
||||
FMLConfig.load();
|
||||
LOGGER.debug(CORE, "Preparing ModFile");
|
||||
environment.computePropertyIfAbsent(Environment.Keys.MODFILEFACTORY.get(), k->ModFile.buildFactory());
|
||||
environment.computePropertyIfAbsent(Environment.Keys.MODFILEFACTORY.get(), k->ModFile::new);
|
||||
arguments = new HashMap<>();
|
||||
arguments.put("modLists", modListsArgumentList);
|
||||
arguments.put("mods", modsArgumentList);
|
||||
|
||||
@@ -32,11 +32,7 @@ import org.apache.maven.artifact.versioning.ArtifactVersion;
|
||||
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
|
||||
import org.apache.maven.artifact.versioning.VersionRange;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
@@ -22,14 +22,8 @@ package net.minecraftforge.fml.loading;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.CORE;
|
||||
|
||||
public class LibraryFinder {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -44,39 +38,9 @@ public class LibraryFinder {
|
||||
return libsPath;
|
||||
}
|
||||
|
||||
// Not used anywhere in Forge's codebase, scheduled for deletion unless a good need is expressed.
|
||||
@Deprecated(forRemoval = true, since = "1.17.1")
|
||||
public static Path findJarPathFor(final String className, final String jarName) {
|
||||
final URL resource = LibraryFinder.class.getClassLoader().getResource(className);
|
||||
return findJarPathFor(className, jarName, resource);
|
||||
}
|
||||
|
||||
/*
|
||||
* Only used in ClasspathLocator now, so moved too a private method and depreciated this.
|
||||
* Scheduled for deletion unless a good need is expressed.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.17.1")
|
||||
public static Path findJarPathFor(final String resourceName, final String jarName, final URL resource) {
|
||||
try {
|
||||
Path path;
|
||||
final URI uri = resource.toURI();
|
||||
if (uri.getScheme().equals("jar") && uri.getRawSchemeSpecificPart().contains("!/")) {
|
||||
int lastExcl = uri.getRawSchemeSpecificPart().lastIndexOf("!/");
|
||||
path = Paths.get(new URI(uri.getRawSchemeSpecificPart().substring(0, lastExcl)));
|
||||
} else {
|
||||
path = Paths.get(new URI("file://"+uri.getRawSchemeSpecificPart().substring(0, uri.getRawSchemeSpecificPart().length()-resourceName.length())));
|
||||
}
|
||||
LOGGER.debug(CORE, "Found JAR {} at path {}", jarName, path.toString());
|
||||
return path;
|
||||
} catch (NullPointerException | URISyntaxException e) {
|
||||
LOGGER.fatal(CORE, "Failed to find JAR for class {} - {}", resourceName, jarName);
|
||||
throw new RuntimeException("Unable to locate "+resourceName+" - "+jarName, e);
|
||||
}
|
||||
}
|
||||
|
||||
static Path getForgeLibraryPath(final String mcVersion, final String forgeVersion, final String forgeGroup) {
|
||||
Path forgePath = findLibsPath().resolve(MavenCoordinateResolver.get(forgeGroup, "forge", "", "universal", mcVersion+"-"+forgeVersion));
|
||||
LOGGER.debug(CORE, "Found forge path {} is {}", forgePath, pathStatus(forgePath));
|
||||
LOGGER.debug(LogMarkers.CORE, "Found forge path {} is {}", forgePath, pathStatus(forgePath));
|
||||
return forgePath;
|
||||
}
|
||||
|
||||
@@ -88,9 +52,9 @@ public class LibraryFinder {
|
||||
Path srgMcPath = findLibsPath().resolve(MavenCoordinateResolver.get("net.minecraft", type, "", "srg", mcVersion+"-"+mcpVersion));
|
||||
Path mcExtrasPath = findLibsPath().resolve(MavenCoordinateResolver.get("net.minecraft", type, "", "extra", mcVersion+"-"+mcpVersion));
|
||||
Path patchedBinariesPath = findLibsPath().resolve(MavenCoordinateResolver.get(forgeGroup, "forge", "", type, mcVersion+"-"+forgeVersion));
|
||||
LOGGER.debug(CORE,"SRG MC at {} is {}", srgMcPath.toString(), pathStatus(srgMcPath));
|
||||
LOGGER.debug(CORE,"MC Extras at {} is {}", mcExtrasPath.toString(), pathStatus(mcExtrasPath));
|
||||
LOGGER.debug(CORE,"Forge patches at {} is {}", patchedBinariesPath.toString(), pathStatus(patchedBinariesPath));
|
||||
LOGGER.debug(LogMarkers.CORE,"SRG MC at {} is {}", srgMcPath.toString(), pathStatus(srgMcPath));
|
||||
LOGGER.debug(LogMarkers.CORE,"MC Extras at {} is {}", mcExtrasPath.toString(), pathStatus(mcExtrasPath));
|
||||
LOGGER.debug(LogMarkers.CORE,"Forge patches at {} is {}", patchedBinariesPath.toString(), pathStatus(patchedBinariesPath));
|
||||
return new Path[] { patchedBinariesPath, mcExtrasPath, srgMcPath };
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,6 @@ import java.util.Map;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.CORE;
|
||||
|
||||
public class MCPNamingService implements INameMappingService {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private HashMap<String, String> methods;
|
||||
@@ -58,7 +56,7 @@ public class MCPNamingService implements INameMappingService {
|
||||
HashMap<String,String> tmpmethods = new HashMap<>(1000);
|
||||
loadMappings("methods.csv", tmpmethods::put);
|
||||
methods = tmpmethods;
|
||||
LOGGER.debug(CORE, "Loaded {} method mappings from methods.csv", methods.size());
|
||||
LOGGER.debug(LogMarkers.CORE, "Loaded {} method mappings from methods.csv", methods.size());
|
||||
}
|
||||
return methods.getOrDefault(origin, origin);
|
||||
}
|
||||
@@ -68,7 +66,7 @@ public class MCPNamingService implements INameMappingService {
|
||||
HashMap<String,String> tmpfields = new HashMap<>(1000);
|
||||
loadMappings("fields.csv", tmpfields::put);
|
||||
fields = tmpfields;
|
||||
LOGGER.debug(CORE, "Loaded {} field mappings from fields.csv", fields.size());
|
||||
LOGGER.debug(LogMarkers.CORE, "Loaded {} field mappings from fields.csv", fields.size());
|
||||
}
|
||||
return fields.getOrDefault(origin, origin);
|
||||
}
|
||||
@@ -81,7 +79,7 @@ public class MCPNamingService implements INameMappingService {
|
||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(path.openStream()))) {
|
||||
reader.lines().skip(1).map(e -> e.split(",")).forEach(e -> mapStore.accept(e[0], e[1]));
|
||||
} catch (IOException e1) {
|
||||
LOGGER.error(CORE, "Error reading mappings", e1);
|
||||
LOGGER.error(LogMarkers.CORE, "Error reading mappings", e1);
|
||||
}
|
||||
}
|
||||
}
|
||||
-1
@@ -30,7 +30,6 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.zip.ZipFile;
|
||||
|
||||
public class ModDirTransformerDiscoverer implements ITransformerDiscoveryService {
|
||||
|
||||
@@ -32,14 +32,12 @@ import net.minecraftforge.fml.loading.toposort.TopologicalSort;
|
||||
import net.minecraftforge.forgespi.locating.IModFile;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.util.StringBuilderFormattable;
|
||||
import org.apache.maven.artifact.versioning.ArtifactVersion;
|
||||
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.util.stream.Collectors.*;
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
package net.minecraftforge.fml.loading;
|
||||
|
||||
import net.minecraftforge.forgespi.language.MavenVersionAdapter;
|
||||
import org.apache.maven.artifact.versioning.ArtifactVersion;
|
||||
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
|
||||
import org.apache.maven.artifact.versioning.VersionRange;
|
||||
|
||||
+6
-7
@@ -21,6 +21,7 @@ package net.minecraftforge.fml.loading.moddiscovery;
|
||||
|
||||
import cpw.mods.jarhandling.SecureJar;
|
||||
import cpw.mods.jarhandling.JarMetadata;
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import net.minecraftforge.forgespi.language.IConfigurable;
|
||||
import net.minecraftforge.forgespi.language.IModFileInfo;
|
||||
import net.minecraftforge.forgespi.language.IModInfo;
|
||||
@@ -42,8 +43,6 @@ import java.util.jar.Manifest;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.SCAN;
|
||||
|
||||
public abstract class AbstractJarFileLocator implements IModLocator {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
protected static final String MODS_TOML = "META-INF/mods.toml";
|
||||
@@ -51,14 +50,14 @@ public abstract class AbstractJarFileLocator implements IModLocator {
|
||||
|
||||
@Override
|
||||
public void scanFile(final IModFile file, final Consumer<Path> pathConsumer) {
|
||||
LOGGER.debug(SCAN,"Scan started: {}", file);
|
||||
LOGGER.debug(LogMarkers.SCAN,"Scan started: {}", file);
|
||||
final Function<Path, SecureJar.Status> status = p->file.getSecureJar().verifyPath(p);
|
||||
try (Stream<Path> files = Files.find(file.getSecureJar().getRootPath(), Integer.MAX_VALUE, (p, a) -> p.getNameCount() > 0 && p.getFileName().toString().endsWith(".class"))) {
|
||||
file.setSecurityStatus(files.peek(pathConsumer).map(status).reduce((s1, s2)-> SecureJar.Status.values()[Math.min(s1.ordinal(), s2.ordinal())]).orElse(SecureJar.Status.INVALID));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
LOGGER.debug(SCAN,"Scan finished: {}", file);
|
||||
LOGGER.debug(LogMarkers.SCAN,"Scan finished: {}", file);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -89,10 +88,10 @@ public abstract class AbstractJarFileLocator implements IModLocator {
|
||||
IModFile mod = null;
|
||||
var type = sj.getManifest().getMainAttributes().getValue(ModFile.TYPE);
|
||||
if (sj.findFile(MODS_TOML).isPresent()) {
|
||||
LOGGER.debug(SCAN, "Found {} mod of type {}: {}", MODS_TOML, type, path);
|
||||
mod = ModFile.newFMLInstance(this, sj);
|
||||
LOGGER.debug(LogMarkers.SCAN, "Found {} mod of type {}: {}", MODS_TOML, type, path);
|
||||
mod = new ModFile(sj, this, ModFileParser::modsTomlParser);
|
||||
} else if (type != null) {
|
||||
LOGGER.debug(SCAN, "Found {} mod of type {}: {}", MANIFEST, type, path);
|
||||
LOGGER.debug(LogMarkers.SCAN, "Found {} mod of type {}: {}", MANIFEST, type, path);
|
||||
mod = new ModFile(sj, this, this::manifestParser);
|
||||
} else {
|
||||
return Optional.empty();
|
||||
|
||||
+3
-4
@@ -19,8 +19,9 @@
|
||||
|
||||
package net.minecraftforge.fml.loading.moddiscovery;
|
||||
|
||||
import net.minecraftforge.forgespi.language.ModFileScanData;
|
||||
import net.minecraftforge.fml.loading.LoadingModList;
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import net.minecraftforge.forgespi.language.ModFileScanData;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -30,8 +31,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.SCAN;
|
||||
|
||||
public class BackgroundScanHandler
|
||||
{
|
||||
private enum ScanStatus {
|
||||
@@ -87,7 +86,7 @@ public class BackgroundScanHandler
|
||||
private void addCompletedFile(final ModFile file, final ModFileScanData modFileScanData, final Throwable throwable) {
|
||||
if (throwable != null) {
|
||||
status = ScanStatus.ERRORED;
|
||||
LOGGER.error(SCAN,"An error occurred scanning file {}", file, throwable);
|
||||
LOGGER.error(LogMarkers.SCAN,"An error occurred scanning file {}", file, throwable);
|
||||
}
|
||||
pendingFiles.remove(file);
|
||||
scannedFiles.add(file);
|
||||
|
||||
+3
-3
@@ -19,6 +19,7 @@
|
||||
|
||||
package net.minecraftforge.fml.loading.moddiscovery;
|
||||
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -36,7 +37,6 @@ import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.SCAN;
|
||||
|
||||
public class ClasspathLocator extends AbstractJarFileLocator {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -62,7 +62,7 @@ public class ClasspathLocator extends AbstractJarFileLocator {
|
||||
|
||||
return paths.build();
|
||||
} catch (IOException e) {
|
||||
LOGGER.fatal(SCAN, "Error trying to find resources", e);
|
||||
LOGGER.fatal(LogMarkers.SCAN, "Error trying to find resources", e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public class ClasspathLocator extends AbstractJarFileLocator {
|
||||
//LOGGER.debug(CORE, "Found JAR {} at path {}", jarName, path.toString());
|
||||
return path;
|
||||
} catch (NullPointerException | URISyntaxException e) {
|
||||
LOGGER.fatal(SCAN, "Failed to find JAR for class {} - {}", resourceName, jarName);
|
||||
LOGGER.fatal(LogMarkers.SCAN, "Failed to find JAR for class {} - {}", resourceName, jarName);
|
||||
throw new RuntimeException("Unable to locate "+resourceName+" - "+jarName, e);
|
||||
}
|
||||
}
|
||||
|
||||
+9
-7
@@ -19,6 +19,7 @@
|
||||
|
||||
package net.minecraftforge.fml.loading.moddiscovery;
|
||||
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import net.minecraftforge.forgespi.locating.IModFile;
|
||||
import net.minecraftforge.forgespi.locating.IModLocator;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -34,9 +35,6 @@ import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.LOADING;
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.SCAN;
|
||||
|
||||
public class ExplodedDirectoryLocator implements IModLocator {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
@@ -47,8 +45,12 @@ public class ExplodedDirectoryLocator implements IModLocator {
|
||||
|
||||
@Override
|
||||
public List<IModFile> scanMods() {
|
||||
explodedMods.forEach(explodedMod -> ModJarMetadata.buildFile(this, jar ->jar.findFile("/META-INF/mods.toml").isPresent(), explodedMod.paths().toArray(Path[]::new))
|
||||
.ifPresentOrElse(f->mods.put(explodedMod, f), () -> LOGGER.warn(LOADING, "Failed to find exploded resource mods.toml in directory {}", explodedMod.paths().get(0).toString())));
|
||||
explodedMods.forEach(explodedMod ->
|
||||
ModJarMetadata.buildFile(this,
|
||||
jar->jar.findFile("/META-INF/mods.toml").isPresent(),
|
||||
(a,b) -> true,
|
||||
explodedMod.paths().toArray(Path[]::new))
|
||||
.ifPresentOrElse(f->mods.put(explodedMod, f), () -> LOGGER.warn(LogMarkers.LOADING, "Failed to find exploded resource mods.toml in directory {}", explodedMod.paths().get(0).toString())));
|
||||
return List.copyOf(mods.values());
|
||||
}
|
||||
|
||||
@@ -59,13 +61,13 @@ public class ExplodedDirectoryLocator implements IModLocator {
|
||||
|
||||
@Override
|
||||
public void scanFile(final IModFile file, final Consumer<Path> pathConsumer) {
|
||||
LOGGER.debug(SCAN,"Scanning exploded directory {}", file.getFilePath().toString());
|
||||
LOGGER.debug(LogMarkers.SCAN,"Scanning exploded directory {}", file.getFilePath().toString());
|
||||
try (Stream<Path> files = Files.find(file.getSecureJar().getRootPath(), Integer.MAX_VALUE, (p, a) -> p.getNameCount() > 0 && p.getFileName().toString().endsWith(".class"))) {
|
||||
files.forEach(pathConsumer);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
LOGGER.debug(SCAN,"Exploded directory scan complete {}", file.getFilePath().toString());
|
||||
LOGGER.debug(LogMarkers.SCAN,"Exploded directory scan complete {}", file.getFilePath().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+10
-8
@@ -1,11 +1,10 @@
|
||||
package net.minecraftforge.fml.loading.moddiscovery;
|
||||
|
||||
import com.electronwill.nightconfig.core.Config;
|
||||
import com.electronwill.nightconfig.core.file.FileConfig;
|
||||
import cpw.mods.jarhandling.SecureJar;
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import net.minecraftforge.forgespi.language.IModFileInfo;
|
||||
import net.minecraftforge.forgespi.language.MavenVersionAdapter;
|
||||
import net.minecraftforge.forgespi.locating.IModFile;
|
||||
import net.minecraftforge.forgespi.locating.IModLocator;
|
||||
import net.minecraftforge.forgespi.locating.ModFileFactory;
|
||||
@@ -18,8 +17,6 @@ import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.LOADING;
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.SCAN;
|
||||
|
||||
public class MinecraftLocator implements IModLocator {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -29,8 +26,13 @@ public class MinecraftLocator implements IModLocator {
|
||||
final var launchHandler = FMLLoader.getLaunchHandler();
|
||||
var baseMC = launchHandler.getMinecraftPaths();
|
||||
var mcjar = ModJarMetadata.buildFile(j->ModFileFactory.FACTORY.build(j, this, this::buildMinecraftTOML), j->true, baseMC.minecraftFilter(), baseMC.minecraftPaths().toArray(Path[]::new)).orElseThrow();
|
||||
var artifacts = baseMC.otherArtifacts().stream().map(SecureJar::from).map(sj->ModFile.newFMLInstance(this, sj)).collect(Collectors.<IModFile>toList());
|
||||
var othermods = baseMC.otherModPaths().stream().map(p->ModJarMetadata.buildFile(this, p.toArray(Path[]::new))).toList();
|
||||
var artifacts = baseMC.otherArtifacts().stream()
|
||||
.map(SecureJar::from)
|
||||
.map(sj -> new ModFile(sj, this, ModFileParser::modsTomlParser))
|
||||
.collect(Collectors.<IModFile>toList());
|
||||
var othermods = baseMC.otherModPaths().stream()
|
||||
.map(p->ModJarMetadata.buildFile(this, p.toArray(Path[]::new)))
|
||||
.toList();
|
||||
artifacts.add(mcjar);
|
||||
artifacts.addAll(othermods);
|
||||
return artifacts;
|
||||
@@ -97,13 +99,13 @@ public class MinecraftLocator implements IModLocator {
|
||||
|
||||
@Override
|
||||
public void scanFile(final IModFile modFile, final Consumer<Path> pathConsumer) {
|
||||
LOGGER.debug(SCAN, "Scan started: {}", modFile);
|
||||
LOGGER.debug(LogMarkers.SCAN, "Scan started: {}", modFile);
|
||||
try (Stream<Path> files = Files.find(modFile.getSecureJar().getRootPath(), Integer.MAX_VALUE, (p, a) -> p.getNameCount() > 0 && p.getFileName().toString().endsWith(".class"))) {
|
||||
files.forEach(pathConsumer);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
LOGGER.debug(SCAN, "Scan finished: {}", modFile);
|
||||
LOGGER.debug(LogMarkers.SCAN, "Scan finished: {}", modFile);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-8
@@ -22,6 +22,7 @@ package net.minecraftforge.fml.loading.moddiscovery;
|
||||
import cpw.mods.modlauncher.Launcher;
|
||||
import cpw.mods.modlauncher.api.IModuleLayerManager;
|
||||
import cpw.mods.modlauncher.util.ServiceLoaderUtils;
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import net.minecraftforge.fml.loading.progress.StartupMessageManager;
|
||||
import net.minecraftforge.forgespi.Environment;
|
||||
import net.minecraftforge.forgespi.locating.IModFile;
|
||||
@@ -35,9 +36,6 @@ import java.util.Map;
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.CORE;
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.SCAN;
|
||||
|
||||
public class ModDiscoverer {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private final ServiceLoader<IModLocator> locators;
|
||||
@@ -45,12 +43,12 @@ public class ModDiscoverer {
|
||||
|
||||
public ModDiscoverer(Map<String, ?> arguments) {
|
||||
Launcher.INSTANCE.environment().computePropertyIfAbsent(Environment.Keys.MODDIRECTORYFACTORY.get(), v->ModsFolderLocator::new);
|
||||
Launcher.INSTANCE.environment().computePropertyIfAbsent(Environment.Keys.PROGRESSMESSAGE.get(), v->StartupMessageManager.locatorConsumer().orElseGet(()->s->{}));
|
||||
Launcher.INSTANCE.environment().computePropertyIfAbsent(Environment.Keys.PROGRESSMESSAGE.get(), v-> StartupMessageManager.locatorConsumer().orElseGet(()-> s->{}));
|
||||
final var moduleLayerManager = Launcher.INSTANCE.environment().findModuleLayerManager().orElseThrow();
|
||||
locators = ServiceLoader.load(moduleLayerManager.getLayer(IModuleLayerManager.Layer.SERVICE).orElseThrow(), IModLocator.class);
|
||||
locatorList = ServiceLoaderUtils.streamServiceLoader(()->locators, sce->LOGGER.error("Failed to load locator list", sce)).collect(Collectors.toList());
|
||||
locatorList.forEach(l->l.initArguments(arguments));
|
||||
LOGGER.debug(CORE,"Found Mod Locators : {}", ()->locatorList.stream().map(iModLocator -> "("+iModLocator.name() + ":" + iModLocator.getClass().getPackage().getImplementationVersion()+")").collect(Collectors.joining(",")));
|
||||
LOGGER.debug(LogMarkers.CORE,"Found Mod Locators : {}", ()->locatorList.stream().map(iModLocator -> "("+iModLocator.name() + ":" + iModLocator.getClass().getPackage().getImplementationVersion()+")").collect(Collectors.joining(",")));
|
||||
}
|
||||
|
||||
ModDiscoverer(List<IModLocator> locatorList) {
|
||||
@@ -59,13 +57,13 @@ public class ModDiscoverer {
|
||||
}
|
||||
|
||||
public ModValidator discoverMods() {
|
||||
LOGGER.debug(SCAN,"Scanning for mods and other resources to load. We know {} ways to find mods", locatorList.size());
|
||||
LOGGER.debug(LogMarkers.SCAN,"Scanning for mods and other resources to load. We know {} ways to find mods", locatorList.size());
|
||||
var loadedFiles = new ArrayList<>();
|
||||
for (IModLocator locator : locatorList) {
|
||||
LOGGER.debug(SCAN,"Trying locator {}", locator);
|
||||
LOGGER.debug(LogMarkers.SCAN,"Trying locator {}", locator);
|
||||
var modFiles = locator.scanMods();
|
||||
for (IModFile mf : modFiles) {
|
||||
LOGGER.info(SCAN, "Found mod file {} of type {} with locator {}", mf.getFileName(), mf.getType(), mf.getLocator());
|
||||
LOGGER.info(LogMarkers.SCAN, "Found mod file {} of type {} with locator {}", mf.getFileName(), mf.getType(), mf.getLocator());
|
||||
StartupMessageManager.modLoaderConsumer().ifPresent(c->c.accept("Found mod file "+mf.getFileName()+" of type "+mf.getType()));
|
||||
}
|
||||
loadedFiles.addAll(modFiles);
|
||||
|
||||
@@ -21,8 +21,9 @@ package net.minecraftforge.fml.loading.moddiscovery;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import cpw.mods.jarhandling.SecureJar;
|
||||
import net.minecraftforge.fml.loading.progress.StartupMessageManager;
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import net.minecraftforge.fml.loading.progress.StartupMessageManager;
|
||||
import net.minecraftforge.forgespi.language.IModFileInfo;
|
||||
import net.minecraftforge.forgespi.language.IModInfo;
|
||||
import net.minecraftforge.forgespi.language.IModLanguageProvider;
|
||||
@@ -46,11 +47,9 @@ import java.util.function.Supplier;
|
||||
import java.util.jar.Attributes;
|
||||
import java.util.jar.Manifest;
|
||||
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.LOADING;
|
||||
|
||||
public class ModFile implements IModFile {
|
||||
// Mods either must have a mods.toml or a manifest. We can no longer just put any jar on the classpath.
|
||||
@Deprecated(forRemoval = true, since = "1.17.1")
|
||||
@Deprecated(forRemoval = true, since = "1.18")
|
||||
public static final Manifest DEFAULTMANIFEST;
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
@@ -74,8 +73,7 @@ public class ModFile implements IModFile {
|
||||
private List<CoreModFile> coreMods;
|
||||
private Path accessTransformer;
|
||||
|
||||
//TODO: Make package private in 1.18+
|
||||
public static final Attributes.Name TYPE = new Attributes.Name("FMLModType");
|
||||
static final Attributes.Name TYPE = new Attributes.Name("FMLModType");
|
||||
private SecureJar.Status securityStatus;
|
||||
|
||||
public ModFile(final SecureJar jar, final IModLocator locator, final ModFileFactory.ModFileInfoParser parser) {
|
||||
@@ -120,9 +118,9 @@ public class ModFile implements IModFile {
|
||||
public boolean identifyMods() {
|
||||
this.modFileInfo = ModFileParser.readModList(this, this.parser);
|
||||
if (this.modFileInfo == null) return this.getType() != Type.MOD;
|
||||
LOGGER.debug(LOADING,"Loading mod file {} with languages {}", this.getFilePath(), this.modFileInfo.requiredLanguageLoaders());
|
||||
LOGGER.debug(LogMarkers.LOADING,"Loading mod file {} with languages {}", this.getFilePath(), this.modFileInfo.requiredLanguageLoaders());
|
||||
this.coreMods = ModFileParser.getCoreMods(this);
|
||||
this.coreMods.forEach(mi-> LOGGER.debug(LOADING,"Found coremod {}", mi.getPath()));
|
||||
this.coreMods.forEach(mi-> LOGGER.debug(LogMarkers.LOADING,"Found coremod {}", mi.getPath()));
|
||||
this.accessTransformer = findResource("META-INF", "accesstransformer.cfg");
|
||||
return true;
|
||||
}
|
||||
@@ -189,7 +187,7 @@ public class ModFile implements IModFile {
|
||||
|
||||
public void identifyLanguage() {
|
||||
this.loaders = this.modFileInfo.requiredLanguageLoaders().stream()
|
||||
.map(spec->FMLLoader.getLanguageLoadingProvider().findLanguage(this, spec.languageName(), spec.acceptedVersions()))
|
||||
.map(spec-> FMLLoader.getLanguageLoadingProvider().findLanguage(this, spec.languageName(), spec.acceptedVersions()))
|
||||
.toList();
|
||||
}
|
||||
|
||||
@@ -213,24 +211,6 @@ public class ModFile implements IModFile {
|
||||
return modFileInfo;
|
||||
}
|
||||
|
||||
// TODO: Remove concept of factory from forgeapi.. Why expose this?
|
||||
@Deprecated(forRemoval = true, since="1.17.1")
|
||||
public static ModFileFactory buildFactory() {
|
||||
return ModFile::new;
|
||||
}
|
||||
|
||||
// TODO: Remove helper functions to cleanup api
|
||||
@Deprecated(forRemoval = true, since="1.17.1")
|
||||
public static ModFile newFMLInstance(final IModLocator locator, final SecureJar jar) {
|
||||
return (ModFile) ModFileFactory.FACTORY.build(jar, locator, ModFileParser::modsTomlParser);
|
||||
}
|
||||
|
||||
// TODO: Remove helper functions to cleanup api
|
||||
@Deprecated(forRemoval = true, since="1.17.1")
|
||||
public static ModFile newFMLInstance(final IModLocator locator, final Path... paths) {
|
||||
return (ModFile) ModJarMetadata.buildFile(locator, paths);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSecurityStatus(final SecureJar.Status status) {
|
||||
this.securityStatus = status;
|
||||
|
||||
+2
-3
@@ -21,6 +21,7 @@ package net.minecraftforge.fml.loading.moddiscovery;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import cpw.mods.modlauncher.api.LamdbaExceptionUtils;
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import net.minecraftforge.fml.loading.StringUtils;
|
||||
import net.minecraftforge.forgespi.language.IConfigurable;
|
||||
import net.minecraftforge.forgespi.language.IModFileInfo;
|
||||
@@ -43,8 +44,6 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.LOADING;
|
||||
|
||||
public class ModFileInfo implements IModFileInfo, IConfigurable
|
||||
{
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -83,7 +82,7 @@ public class ModFileInfo implements IModFileInfo, IConfigurable
|
||||
this.mods = modConfigs.stream()
|
||||
.map(mi-> new ModInfo(this, mi))
|
||||
.collect(Collectors.toList());
|
||||
LOGGER.debug(LOADING, "Found valid mod file {} with {} mods - versions {}",
|
||||
LOGGER.debug(LogMarkers.LOADING, "Found valid mod file {} with {} mods - versions {}",
|
||||
this.modFile::getFileName,
|
||||
() -> this.mods.stream().map(IModInfo::getModId).collect(Collectors.joining(",", "{", "}")),
|
||||
() -> this.mods.stream().map(IModInfo::getVersion).map(Objects::toString).collect(Collectors.joining(",", "{", "}")));
|
||||
|
||||
+5
-6
@@ -22,6 +22,7 @@ package net.minecraftforge.fml.loading.moddiscovery;
|
||||
import com.electronwill.nightconfig.core.file.FileConfig;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import net.minecraftforge.forgespi.language.IModFileInfo;
|
||||
import net.minecraftforge.forgespi.locating.IModFile;
|
||||
import net.minecraftforge.forgespi.locating.ModFileFactory;
|
||||
@@ -37,8 +38,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.LOADING;
|
||||
|
||||
public class ModFileParser {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
@@ -48,10 +47,10 @@ public class ModFileParser {
|
||||
|
||||
public static IModFileInfo modsTomlParser(final IModFile imodFile) {
|
||||
ModFile modFile = (ModFile) imodFile;
|
||||
LOGGER.debug(LOADING,"Considering mod file candidate {}", modFile.getFilePath());
|
||||
LOGGER.debug(LogMarkers.LOADING,"Considering mod file candidate {}", modFile.getFilePath());
|
||||
final Path modsjson = modFile.findResource("META-INF", "mods.toml");
|
||||
if (!Files.exists(modsjson)) {
|
||||
LOGGER.warn(LOADING, "Mod file {} is missing mods.toml file", modFile.getFilePath());
|
||||
LOGGER.warn(LogMarkers.LOADING, "Mod file {} is missing mods.toml file", modFile.getFilePath());
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -75,12 +74,12 @@ public class ModFileParser {
|
||||
final Gson gson = new Gson();
|
||||
coreModPaths = gson.fromJson(Files.newBufferedReader(coremodsjson), type);
|
||||
} catch (IOException e) {
|
||||
LOGGER.debug(LOADING,"Failed to read coremod list coremods.json", e);
|
||||
LOGGER.debug(LogMarkers.LOADING,"Failed to read coremod list coremods.json", e);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
return coreModPaths.entrySet().stream()
|
||||
.peek(e-> LOGGER.debug(LOADING,"Found coremod {} with Javascript path {}", e.getKey(), e.getValue()))
|
||||
.peek(e-> LOGGER.debug(LogMarkers.LOADING,"Found coremod {} with Javascript path {}", e.getKey(), e.getValue()))
|
||||
.map(e -> new CoreModFile(e.getKey(), modFile.findResource(e.getValue()),modFile))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
+5
-11
@@ -18,25 +18,19 @@ public final class ModJarMetadata implements JarMetadata {
|
||||
private ModuleDescriptor descriptor;
|
||||
|
||||
// TODO: Remove helper functions to cleanup api
|
||||
@Deprecated(forRemoval = true, since="1.17.1")
|
||||
static Optional<IModFile> buildFile(IModLocator locator, Predicate<SecureJar> jarTest, Path... files) {
|
||||
return buildFile(locator, jarTest, (a,b) -> true, files);
|
||||
}
|
||||
|
||||
// TODO: Remove helper functions to cleanup api
|
||||
@Deprecated(forRemoval = true, since="1.17.1")
|
||||
@Deprecated(forRemoval = true, since="1.18")
|
||||
static Optional<IModFile> buildFile(IModLocator locator, Predicate<SecureJar> jarTest, BiPredicate<String, String> filter, Path... files) {
|
||||
return buildFile(j->ModFile.newFMLInstance(locator, j), jarTest, filter, files);
|
||||
return buildFile(j->new ModFile(j, locator, ModFileParser::modsTomlParser), jarTest, filter, files);
|
||||
}
|
||||
|
||||
// TODO: Remove helper functions to cleanup api
|
||||
@Deprecated(forRemoval = true, since="1.17.1")
|
||||
@Deprecated(forRemoval = true, since="1.18")
|
||||
static IModFile buildFile(IModLocator locator, Path... files) {
|
||||
return buildFile(locator, j->true, files).orElseThrow(()->new IllegalArgumentException("Failed to find valid JAR file"));
|
||||
return buildFile(locator, j->true, (a,b) -> true, files).orElseThrow(()->new IllegalArgumentException("Failed to find valid JAR file"));
|
||||
}
|
||||
|
||||
// TODO: Remove helper functions to cleanup api
|
||||
@Deprecated(forRemoval = true, since="1.17.1")
|
||||
@Deprecated(forRemoval = true, since="1.18")
|
||||
static Optional<IModFile> buildFile(Function<SecureJar, IModFile> mfConstructor, Predicate<SecureJar> jarTest, BiPredicate<String, String> filter, Path... files) {
|
||||
var mjm = new ModJarMetadata();
|
||||
var sj = SecureJar.from(()->ModFile.DEFAULTMANIFEST, j->mjm, filter, files);
|
||||
|
||||
+7
-8
@@ -21,6 +21,7 @@ package net.minecraftforge.fml.loading.moddiscovery;
|
||||
|
||||
import net.minecraftforge.fml.loading.FMLPaths;
|
||||
import net.minecraftforge.fml.loading.FileUtils;
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import net.minecraftforge.fml.loading.MavenCoordinateResolver;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -35,8 +36,6 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.CORE;
|
||||
|
||||
public class ModListHandler {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
/**
|
||||
@@ -59,22 +58,22 @@ public class ModListHandler {
|
||||
filter(path -> Files.exists(path.getLeft())).
|
||||
findFirst().
|
||||
orElseGet(()->{
|
||||
LOGGER.warn(CORE, "Failed to find coordinate {}", mc);
|
||||
LOGGER.warn(LogMarkers.CORE, "Failed to find coordinate {}", mc);
|
||||
return null;
|
||||
})).
|
||||
filter(Objects::nonNull).
|
||||
collect(Collectors.toList());
|
||||
|
||||
final List<String> found = foundCoordinates.stream().map(Pair::getRight).collect(Collectors.toList());
|
||||
LOGGER.debug(CORE, "Found mod coordinates from lists: {}", found);
|
||||
LOGGER.debug(LogMarkers.CORE, "Found mod coordinates from lists: {}", found);
|
||||
return found;
|
||||
}
|
||||
|
||||
private static List<String> transformPathToList(final String path) {
|
||||
LOGGER.debug(CORE, "Reading mod list {}", path);
|
||||
LOGGER.debug(LogMarkers.CORE, "Reading mod list {}", path);
|
||||
Path filePath = FMLPaths.GAMEDIR.get().resolve(path);
|
||||
if (!Files.exists(filePath)) {
|
||||
LOGGER.warn(CORE, "Failed to find modlist file at {}", filePath);
|
||||
LOGGER.warn(LogMarkers.CORE, "Failed to find modlist file at {}", filePath);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -82,7 +81,7 @@ public class ModListHandler {
|
||||
if (Objects.equals("list",extension)) {
|
||||
return readListFile(filePath).stream().filter(s -> !s.isEmpty()).collect(Collectors.toList());
|
||||
} else {
|
||||
LOGGER.warn(CORE, "Failed to read unknown file list type {} for file {}", extension, filePath);
|
||||
LOGGER.warn(LogMarkers.CORE, "Failed to read unknown file list type {} for file {}", extension, filePath);
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@@ -96,7 +95,7 @@ public class ModListHandler {
|
||||
try {
|
||||
return Files.readAllLines(filePath);
|
||||
} catch (IOException e) {
|
||||
LOGGER.warn(CORE, "Failed to read file list {}", filePath, e);
|
||||
LOGGER.warn(LogMarkers.CORE, "Failed to read file list {}", filePath, e);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
+6
-4
@@ -2,7 +2,10 @@ package net.minecraftforge.fml.loading.moddiscovery;
|
||||
|
||||
import cpw.mods.modlauncher.api.IModuleLayerManager;
|
||||
import cpw.mods.modlauncher.api.ITransformationService;
|
||||
import net.minecraftforge.fml.loading.*;
|
||||
import net.minecraftforge.fml.loading.EarlyLoadingException;
|
||||
import net.minecraftforge.fml.loading.LoadingModList;
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import net.minecraftforge.fml.loading.ModSorter;
|
||||
import net.minecraftforge.fml.loading.progress.StartupMessageManager;
|
||||
import net.minecraftforge.forgespi.locating.IModFile;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -10,7 +13,6 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.*;
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.SCAN;
|
||||
|
||||
public class ModValidator {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -34,7 +36,7 @@ public class ModValidator {
|
||||
|
||||
public void stage1Validation() {
|
||||
brokenFiles = validateFiles(candidateMods);
|
||||
LOGGER.debug(SCAN,"Found {} mod files with {} mods", candidateMods::size, ()-> candidateMods.stream().mapToInt(mf -> mf.getModInfos().size()).sum());
|
||||
LOGGER.debug(LogMarkers.SCAN,"Found {} mod files with {} mods", candidateMods::size, ()-> candidateMods.stream().mapToInt(mf -> mf.getModInfos().size()).sum());
|
||||
StartupMessageManager.modLoaderConsumer().ifPresent(c->c.accept("Found "+ candidateMods.size()+" modfiles to load"));
|
||||
}
|
||||
|
||||
@@ -45,7 +47,7 @@ public class ModValidator {
|
||||
{
|
||||
ModFile mod = iterator.next();
|
||||
if (!mod.getLocator().isValid(mod) || !mod.identifyMods()) {
|
||||
LOGGER.warn(SCAN, "File {} has been ignored - it is invalid", mod.getFilePath());
|
||||
LOGGER.warn(LogMarkers.SCAN, "File {} has been ignored - it is invalid", mod.getFilePath());
|
||||
iterator.remove();
|
||||
brokenFiles.add(mod);
|
||||
}
|
||||
|
||||
+2
-2
@@ -20,6 +20,7 @@
|
||||
package net.minecraftforge.fml.loading.moddiscovery;
|
||||
|
||||
import net.minecraftforge.fml.loading.FMLPaths;
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import net.minecraftforge.fml.loading.ModDirTransformerDiscoverer;
|
||||
import net.minecraftforge.fml.loading.StringUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -32,7 +33,6 @@ import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static cpw.mods.modlauncher.api.LamdbaExceptionUtils.uncheck;
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.SCAN;
|
||||
|
||||
/**
|
||||
* Support loading mods located in JAR files in the mods folder
|
||||
@@ -58,7 +58,7 @@ public class ModsFolderLocator extends AbstractJarFileLocator {
|
||||
|
||||
@Override
|
||||
public Stream<Path> scanCandidates() {
|
||||
LOGGER.debug(SCAN,"Scanning mods dir {} for mods", this.modFolder);
|
||||
LOGGER.debug(LogMarkers.SCAN,"Scanning mods dir {} for mods", this.modFolder);
|
||||
var excluded = ModDirTransformerDiscoverer.allExcluded();
|
||||
|
||||
return uncheck(()-> Files.list(this.modFolder))
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
package net.minecraftforge.fml.loading.moddiscovery;
|
||||
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import net.minecraftforge.forgespi.language.IModLanguageProvider;
|
||||
import net.minecraftforge.forgespi.language.ModFileScanData;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -31,8 +32,6 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.SCAN;
|
||||
|
||||
public class Scanner {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private final ModFile fileToScan;
|
||||
@@ -48,7 +47,7 @@ public class Scanner {
|
||||
final List<IModLanguageProvider> loaders = fileToScan.getLoaders();
|
||||
if (loaders != null) {
|
||||
loaders.forEach(loader -> {
|
||||
LOGGER.debug(SCAN, "Scanning {} with language loader {}", fileToScan.getFilePath(), loader.name());
|
||||
LOGGER.debug(LogMarkers.SCAN, "Scanning {} with language loader {}", fileToScan.getFilePath(), loader.name());
|
||||
loader.getFileVisitor().accept(result);
|
||||
});
|
||||
}
|
||||
@@ -56,7 +55,7 @@ public class Scanner {
|
||||
}
|
||||
|
||||
private void fileVisitor(final Path path, final ModFileScanData result) {
|
||||
LOGGER.debug(SCAN,"Scanning {} path {}", fileToScan, path);
|
||||
LOGGER.debug(LogMarkers.SCAN,"Scanning {} path {}", fileToScan, path);
|
||||
try (InputStream in = Files.newInputStream(path)){
|
||||
ModClassVisitor mcv = new ModClassVisitor();
|
||||
ClassReader cr = new ClassReader(in);
|
||||
|
||||
+2
-2
@@ -20,8 +20,8 @@
|
||||
package net.minecraftforge.fml.loading.progress;
|
||||
|
||||
import cpw.mods.modlauncher.api.LamdbaExceptionUtils;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.function.IntConsumer;
|
||||
@@ -58,7 +58,7 @@ public enum EarlyProgressVisualization {
|
||||
|
||||
default long handOffWindow(final IntSupplier width, final IntSupplier height, final Supplier<String> title, LongSupplier monitorSupplier) {
|
||||
return FMLLoader.getGameLayer().findModule("forge")
|
||||
.map(l->Class.forName(l, "net.minecraftforge.fmllegacy.NoVizFallback"))
|
||||
.map(l->Class.forName(l, "net.minecraftforge.client.loading.NoVizFallback"))
|
||||
.map(LamdbaExceptionUtils.rethrowFunction(c->c.getMethod("fallback", IntSupplier.class, IntSupplier.class, Supplier.class, LongSupplier.class)))
|
||||
.map(LamdbaExceptionUtils.rethrowFunction(m->(LongSupplier)m.invoke(null, width, height, title, monitorSupplier)))
|
||||
.map(LongSupplier::getAsLong)
|
||||
|
||||
+1
-1
@@ -19,10 +19,10 @@
|
||||
|
||||
package net.minecraftforge.fml.loading.targets;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
import net.minecraftforge.fml.loading.LibraryFinder;
|
||||
import net.minecraftforge.fml.loading.VersionInfo;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
+3
-4
@@ -21,6 +21,7 @@ package net.minecraftforge.fml.loading.targets;
|
||||
|
||||
import cpw.mods.modlauncher.api.ILaunchHandlerService;
|
||||
import cpw.mods.modlauncher.api.ITransformingClassLoaderBuilder;
|
||||
import net.minecraftforge.fml.loading.LogMarkers;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -35,8 +36,6 @@ import java.util.Optional;
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.CORE;
|
||||
|
||||
public abstract class CommonLaunchHandler implements ILaunchHandlerService {
|
||||
public record LocatedPaths(List<Path> minecraftPaths, BiPredicate<String, String> minecraftFilter, List<List<Path>> otherModPaths, List<Path> otherArtifacts) {}
|
||||
|
||||
@@ -63,7 +62,7 @@ public abstract class CommonLaunchHandler implements ILaunchHandlerService {
|
||||
|
||||
protected final Map<String, List<Path>> getModClasses() {
|
||||
final String modClasses = Optional.ofNullable(System.getenv("MOD_CLASSES")).orElse("");
|
||||
LOGGER.debug(CORE, "Got mod coordinates {} from env", modClasses);
|
||||
LOGGER.debug(LogMarkers.CORE, "Got mod coordinates {} from env", modClasses);
|
||||
|
||||
record ExplodedModPath(String modid, Path path) {}
|
||||
// "a/b/;c/d/;" -> "modid%%c:\fish\pepper;modid%%c:\fish2\pepper2\;modid2%%c:\fishy\bums;modid2%%c:\hmm"
|
||||
@@ -72,7 +71,7 @@ public abstract class CommonLaunchHandler implements ILaunchHandlerService {
|
||||
.map(splitString -> new ExplodedModPath(splitString.length == 1 ? "defaultmodid" : splitString[0], Paths.get(splitString[splitString.length - 1])))
|
||||
.collect(Collectors.groupingBy(ExplodedModPath::modid, Collectors.mapping(ExplodedModPath::path, Collectors.toList())));
|
||||
|
||||
LOGGER.debug(CORE, "Found supplied mod coordinates [{}]", modClassPaths);
|
||||
LOGGER.debug(LogMarkers.CORE, "Found supplied mod coordinates [{}]", modClassPaths);
|
||||
|
||||
//final var explodedTargets = ((Map<String, List<ExplodedDirectoryLocator.ExplodedMod>>)arguments).computeIfAbsent("explodedTargets", a -> new ArrayList<>());
|
||||
//modClassPaths.forEach((modlabel,paths) -> explodedTargets.add(new ExplodedDirectoryLocator.ExplodedMod(modlabel, paths)));
|
||||
|
||||
+1
-1
@@ -20,10 +20,10 @@
|
||||
package net.minecraftforge.fml.loading.targets;
|
||||
|
||||
import cpw.mods.jarhandling.SecureJar;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
import net.minecraftforge.fml.loading.LibraryFinder;
|
||||
import net.minecraftforge.fml.loading.VersionInfo;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.server;
|
||||
package net.minecraftforge.fml.server;
|
||||
|
||||
import cpw.mods.modlauncher.InvalidLauncherSetupException;
|
||||
import cpw.mods.modlauncher.Launcher;
|
||||
+3
-4
@@ -1,5 +1,4 @@
|
||||
net.minecraftforge.fml.loading.RuntimeDistCleaner
|
||||
net.minecraftforge.common.asm.RuntimeEnumExtender
|
||||
net.minecraftforge.common.asm.ObjectHolderDefinalize
|
||||
net.minecraftforge.common.asm.CapabilityInjectDefinalize
|
||||
net.minecraftforge.common.asm.CapabilityTokenSubclass
|
||||
net.minecraftforge.fml.common.asm.RuntimeEnumExtender
|
||||
net.minecraftforge.fml.common.asm.ObjectHolderDefinalize
|
||||
net.minecraftforge.fml.common.asm.CapabilityTokenSubclass
|
||||
@@ -31,7 +31,6 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.LoadingFailedException;
|
||||
import net.minecraftforge.fml.ModLoader;
|
||||
import net.minecraftforge.fml.ModWorkManager;
|
||||
import net.minecraftforge.fml.VersionChecker;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -39,8 +38,6 @@ import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static net.minecraftforge.fml.loading.LogMarkers.LOADING;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class ClientModLoader
|
||||
{
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
+2
-2
@@ -17,8 +17,8 @@ version = '1.0'
|
||||
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = 'modid'
|
||||
|
||||
// Mojang ships Java 16 to end users in 1.17+ instead of Java 8 in 1.16 or lower, so your mod should target Java 16.
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(16)
|
||||
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
||||
|
||||
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
|
||||
minecraft {
|
||||
|
||||
@@ -10,7 +10,7 @@ import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent;
|
||||
import net.minecraftforge.fmlserverevents.FMLServerStartingEvent;
|
||||
import net.minecraftforge.event.server.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"pack": {
|
||||
"description": "examplemod resources",
|
||||
"pack_format": 7
|
||||
"pack_format": 8
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/com/mojang/blaze3d/platform/GlStateManager.java
|
||||
+++ b/com/mojang/blaze3d/platform/GlStateManager.java
|
||||
@@ -530,9 +_,16 @@
|
||||
@@ -539,9 +_,16 @@
|
||||
f_84077_[f_84076_].f_84800_ = false;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
+ public static float lastBrightnessX = 0.0f;
|
||||
+ public static float lastBrightnessY = 0.0f;
|
||||
public static void m_84160_(int p_84161_, int p_84162_, float p_84163_) {
|
||||
RenderSystem.m_69393_(RenderSystem::m_69587_);
|
||||
RenderSystem.m_187555_();
|
||||
GL11.glTexParameterf(p_84161_, p_84162_, p_84163_);
|
||||
+ if (p_84161_ == GL13.GL_TEXTURE1) {
|
||||
+ lastBrightnessX = p_84162_;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/com/mojang/blaze3d/vertex/VertexConsumer.java
|
||||
+++ b/com/mojang/blaze3d/vertex/VertexConsumer.java
|
||||
@@ -15,7 +_,7 @@
|
||||
@@ -16,7 +_,7 @@
|
||||
import org.lwjgl.system.MemoryStack;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -9,7 +9,7 @@
|
||||
Logger f_85943_ = LogManager.getLogger();
|
||||
|
||||
VertexConsumer m_5483_(double p_85945_, double p_85946_, double p_85947_);
|
||||
@@ -100,11 +_,12 @@
|
||||
@@ -105,11 +_,12 @@
|
||||
f5 = afloat[k] * p_86001_;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
-
|
||||
- p_127520_.append("\n");
|
||||
+ p_127520_.append("Stacktrace:");
|
||||
+ p_127520_.append(net.minecraftforge.fmllegacy.CrashReportExtender.generateEnhancedStackTrace(this.f_127506_));
|
||||
+ p_127520_.append(net.minecraftforge.logging.CrashReportExtender.generateEnhancedStackTrace(this.f_127506_));
|
||||
}
|
||||
|
||||
for(CrashReportCategory crashreportcategory : this.f_127503_) {
|
||||
@@ -21,7 +21,7 @@
|
||||
p_127520_.append("\n\n");
|
||||
}
|
||||
|
||||
+ net.minecraftforge.fmllegacy.CrashReportExtender.extendSystemReport(f_178624_);
|
||||
+ net.minecraftforge.logging.CrashReportExtender.extendSystemReport(f_178624_);
|
||||
this.f_178624_.m_143525_(p_127520_);
|
||||
}
|
||||
|
||||
@@ -41,13 +41,13 @@
|
||||
- }
|
||||
-
|
||||
- return s;
|
||||
+ return net.minecraftforge.fmllegacy.CrashReportExtender.generateEnhancedStackTrace(throwable);
|
||||
+ return net.minecraftforge.logging.CrashReportExtender.generateEnhancedStackTrace(throwable);
|
||||
}
|
||||
|
||||
public String m_127526_() {
|
||||
StringBuilder stringbuilder = new StringBuilder();
|
||||
stringbuilder.append("---- Minecraft Crash Report ----\n");
|
||||
+ net.minecraftforge.fmllegacy.CrashReportExtender.addCrashReportHeader(stringbuilder, this);
|
||||
+ net.minecraftforge.logging.CrashReportExtender.addCrashReportHeader(stringbuilder, this);
|
||||
stringbuilder.append("// ");
|
||||
stringbuilder.append(m_127531_());
|
||||
stringbuilder.append("\n\n");
|
||||
@@ -22,7 +22,7 @@
|
||||
- p_128169_.append("\n\tat ");
|
||||
- p_128169_.append((Object)stacktraceelement);
|
||||
- }
|
||||
+ p_128169_.append(net.minecraftforge.fmllegacy.CrashReportExtender.generateEnhancedStackTrace(this.f_128139_));
|
||||
+ p_128169_.append(net.minecraftforge.logging.CrashReportExtender.generateEnhancedStackTrace(this.f_128139_));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/SharedConstants.java
|
||||
+++ b/net/minecraft/SharedConstants.java
|
||||
@@ -160,6 +_,7 @@
|
||||
@@ -184,6 +_,7 @@
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
--- a/net/minecraft/Util.java
|
||||
+++ b/net/minecraft/Util.java
|
||||
@@ -127,6 +_,9 @@
|
||||
return executorservice;
|
||||
@@ -149,6 +_,9 @@
|
||||
return 255;
|
||||
}
|
||||
|
||||
+ // We add this inner class to compensate for Mojang's missing inner class and allow us to obf subsequent anon inner classes correctly.
|
||||
+ @SuppressWarnings("unused") private static LongSupplier INNER_CLASS_SHIFT = new LongSupplier() { public long getAsLong() { return 0; } };
|
||||
+
|
||||
public static Executor m_137577_() {
|
||||
public static ExecutorService m_183988_() {
|
||||
return f_137443_;
|
||||
}
|
||||
@@ -205,7 +_,7 @@
|
||||
@@ -227,7 +_,7 @@
|
||||
try {
|
||||
type = DataFixers.m_14512_().getSchema(DataFixUtils.makeKey(SharedConstants.m_136187_().getWorldVersion())).getChoiceType(p_137552_, p_137553_);
|
||||
type = DataFixers.m_14512_().getSchema(DataFixUtils.makeKey(SharedConstants.m_183709_().getWorldVersion())).getChoiceType(p_137552_, p_137553_);
|
||||
} catch (IllegalArgumentException illegalargumentexception) {
|
||||
- f_137446_.error("No data fixer registered for {}", (Object)p_137553_);
|
||||
+ f_137446_.debug("No data fixer registered for {}", (Object)p_137553_);
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
--- a/net/minecraft/advancements/Advancement.java
|
||||
+++ b/net/minecraft/advancements/Advancement.java
|
||||
@@ -127,7 +_,7 @@
|
||||
@@ -129,8 +_,8 @@
|
||||
return this.f_138305_;
|
||||
}
|
||||
|
||||
- public static class Builder {
|
||||
@Nullable
|
||||
+ public static class Builder implements net.minecraftforge.common.extensions.IForgeAdvancementBuilder {
|
||||
private ResourceLocation f_138332_;
|
||||
@Nullable
|
||||
private Advancement f_138333_;
|
||||
private DisplayInfo f_138334_;
|
||||
@@ -311,6 +_,7 @@
|
||||
@@ -321,6 +_,7 @@
|
||||
}
|
||||
|
||||
public static Advancement.Builder m_138380_(JsonObject p_138381_, DeserializationContext p_138382_) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/advancements/AdvancementList.java
|
||||
+++ b/net/minecraft/advancements/AdvancementList.java
|
||||
@@ -90,6 +_,7 @@
|
||||
@@ -91,6 +_,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
public void m_9989_(ServerPlayer p_9990_) {
|
||||
p_9990_.m_6756_(this.f_9979_);
|
||||
- LootContext lootcontext = (new LootContext.Builder(p_9990_.m_9236_())).m_78972_(LootContextParams.f_81455_, p_9990_).m_78972_(LootContextParams.f_81460_, p_9990_.m_20182_()).m_78977_(p_9990_.m_21187_()).m_78975_(LootContextParamSets.f_81418_);
|
||||
+ LootContext lootcontext = (new LootContext.Builder(p_9990_.m_9236_())).m_78972_(LootContextParams.f_81455_, p_9990_).m_78972_(LootContextParams.f_81460_, p_9990_.m_20182_()).m_78977_(p_9990_.m_21187_()).m_78963_(p_9990_.m_36336_()).m_78975_(LootContextParamSets.f_81418_); // FORGE: luck to LootContext
|
||||
- LootContext lootcontext = (new LootContext.Builder(p_9990_.m_183503_())).m_78972_(LootContextParams.f_81455_, p_9990_).m_78972_(LootContextParams.f_81460_, p_9990_.m_20182_()).m_78977_(p_9990_.m_21187_()).m_78975_(LootContextParamSets.f_81418_);
|
||||
+ LootContext lootcontext = (new LootContext.Builder(p_9990_.m_183503_())).m_78972_(LootContextParams.f_81455_, p_9990_).m_78972_(LootContextParams.f_81460_, p_9990_.m_20182_()).m_78977_(p_9990_.m_21187_()).m_78963_(p_9990_.m_36336_()).m_78975_(LootContextParamSets.f_81418_); // FORGE: luck to LootContext
|
||||
boolean flag = false;
|
||||
|
||||
for(ResourceLocation resourcelocation : this.f_9980_) {
|
||||
@@ -5,6 +5,6 @@
|
||||
@DontObfuscate
|
||||
public static String m_129629_() {
|
||||
- return "vanilla";
|
||||
+ return net.minecraftforge.fmllegacy.BrandingControl.getClientBranding();
|
||||
+ return net.minecraftforge.internal.BrandingControl.getClientBranding();
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@
|
||||
|
||||
public boolean m_90864_() {
|
||||
- return this.f_90816_.equals(this.f_90814_);
|
||||
+ return this.f_90816_.equals(this.f_90814_) && getKeyModifier() == getKeyModifierDefault();
|
||||
+ return this.f_90816_.equals(this.f_90814_) && getKeyModifier() == getDefaultKeyModifier();
|
||||
}
|
||||
|
||||
public String m_90865_() {
|
||||
@@ -174,7 +174,7 @@
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public net.minecraftforge.client.settings.KeyModifier getKeyModifierDefault() {
|
||||
+ public net.minecraftforge.client.settings.KeyModifier getDefaultKeyModifier() {
|
||||
+ return keyModifierDefault;
|
||||
+ }
|
||||
+
|
||||
|
||||
@@ -1,44 +1,44 @@
|
||||
--- a/net/minecraft/client/KeyboardHandler.java
|
||||
+++ b/net/minecraft/client/KeyboardHandler.java
|
||||
@@ -312,7 +_,9 @@
|
||||
@@ -307,7 +_,9 @@
|
||||
}
|
||||
|
||||
Screen screen = this.f_90867_.f_91080_;
|
||||
- if (p_90897_ == 1 && (!(this.f_90867_.f_91080_ instanceof ControlsScreen) || ((ControlsScreen)screen).f_97515_ <= Util.m_137550_() - 20L)) {
|
||||
- if (p_90897_ == 1 && (!(this.f_90867_.f_91080_ instanceof KeyBindsScreen) || ((KeyBindsScreen)screen).f_193976_ <= Util.m_137550_() - 20L)) {
|
||||
+
|
||||
+ if ((!(this.f_90867_.f_91080_ instanceof ControlsScreen) || ((ControlsScreen)screen).f_97515_ <= Util.m_137550_() - 20L)) {
|
||||
+ if ((!(this.f_90867_.f_91080_ instanceof KeyBindsScreen) || ((KeyBindsScreen)screen).f_193976_ <= Util.m_137550_() - 20L)) {
|
||||
+ if (p_90897_ == 1) {
|
||||
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_.f_92052_ = this.f_90867_.m_91268_().m_85440_();
|
||||
@@ -331,6 +_,8 @@
|
||||
@@ -326,6 +_,8 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
+ } else if (p_90897_ == 0 /*GLFW_RELEASE*/ && this.f_90867_.f_91080_ instanceof ControlsScreen)
|
||||
+ ((ControlsScreen)this.f_90867_.f_91080_).f_97514_ = null; //Forge: Unset pure modifiers.
|
||||
+ } else if (p_90897_ == 0 /*GLFW_RELEASE*/ && this.f_90867_.f_91080_ instanceof KeyBindsScreen)
|
||||
+ ((KeyBindsScreen)this.f_90867_.f_91080_).f_193975_ = null; //Forge: Unset pure modifiers.
|
||||
}
|
||||
|
||||
if (NarratorChatListener.f_93311_.m_93316_()) {
|
||||
@@ -354,11 +_,15 @@
|
||||
@@ -349,11 +_,15 @@
|
||||
Screen.m_96579_(() -> {
|
||||
if (p_90897_ != 1 && (p_90897_ != 2 || !this.f_90868_)) {
|
||||
if (p_90897_ == 0) {
|
||||
- aboolean[0] = screen.m_7920_(p_90895_, p_90896_, p_90898_);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyReleasedPre(this.f_90867_.f_91080_, p_90895_, p_90896_, p_90898_);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onScreenKeyReleasedPre(this.f_90867_.f_91080_, p_90895_, p_90896_, p_90898_);
|
||||
+ if (!aboolean[0]) aboolean[0] = screen.m_7920_(p_90895_, p_90896_, p_90898_);
|
||||
+ if (!aboolean[0]) aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyReleasedPost(this.f_90867_.f_91080_, p_90895_, p_90896_, p_90898_);
|
||||
+ if (!aboolean[0]) aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onScreenKeyReleasedPost(this.f_90867_.f_91080_, p_90895_, p_90896_, p_90898_);
|
||||
}
|
||||
} else {
|
||||
screen.m_169416_();
|
||||
- aboolean[0] = screen.m_7933_(p_90895_, p_90896_, p_90898_);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyPressedPre(this.f_90867_.f_91080_, p_90895_, p_90896_, p_90898_);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onScreenKeyPressedPre(this.f_90867_.f_91080_, p_90895_, p_90896_, p_90898_);
|
||||
+ if (!aboolean[0]) aboolean[0] = screen.m_7933_(p_90895_, p_90896_, p_90898_);
|
||||
+ if (!aboolean[0]) aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyPressedPost(this.f_90867_.f_91080_, p_90895_, p_90896_, p_90898_);
|
||||
+ if (!aboolean[0]) aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onScreenKeyPressedPost(this.f_90867_.f_91080_, p_90895_, p_90896_, p_90898_);
|
||||
}
|
||||
|
||||
}, "keyPressed event handler", screen.getClass().getCanonicalName());
|
||||
@@ -411,7 +_,7 @@
|
||||
@@ -406,7 +_,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,22 +47,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -421,12 +_,16 @@
|
||||
@@ -416,12 +_,16 @@
|
||||
if (guieventlistener != null && this.f_90867_.m_91265_() == null) {
|
||||
if (Character.charCount(p_90891_) == 1) {
|
||||
Screen.m_96579_(() -> {
|
||||
- guieventlistener.m_5534_((char)p_90891_, p_90892_);
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onGuiCharTypedPre(this.f_90867_.f_91080_, (char)p_90891_, p_90892_)) return;
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onScreenCharTypedPre(this.f_90867_.f_91080_, (char)p_90891_, p_90892_)) return;
|
||||
+ if (guieventlistener.m_5534_((char)p_90891_, p_90892_)) return;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onGuiCharTypedPost(this.f_90867_.f_91080_, (char)p_90891_, p_90892_);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onScreenCharTypedPost(this.f_90867_.f_91080_, (char)p_90891_, p_90892_);
|
||||
}, "charTyped event handler", guieventlistener.getClass().getCanonicalName());
|
||||
} else {
|
||||
for(char c0 : Character.toChars(p_90891_)) {
|
||||
Screen.m_96579_(() -> {
|
||||
- guieventlistener.m_5534_(c0, p_90892_);
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onGuiCharTypedPre(this.f_90867_.f_91080_, c0, p_90892_)) return;
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onScreenCharTypedPre(this.f_90867_.f_91080_, c0, p_90892_)) return;
|
||||
+ if (guieventlistener.m_5534_(c0, p_90892_)) return;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onGuiCharTypedPost(this.f_90867_.f_91080_, c0, p_90892_);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onScreenCharTypedPost(this.f_90867_.f_91080_, c0, p_90892_);
|
||||
}, "charTyped event handler", guieventlistener.getClass().getCanonicalName());
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/client/Minecraft.java
|
||||
+++ b/net/minecraft/client/Minecraft.java
|
||||
@@ -257,7 +_,7 @@
|
||||
@@ -254,7 +_,7 @@
|
||||
import org.lwjgl.util.tinyfd.TinyFileDialogs;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
-public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements SnooperPopulator, WindowEventHandler {
|
||||
+public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements SnooperPopulator, WindowEventHandler, net.minecraftforge.client.extensions.IForgeMinecraft {
|
||||
-public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements WindowEventHandler {
|
||||
+public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements WindowEventHandler, net.minecraftforge.client.extensions.IForgeMinecraft {
|
||||
private static Minecraft f_90981_;
|
||||
private static final Logger f_90982_ = LogManager.getLogger();
|
||||
public static final boolean f_91002_ = Util.m_137581_() == Util.OS.OSX;
|
||||
@@ -397,14 +_,13 @@
|
||||
@@ -394,14 +_,13 @@
|
||||
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,14 +18,14 @@
|
||||
this.f_91030_ = p_91084_.f_101905_.f_101945_;
|
||||
YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(this.f_91030_);
|
||||
this.f_91048_ = yggdrasilauthenticationservice.createMinecraftSessionService();
|
||||
this.f_91049_ = this.m_91130_(yggdrasilauthenticationservice, p_91084_);
|
||||
this.f_193584_ = this.m_193585_(yggdrasilauthenticationservice, p_91084_);
|
||||
this.f_90998_ = p_91084_.f_101905_.f_101942_;
|
||||
f_90982_.info("Setting user: {}", (Object)this.f_90998_.m_92546_());
|
||||
- f_90982_.debug("(Session ID is {})", (Object)this.f_90998_.m_92544_());
|
||||
this.f_91033_ = p_91084_.f_101908_.f_101926_;
|
||||
this.f_91034_ = !p_91084_.f_101908_.f_101929_;
|
||||
this.f_91035_ = !p_91084_.f_101908_.f_101930_;
|
||||
@@ -436,6 +_,7 @@
|
||||
@@ -433,6 +_,7 @@
|
||||
}
|
||||
|
||||
Util.f_137440_ = RenderSystem.m_69576_();
|
||||
@@ -33,7 +33,7 @@
|
||||
this.f_90989_ = new VirtualScreen(this);
|
||||
this.f_90990_ = this.f_90989_.m_110872_(displaydata, this.f_91066_.f_92123_, this.m_91270_());
|
||||
this.m_7440_(true);
|
||||
@@ -450,7 +_,6 @@
|
||||
@@ -448,7 +_,6 @@
|
||||
|
||||
this.f_90990_.m_85380_(this.f_91066_.f_92113_);
|
||||
this.f_91067_ = new MouseHandler(this);
|
||||
@@ -41,15 +41,15 @@
|
||||
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);
|
||||
@@ -458,6 +_,7 @@
|
||||
@@ -456,6 +_,7 @@
|
||||
this.f_91042_.m_83931_(0.0F, 0.0F, 0.0F, 0.0F);
|
||||
this.f_91042_.m_83954_(f_91002_);
|
||||
this.f_91036_ = new SimpleReloadableResourceManager(PackType.CLIENT_RESOURCES);
|
||||
+ net.minecraftforge.fmlclient.ClientModLoader.begin(this, this.f_91038_, this.f_91036_, this.f_91037_);
|
||||
+ net.minecraftforge.client.loading.ClientModLoader.begin(this, this.f_91038_, this.f_91036_, this.f_91037_);
|
||||
this.f_91038_.m_10506_();
|
||||
this.f_91066_.m_92145_(this.f_91038_);
|
||||
this.f_91039_ = new LanguageManager(this.f_91066_.f_92075_);
|
||||
@@ -506,6 +_,7 @@
|
||||
@@ -504,6 +_,7 @@
|
||||
this.m_91271_();
|
||||
this.f_91036_.m_7217_(this.f_90997_);
|
||||
this.f_91061_ = new ParticleEngine(this.f_91073_, this.f_90987_);
|
||||
@@ -57,7 +57,7 @@
|
||||
this.f_91036_.m_7217_(this.f_91061_);
|
||||
this.f_91053_ = new PaintingTextureManager(this.f_90987_);
|
||||
this.f_91036_.m_7217_(this.f_91053_);
|
||||
@@ -513,7 +_,8 @@
|
||||
@@ -511,7 +_,8 @@
|
||||
this.f_91036_.m_7217_(this.f_91054_);
|
||||
this.f_91047_ = new GpuWarnlistManager();
|
||||
this.f_91036_.m_7217_(this.f_91047_);
|
||||
@@ -67,7 +67,7 @@
|
||||
this.f_91064_ = new DebugRenderer(this);
|
||||
RenderSystem.m_69900_(this::m_91113_);
|
||||
if (this.f_91042_.f_83915_ == this.f_90990_.m_85441_() && this.f_91042_.f_83916_ == this.f_90990_.m_85442_()) {
|
||||
@@ -531,6 +_,10 @@
|
||||
@@ -529,6 +_,10 @@
|
||||
TinyFileDialogs.tinyfd_messageBox("Minecraft", stringbuilder.toString(), "ok", "error", false);
|
||||
}
|
||||
|
||||
@@ -78,11 +78,11 @@
|
||||
this.f_90990_.m_85409_(this.f_91066_.f_92041_);
|
||||
this.f_90990_.m_85424_(this.f_91066_.f_92034_);
|
||||
this.f_90990_.m_85426_();
|
||||
@@ -546,13 +_,16 @@
|
||||
@@ -544,13 +_,16 @@
|
||||
}
|
||||
|
||||
this.f_167847_.m_168556_();
|
||||
+ if (net.minecraftforge.fmlclient.ClientModLoader.completeModLoading()) return; // Do not overwrite the error screen
|
||||
+ 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) {
|
||||
@@ -100,16 +100,16 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -587,6 +_,8 @@
|
||||
@@ -585,6 +_,8 @@
|
||||
|
||||
private SocialInteractionsService m_91130_(YggdrasilAuthenticationService p_91131_, GameConfig p_91132_) {
|
||||
private UserApiService m_193585_(YggdrasilAuthenticationService p_193586_, GameConfig p_193587_) {
|
||||
try {
|
||||
+ if ("0".equals(p_91132_.f_101905_.f_101942_.m_92547_())) // Forge: We use "0" in dev. Short circuit to stop exception spam.
|
||||
+ return new OfflineSocialInteractions();
|
||||
return p_91131_.createSocialInteractionsService(p_91132_.f_101905_.f_101942_.m_92547_());
|
||||
+ if ("0".equals(p_193587_.f_101905_.f_101942_.m_92547_())) // Forge: We use "0" in dev. Short circuit to stop exception spam.
|
||||
+ return UserApiService.OFFLINE;
|
||||
return p_193586_.createUserApiService(p_193587_.f_101905_.f_101942_.m_92547_());
|
||||
} catch (AuthenticationException authenticationexception) {
|
||||
f_90982_.error("Failed to verify authentication", (Throwable)authenticationexception);
|
||||
@@ -599,7 +_,7 @@
|
||||
@@ -597,7 +_,7 @@
|
||||
}
|
||||
|
||||
private void m_91239_(Throwable p_91240_) {
|
||||
@@ -118,7 +118,7 @@
|
||||
Component component;
|
||||
if (p_91240_ instanceof SimpleReloadableResourceManager.ResourcePackLoadingFailure) {
|
||||
component = new TextComponent(((SimpleReloadableResourceManager.ResourcePackLoadingFailure)p_91240_).m_10921_().m_8017_());
|
||||
@@ -690,7 +_,7 @@
|
||||
@@ -691,7 +_,7 @@
|
||||
return Stream.of(Registry.f_122827_.m_7981_(p_91317_.m_41720_()));
|
||||
});
|
||||
ReloadableIdSearchTree<ItemStack> reloadableidsearchtree = new ReloadableIdSearchTree<>((p_91121_) -> {
|
||||
@@ -127,24 +127,24 @@
|
||||
});
|
||||
NonNullList<ItemStack> nonnulllist = NonNullList.m_122779_();
|
||||
|
||||
@@ -760,13 +_,13 @@
|
||||
@@ -761,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_());
|
||||
- System.exit(-1);
|
||||
+ net.minecraftforge.fmllegacy.server.ServerLifecycleHooks.handleExit(-1);
|
||||
+ net.minecraftforge.server.ServerLifecycleHooks.handleExit(-1);
|
||||
} else if (p_91333_.m_127512_(file2)) {
|
||||
Bootstrap.m_135875_("#@!@# Game crashed! Crash report saved to: #@!@# " + file2.getAbsolutePath());
|
||||
- System.exit(-1);
|
||||
+ net.minecraftforge.fmllegacy.server.ServerLifecycleHooks.handleExit(-1);
|
||||
+ net.minecraftforge.server.ServerLifecycleHooks.handleExit(-1);
|
||||
} else {
|
||||
Bootstrap.m_135875_("#@?@# Game crashed! Crash report could not be saved. #@?@#");
|
||||
- System.exit(-2);
|
||||
+ net.minecraftforge.fmllegacy.server.ServerLifecycleHooks.handleExit(-2);
|
||||
+ net.minecraftforge.server.ServerLifecycleHooks.handleExit(-2);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -876,10 +_,6 @@
|
||||
@@ -877,10 +_,6 @@
|
||||
f_90982_.error("setScreen called from non-game thread");
|
||||
}
|
||||
|
||||
@@ -155,37 +155,37 @@
|
||||
if (p_91153_ == null && this.f_91073_ == null) {
|
||||
p_91153_ = new TitleScreen();
|
||||
} else if (p_91153_ == null && this.f_91074_.m_21224_()) {
|
||||
@@ -890,6 +_,15 @@
|
||||
@@ -891,6 +_,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ net.minecraftforge.client.ForgeHooksClient.clearGuiLayers(this);
|
||||
+ Screen old = this.f_91080_;
|
||||
+ net.minecraftforge.client.event.GuiOpenEvent event = new net.minecraftforge.client.event.GuiOpenEvent(p_91153_);
|
||||
+ net.minecraftforge.client.event.ScreenOpenEvent event = new net.minecraftforge.client.event.ScreenOpenEvent(p_91153_);
|
||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return;
|
||||
+
|
||||
+ p_91153_ = event.getGui();
|
||||
+ p_91153_ = event.getScreen();
|
||||
+ if (old != null && p_91153_ != old)
|
||||
+ old.m_7861_();
|
||||
+
|
||||
this.f_91080_ = p_91153_;
|
||||
BufferUploader.m_166835_();
|
||||
if (p_91153_ != null) {
|
||||
@@ -1018,11 +_,13 @@
|
||||
@@ -1019,11 +_,13 @@
|
||||
RenderSystem.m_69481_();
|
||||
this.f_91026_.m_7238_();
|
||||
if (!this.f_91079_) {
|
||||
+ net.minecraftforge.fmllegacy.hooks.BasicEventHooks.onRenderTickStart(this.f_91012_ ? this.f_91013_ : this.f_90991_.f_92518_);
|
||||
+ net.minecraftforge.event.ForgeEventFactory.onRenderTickStart(this.f_91012_ ? this.f_91013_ : this.f_90991_.f_92518_);
|
||||
this.f_91026_.m_6182_("gameRenderer");
|
||||
this.f_91063_.m_109093_(this.f_91012_ ? this.f_91013_ : this.f_90991_.f_92518_, i, p_91384_);
|
||||
this.f_91026_.m_6182_("toasts");
|
||||
this.f_91003_.m_94920_(new PoseStack());
|
||||
this.f_91026_.m_7238_();
|
||||
+ net.minecraftforge.fmllegacy.hooks.BasicEventHooks.onRenderTickEnd(this.f_91012_ ? this.f_91013_ : this.f_90991_.f_92518_);
|
||||
+ net.minecraftforge.event.ForgeEventFactory.onRenderTickEnd(this.f_91012_ ? this.f_91013_ : this.f_90991_.f_92518_);
|
||||
}
|
||||
|
||||
if (this.f_91056_ != null) {
|
||||
@@ -1132,10 +_,12 @@
|
||||
@@ -1129,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_());
|
||||
@@ -198,7 +198,7 @@
|
||||
this.f_91063_.m_109097_(this.f_90990_.m_85441_(), this.f_90990_.m_85442_());
|
||||
this.f_91067_.m_91599_();
|
||||
}
|
||||
@@ -1432,11 +_,21 @@
|
||||
@@ -1429,11 +_,21 @@
|
||||
if (p_91387_ && this.f_91077_ != null && this.f_91077_.m_6662_() == HitResult.Type.BLOCK) {
|
||||
BlockHitResult blockhitresult = (BlockHitResult)this.f_91077_;
|
||||
BlockPos blockpos = blockhitresult.m_82425_();
|
||||
@@ -222,7 +222,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1455,6 +_,8 @@
|
||||
@@ -1452,6 +_,8 @@
|
||||
}
|
||||
|
||||
} else if (!this.f_91074_.m_108637_()) {
|
||||
@@ -231,7 +231,7 @@
|
||||
switch(this.f_91077_.m_6662_()) {
|
||||
case ENTITY:
|
||||
this.f_91072_.m_105223_(this.f_91074_, ((EntityHitResult)this.f_91077_).m_82443_());
|
||||
@@ -1462,7 +_,7 @@
|
||||
@@ -1459,7 +_,7 @@
|
||||
case BLOCK:
|
||||
BlockHitResult blockhitresult = (BlockHitResult)this.f_91077_;
|
||||
BlockPos blockpos = blockhitresult.m_82425_();
|
||||
@@ -240,7 +240,7 @@
|
||||
this.f_91072_.m_105269_(blockpos, blockhitresult.m_82434_());
|
||||
break;
|
||||
}
|
||||
@@ -1472,8 +_,10 @@
|
||||
@@ -1469,8 +_,10 @@
|
||||
}
|
||||
|
||||
this.f_91074_.m_36334_();
|
||||
@@ -251,7 +251,7 @@
|
||||
this.f_91074_.m_6674_(InteractionHand.MAIN_HAND);
|
||||
}
|
||||
}
|
||||
@@ -1488,6 +_,11 @@
|
||||
@@ -1485,6 +_,11 @@
|
||||
}
|
||||
|
||||
for(InteractionHand interactionhand : InteractionHand.values()) {
|
||||
@@ -263,7 +263,7 @@
|
||||
ItemStack itemstack = this.f_91074_.m_21120_(interactionhand);
|
||||
if (this.f_91077_ != null) {
|
||||
switch(this.f_91077_.m_6662_()) {
|
||||
@@ -1501,6 +_,7 @@
|
||||
@@ -1502,6 +_,7 @@
|
||||
|
||||
if (interactionresult.m_19077_()) {
|
||||
if (interactionresult.m_19080_()) {
|
||||
@@ -271,7 +271,7 @@
|
||||
this.f_91074_.m_6674_(interactionhand);
|
||||
}
|
||||
|
||||
@@ -1513,6 +_,7 @@
|
||||
@@ -1514,6 +_,7 @@
|
||||
InteractionResult interactionresult1 = this.f_91072_.m_105262_(this.f_91074_, this.f_91073_, interactionhand, blockhitresult);
|
||||
if (interactionresult1.m_19077_()) {
|
||||
if (interactionresult1.m_19080_()) {
|
||||
@@ -279,7 +279,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);
|
||||
@@ -1528,6 +_,9 @@
|
||||
@@ -1529,6 +_,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,25 +289,25 @@
|
||||
if (!itemstack.m_41619_()) {
|
||||
InteractionResult interactionresult2 = this.f_91072_.m_105235_(this.f_91074_, this.f_91073_, interactionhand);
|
||||
if (interactionresult2.m_19077_()) {
|
||||
@@ -1554,6 +_,8 @@
|
||||
@@ -1555,6 +_,8 @@
|
||||
--this.f_91011_;
|
||||
}
|
||||
|
||||
+ net.minecraftforge.fmllegacy.hooks.BasicEventHooks.onPreClientTick();
|
||||
+ net.minecraftforge.event.ForgeEventFactory.onPreClientTick();
|
||||
+
|
||||
this.f_91026_.m_6180_("gui");
|
||||
if (!this.f_91012_) {
|
||||
this.f_91065_.m_93066_();
|
||||
@@ -1679,6 +_,8 @@
|
||||
this.f_91065_.m_193832_(this.f_91012_);
|
||||
this.f_91026_.m_7238_();
|
||||
@@ -1683,6 +_,8 @@
|
||||
this.f_91026_.m_6182_("keyboard");
|
||||
this.f_91068_.m_90931_();
|
||||
this.f_91026_.m_7238_();
|
||||
+
|
||||
+ net.minecraftforge.fmllegacy.hooks.BasicEventHooks.onPostClientTick();
|
||||
+ net.minecraftforge.event.ForgeEventFactory.onPostClientTick();
|
||||
}
|
||||
|
||||
private boolean m_91278_() {
|
||||
@@ -1814,11 +_,11 @@
|
||||
@@ -1821,11 +_,11 @@
|
||||
}
|
||||
|
||||
public void m_91200_(String p_91201_) {
|
||||
@@ -321,7 +321,7 @@
|
||||
return p_91204_.m_46934_();
|
||||
}, (p_167886_, p_167887_, p_167888_, p_167889_) -> {
|
||||
RegistryWriteOps<JsonElement> registrywriteops = RegistryWriteOps.m_135767_(JsonOps.INSTANCE, p_91205_);
|
||||
@@ -1828,10 +_,10 @@
|
||||
@@ -1835,10 +_,10 @@
|
||||
});
|
||||
WorldGenSettings worldgensettings = dataresult.resultOrPartial(Util.m_137489_("Error reading worldgen settings after loading data packs: ", f_90982_::error)).orElse(p_91206_);
|
||||
return new PrimaryLevelData(p_91204_, worldgensettings, dataresult.lifecycle());
|
||||
@@ -334,7 +334,7 @@
|
||||
LevelStorageSource.LevelStorageAccess levelstoragesource$levelstorageaccess;
|
||||
try {
|
||||
levelstoragesource$levelstorageaccess = this.f_91031_.m_78260_(p_91220_);
|
||||
@@ -1843,12 +_,17 @@
|
||||
@@ -1850,12 +_,17 @@
|
||||
}
|
||||
|
||||
Minecraft.ServerStem minecraft$serverstem;
|
||||
@@ -354,7 +354,7 @@
|
||||
}));
|
||||
|
||||
try {
|
||||
@@ -1868,7 +_,7 @@
|
||||
@@ -1875,7 +_,7 @@
|
||||
this.f_90999_.set((StoringChunkProgressListener)null);
|
||||
|
||||
try {
|
||||
@@ -363,8 +363,8 @@
|
||||
minecraft$serverstem.m_91433_().m_136179_();
|
||||
YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(this.f_91030_);
|
||||
MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
|
||||
@@ -1880,7 +_,7 @@
|
||||
SkullBlockEntity.m_182462_(this);
|
||||
@@ -1885,7 +_,7 @@
|
||||
SkullBlockEntity.m_196700_(gameprofilecache, minecraftsessionservice, this);
|
||||
GameProfileCache.m_11004_(false);
|
||||
this.f_91007_ = MinecraftServer.m_129872_((p_167898_) -> {
|
||||
- return new IntegratedServer(p_167898_, this, p_91221_, levelstoragesource$levelstorageaccess, minecraft$serverstem.m_91432_(), minecraft$serverstem.m_91433_(), worlddata, minecraftsessionservice, gameprofilerepository, gameprofilecache, (p_168000_) -> {
|
||||
@@ -372,7 +372,7 @@
|
||||
StoringChunkProgressListener storingchunkprogresslistener = new StoringChunkProgressListener(p_168000_ + 0);
|
||||
this.f_90999_.set(storingchunkprogresslistener);
|
||||
return ProcessorChunkProgressListener.m_143583_(storingchunkprogresslistener, this.f_91023_::add);
|
||||
@@ -1924,11 +_,16 @@
|
||||
@@ -1929,11 +_,16 @@
|
||||
connection.m_129505_(new ClientHandshakePacketListenerImpl(connection, this, (Screen)null, (p_167998_) -> {
|
||||
}));
|
||||
connection.m_129512_(new ClientIntentionPacket(socketaddress.toString(), 0, ConnectionProtocol.LOGIN));
|
||||
@@ -391,7 +391,7 @@
|
||||
});
|
||||
minecraft$serverstem.close();
|
||||
|
||||
@@ -2016,6 +_,7 @@
|
||||
@@ -2021,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_91156_(ClientLevel p_91157_) {
|
||||
@@ -399,7 +399,7 @@
|
||||
ProgressScreen progressscreen = new ProgressScreen(true);
|
||||
progressscreen.m_6309_(new TranslatableComponent("connect.joining"));
|
||||
this.m_91362_(progressscreen);
|
||||
@@ -2049,10 +_,12 @@
|
||||
@@ -2053,10 +_,12 @@
|
||||
IntegratedServer integratedserver = this.f_91007_;
|
||||
this.f_91007_ = null;
|
||||
this.f_91063_.m_109150_();
|
||||
@@ -412,23 +412,15 @@
|
||||
if (integratedserver != null) {
|
||||
this.f_91026_.m_6180_("waitForServer");
|
||||
|
||||
@@ -2067,6 +_,7 @@
|
||||
@@ -2071,6 +_,7 @@
|
||||
this.f_91065_.m_93089_();
|
||||
this.f_91008_ = null;
|
||||
this.f_91010_ = false;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.handleClientWorldClosing(f_91073_);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.handleClientLevelClosing(f_91073_);
|
||||
this.f_91004_.m_90740_();
|
||||
}
|
||||
|
||||
@@ -2097,6 +_,7 @@
|
||||
this.f_91061_.m_107342_(p_91325_);
|
||||
this.f_167845_.m_112257_(p_91325_);
|
||||
this.m_91341_();
|
||||
+ net.minecraftforge.client.MinecraftForgeClient.clearRenderCache();
|
||||
}
|
||||
|
||||
public boolean m_91400_() {
|
||||
@@ -2152,66 +_,9 @@
|
||||
@@ -2157,66 +_,9 @@
|
||||
|
||||
private void m_91280_() {
|
||||
if (this.f_91077_ != null && this.f_91077_.m_6662_() != HitResult.Type.MISS) {
|
||||
@@ -498,7 +490,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2768,7 +_,7 @@
|
||||
@@ -2707,7 +_,7 @@
|
||||
return this.f_90993_;
|
||||
}
|
||||
|
||||
@@ -507,7 +499,7 @@
|
||||
int i = p_167938_.m_10374_();
|
||||
Supplier<PackResources> supplier = p_167937_;
|
||||
if (i <= 3) {
|
||||
@@ -2779,7 +_,7 @@
|
||||
@@ -2718,7 +_,7 @@
|
||||
supplier = m_91352_(supplier);
|
||||
}
|
||||
|
||||
@@ -516,7 +508,7 @@
|
||||
}
|
||||
|
||||
private static Supplier<PackResources> m_91330_(Supplier<PackResources> p_91331_) {
|
||||
@@ -2796,6 +_,14 @@
|
||||
@@ -2735,6 +_,14 @@
|
||||
|
||||
public void m_91312_(int p_91313_) {
|
||||
this.f_91051_.m_119410_(p_91313_);
|
||||
|
||||
@@ -13,19 +13,19 @@
|
||||
screen.m_169415_();
|
||||
Screen.m_96579_(() -> {
|
||||
- aboolean[0] = screen.m_6375_(d0, d1, i);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiMouseClickedPre(this.f_91503_.f_91080_, d0, d1, i);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onScreenMouseClickedPre(this.f_91503_.f_91080_, d0, d1, i);
|
||||
+ if (!aboolean[0]) {
|
||||
+ aboolean[0] = this.f_91503_.f_91080_.m_6375_(d0, d1, i);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiMouseClickedPost(this.f_91503_.f_91080_, d0, d1, i, aboolean[0]);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onScreenMouseClickedPost(this.f_91503_.f_91080_, d0, d1, i, aboolean[0]);
|
||||
+ }
|
||||
}, "mouseClicked event handler", screen.getClass().getCanonicalName());
|
||||
} else {
|
||||
Screen.m_96579_(() -> {
|
||||
- aboolean[0] = screen.m_6348_(d0, d1, i);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiMouseReleasedPre(this.f_91503_.f_91080_, d0, d1, i);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onScreenMouseReleasedPre(this.f_91503_.f_91080_, d0, d1, i);
|
||||
+ if (!aboolean[0]) {
|
||||
+ aboolean[0] = this.f_91503_.f_91080_.m_6348_(d0, d1, i);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiMouseReleasedPost(this.f_91503_.f_91080_, d0, d1, i, aboolean[0]);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onScreenMouseReleasedPost(this.f_91503_.f_91080_, d0, d1, i, aboolean[0]);
|
||||
+ }
|
||||
}, "mouseReleased event handler", screen.getClass().getCanonicalName());
|
||||
}
|
||||
@@ -54,9 +54,9 @@
|
||||
double d2 = this.f_91508_ * (double)this.f_91503_.m_91268_().m_85446_() / (double)this.f_91503_.m_91268_().m_85444_();
|
||||
- this.f_91503_.f_91080_.m_6050_(d1, d2, d0);
|
||||
this.f_91503_.f_91080_.m_169415_();
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onGuiMouseScrollPre(this, this.f_91503_.f_91080_, d0)) return;
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onScreenMouseScrollPre(this, this.f_91503_.f_91080_, d0)) return;
|
||||
+ if (this.f_91503_.f_91080_.m_6050_(d1, d2, d0)) return;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onGuiMouseScrollPost(this, this.f_91503_.f_91080_, d0);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onScreenMouseScrollPost(this, this.f_91503_.f_91080_, d0);
|
||||
} else if (this.f_91503_.f_91074_ != null) {
|
||||
if (this.f_91518_ != 0.0D && Math.signum(d0) != Math.signum(this.f_91518_)) {
|
||||
this.f_91518_ = 0.0D;
|
||||
@@ -73,9 +73,9 @@
|
||||
double d3 = (p_91564_ - this.f_91508_) * (double)this.f_91503_.m_91268_().m_85446_() / (double)this.f_91503_.m_91268_().m_85444_();
|
||||
Screen.m_96579_(() -> {
|
||||
- screen.m_7979_(d0, d1, this.f_91510_, d2, d3);
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onGuiMouseDragPre(this.f_91503_.f_91080_, d0, d1, this.f_91510_, d2, d3)) return;
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onScreenMouseDragPre(this.f_91503_.f_91080_, d0, d1, this.f_91510_, d2, d3)) return;
|
||||
+ if (screen.m_7979_(d0, d1, this.f_91510_, d2, d3)) return;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onGuiMouseDragPost(this.f_91503_.f_91080_, d0, d1, this.f_91510_, d2, d3);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onScreenMouseDragPost(this.f_91503_.f_91080_, d0, d1, this.f_91510_, d2, d3);
|
||||
}, "mouseDragged event handler", screen.getClass().getCanonicalName());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/Options.java
|
||||
+++ b/net/minecraft/client/Options.java
|
||||
@@ -179,6 +_,7 @@
|
||||
@@ -186,6 +_,7 @@
|
||||
public boolean f_92076_;
|
||||
|
||||
public Options(Minecraft p_92138_, File p_92139_) {
|
||||
@@ -8,8 +8,8 @@
|
||||
this.f_92060_ = p_92138_;
|
||||
this.f_92110_ = new File(p_92139_, "options.txt");
|
||||
if (p_92138_.m_91103_() && Runtime.getRuntime().maxMemory() >= 1000000000L) {
|
||||
@@ -283,10 +_,14 @@
|
||||
this.f_92076_ = p_168428_.m_142682_("syncChunkWrites", this.f_92076_);
|
||||
@@ -299,10 +_,14 @@
|
||||
this.f_193762_ = p_168428_.m_142682_("allowServerListing", this.f_193762_);
|
||||
|
||||
for(KeyMapping keymapping : this.f_92059_) {
|
||||
- String s = keymapping.m_90865_();
|
||||
@@ -25,15 +25,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -474,6 +_,7 @@
|
||||
@@ -490,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_92169_() {
|
||||
+ if (net.minecraftforge.fmlclient.ClientModLoader.isLoading()) return; //Don't save settings before mods add keybindigns and the like to prevent them from being deleted.
|
||||
+ if (net.minecraftforge.client.loading.ClientModLoader.isLoading()) return; //Don't save settings before mods add keybindigns and the like to prevent them from being deleted.
|
||||
try {
|
||||
final PrintWriter printwriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(this.f_92110_), StandardCharsets.UTF_8));
|
||||
|
||||
@@ -622,6 +_,23 @@
|
||||
@@ -638,6 +_,23 @@
|
||||
}
|
||||
|
||||
p_92146_.m_10509_(set);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
+ }
|
||||
+ final File target = event.getScreenshotFile();
|
||||
+
|
||||
Util.m_137579_().execute(() -> {
|
||||
Util.m_183992_().execute(() -> {
|
||||
try {
|
||||
- nativeimage.m_85056_(file2);
|
||||
+ nativeimage.m_85056_(target);
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
--- a/net/minecraft/client/User.java
|
||||
+++ b/net/minecraft/client/User.java
|
||||
@@ -18,8 +_,22 @@
|
||||
private final String f_92536_;
|
||||
private final String f_92537_;
|
||||
@@ -21,8 +_,22 @@
|
||||
private final Optional<String> f_193796_;
|
||||
private final Optional<String> f_193797_;
|
||||
private final User.Type f_92538_;
|
||||
+ /** Forge: Cache of the local session's GameProfile properties. */
|
||||
+ private com.mojang.authlib.properties.PropertyMap properties;
|
||||
|
||||
public User(String p_92540_, String p_92541_, String p_92542_, String p_92543_) {
|
||||
+ if (p_92540_ == null || p_92540_.isEmpty()) {
|
||||
+ p_92540_ = "MissingName";
|
||||
+ p_92541_ = p_92542_ = "NotValid";
|
||||
public User(String p_193799_, String p_193800_, String p_193801_, Optional<String> p_193802_, Optional<String> p_193803_, User.Type p_193804_) {
|
||||
+ if (p_193799_ == null || p_193799_.isEmpty()) {
|
||||
+ p_193799_ = "MissingName";
|
||||
+ p_193800_ = p_193801_ = "NotValid";
|
||||
+ org.apache.logging.log4j.Logger logger = org.apache.logging.log4j.LogManager.getLogger(getClass().getName());
|
||||
+ logger.warn("=========================================================");
|
||||
+ logger.warn("WARNING!! the username was not set for this session, typically");
|
||||
@@ -20,10 +20,10 @@
|
||||
+ logger.warn("when asking for help!");
|
||||
+ logger.warn("=========================================================");
|
||||
+ }
|
||||
this.f_92535_ = p_92540_;
|
||||
this.f_92536_ = p_92541_;
|
||||
this.f_92537_ = p_92542_;
|
||||
@@ -45,10 +_,22 @@
|
||||
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_());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/Gui.java
|
||||
+++ b/net/minecraft/client/gui/Gui.java
|
||||
@@ -446,6 +_,10 @@
|
||||
@@ -463,6 +_,10 @@
|
||||
|
||||
for(MobEffectInstance mobeffectinstance : Ordering.natural().reverse().sortedCopy(collection)) {
|
||||
MobEffect mobeffect = mobeffectinstance.m_19544_();
|
||||
@@ -9,17 +9,17 @@
|
||||
+ // Rebind in case previous renderHUDEffect changed texture
|
||||
+ RenderSystem.m_157456_(0, AbstractContainerScreen.f_97725_);
|
||||
if (mobeffectinstance.m_19575_()) {
|
||||
int k = this.f_92977_;
|
||||
int l = 1;
|
||||
@@ -483,6 +_,7 @@
|
||||
int i = this.f_92977_;
|
||||
int j = 1;
|
||||
@@ -500,6 +_,7 @@
|
||||
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, f1);
|
||||
m_93200_(p_93029_, j1 + 3, k1 + 3, this.m_93252_(), 18, 18, textureatlassprite);
|
||||
m_93200_(p_93029_, l + 3, i1 + 3, this.m_93252_(), 18, 18, textureatlassprite);
|
||||
});
|
||||
+ renderer.renderHUDEffect(mobeffectinstance,this, p_93029_, k, l, this.m_93252_(), f);
|
||||
+ renderer.renderHUDEffect(mobeffectinstance,this, p_93029_, i, j, this.m_93252_(), f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -608,7 +_,8 @@
|
||||
@@ -625,7 +_,8 @@
|
||||
mutablecomponent.m_130940_(ChatFormatting.ITALIC);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
int j = (this.f_92977_ - i) / 2;
|
||||
int k = this.f_92978_ - 59;
|
||||
if (!this.f_92986_.f_91072_.m_105205_()) {
|
||||
@@ -624,7 +_,13 @@
|
||||
@@ -641,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));
|
||||
@@ -44,7 +44,7 @@
|
||||
RenderSystem.m_69461_();
|
||||
}
|
||||
}
|
||||
@@ -1128,7 +_,7 @@
|
||||
@@ -1153,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/MapRenderer.java
|
||||
+++ b/net/minecraft/client/gui/MapRenderer.java
|
||||
@@ -123,6 +_,7 @@
|
||||
@@ -118,6 +_,7 @@
|
||||
|
||||
for(MapDecoration mapdecoration : this.f_93280_.m_164811_()) {
|
||||
if (!p_93294_ || mapdecoration.m_77809_()) {
|
||||
|
||||
+1
-1
@@ -13,4 +13,4 @@
|
||||
+
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public abstract static class Entry<E extends AbstractSelectionList.Entry<E>> implements GuiEventListener {
|
||||
@Deprecated
|
||||
/** @deprecated */
|
||||
@@ -5,7 +5,7 @@
|
||||
for(LerpingBossEvent lerpingbossevent : this.f_93699_.values()) {
|
||||
int k = i / 2 - 91;
|
||||
+ net.minecraftforge.client.event.RenderGameOverlayEvent.BossInfo event =
|
||||
+ net.minecraftforge.client.ForgeHooksClient.bossBarRenderPre(p_93705_, this.f_93698_.m_91268_(), lerpingbossevent, k, j, 10 + this.f_93698_.f_91062_.f_92710_);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.renderBossEventPre(p_93705_, this.f_93698_.m_91268_(), lerpingbossevent, k, j, 10 + this.f_93698_.f_91062_.f_92710_);
|
||||
+ if (!event.isCanceled()) {
|
||||
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.m_157456_(0, f_93697_);
|
||||
@@ -17,7 +17,7 @@
|
||||
- j += 10 + 9;
|
||||
+ }
|
||||
+ j += event.getIncrement();
|
||||
+ net.minecraftforge.client.ForgeHooksClient.bossBarRenderPost(p_93705_, this.f_93698_.m_91268_());
|
||||
+ net.minecraftforge.client.ForgeHooksClient.renderBossEventPost(p_93705_, this.f_93698_.m_91268_());
|
||||
if (j >= this.f_93698_.m_91268_().m_85446_() / 3) {
|
||||
break;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/components/DebugScreenOverlay.java
|
||||
+++ b/net/minecraft/client/gui/components/DebugScreenOverlay.java
|
||||
@@ -354,7 +_,7 @@
|
||||
@@ -363,7 +_,7 @@
|
||||
list.add(this.m_94071_(entry));
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
list.add("#" + resourcelocation);
|
||||
}
|
||||
}
|
||||
@@ -370,7 +_,7 @@
|
||||
@@ -379,7 +_,7 @@
|
||||
list.add(this.m_94071_(entry1));
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
list.add("#" + resourcelocation1);
|
||||
}
|
||||
}
|
||||
@@ -380,6 +_,7 @@
|
||||
@@ -389,6 +_,7 @@
|
||||
list.add("");
|
||||
list.add(ChatFormatting.UNDERLINE + "Targeted Entity");
|
||||
list.add(String.valueOf((Object)Registry.f_122826_.m_7981_(entity.m_6095_())));
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
int k1 = (int)((double)this.f_96163_.m_91268_().m_85446_() * 0.8325D);
|
||||
float f6 = this.f_96164_.m_7750_();
|
||||
this.f_96167_ = Mth.m_14036_(this.f_96167_ * 0.95F + f6 * 0.050000012F, 0.0F, 1.0F);
|
||||
+ net.minecraftforge.fmlclient.ClientModLoader.renderProgressText();
|
||||
+ net.minecraftforge.client.loading.ClientModLoader.renderProgressText();
|
||||
if (f < 1.0F) {
|
||||
this.m_96182_(p_96178_, i / 2 - j1, k1 - 5, i / 2 + j1, k1 + 5, 1.0F - Mth.m_14036_(f, 0.0F, 1.0F));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/OptionsScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/OptionsScreen.java
|
||||
@@ -134,4 +_,12 @@
|
||||
@@ -141,4 +_,12 @@
|
||||
m_93215_(p_96249_, this.f_96547_, this.f_96539_, this.f_96543_ / 2, 15, 16777215);
|
||||
super.m_6305_(p_96249_, p_96250_, p_96251_, p_96252_);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/Screen.java
|
||||
+++ b/net/minecraft/client/gui/screens/Screen.java
|
||||
@@ -125,7 +_,7 @@
|
||||
@@ -126,7 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_7379_() {
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
protected <T extends GuiEventListener & Widget & NarratableEntry> T m_142416_(T p_169406_) {
|
||||
@@ -162,15 +_,29 @@
|
||||
@@ -163,15 +_,29 @@
|
||||
this.f_169368_.clear();
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
this.m_169383_(p_169389_, list, p_169392_, p_169393_);
|
||||
}
|
||||
|
||||
@@ -183,20 +_,48 @@
|
||||
@@ -184,20 +_,44 @@
|
||||
}
|
||||
|
||||
public void m_96597_(PoseStack p_96598_, List<Component> p_96599_, int p_96600_, int p_96601_) {
|
||||
@@ -57,9 +57,7 @@
|
||||
+ public void renderComponentTooltip(PoseStack poseStack, List<? extends net.minecraft.network.chat.FormattedText> tooltips, int mouseX, int mouseY, @Nullable Font font) {
|
||||
+ this.renderComponentTooltip(poseStack, tooltips, mouseX, mouseY, font, ItemStack.f_41583_);
|
||||
+ }
|
||||
+ @Deprecated(forRemoval = true, since = "1.17.1") public void renderComponentToolTip(PoseStack poseStack, List<? extends net.minecraft.network.chat.FormattedText> tooltips, int mouseX, int mouseY, @Nullable Font font) {
|
||||
+ renderComponentTooltip(poseStack, tooltips, mouseX, mouseY, font);
|
||||
+ }
|
||||
+
|
||||
+ public void renderComponentTooltip(PoseStack poseStack, List<? extends net.minecraft.network.chat.FormattedText> tooltips, int mouseX, int mouseY, @Nullable Font font, ItemStack stack) {
|
||||
+ this.tooltipFont = font;
|
||||
+ this.tooltipStack = stack;
|
||||
@@ -72,29 +70,27 @@
|
||||
public void m_96617_(PoseStack p_96618_, List<? extends FormattedCharSequence> p_96619_, int p_96620_, int p_96621_) {
|
||||
this.m_169383_(p_96618_, p_96619_.stream().map(ClientTooltipComponent::m_169948_).collect(Collectors.toList()), p_96620_, p_96621_);
|
||||
}
|
||||
+ @Deprecated(forRemoval = true, since = "1.17.1") public void renderToolTip(PoseStack p_96618_, List<? extends FormattedCharSequence> p_96619_, int p_96620_, int p_96621_, Font font) {
|
||||
+ renderTooltip(p_96618_, p_96619_, p_96620_, p_96621_, font);
|
||||
+ }
|
||||
|
||||
+ public void renderTooltip(PoseStack poseStack, List<? extends FormattedCharSequence> lines, int x, int y, Font font) {
|
||||
+ this.tooltipFont = font;
|
||||
+ this.m_96617_(poseStack, lines, x, y);
|
||||
+ this.tooltipFont = null;
|
||||
+ }
|
||||
|
||||
+
|
||||
private void m_169383_(PoseStack p_169384_, List<ClientTooltipComponent> p_169385_, int p_169386_, int p_169387_) {
|
||||
if (!p_169385_.isEmpty()) {
|
||||
+ net.minecraftforge.client.event.RenderTooltipEvent.Pre preEvent = net.minecraftforge.client.ForgeHooksClient.preTooltipEvent(this.tooltipStack, p_169384_, p_169386_, p_169387_, f_96543_, f_96544_, p_169385_, this.tooltipFont, this.f_96547_);
|
||||
+ net.minecraftforge.client.event.RenderTooltipEvent.Pre preEvent = net.minecraftforge.client.ForgeHooksClient.onRenderTooltipPre(this.tooltipStack, p_169384_, p_169386_, p_169387_, f_96543_, f_96544_, p_169385_, this.tooltipFont, this.f_96547_);
|
||||
+ if (preEvent.isCanceled()) return;
|
||||
int i = 0;
|
||||
int j = p_169385_.size() == 1 ? -2 : 0;
|
||||
|
||||
for(ClientTooltipComponent clienttooltipcomponent : p_169385_) {
|
||||
- int k = clienttooltipcomponent.m_142069_(this.f_96547_);
|
||||
+ int k = clienttooltipcomponent.m_142069_(preEvent.getFontRenderer());
|
||||
+ int k = clienttooltipcomponent.m_142069_(preEvent.getFont());
|
||||
if (k > i) {
|
||||
i = k;
|
||||
}
|
||||
@@ -204,8 +_,8 @@
|
||||
@@ -205,8 +_,8 @@
|
||||
j += clienttooltipcomponent.m_142103_();
|
||||
}
|
||||
|
||||
@@ -105,7 +101,7 @@
|
||||
if (j2 + i > this.f_96543_) {
|
||||
j2 -= 28 + i;
|
||||
}
|
||||
@@ -226,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_();
|
||||
@@ -118,7 +114,7 @@
|
||||
- m_93123_(matrix4f, bufferbuilder, j2 + i + 2, k2 - 3 + 1, j2 + i + 3, k2 + j + 3 - 1, 400, 1347420415, 1344798847);
|
||||
- m_93123_(matrix4f, bufferbuilder, j2 - 3, k2 - 3, j2 + i + 3, k2 - 3 + 1, 400, 1347420415, 1347420415);
|
||||
- m_93123_(matrix4f, bufferbuilder, j2 - 3, k2 + j + 2, j2 + i + 3, k2 + j + 3, 400, 1344798847, 1344798847);
|
||||
+ net.minecraftforge.client.event.RenderTooltipEvent.Color colorEvent = net.minecraftforge.client.ForgeHooksClient.colorTooltipEvent(this.tooltipStack, p_169384_, j2, k2, preEvent.getFontRenderer(), p_169385_);
|
||||
+ net.minecraftforge.client.event.RenderTooltipEvent.Color colorEvent = net.minecraftforge.client.ForgeHooksClient.onRenderTooltipColor(this.tooltipStack, p_169384_, j2, k2, preEvent.getFont(), p_169385_);
|
||||
+ m_93123_(matrix4f, bufferbuilder, j2 - 3, k2 - 4, j2 + i + 3, k2 - 3, 400, colorEvent.getBackgroundStart(), colorEvent.getBackgroundStart());
|
||||
+ m_93123_(matrix4f, bufferbuilder, j2 - 3, k2 + j + 3, j2 + i + 3, k2 + j + 4, 400, colorEvent.getBackgroundEnd(), colorEvent.getBackgroundEnd());
|
||||
+ m_93123_(matrix4f, bufferbuilder, j2 - 3, k2 - 3, j2 + i + 3, k2 + j + 3, 400, colorEvent.getBackgroundStart(), colorEvent.getBackgroundEnd());
|
||||
@@ -131,25 +127,25 @@
|
||||
RenderSystem.m_69482_();
|
||||
RenderSystem.m_69472_();
|
||||
RenderSystem.m_69478_();
|
||||
@@ -249,7 +_,7 @@
|
||||
@@ -250,7 +_,7 @@
|
||||
|
||||
for(int i2 = 0; i2 < p_169385_.size(); ++i2) {
|
||||
ClientTooltipComponent clienttooltipcomponent1 = p_169385_.get(i2);
|
||||
- clienttooltipcomponent1.m_142440_(this.f_96547_, j2, l1, matrix4f, multibuffersource$buffersource);
|
||||
+ clienttooltipcomponent1.m_142440_(preEvent.getFontRenderer(), j2, l1, matrix4f, multibuffersource$buffersource);
|
||||
+ clienttooltipcomponent1.m_142440_(preEvent.getFont(), j2, l1, matrix4f, multibuffersource$buffersource);
|
||||
l1 += clienttooltipcomponent1.m_142103_() + (i2 == 0 ? 2 : 0);
|
||||
}
|
||||
|
||||
@@ -259,7 +_,7 @@
|
||||
@@ -260,7 +_,7 @@
|
||||
|
||||
for(int l2 = 0; l2 < p_169385_.size(); ++l2) {
|
||||
ClientTooltipComponent clienttooltipcomponent2 = p_169385_.get(l2);
|
||||
- clienttooltipcomponent2.m_142162_(this.f_96547_, j2, l1, p_169384_, this.f_96542_, 400, this.f_96541_.m_91097_());
|
||||
+ clienttooltipcomponent2.m_142162_(preEvent.getFontRenderer(), j2, l1, p_169384_, this.f_96542_, 400, this.f_96541_.m_91097_());
|
||||
- clienttooltipcomponent2.m_183452_(this.f_96547_, j2, l1, p_169384_, this.f_96542_, 400);
|
||||
+ clienttooltipcomponent2.m_183452_(preEvent.getFont(), j2, l1, p_169384_, this.f_96542_, 400);
|
||||
l1 += clienttooltipcomponent2.m_142103_() + (l2 == 0 ? 2 : 0);
|
||||
}
|
||||
|
||||
@@ -353,9 +_,12 @@
|
||||
@@ -354,9 +_,12 @@
|
||||
}
|
||||
|
||||
public void m_96612_(String p_96613_, boolean p_96614_) {
|
||||
@@ -162,7 +158,7 @@
|
||||
|
||||
this.f_96541_.f_91074_.m_108739_(p_96613_);
|
||||
}
|
||||
@@ -366,11 +_,21 @@
|
||||
@@ -367,11 +_,21 @@
|
||||
this.f_96547_ = p_96607_.f_91062_;
|
||||
this.f_96543_ = p_96608_;
|
||||
this.f_96544_ = p_96609_;
|
||||
@@ -173,34 +169,34 @@
|
||||
+ this.f_169368_.add(ne);
|
||||
+ f_96540_.add(b);
|
||||
+ };
|
||||
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent.Pre(this, this.f_96540_, add, this::m_169411_))) {
|
||||
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.InitScreenEvent.Pre(this, this.f_96540_, add, this::m_169411_))) {
|
||||
this.m_169413_();
|
||||
this.m_7522_((GuiEventListener)null);
|
||||
this.m_7856_();
|
||||
this.m_169407_(false);
|
||||
this.m_169378_(f_169370_);
|
||||
+ }
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent.Post(this, this.f_96540_, add, this::m_169411_));
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.InitScreenEvent.Post(this, this.f_96540_, add, this::m_169411_));
|
||||
}
|
||||
|
||||
public List<? extends GuiEventListener> m_6702_() {
|
||||
@@ -393,6 +_,7 @@
|
||||
@@ -394,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);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this, p_96559_));
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.BackgroundDrawnEvent(this, p_96559_));
|
||||
} else {
|
||||
this.m_96626_(p_96560_);
|
||||
}
|
||||
@@ -412,6 +_,7 @@
|
||||
@@ -413,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_();
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent(this, new PoseStack()));
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.BackgroundDrawnEvent(this, new PoseStack()));
|
||||
}
|
||||
|
||||
public boolean m_7043_() {
|
||||
@@ -497,6 +_,10 @@
|
||||
@@ -498,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
|
||||
@@ -63,6 +_,7 @@
|
||||
@@ -64,6 +_,7 @@
|
||||
private final PanoramaRenderer f_96729_ = new PanoramaRenderer(f_96716_);
|
||||
private final boolean f_96714_;
|
||||
private long f_96715_;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public TitleScreen() {
|
||||
this(false);
|
||||
@@ -106,11 +_,16 @@
|
||||
@@ -107,11 +_,16 @@
|
||||
this.f_96728_ = this.f_96543_ - this.f_96727_ - 2;
|
||||
int i = 24;
|
||||
int j = this.f_96544_ / 4 + 48;
|
||||
@@ -18,14 +18,14 @@
|
||||
} else {
|
||||
this.m_96763_(j, 24);
|
||||
+ modButton = this.m_142416_(new Button(this.f_96543_ / 2 - 100, j + 24 * 2, 98, 20, new TranslatableComponent("fml.menu.mods"), button -> {
|
||||
+ this.f_96541_.m_91152_(new net.minecraftforge.fmlclient.gui.screen.ModListScreen(this));
|
||||
+ this.f_96541_.m_91152_(new net.minecraftforge.client.gui.ModListScreen(this));
|
||||
+ }));
|
||||
}
|
||||
+ modUpdateNotification = net.minecraftforge.client.gui.NotificationModUpdateScreen.init(this, modButton);
|
||||
|
||||
this.m_142416_(new ImageButton(this.f_96543_ / 2 - 124, j + 72 + 12, 20, 20, 0, 106, 20, Button.f_93617_, 256, 256, (p_96791_) -> {
|
||||
this.f_96541_.m_91152_(new LanguageSelectScreen(this, this.f_96541_.f_91066_, this.f_96541_.m_91102_()));
|
||||
@@ -158,7 +_,7 @@
|
||||
@@ -159,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;
|
||||
}
|
||||
@@ -283,6 +_,7 @@
|
||||
@@ -284,6 +_,7 @@
|
||||
|
||||
RenderSystem.m_157456_(0, f_96724_);
|
||||
m_93133_(p_96739_, j + 88, 67, 0.0F, 0.0F, 98, 14, 128, 16);
|
||||
@@ -42,23 +42,23 @@
|
||||
if (this.f_96721_ != null) {
|
||||
p_96739_.m_85836_();
|
||||
p_96739_.m_85837_((double)(this.f_96543_ / 2 + 90), 70.0D, 0.0D);
|
||||
@@ -305,7 +_,14 @@
|
||||
@@ -306,7 +_,14 @@
|
||||
s = s + I18n.m_118938_("menu.modded");
|
||||
}
|
||||
|
||||
- m_93236_(p_96739_, this.f_96547_, s, 2, this.f_96544_ - 10, 16777215 | l);
|
||||
+ net.minecraftforge.fmllegacy.BrandingControl.forEachLine(true, true, (brdline, brd) ->
|
||||
+ net.minecraftforge.internal.BrandingControl.forEachLine(true, true, (brdline, brd) ->
|
||||
+ m_93236_(p_96739_, this.f_96547_, brd, 2, this.f_96544_ - ( 10 + brdline * (this.f_96547_.f_92710_ + 1)), 16777215 | l)
|
||||
+ );
|
||||
+
|
||||
+ net.minecraftforge.fmllegacy.BrandingControl.forEachAboveCopyrightLine((brdline, brd) ->
|
||||
+ net.minecraftforge.internal.BrandingControl.forEachAboveCopyrightLine((brdline, brd) ->
|
||||
+ m_93236_(p_96739_, this.f_96547_, brd, this.f_96543_ - f_96547_.m_92895_(brd), this.f_96544_ - (10 + (brdline + 1) * ( this.f_96547_.f_92710_ + 1)), 16777215 | l)
|
||||
+ );
|
||||
+
|
||||
m_93236_(p_96739_, this.f_96547_, "Copyright Mojang AB. Do not distribute!", this.f_96728_, this.f_96544_ - 10, 16777215 | l);
|
||||
if (p_96740_ > this.f_96728_ && p_96740_ < this.f_96728_ + this.f_96727_ && p_96741_ > this.f_96544_ - 10 && p_96741_ < this.f_96544_) {
|
||||
m_93172_(p_96739_, this.f_96728_, this.f_96544_ - 1, this.f_96728_ + this.f_96727_, this.f_96544_, 16777215 | l);
|
||||
@@ -321,6 +_,7 @@
|
||||
@@ -322,6 +_,7 @@
|
||||
if (this.m_96789_() && f1 >= 1.0F) {
|
||||
this.f_96726_.m_6305_(p_96739_, p_96740_, p_96741_, p_96742_);
|
||||
}
|
||||
|
||||
+7
-7
@@ -1,14 +1,14 @@
|
||||
--- a/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/advancements/AdvancementsScreen.java
|
||||
@@ -42,6 +_,7 @@
|
||||
private final Map<Advancement, AdvancementTab> f_97335_ = Maps.newLinkedHashMap();
|
||||
@@ -43,6 +_,7 @@
|
||||
@Nullable
|
||||
private AdvancementTab f_97336_;
|
||||
private boolean f_97337_;
|
||||
+ private static int tabPage, maxPages;
|
||||
|
||||
public AdvancementsScreen(ClientAdvancements p_97340_) {
|
||||
super(NarratorChatListener.f_93310_);
|
||||
@@ -57,7 +_,13 @@
|
||||
@@ -58,7 +_,13 @@
|
||||
} else {
|
||||
this.f_97334_.m_104401_(this.f_97336_ == null ? null : this.f_97336_.m_97182_(), true);
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
|
||||
public void m_7861_() {
|
||||
@@ -75,7 +_,7 @@
|
||||
@@ -76,7 +_,7 @@
|
||||
int j = (this.f_96544_ - 140) / 2;
|
||||
|
||||
for(AdvancementTab advancementtab : this.f_97335_.values()) {
|
||||
@@ -32,7 +32,7 @@
|
||||
this.f_97334_.m_104401_(advancementtab.m_97182_(), true);
|
||||
break;
|
||||
}
|
||||
@@ -99,6 +_,11 @@
|
||||
@@ -100,6 +_,11 @@
|
||||
int i = (this.f_96543_ - 252) / 2;
|
||||
int j = (this.f_96544_ - 140) / 2;
|
||||
this.m_7333_(p_97361_);
|
||||
@@ -44,7 +44,7 @@
|
||||
this.m_97373_(p_97361_, p_97362_, p_97363_, i, j);
|
||||
this.m_97356_(p_97361_, i, j);
|
||||
this.m_97381_(p_97361_, p_97362_, p_97363_, i, j);
|
||||
@@ -149,12 +_,14 @@
|
||||
@@ -150,12 +_,14 @@
|
||||
RenderSystem.m_157456_(0, f_97330_);
|
||||
|
||||
for(AdvancementTab advancementtab : this.f_97335_.values()) {
|
||||
@@ -59,7 +59,7 @@
|
||||
advancementtab1.m_97159_(p_97358_, p_97359_, this.f_96542_);
|
||||
}
|
||||
|
||||
@@ -180,7 +_,7 @@
|
||||
@@ -181,7 +_,7 @@
|
||||
|
||||
if (this.f_97335_.size() > 1) {
|
||||
for(AdvancementTab advancementtab : this.f_97335_.values()) {
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
--- a/net/minecraft/client/gui/screens/controls/ControlList.java
|
||||
+++ b/net/minecraft/client/gui/screens/controls/ControlList.java
|
||||
@@ -53,7 +_,7 @@
|
||||
}
|
||||
|
||||
protected int m_5756_() {
|
||||
- return super.m_5756_() + 15;
|
||||
+ return super.m_5756_() + 15 + 20;
|
||||
}
|
||||
|
||||
public int m_5759_() {
|
||||
@@ -109,7 +_,7 @@
|
||||
KeyEntry(final KeyMapping p_97451_, final Component p_97452_) {
|
||||
this.f_97445_ = p_97451_;
|
||||
this.f_97446_ = p_97452_;
|
||||
- this.f_97447_ = new Button(0, 0, 75, 20, p_97452_, (p_97479_) -> {
|
||||
+ this.f_97447_ = new Button(0, 0, 75 + 20 /*Forge: add space*/, 20, p_97452_, (p_97479_) -> {
|
||||
ControlList.this.f_97396_.f_97514_ = p_97451_;
|
||||
}) {
|
||||
protected MutableComponent m_5646_() {
|
||||
@@ -117,6 +_,7 @@
|
||||
}
|
||||
};
|
||||
this.f_97448_ = new Button(0, 0, 50, 20, new TranslatableComponent("controls.reset"), (p_97475_) -> {
|
||||
+ f_97445_.setToDefault();
|
||||
ControlList.this.f_93386_.f_91066_.m_92159_(p_97451_, p_97451_.m_90861_());
|
||||
KeyMapping.m_90854_();
|
||||
}) {
|
||||
@@ -130,7 +_,7 @@
|
||||
boolean flag = ControlList.this.f_97396_.f_97514_ == this.f_97445_;
|
||||
float f = (float)(p_97466_ + 90 - ControlList.this.f_97397_);
|
||||
ControlList.this.f_93386_.f_91062_.m_92889_(p_97463_, this.f_97446_, f, (float)(p_97465_ + p_97468_ / 2 - 9 / 2), 16777215);
|
||||
- this.f_97448_.f_93620_ = p_97466_ + 190;
|
||||
+ this.f_97448_.f_93620_ = p_97466_ + 190 + 20;
|
||||
this.f_97448_.f_93621_ = p_97465_;
|
||||
this.f_97448_.f_93623_ = !this.f_97445_.m_90864_();
|
||||
this.f_97448_.m_6305_(p_97463_, p_97469_, p_97470_, p_97472_);
|
||||
@@ -138,11 +_,12 @@
|
||||
this.f_97447_.f_93621_ = p_97465_;
|
||||
this.f_97447_.m_93666_(this.f_97445_.m_90863_());
|
||||
boolean flag1 = false;
|
||||
+ boolean keyCodeModifierConflict = true; // less severe form of conflict, like SHIFT conflicting with SHIFT+G
|
||||
if (!this.f_97445_.m_90862_()) {
|
||||
for(KeyMapping keymapping : ControlList.this.f_93386_.f_91066_.f_92059_) {
|
||||
if (keymapping != this.f_97445_ && this.f_97445_.m_90850_(keymapping)) {
|
||||
flag1 = true;
|
||||
- break;
|
||||
+ keyCodeModifierConflict &= keymapping.hasKeyCodeModifierConflict(keymapping);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -150,7 +_,7 @@
|
||||
if (flag) {
|
||||
this.f_97447_.m_93666_((new TextComponent("> ")).m_7220_(this.f_97447_.m_6035_().m_6881_().m_130940_(ChatFormatting.YELLOW)).m_130946_(" <").m_130940_(ChatFormatting.YELLOW));
|
||||
} else if (flag1) {
|
||||
- this.f_97447_.m_93666_(this.f_97447_.m_6035_().m_6881_().m_130940_(ChatFormatting.RED));
|
||||
+ this.f_97447_.m_93666_(this.f_97447_.m_6035_().m_6881_().m_130940_(keyCodeModifierConflict ? ChatFormatting.GOLD : ChatFormatting.RED));
|
||||
}
|
||||
|
||||
this.f_97447_.m_6305_(p_97463_, p_97469_, p_97470_, p_97472_);
|
||||
@@ -1,26 +0,0 @@
|
||||
--- a/net/minecraft/client/gui/screens/controls/ControlsScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/controls/ControlsScreen.java
|
||||
@@ -35,7 +_,7 @@
|
||||
this.m_7787_(this.f_97516_);
|
||||
this.f_97517_ = this.m_142416_(new Button(this.f_96543_ / 2 - 155, this.f_96544_ - 29, 150, 20, new TranslatableComponent("controls.resetAll"), (p_97538_) -> {
|
||||
for(KeyMapping keymapping : this.f_96282_.f_92059_) {
|
||||
- keymapping.m_90848_(keymapping.m_90861_());
|
||||
+ keymapping.setToDefault();
|
||||
}
|
||||
|
||||
KeyMapping.m_90854_();
|
||||
@@ -59,11 +_,14 @@
|
||||
public boolean m_7933_(int p_97526_, int p_97527_, int p_97528_) {
|
||||
if (this.f_97514_ != null) {
|
||||
if (p_97526_ == 256) {
|
||||
+ this.f_97514_.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), InputConstants.f_84822_);
|
||||
this.f_96282_.m_92159_(this.f_97514_, InputConstants.f_84822_);
|
||||
} else {
|
||||
+ this.f_97514_.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), InputConstants.m_84827_(p_97526_, p_97527_));
|
||||
this.f_96282_.m_92159_(this.f_97514_, InputConstants.m_84827_(p_97526_, p_97527_));
|
||||
}
|
||||
|
||||
+ if (!net.minecraftforge.client.settings.KeyModifier.isKeyCodeModifier(this.f_97514_.getKey()))
|
||||
this.f_97514_ = null;
|
||||
this.f_97515_ = Util.m_137550_();
|
||||
KeyMapping.m_90854_();
|
||||
@@ -0,0 +1,60 @@
|
||||
--- a/net/minecraft/client/gui/screens/controls/KeyBindsList.java
|
||||
+++ b/net/minecraft/client/gui/screens/controls/KeyBindsList.java
|
||||
@@ -53,7 +_,7 @@
|
||||
}
|
||||
|
||||
protected int m_5756_() {
|
||||
- return super.m_5756_() + 15;
|
||||
+ return super.m_5756_() + 15 + 20;
|
||||
}
|
||||
|
||||
public int m_5759_() {
|
||||
@@ -109,7 +_,7 @@
|
||||
KeyEntry(final KeyMapping p_193916_, final Component p_193917_) {
|
||||
this.f_193910_ = p_193916_;
|
||||
this.f_193911_ = p_193917_;
|
||||
- this.f_193912_ = new Button(0, 0, 75, 20, p_193917_, (p_193939_) -> {
|
||||
+ this.f_193912_ = new Button(0, 0, 75 + 20 /* Forge: Add space */, 20, p_193917_, (p_193939_) -> {
|
||||
KeyBindsList.this.f_193858_.f_193975_ = p_193916_;
|
||||
}) {
|
||||
protected MutableComponent m_5646_() {
|
||||
@@ -117,6 +_,7 @@
|
||||
}
|
||||
};
|
||||
this.f_193913_ = new Button(0, 0, 50, 20, new TranslatableComponent("controls.reset"), (p_193935_) -> {
|
||||
+ this.f_193910_.setToDefault();
|
||||
KeyBindsList.this.f_93386_.f_91066_.m_92159_(p_193916_, p_193916_.m_90861_());
|
||||
KeyMapping.m_90854_();
|
||||
}) {
|
||||
@@ -130,7 +_,7 @@
|
||||
boolean flag = KeyBindsList.this.f_193858_.f_193975_ == this.f_193910_;
|
||||
float f = (float)(p_193926_ + 90 - KeyBindsList.this.f_193859_);
|
||||
KeyBindsList.this.f_93386_.f_91062_.m_92889_(p_193923_, this.f_193911_, f, (float)(p_193925_ + p_193928_ / 2 - 9 / 2), 16777215);
|
||||
- this.f_193913_.f_93620_ = p_193926_ + 190;
|
||||
+ this.f_193913_.f_93620_ = p_193926_ + 190 + 20;
|
||||
this.f_193913_.f_93621_ = p_193925_;
|
||||
this.f_193913_.f_93623_ = !this.f_193910_.m_90864_();
|
||||
this.f_193913_.m_6305_(p_193923_, p_193929_, p_193930_, p_193932_);
|
||||
@@ -138,11 +_,12 @@
|
||||
this.f_193912_.f_93621_ = p_193925_;
|
||||
this.f_193912_.m_93666_(this.f_193910_.m_90863_());
|
||||
boolean flag1 = false;
|
||||
+ boolean keyCodeModifierConflict = true; // gracefully handle conflicts like SHIFT vs SHIFT+G
|
||||
if (!this.f_193910_.m_90862_()) {
|
||||
for(KeyMapping keymapping : KeyBindsList.this.f_93386_.f_91066_.f_92059_) {
|
||||
if (keymapping != this.f_193910_ && this.f_193910_.m_90850_(keymapping)) {
|
||||
flag1 = true;
|
||||
- break;
|
||||
+ keyCodeModifierConflict &= keymapping.hasKeyModifierConflict(keymapping);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -150,7 +_,7 @@
|
||||
if (flag) {
|
||||
this.f_193912_.m_93666_((new TextComponent("> ")).m_7220_(this.f_193912_.m_6035_().m_6881_().m_130940_(ChatFormatting.YELLOW)).m_130946_(" <").m_130940_(ChatFormatting.YELLOW));
|
||||
} else if (flag1) {
|
||||
- this.f_193912_.m_93666_(this.f_193912_.m_6035_().m_6881_().m_130940_(ChatFormatting.RED));
|
||||
+ this.f_193912_.m_93666_(this.f_193912_.m_6035_().m_6881_().m_130940_(keyCodeModifierConflict ? ChatFormatting.GOLD : ChatFormatting.RED));
|
||||
}
|
||||
|
||||
this.f_193912_.m_6305_(p_193923_, p_193929_, p_193930_, p_193932_);
|
||||
@@ -0,0 +1,26 @@
|
||||
--- a/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/controls/KeyBindsScreen.java
|
||||
@@ -31,7 +_,7 @@
|
||||
this.m_7787_(this.f_193977_);
|
||||
this.f_193978_ = this.m_142416_(new Button(this.f_96543_ / 2 - 155, this.f_96544_ - 29, 150, 20, new TranslatableComponent("controls.resetAll"), (p_193999_) -> {
|
||||
for(KeyMapping keymapping : this.f_96282_.f_92059_) {
|
||||
- keymapping.m_90848_(keymapping.m_90861_());
|
||||
+ keymapping.setToDefault();
|
||||
}
|
||||
|
||||
KeyMapping.m_90854_();
|
||||
@@ -55,11 +_,14 @@
|
||||
public boolean m_7933_(int p_193987_, int p_193988_, int p_193989_) {
|
||||
if (this.f_193975_ != null) {
|
||||
if (p_193987_ == 256) {
|
||||
+ this.f_193975_.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), InputConstants.f_84822_);
|
||||
this.f_96282_.m_92159_(this.f_193975_, InputConstants.f_84822_);
|
||||
} else {
|
||||
+ this.f_193975_.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), InputConstants.m_84827_(p_193987_, p_193988_));
|
||||
this.f_96282_.m_92159_(this.f_193975_, InputConstants.m_84827_(p_193987_, p_193988_));
|
||||
}
|
||||
|
||||
+ if(!net.minecraftforge.client.settings.KeyModifier.isKeyCodeModifier(this.f_193975_.getKey()))
|
||||
this.f_193975_ = null;
|
||||
this.f_193976_ = Util.m_137550_();
|
||||
KeyMapping.m_90854_();
|
||||
+5
-5
@@ -4,7 +4,7 @@
|
||||
int i = this.f_97735_;
|
||||
int j = this.f_97736_;
|
||||
this.m_7286_(p_97795_, p_97798_, p_97796_, p_97797_);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiContainerEvent.DrawBackground(this, p_97795_, p_97796_, p_97797_));
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ContainerScreenEvent.DrawBackground(this, p_97795_, p_97796_, p_97797_));
|
||||
RenderSystem.m_69465_();
|
||||
super.m_6305_(p_97795_, p_97796_, p_97797_, p_97798_);
|
||||
PoseStack posestack = RenderSystem.m_157191_();
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
|
||||
this.m_7027_(p_97795_, p_97796_, p_97797_);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiContainerEvent.DrawForeground(this, p_97795_, p_97796_, p_97797_));
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ContainerScreenEvent.DrawForeground(this, p_97795_, p_97796_, p_97797_));
|
||||
ItemStack itemstack = this.f_97711_.m_41619_() ? this.f_97732_.m_142621_() : this.f_97711_;
|
||||
if (!itemstack.m_41619_()) {
|
||||
int l1 = 8;
|
||||
@@ -53,7 +53,7 @@
|
||||
if (super.m_6375_(p_97748_, p_97749_, p_97750_)) {
|
||||
return true;
|
||||
} else {
|
||||
- boolean flag = this.f_96541_.f_91066_.f_92097_.m_90830_(p_97750_);
|
||||
- boolean flag = this.f_96541_.f_91066_.f_92097_.m_90830_(p_97750_) && this.f_96541_.f_91072_.m_105290_();
|
||||
+ InputConstants.Key mouseKey = InputConstants.Type.MOUSE.m_84895_(p_97750_);
|
||||
+ boolean flag = this.f_96541_.f_91066_.f_92097_.isActiveAndMatches(mouseKey);
|
||||
Slot slot = this.m_97744_(p_97748_, p_97749_);
|
||||
@@ -71,7 +71,7 @@
|
||||
}
|
||||
} else if (!this.f_97738_) {
|
||||
if (this.f_97732_.m_142621_().m_41619_()) {
|
||||
- if (this.f_96541_.f_91066_.f_92097_.m_90830_(p_97750_)) {
|
||||
- if (flag) {
|
||||
+ if (this.f_96541_.f_91066_.f_92097_.isActiveAndMatches(mouseKey)) {
|
||||
this.m_6597_(slot, l, p_97750_, ClickType.CLONE);
|
||||
} else {
|
||||
@@ -80,7 +80,7 @@
|
||||
this.f_97717_ = 0;
|
||||
} else if (p_97750_ == 1) {
|
||||
this.f_97717_ = 1;
|
||||
- } else if (this.f_96541_.f_91066_.f_92097_.m_90830_(p_97750_)) {
|
||||
- } else if (flag) {
|
||||
+ } else if (this.f_96541_.f_91066_.f_92097_.isActiveAndMatches(mouseKey)) {
|
||||
this.f_97717_ = 2;
|
||||
}
|
||||
|
||||
+18
-18
@@ -9,7 +9,7 @@
|
||||
private boolean f_98515_;
|
||||
private final Map<ResourceLocation, Tag<Item>> f_98516_ = Maps.newTreeMap();
|
||||
|
||||
@@ -242,6 +_,12 @@
|
||||
@@ -233,6 +_,12 @@
|
||||
protected void m_7856_() {
|
||||
if (this.f_96541_.f_91072_.m_105290_()) {
|
||||
super.m_7856_();
|
||||
@@ -22,7 +22,7 @@
|
||||
this.f_96541_.f_91068_.m_90926_(true);
|
||||
this.f_98510_ = new EditBox(this.f_96547_, this.f_97735_ + 82, this.f_97736_ + 6, 80, 9, new TranslatableComponent("itemGroup.search"));
|
||||
this.f_98510_.m_94199_(50);
|
||||
@@ -283,7 +_,7 @@
|
||||
@@ -274,7 +_,7 @@
|
||||
public boolean m_5534_(char p_98521_, int p_98522_) {
|
||||
if (this.f_98514_) {
|
||||
return false;
|
||||
@@ -31,7 +31,7 @@
|
||||
return false;
|
||||
} else {
|
||||
String s = this.f_98510_.m_94155_();
|
||||
@@ -301,7 +_,7 @@
|
||||
@@ -292,7 +_,7 @@
|
||||
|
||||
public boolean m_7933_(int p_98547_, int p_98548_, int p_98549_) {
|
||||
this.f_98514_ = false;
|
||||
@@ -40,7 +40,7 @@
|
||||
if (this.f_96541_.f_91066_.f_92098_.m_90832_(p_98547_, p_98548_)) {
|
||||
this.f_98514_ = true;
|
||||
this.m_98560_(CreativeModeTab.f_40754_);
|
||||
@@ -338,6 +_,32 @@
|
||||
@@ -329,6 +_,32 @@
|
||||
private void m_98630_() {
|
||||
(this.f_97732_).f_98639_.clear();
|
||||
this.f_98516_.clear();
|
||||
@@ -73,7 +73,7 @@
|
||||
String s = this.f_98510_.m_94155_();
|
||||
if (s.isEmpty()) {
|
||||
for(Item item : Registry.f_122827_) {
|
||||
@@ -383,9 +_,9 @@
|
||||
@@ -374,9 +_,9 @@
|
||||
|
||||
protected void m_7027_(PoseStack p_98616_, int p_98617_, int p_98618_) {
|
||||
CreativeModeTab creativemodetab = CreativeModeTab.f_40748_[f_98507_];
|
||||
@@ -85,7 +85,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -396,7 +_,7 @@
|
||||
@@ -387,7 +_,7 @@
|
||||
double d1 = p_98532_ - (double)this.f_97736_;
|
||||
|
||||
for(CreativeModeTab creativemodetab : CreativeModeTab.f_40748_) {
|
||||
@@ -94,7 +94,7 @@
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -417,7 +_,7 @@
|
||||
@@ -408,7 +_,7 @@
|
||||
this.f_98509_ = false;
|
||||
|
||||
for(CreativeModeTab creativemodetab : CreativeModeTab.f_40748_) {
|
||||
@@ -103,7 +103,7 @@
|
||||
this.m_98560_(creativemodetab);
|
||||
return true;
|
||||
}
|
||||
@@ -428,12 +_,15 @@
|
||||
@@ -419,12 +_,15 @@
|
||||
}
|
||||
|
||||
private boolean m_98631_() {
|
||||
@@ -119,7 +119,7 @@
|
||||
this.f_97737_.clear();
|
||||
(this.f_97732_).f_98639_.clear();
|
||||
if (p_98561_ == CreativeModeTab.f_40760_) {
|
||||
@@ -510,13 +_,15 @@
|
||||
@@ -501,13 +_,15 @@
|
||||
}
|
||||
|
||||
if (this.f_98510_ != null) {
|
||||
@@ -136,7 +136,7 @@
|
||||
|
||||
this.m_98630_();
|
||||
} else {
|
||||
@@ -576,16 +_,34 @@
|
||||
@@ -567,16 +_,34 @@
|
||||
this.m_7333_(p_98577_);
|
||||
super.m_6305_(p_98577_, p_98578_, p_98579_, p_98580_);
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.m_7025_(p_98577_, p_98578_, p_98579_);
|
||||
}
|
||||
@@ -620,7 +_,7 @@
|
||||
@@ -611,7 +_,7 @@
|
||||
list1.add(1, creativemodetab.m_40786_().m_6881_().m_130940_(ChatFormatting.BLUE));
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
} else {
|
||||
super.m_6057_(p_98590_, p_98591_, p_98592_, p_98593_);
|
||||
}
|
||||
@@ -631,16 +_,32 @@
|
||||
@@ -622,16 +_,32 @@
|
||||
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
CreativeModeTab creativemodetab = CreativeModeTab.f_40748_[f_98507_];
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
this.m_93228_(p_98572_, this.f_97735_, this.f_97736_, 0, 0, this.f_97726_, this.f_97727_);
|
||||
this.f_98510_.m_6305_(p_98572_, p_98574_, p_98575_, p_98573_);
|
||||
RenderSystem.m_157429_(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
@@ -648,11 +_,14 @@
|
||||
@@ -639,11 +_,14 @@
|
||||
int j = this.f_97736_ + 18;
|
||||
int k = j + 112;
|
||||
RenderSystem.m_157427_(GameRenderer::m_172817_);
|
||||
@@ -235,7 +235,7 @@
|
||||
this.m_98581_(p_98572_, creativemodetab);
|
||||
if (creativemodetab == CreativeModeTab.f_40761_) {
|
||||
InventoryScreen.m_98850_(this.f_97735_ + 88, this.f_97736_ + 45, 20, (float)(this.f_97735_ + 88 - p_98574_), (float)(this.f_97736_ + 45 - 30 - p_98575_), this.f_96541_.f_91074_);
|
||||
@@ -661,6 +_,7 @@
|
||||
@@ -652,6 +_,7 @@
|
||||
}
|
||||
|
||||
protected boolean m_98562_(CreativeModeTab p_98563_, double p_98564_, double p_98565_) {
|
||||
@@ -243,15 +243,15 @@
|
||||
int i = p_98563_.m_40793_();
|
||||
int j = 28 * i;
|
||||
int k = 0;
|
||||
@@ -729,6 +_,7 @@
|
||||
i1 = i1 + (this.f_97727_ - 4);
|
||||
@@ -720,6 +_,7 @@
|
||||
i1 += this.f_97727_ - 4;
|
||||
}
|
||||
|
||||
+ RenderSystem.m_69478_(); //Forge: Make sure blend is enabled else tabs show a white border.
|
||||
this.m_93228_(p_98582_, l, i1, j, k, 28, 32);
|
||||
this.f_96542_.f_115093_ = 100.0F;
|
||||
l = l + 6;
|
||||
@@ -918,6 +_,22 @@
|
||||
l += 6;
|
||||
@@ -909,6 +_,22 @@
|
||||
|
||||
public boolean m_8010_(Player p_98665_) {
|
||||
return this.f_98655_.m_8010_(p_98665_);
|
||||
|
||||
+49
-20
@@ -1,25 +1,40 @@
|
||||
--- a/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen.java
|
||||
@@ -34,6 +_,9 @@
|
||||
this.f_97735_ = (this.f_96543_ - this.f_97726_) / 2;
|
||||
this.f_98699_ = false;
|
||||
} else {
|
||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.PotionShiftEvent(this)))
|
||||
+ this.f_97735_ = (this.f_96543_ - this.f_97726_) / 2;
|
||||
+ else
|
||||
this.f_97735_ = 160 + (this.f_96543_ - this.f_97726_ - 200) / 2;
|
||||
this.f_98699_ = true;
|
||||
}
|
||||
@@ -58,7 +_,7 @@
|
||||
j = 132 / (collection.size() - 1);
|
||||
@@ -32,13 +_,21 @@
|
||||
}
|
||||
|
||||
public boolean m_194018_() {
|
||||
- int i = this.f_97735_ + this.f_97726_ + 2;
|
||||
+ int i;
|
||||
+ if(cancelShift)
|
||||
+ i = (this.f_96543_ - this.f_97726_) / 2;
|
||||
+ else
|
||||
+ i = this.f_97735_ + this.f_97726_ + 2;
|
||||
int j = this.f_96543_ - i;
|
||||
return j >= 32;
|
||||
}
|
||||
|
||||
private void m_194014_(PoseStack p_194015_, int p_194016_, int p_194017_) {
|
||||
- int i = this.f_97735_ + this.f_97726_ + 2;
|
||||
+ int i;
|
||||
+ if(cancelShift)
|
||||
+ i = (this.f_96543_ - this.f_97726_) / 2;
|
||||
+ else
|
||||
+ i = this.f_97735_ + this.f_97726_ + 2;
|
||||
int j = this.f_96543_ - i;
|
||||
Collection<MobEffectInstance> collection = this.f_96541_.f_91074_.m_21220_();
|
||||
if (!collection.isEmpty() && j >= 32) {
|
||||
@@ -49,7 +_,8 @@
|
||||
k = 132 / (collection.size() - 1);
|
||||
}
|
||||
|
||||
- Iterable<MobEffectInstance> iterable = Ordering.natural().sortedCopy(collection);
|
||||
+ Iterable<MobEffectInstance> iterable = collection.stream().filter(net.minecraftforge.client.ForgeHooksClient::shouldRender).sorted().collect(java.util.stream.Collectors.toList());
|
||||
this.m_98709_(p_98716_, i, j, iterable);
|
||||
this.m_98717_(p_98716_, i, j, iterable);
|
||||
this.m_98722_(p_98716_, i, j, iterable);
|
||||
@@ -95,6 +_,12 @@
|
||||
+
|
||||
+ Iterable<MobEffectInstance> iterable = collection.stream().filter(net.minecraftforge.client.ForgeHooksClient::shouldRenderEffect).sorted().collect(java.util.stream.Collectors.toList());
|
||||
this.m_194002_(p_194015_, i, k, iterable, flag);
|
||||
this.m_194008_(p_194015_, i, k, iterable, flag);
|
||||
if (flag) {
|
||||
@@ -110,6 +_,12 @@
|
||||
int i = this.f_97736_;
|
||||
|
||||
for(MobEffectInstance mobeffectinstance : p_98726_) {
|
||||
@@ -29,6 +44,20 @@
|
||||
+ i += p_98725_;
|
||||
+ continue;
|
||||
+ }
|
||||
String s = I18n.m_118938_(mobeffectinstance.m_19544_().m_19481_());
|
||||
if (mobeffectinstance.m_19564_() >= 1 && mobeffectinstance.m_19564_() <= 9) {
|
||||
s = s + " " + I18n.m_118938_("enchantment.level." + (mobeffectinstance.m_19564_() + 1));
|
||||
Component component = this.m_194000_(mobeffectinstance);
|
||||
this.f_96547_.m_92763_(p_98723_, component, (float)(p_98724_ + 10 + 18), (float)(i + 6), 16777215);
|
||||
String s = MobEffectUtil.m_19581_(mobeffectinstance, 1.0F);
|
||||
@@ -126,5 +_,13 @@
|
||||
}
|
||||
|
||||
return mutablecomponent;
|
||||
+ }
|
||||
+
|
||||
+ // FORGE START
|
||||
+ boolean cancelShift = false;
|
||||
+ @Override
|
||||
+ protected void m_7856_() {
|
||||
+ super.m_7856_();
|
||||
+ cancelShift = net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.PotionShiftEvent(this));
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/inventory/tooltip/ClientTooltipComponent.java
|
||||
+++ b/net/minecraft/client/gui/screens/inventory/tooltip/ClientTooltipComponent.java
|
||||
@@ -22,6 +_,8 @@
|
||||
@@ -21,6 +_,8 @@
|
||||
if (p_169951_ instanceof BundleTooltip) {
|
||||
return new ClientBundleTooltip((BundleTooltip)p_169951_);
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/multiplayer/JoinMultiplayerScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/multiplayer/JoinMultiplayerScreen.java
|
||||
@@ -247,6 +_,11 @@
|
||||
@@ -250,6 +_,11 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java
|
||||
+++ b/net/minecraft/client/gui/screens/multiplayer/ServerSelectionList.java
|
||||
@@ -333,6 +_,8 @@
|
||||
@@ -334,6 +_,8 @@
|
||||
this.f_99855_.m_99707_(list1);
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -1,19 +1,19 @@
|
||||
--- a/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java
|
||||
+++ b/net/minecraft/client/gui/screens/worldselection/CreateWorldScreen.java
|
||||
@@ -117,7 +_,7 @@
|
||||
@@ -116,7 +_,7 @@
|
||||
|
||||
public static CreateWorldScreen m_100898_(@Nullable Screen p_100899_) {
|
||||
RegistryAccess.RegistryHolder registryaccess$registryholder = RegistryAccess.m_123086_();
|
||||
- return new CreateWorldScreen(p_100899_, DataPackConfig.f_45842_, new WorldGenSettingsComponent(registryaccess$registryholder, WorldGenSettings.m_64641_(registryaccess$registryholder.m_175515_(Registry.f_122818_), registryaccess$registryholder.m_175515_(Registry.f_122885_), registryaccess$registryholder.m_175515_(Registry.f_122878_)), Optional.of(WorldPreset.f_101506_), OptionalLong.empty()));
|
||||
+ return new CreateWorldScreen(p_100899_, DataPackConfig.f_45842_, new WorldGenSettingsComponent(registryaccess$registryholder, net.minecraftforge.client.ForgeHooksClient.getDefaultWorldType().map(type -> type.m_7012_(registryaccess$registryholder, new java.util.Random().nextLong(), true, false)).orElseGet(() -> WorldGenSettings.m_64641_(registryaccess$registryholder.m_175512_(Registry.f_122818_), registryaccess$registryholder.m_175512_(Registry.f_122885_), registryaccess$registryholder.m_175512_(Registry.f_122878_))), net.minecraftforge.client.ForgeHooksClient.getDefaultWorldType(), OptionalLong.empty()));
|
||||
- return new CreateWorldScreen(p_100899_, DataPackConfig.f_45842_, new WorldGenSettingsComponent(registryaccess$registryholder, WorldGenSettings.m_190050_(registryaccess$registryholder), Optional.of(WorldPreset.f_101506_), OptionalLong.empty()));
|
||||
+ return new CreateWorldScreen(p_100899_, DataPackConfig.f_45842_, new WorldGenSettingsComponent(registryaccess$registryholder, net.minecraftforge.client.ForgeHooksClient.getDefaultWorldPreset().map(type -> type.m_7012_(registryaccess$registryholder, new java.util.Random().nextLong(), true, false)).orElseGet(() -> WorldGenSettings.m_190050_(registryaccess$registryholder)), net.minecraftforge.client.ForgeHooksClient.getDefaultWorldPreset(), OptionalLong.empty()));
|
||||
}
|
||||
|
||||
private CreateWorldScreen(@Nullable Screen p_100861_, DataPackConfig p_100862_, WorldGenSettingsComponent p_100863_) {
|
||||
@@ -596,6 +_,7 @@
|
||||
@@ -595,6 +_,7 @@
|
||||
File file1 = path.toFile();
|
||||
if (this.f_100832_ == null) {
|
||||
this.f_100832_ = new PackRepository(PackType.SERVER_DATA, new ServerPacksSource(), new FolderRepositorySource(file1, PackSource.f_10527_));
|
||||
+ net.minecraftforge.fmllegacy.packs.ResourcePackLoader.loadResourcePacks(this.f_100832_, net.minecraftforge.fmllegacy.server.ServerLifecycleHooks::buildPackFinderNew);
|
||||
+ net.minecraftforge.resource.ResourcePackLoader.loadResourcePacks(this.f_100832_, net.minecraftforge.server.ServerLifecycleHooks::buildPackFinder);
|
||||
this.f_100832_.m_10506_();
|
||||
}
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
this.f_170244_.f_93624_ = false;
|
||||
this.f_101391_ = p_101430_.m_142416_(new Button(j, 120, 150, 20, new TranslatableComponent("selectWorld.customizeType"), (p_170248_) -> {
|
||||
WorldPreset.PresetEditor worldpreset$preseteditor = WorldPreset.f_101509_.get(this.f_101395_);
|
||||
+ worldpreset$preseteditor = net.minecraftforge.client.ForgeHooksClient.getBiomeGeneratorTypeScreenFactory(this.f_101395_, worldpreset$preseteditor);
|
||||
+ worldpreset$preseteditor = net.minecraftforge.client.ForgeHooksClient.getPresetEditor(this.f_101395_, worldpreset$preseteditor);
|
||||
if (worldpreset$preseteditor != null) {
|
||||
p_101431_.m_91152_(worldpreset$preseteditor.m_101642_(p_101430_, this.f_101394_));
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
this.f_101389_.f_93624_ = p_170288_;
|
||||
this.f_101380_.f_93624_ = p_170288_;
|
||||
- this.f_101391_.f_93624_ = p_170288_ && WorldPreset.f_101509_.containsKey(this.f_101395_);
|
||||
+ this.f_101391_.f_93624_ = p_170288_ && (WorldPreset.f_101509_.containsKey(this.f_101395_) || net.minecraftforge.client.ForgeHooksClient.hasBiomeGeneratorSettingsOptionsScreen(this.f_101395_));
|
||||
+ this.f_101391_.f_93624_ = p_170288_ && (WorldPreset.f_101509_.containsKey(this.f_101395_) || net.minecraftforge.client.ForgeHooksClient.hasPresetEditor(this.f_101395_));
|
||||
this.f_101392_.f_93624_ = p_170288_;
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/gui/screens/worldselection/WorldPreset.java
|
||||
+++ b/net/minecraft/client/gui/screens/worldselection/WorldPreset.java
|
||||
@@ -116,6 +_,9 @@
|
||||
@@ -83,6 +_,9 @@
|
||||
WorldPreset(String p_101519_) {
|
||||
this.f_101516_ = new TranslatableComponent("generator." + p_101519_);
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
private static WorldGenSettings m_101549_(RegistryAccess p_101550_, WorldGenSettings p_101551_, WorldPreset p_101552_, Biome p_101553_) {
|
||||
BiomeSource biomesource = new FixedBiomeSource(p_101553_);
|
||||
@@ -173,4 +_,8 @@
|
||||
@@ -125,4 +_,8 @@
|
||||
public interface PresetEditor {
|
||||
Screen m_101642_(CreateWorldScreen p_101643_, WorldGenSettings p_101644_);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
--- a/net/minecraft/client/main/Main.java
|
||||
+++ b/net/minecraft/client/main/Main.java
|
||||
@@ -122,7 +_,7 @@
|
||||
String s7 = m_129638_(optionset, optionspec);
|
||||
Integer integer = m_129638_(optionset, optionspec1);
|
||||
@@ -135,7 +_,7 @@
|
||||
}
|
||||
|
||||
CrashReport.m_127529_();
|
||||
- Bootstrap.m_135870_();
|
||||
+ net.minecraftforge.fml.loading.BackgroundWaiter.runAndTick(()->Bootstrap.m_135870_(), net.minecraftforge.fml.loading.FMLLoader.progressWindowTick);
|
||||
Bootstrap.m_135889_();
|
||||
Util.m_137584_();
|
||||
User user = new User(optionspec9.value(optionset), s5, optionspec11.value(optionset), optionspec20.value(optionset));
|
||||
String s10 = optionspec23.value(optionset);
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/multiplayer/ClientChunkCache.java
|
||||
+++ b/net/minecraft/client/multiplayer/ClientChunkCache.java
|
||||
@@ -60,6 +_,7 @@
|
||||
@@ -59,6 +_,7 @@
|
||||
int i = this.f_104410_.m_104481_(p_104456_, p_104457_);
|
||||
LevelChunk levelchunk = this.f_104410_.m_104479_(i);
|
||||
if (m_104438_(levelchunk, p_104456_, p_104457_)) {
|
||||
@@ -8,7 +8,7 @@
|
||||
this.f_104410_.m_104487_(i, levelchunk, (LevelChunk)null);
|
||||
}
|
||||
|
||||
@@ -110,6 +_,7 @@
|
||||
@@ -99,6 +_,7 @@
|
||||
}
|
||||
|
||||
this.f_104411_.m_171649_(chunkpos);
|
||||
|
||||
+3
-3
@@ -4,15 +4,15 @@
|
||||
this.f_104521_.accept(new TranslatableComponent("connect.joining"));
|
||||
this.f_104523_ = p_104547_.m_134774_();
|
||||
this.f_104522_.m_129498_(ConnectionProtocol.PLAY);
|
||||
+ net.minecraftforge.fmllegacy.network.NetworkHooks.handleClientLoginSuccess(this.f_104522_);
|
||||
this.f_104522_.m_129505_(new ClientPacketListener(this.f_104519_, this.f_104520_, this.f_104522_, this.f_104523_));
|
||||
+ net.minecraftforge.network.NetworkHooks.handleClientLoginSuccess(this.f_104522_);
|
||||
this.f_104522_.m_129505_(new ClientPacketListener(this.f_104519_, this.f_104520_, this.f_104522_, this.f_104523_, this.f_104519_.m_193590_()));
|
||||
}
|
||||
|
||||
@@ -143,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_7254_(ClientboundCustomQueryPacket p_104545_) {
|
||||
+ if (net.minecraftforge.fmllegacy.network.NetworkHooks.onCustomPayload(p_104545_, this.f_104522_)) return;
|
||||
+ if (net.minecraftforge.network.NetworkHooks.onCustomPayload(p_104545_, this.f_104522_)) return;
|
||||
this.f_104521_.accept(new TranslatableComponent("connect.negotiating"));
|
||||
this.f_104522_.m_129512_(new ServerboundCustomQueryPacket(p_104545_.m_134755_(), (FriendlyByteBuf)null));
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/client/multiplayer/ClientLevel.java
|
||||
+++ b/net/minecraft/client/multiplayer/ClientLevel.java
|
||||
@@ -112,6 +_,8 @@
|
||||
this.m_104752_(new BlockPos(8, 64, 8), 0.0F);
|
||||
@@ -130,6 +_,8 @@
|
||||
this.f_194123_ = p_194134_;
|
||||
this.m_46465_();
|
||||
this.m_46466_();
|
||||
+ this.gatherCapabilities();
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(this));
|
||||
}
|
||||
|
||||
public DimensionSpecialEffects m_104583_() {
|
||||
@@ -171,6 +_,7 @@
|
||||
public void m_194171_(Runnable p_194172_) {
|
||||
@@ -216,6 +_,7 @@
|
||||
this.m_46473_().m_6521_(() -> {
|
||||
return Registry.f_122826_.m_7981_(p_104640_.m_6095_()).toString();
|
||||
});
|
||||
@@ -17,7 +17,7 @@
|
||||
p_104640_.m_8119_();
|
||||
this.m_46473_().m_7238_();
|
||||
|
||||
@@ -233,8 +_,10 @@
|
||||
@@ -278,8 +_,10 @@
|
||||
}
|
||||
|
||||
private void m_104739_(int p_104740_, Entity p_104741_) {
|
||||
@@ -28,7 +28,7 @@
|
||||
}
|
||||
|
||||
public void m_171642_(int p_171643_, Entity.RemovalReason p_171644_) {
|
||||
@@ -367,6 +_,11 @@
|
||||
@@ -410,6 +_,11 @@
|
||||
}
|
||||
|
||||
public void m_6263_(@Nullable Player p_104645_, double p_104646_, double p_104647_, double p_104648_, SoundEvent p_104649_, SoundSource p_104650_, float p_104651_, float p_104652_) {
|
||||
@@ -40,7 +40,7 @@
|
||||
if (p_104645_ == this.f_104565_.f_91074_) {
|
||||
this.m_7785_(p_104646_, p_104647_, p_104648_, p_104649_, p_104650_, p_104651_, p_104652_, false);
|
||||
}
|
||||
@@ -374,6 +_,11 @@
|
||||
@@ -417,6 +_,11 @@
|
||||
}
|
||||
|
||||
public void m_6269_(@Nullable Player p_104659_, Entity p_104660_, SoundEvent p_104661_, SoundSource p_104662_, float p_104663_, float p_104664_) {
|
||||
@@ -52,7 +52,7 @@
|
||||
if (p_104659_ == this.f_104565_.f_91074_) {
|
||||
this.f_104565_.m_91106_().m_120367_(new EntityBoundSoundInstance(p_104661_, p_104662_, p_104663_, p_104664_, p_104660_));
|
||||
}
|
||||
@@ -818,6 +_,7 @@
|
||||
@@ -879,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_104851_(Difficulty p_104852_) {
|
||||
@@ -60,7 +60,7 @@
|
||||
this.f_104840_ = p_104852_;
|
||||
}
|
||||
|
||||
@@ -860,6 +_,9 @@
|
||||
@@ -921,6 +_,9 @@
|
||||
public void m_141981_(Entity p_171716_) {
|
||||
p_171716_.m_19877_();
|
||||
ClientLevel.this.f_104566_.remove(p_171716_);
|
||||
@@ -69,4 +69,4 @@
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityLeaveWorldEvent(p_171716_, ClientLevel.this));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+25
-35
@@ -1,31 +1,22 @@
|
||||
--- a/net/minecraft/client/multiplayer/ClientPacketListener.java
|
||||
+++ b/net/minecraft/client/multiplayer/ClientPacketListener.java
|
||||
@@ -360,6 +_,7 @@
|
||||
@@ -357,6 +_,7 @@
|
||||
|
||||
this.f_104888_.f_91064_.m_113434_();
|
||||
this.f_104888_.f_91074_.m_172530_();
|
||||
+ net.minecraftforge.client.ForgeHooksClient.firePlayerLogin(this.f_104888_.f_91072_, this.f_104888_.f_91074_, this.f_104888_.m_91403_().m_6198_());
|
||||
int i = p_105030_.m_132398_();
|
||||
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_);
|
||||
@@ -370,6 +_,7 @@
|
||||
this.f_104888_.f_91074_.m_36393_(p_105030_.m_132410_());
|
||||
this.f_104888_.f_91074_.m_108711_(p_105030_.m_132411_());
|
||||
this.f_104888_.f_91072_.m_171805_(p_105030_.m_132403_(), p_105030_.m_132404_());
|
||||
+ net.minecraftforge.fmllegacy.network.NetworkHooks.sendMCRegistryPackets(f_104885_, "PLAY_TO_SERVER");
|
||||
@@ -368,6 +_,7 @@
|
||||
this.f_104888_.f_91074_.m_108711_(p_105030_.f_132372_());
|
||||
this.f_104888_.f_91072_.m_171805_(p_105030_.f_132363_(), p_105030_.f_132364_());
|
||||
this.f_104888_.f_91066_.m_193770_(p_105030_.f_132370_());
|
||||
+ net.minecraftforge.network.NetworkHooks.sendMCRegistryPackets(f_104885_, "PLAY_TO_SERVER");
|
||||
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_();
|
||||
@@ -612,7 +_,7 @@
|
||||
BlockPos blockpos = new BlockPos(compoundtag.m_128451_("x"), compoundtag.m_128451_("y"), compoundtag.m_128451_("z"));
|
||||
BlockEntity blockentity = levelchunk.m_5685_(blockpos, LevelChunk.EntityCreationType.IMMEDIATE);
|
||||
if (blockentity != null) {
|
||||
- blockentity.m_142466_(compoundtag);
|
||||
+ blockentity.handleUpdateTag(compoundtag);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -694,7 +_,9 @@
|
||||
@@ -715,7 +_,9 @@
|
||||
|
||||
public void m_5784_(ClientboundChatPacket p_104986_) {
|
||||
PacketUtils.m_131363_(p_104986_, this, this.f_104888_);
|
||||
@@ -36,7 +27,7 @@
|
||||
}
|
||||
|
||||
public void m_7791_(ClientboundAnimatePacket p_104968_) {
|
||||
@@ -865,8 +_,10 @@
|
||||
@@ -886,8 +_,10 @@
|
||||
localplayer1.m_21204_().m_22159_(localplayer.m_21204_());
|
||||
}
|
||||
|
||||
@@ -47,20 +38,19 @@
|
||||
this.f_104889_.m_104630_(i, localplayer1);
|
||||
localplayer1.m_146922_(-180.0F);
|
||||
localplayer1.f_108618_ = new KeyboardInput(this.f_104888_.f_91066_);
|
||||
@@ -977,6 +_,12 @@
|
||||
@@ -990,10 +_,7 @@
|
||||
PacketUtils.m_131363_(p_104976_, this, this.f_104888_);
|
||||
BlockPos blockpos = p_104976_.m_131704_();
|
||||
this.f_104888_.f_91073_.m_141902_(blockpos, p_104976_.m_195645_()).ifPresent((p_194239_) -> {
|
||||
- CompoundTag compoundtag = p_104976_.m_131708_();
|
||||
- if (compoundtag != null) {
|
||||
- p_194239_.m_142466_(compoundtag);
|
||||
- }
|
||||
+ p_194239_.onDataPacket(f_104885_, p_104976_);
|
||||
|
||||
if (flag && this.f_104888_.f_91080_ instanceof CommandBlockEditScreen) {
|
||||
((CommandBlockEditScreen)this.f_104888_.f_91080_).m_98398_();
|
||||
+ } else {
|
||||
+ if (blockentity == null) {
|
||||
+ f_104883_.error("Received invalid update packet for null tile entity at {} with data: {}", p_104976_.m_131704_(), p_104976_.m_131708_());
|
||||
+ return;
|
||||
+ }
|
||||
+ blockentity.onDataPacket(f_104885_, p_104976_);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1139,6 +_,7 @@
|
||||
if (p_194239_ instanceof CommandBlockEntity && this.f_104888_.f_91080_ instanceof CommandBlockEditScreen) {
|
||||
((CommandBlockEditScreen)this.f_104888_.f_91080_).m_98398_();
|
||||
@@ -1160,6 +_,7 @@
|
||||
clientrecipebook.m_90625_(this.f_104900_.m_44051_());
|
||||
clientrecipebook.m_90639_().forEach(mutablesearchtree::m_8080_);
|
||||
mutablesearchtree.m_7729_();
|
||||
@@ -68,7 +58,7 @@
|
||||
}
|
||||
|
||||
public void m_7244_(ClientboundPlayerLookAtPacket p_105054_) {
|
||||
@@ -1216,7 +_,7 @@
|
||||
@@ -1237,7 +_,7 @@
|
||||
PacketUtils.m_131363_(p_105130_, this, this.f_104888_);
|
||||
Entity entity = this.f_104889_.m_6815_(p_105130_.m_133622_());
|
||||
if (entity instanceof LivingEntity) {
|
||||
@@ -77,7 +67,7 @@
|
||||
if (mobeffect != null) {
|
||||
MobEffectInstance mobeffectinstance = new MobEffectInstance(mobeffect, p_105130_.m_133625_(), p_105130_.m_133624_(), p_105130_.m_133627_(), p_105130_.m_133626_(), p_105130_.m_133628_());
|
||||
mobeffectinstance.m_19562_(p_105130_.m_133619_());
|
||||
@@ -1233,6 +_,7 @@
|
||||
@@ -1254,6 +_,7 @@
|
||||
f_104883_.warn("Incomplete server tags, disconnecting. Missing: {}", (Object)multimap);
|
||||
this.f_104885_.m_129507_(new TranslatableComponent("multiplayer.disconnect.missing_tags"));
|
||||
} else {
|
||||
@@ -85,12 +75,12 @@
|
||||
this.f_104895_ = tagcontainer;
|
||||
if (!this.f_104885_.m_129531_()) {
|
||||
tagcontainer.m_13431_();
|
||||
@@ -1780,7 +_,8 @@
|
||||
@@ -1803,7 +_,8 @@
|
||||
int i5 = friendlybytebuf.m_130242_();
|
||||
this.f_104888_.f_91064_.f_173815_.m_173830_(positionsource, i5);
|
||||
} else {
|
||||
- f_104883_.warn("Unknown custom packed identifier: {}", (Object)resourcelocation);
|
||||
+ if (!net.minecraftforge.fmllegacy.network.NetworkHooks.onCustomPayload(p_105004_, this.f_104885_))
|
||||
+ if (!net.minecraftforge.network.NetworkHooks.onCustomPayload(p_105004_, this.f_104885_))
|
||||
+ f_104883_.warn("Unknown custom packet identifier: {}", (Object)resourcelocation);
|
||||
}
|
||||
} finally {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
- block.m_5707_(level, p_105268_, blockstate, this.f_105189_.f_91074_);
|
||||
FluidState fluidstate = level.m_6425_(p_105268_);
|
||||
- boolean flag = level.m_7731_(p_105268_, fluidstate.m_76188_(), 11);
|
||||
+ boolean flag = blockstate.removedByPlayer(level, p_105268_, f_105189_.f_91074_, false, fluidstate);
|
||||
+ boolean flag = blockstate.onDestroyedByPlayer(level, p_105268_, f_105189_.f_91074_, false, fluidstate);
|
||||
if (flag) {
|
||||
block.m_6786_(level, p_105268_, blockstate);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
}
|
||||
|
||||
protected void m_105317_(GameType p_105318_) {
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onClientChangeGameMode(this, this.f_105300_, p_105318_);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onClientChangeGameType(this, this.f_105300_, p_105318_);
|
||||
this.f_105300_ = p_105318_;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
@Nullable
|
||||
private String f_105372_;
|
||||
private boolean f_105373_;
|
||||
+ public net.minecraftforge.fmlclient.ExtendedServerListData forgeData = null;
|
||||
+ public net.minecraftforge.client.ExtendedServerListData forgeData = null;
|
||||
|
||||
public ServerData(String p_105375_, String p_105376_, boolean p_105377_) {
|
||||
this.f_105362_ = p_105375_;
|
||||
@@ -9,7 +9,7 @@
|
||||
private final Queue<Particle> f_107294_ = Queues.newArrayDeque();
|
||||
private final Map<ResourceLocation, ParticleEngine.MutableSpriteSet> f_107295_ = Maps.newHashMap();
|
||||
private final TextureAtlas f_107296_;
|
||||
@@ -177,13 +_,13 @@
|
||||
@@ -176,13 +_,13 @@
|
||||
}
|
||||
|
||||
public <T extends ParticleOptions> void m_107381_(ParticleType<T> p_107382_, ParticleProvider<T> p_107383_) {
|
||||
@@ -25,7 +25,7 @@
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> m_5540_(PreparableReloadListener.PreparationBarrier p_107305_, ResourceManager p_107306_, ProfilerFiller p_107307_, ProfilerFiller p_107308_, Executor p_107309_, Executor p_107310_) {
|
||||
@@ -301,7 +_,7 @@
|
||||
@@ -300,7 +_,7 @@
|
||||
|
||||
@Nullable
|
||||
private <T extends ParticleOptions> Particle m_107395_(T p_107396_, double p_107397_, double p_107398_, double p_107399_, double p_107400_, double p_107401_, double p_107402_) {
|
||||
@@ -34,7 +34,7 @@
|
||||
return particleprovider == null ? null : particleprovider.m_6966_(p_107396_, this.f_107287_, p_107397_, p_107398_, p_107399_, p_107400_, p_107401_, p_107402_);
|
||||
}
|
||||
|
||||
@@ -382,7 +_,13 @@
|
||||
@@ -381,7 +_,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
p_107339_.m_109896_();
|
||||
RenderSystem.m_69482_();
|
||||
PoseStack posestack = RenderSystem.m_157191_();
|
||||
@@ -390,7 +_,8 @@
|
||||
@@ -389,7 +_,8 @@
|
||||
posestack.m_166854_(p_107337_.m_85850_().m_85861_());
|
||||
RenderSystem.m_157182_();
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
Iterable<Particle> iterable = this.f_107289_.get(particlerendertype);
|
||||
if (iterable != null) {
|
||||
RenderSystem.m_157427_(GameRenderer::m_172829_);
|
||||
@@ -400,6 +_,7 @@
|
||||
@@ -399,6 +_,7 @@
|
||||
particlerendertype.m_6505_(bufferbuilder, this.f_107291_);
|
||||
|
||||
for(Particle particle : iterable) {
|
||||
@@ -66,7 +66,7 @@
|
||||
try {
|
||||
particle.m_5744_(bufferbuilder, p_107340_, p_107341_);
|
||||
} catch (Throwable throwable) {
|
||||
@@ -430,7 +_,7 @@
|
||||
@@ -429,7 +_,7 @@
|
||||
}
|
||||
|
||||
public void m_107355_(BlockPos p_107356_, BlockState p_107357_) {
|
||||
@@ -75,7 +75,7 @@
|
||||
VoxelShape voxelshape = p_107357_.m_60808_(this.f_107287_, p_107356_);
|
||||
double d0 = 0.25D;
|
||||
voxelshape.m_83286_((p_172273_, p_172274_, p_172275_, p_172276_, p_172277_, p_172278_) -> {
|
||||
@@ -450,7 +_,7 @@
|
||||
@@ -449,7 +_,7 @@
|
||||
double d7 = d4 * d1 + p_172273_;
|
||||
double d8 = d5 * d2 + p_172274_;
|
||||
double d9 = d6 * d3 + p_172275_;
|
||||
@@ -84,7 +84,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -494,12 +_,18 @@
|
||||
@@ -493,12 +_,18 @@
|
||||
d0 = (double)i + aabb.f_82291_ + (double)0.1F;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
--- a/net/minecraft/client/player/AbstractClientPlayer.java
|
||||
+++ b/net/minecraft/client/player/AbstractClientPlayer.java
|
||||
@@ -143,6 +_,6 @@
|
||||
@@ -144,6 +_,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
- return Mth.m_14179_(Minecraft.m_91087_().f_91066_.f_92070_, 1.0F, f);
|
||||
+ return net.minecraftforge.client.ForgeHooksClient.getOffsetFOV(this, f);
|
||||
+ return net.minecraftforge.client.ForgeHooksClient.getFieldOfView(this, f);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/player/LocalPlayer.java
|
||||
+++ b/net/minecraft/client/player/LocalPlayer.java
|
||||
@@ -139,6 +_,7 @@
|
||||
@@ -144,6 +_,7 @@
|
||||
}
|
||||
|
||||
public boolean m_6469_(DamageSource p_108662_, float p_108663_) {
|
||||
@@ -8,7 +8,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -462,6 +_,11 @@
|
||||
@@ -466,6 +_,11 @@
|
||||
}
|
||||
|
||||
public void m_5496_(SoundEvent p_108651_, float p_108652_, float p_108653_) {
|
||||
@@ -20,15 +20,15 @@
|
||||
this.f_19853_.m_7785_(this.m_20185_(), this.m_20186_(), this.m_20189_(), p_108651_, this.m_5720_(), p_108652_, p_108653_, false);
|
||||
}
|
||||
|
||||
@@ -617,6 +_,7 @@
|
||||
@@ -621,6 +_,7 @@
|
||||
boolean flag2 = this.m_108733_();
|
||||
this.f_108601_ = !this.m_150110_().f_35935_ && !this.m_6069_() && this.m_20175_(Pose.CROUCHING) && (this.m_6144_() || !this.m_5803_() && !this.m_20175_(Pose.STANDING));
|
||||
this.f_108618_.m_7606_(this.m_108635_());
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onInputUpdate(this, this.f_108618_);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onMovementInputUpdate(this, this.f_108618_);
|
||||
this.f_108619_.m_91301_().m_120586_(this.f_108618_);
|
||||
if (this.m_6117_() && !this.m_20159_()) {
|
||||
this.f_108618_.f_108566_ *= 0.2F;
|
||||
@@ -689,7 +_,7 @@
|
||||
@@ -693,7 +_,7 @@
|
||||
|
||||
if (this.f_108618_.f_108572_ && !flag7 && !flag && !this.m_150110_().f_35935_ && !this.m_20159_() && !this.m_6147_()) {
|
||||
ItemStack itemstack = this.m_6844_(EquipmentSlot.CHEST);
|
||||
@@ -37,7 +37,7 @@
|
||||
this.f_108617_.m_104955_(new ServerboundPlayerCommandPacket(this, ServerboundPlayerCommandPacket.Action.START_FALL_FLYING));
|
||||
}
|
||||
}
|
||||
@@ -807,6 +_,7 @@
|
||||
@@ -811,6 +_,7 @@
|
||||
|
||||
public void m_6083_() {
|
||||
super.m_6083_();
|
||||
@@ -45,7 +45,7 @@
|
||||
this.f_108611_ = false;
|
||||
if (this.m_20202_() instanceof Boat) {
|
||||
Boat boat = (Boat)this.m_20202_();
|
||||
@@ -1004,6 +_,18 @@
|
||||
@@ -1024,6 +_,18 @@
|
||||
} else {
|
||||
return super.m_7398_(p_108758_);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
}
|
||||
|
||||
- return d0;
|
||||
+ return net.minecraftforge.client.ForgeHooksClient.getFOVModifier(this, p_109142_, p_109143_, d0);
|
||||
+ return net.minecraftforge.client.ForgeHooksClient.getFieldOfView(this, p_109142_, p_109143_, d0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
--- a/net/minecraft/client/renderer/ItemModelShaper.java
|
||||
+++ b/net/minecraft/client/renderer/ItemModelShaper.java
|
||||
@@ -31,7 +_,8 @@
|
||||
|
||||
public TextureAtlasSprite m_109399_(ItemStack p_109400_) {
|
||||
BakedModel bakedmodel = this.m_109406_(p_109400_);
|
||||
- return bakedmodel == this.f_109390_.m_119409_() && p_109400_.m_41720_() instanceof BlockItem ? this.f_109390_.m_119430_().m_110882_(((BlockItem)p_109400_.m_41720_()).m_40614_().m_49966_()) : bakedmodel.m_6160_();
|
||||
+ // FORGE: Make sure to call the item overrides
|
||||
+ return bakedmodel == this.f_109390_.m_119409_() && p_109400_.m_41720_() instanceof BlockItem ? this.f_109390_.m_119430_().m_110882_(((BlockItem)p_109400_.m_41720_()).m_40614_().m_49966_()) : bakedmodel.m_7343_().m_173464_(bakedmodel, p_109400_, null, null, 0).getParticleIcon(net.minecraftforge.client.model.data.EmptyModelData.INSTANCE);
|
||||
}
|
||||
@@ -24,6 +_,7 @@
|
||||
|
||||
public BakedModel m_109406_(ItemStack p_109407_) {
|
||||
BakedModel bakedmodel = this.m_109394_(p_109407_.m_41720_());
|
||||
+ // FORGE: Make sure to call the item overrides
|
||||
return bakedmodel == null ? this.f_109390_.m_119409_() : bakedmodel;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/client/renderer/LevelRenderer.java
|
||||
+++ b/net/minecraft/client/renderer/LevelRenderer.java
|
||||
@@ -241,6 +_,11 @@
|
||||
@@ -257,6 +_,11 @@
|
||||
}
|
||||
|
||||
private void m_109703_(LightTexture p_109704_, float p_109705_, double p_109706_, double p_109707_, double p_109708_) {
|
||||
@@ -12,7 +12,7 @@
|
||||
float f = this.f_109461_.f_91073_.m_46722_(p_109705_);
|
||||
if (!(f <= 0.0F)) {
|
||||
p_109704_.m_109896_();
|
||||
@@ -362,6 +_,11 @@
|
||||
@@ -377,6 +_,11 @@
|
||||
}
|
||||
|
||||
public void m_109693_(Camera p_109694_) {
|
||||
@@ -24,33 +24,23 @@
|
||||
float f = this.f_109461_.f_91073_.m_46722_(1.0F) / (Minecraft.m_91405_() ? 1.0F : 2.0F);
|
||||
if (!(f <= 0.0F)) {
|
||||
Random random = new Random((long)this.f_109477_ * 312987231L);
|
||||
@@ -804,7 +_,7 @@
|
||||
this.f_109448_ = true;
|
||||
BlockPos blockpos2 = chunkrenderdispatcher$renderchunk1.m_112839_().m_142082_(8, 8, 8);
|
||||
boolean flag = blockpos2.m_123331_(blockpos) < 768.0D;
|
||||
- if (!chunkrenderdispatcher$renderchunk1.m_112842_() && !flag) {
|
||||
+ if (net.minecraftforge.common.ForgeConfig.CLIENT.alwaysSetupTerrainOffThread.get() || !chunkrenderdispatcher$renderchunk1.m_112842_() && !flag) {
|
||||
this.f_109466_.add(chunkrenderdispatcher$renderchunk1);
|
||||
} else {
|
||||
this.f_109461_.m_91307_().m_6180_("build near");
|
||||
@@ -980,13 +_,14 @@
|
||||
@@ -1148,20 +_,23 @@
|
||||
RenderSystem.m_69421_(16640, Minecraft.f_91002_);
|
||||
float f = p_109605_.m_109152_();
|
||||
boolean flag1 = 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_();
|
||||
boolean flag2 = this.f_109461_.f_91073_.m_104583_().m_5781_(Mth.m_14107_(d0), Mth.m_14107_(d1)) || this.f_109461_.f_91065_.m_93090_().m_93715_();
|
||||
+ FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_SKY, f, flag1, p_109601_);
|
||||
profilerfiller.m_6182_("sky");
|
||||
RenderSystem.m_157427_(GameRenderer::m_172808_);
|
||||
this.m_181409_(p_109600_, p_109607_, p_109601_, () -> {
|
||||
FogRenderer.m_109024_(p_109604_, FogRenderer.FogMode.FOG_SKY, f, flag1);
|
||||
FogRenderer.m_109024_(p_109604_, FogRenderer.FogMode.FOG_SKY, f, flag2);
|
||||
});
|
||||
profilerfiller.m_6182_("fog");
|
||||
- FogRenderer.m_109024_(p_109604_, FogRenderer.FogMode.FOG_TERRAIN, Math.max(f - 16.0F, 32.0F), flag1);
|
||||
- FogRenderer.m_109024_(p_109604_, FogRenderer.FogMode.FOG_TERRAIN, Math.max(f - 16.0F, 32.0F), flag2);
|
||||
+ FogRenderer.setupFog(p_109604_, FogRenderer.FogMode.FOG_TERRAIN, Math.max(f - 16.0F, 32.0F), flag1, p_109601_);
|
||||
profilerfiller.m_6182_("terrain_setup");
|
||||
this.m_109695_(p_109604_, frustum, flag, this.f_109449_++, this.f_109461_.f_91074_.m_5833_());
|
||||
profilerfiller.m_6182_("updatechunks");
|
||||
@@ -1007,7 +_,9 @@
|
||||
this.m_109510_(p_109602_ + l1);
|
||||
this.m_194338_(p_109604_, frustum, flag1, this.f_109461_.f_91074_.m_5833_());
|
||||
profilerfiller.m_6182_("compilechunks");
|
||||
this.m_194370_(p_109604_);
|
||||
profilerfiller.m_6182_("terrain");
|
||||
this.m_172993_(RenderType.m_110451_(), p_109600_, d0, d1, d2, p_109607_);
|
||||
+ this.f_109461_.m_91304_().m_119428_(TextureAtlas.f_118259_).setBlurMipmap(false, this.f_109461_.f_91066_.f_92027_ > 0); // FORGE: fix flickering leaves when mods mess up the blurMipmap settings
|
||||
@@ -59,7 +49,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_());
|
||||
@@ -1037,7 +_,7 @@
|
||||
@@ -1191,7 +_,7 @@
|
||||
MultiBufferSource.BufferSource multibuffersource$buffersource = this.f_109464_.m_110104_();
|
||||
|
||||
for(Entity entity : this.f_109465_.m_104735_()) {
|
||||
@@ -68,7 +58,7 @@
|
||||
++this.f_109439_;
|
||||
if (entity.f_19797_ == 0) {
|
||||
entity.f_19790_ = entity.m_20185_();
|
||||
@@ -1076,6 +_,7 @@
|
||||
@@ -1230,6 +_,7 @@
|
||||
List<BlockEntity> list = levelrenderer$renderchunkinfo.f_109839_.m_112835_().m_112773_();
|
||||
if (!list.isEmpty()) {
|
||||
for(BlockEntity blockentity1 : list) {
|
||||
@@ -76,7 +66,7 @@
|
||||
BlockPos blockpos3 = blockentity1.m_58899_();
|
||||
MultiBufferSource multibuffersource1 = multibuffersource$buffersource;
|
||||
p_109600_.m_85836_();
|
||||
@@ -1101,6 +_,7 @@
|
||||
@@ -1255,6 +_,7 @@
|
||||
|
||||
synchronized(this.f_109468_) {
|
||||
for(BlockEntity blockentity : this.f_109468_) {
|
||||
@@ -84,21 +74,21 @@
|
||||
BlockPos blockpos2 = blockentity.m_58899_();
|
||||
p_109600_.m_85836_();
|
||||
p_109600_.m_85837_((double)blockpos2.m_123341_() - d0, (double)blockpos2.m_123342_() - d1, (double)blockpos2.m_123343_() - d2);
|
||||
@@ -1152,10 +_,13 @@
|
||||
@@ -1306,10 +_,13 @@
|
||||
profilerfiller.m_6182_("outline");
|
||||
BlockPos blockpos = ((BlockHitResult)hitresult).m_82425_();
|
||||
BlockState blockstate = this.f_109465_.m_8055_(blockpos);
|
||||
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(this, p_109604_, hitresult, p_109601_, p_109600_, multibuffersource$buffersource))
|
||||
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawHighlight(this, p_109604_, hitresult, p_109601_, p_109600_, multibuffersource$buffersource))
|
||||
if (!blockstate.m_60795_() && this.f_109465_.m_6857_().m_61937_(blockpos)) {
|
||||
VertexConsumer vertexconsumer2 = multibuffersource$buffersource.m_6299_(RenderType.m_110504_());
|
||||
this.m_109637_(p_109600_, vertexconsumer2, p_109604_.m_90592_(), d0, d1, d2, blockpos, blockstate);
|
||||
}
|
||||
+ } else if (hitresult != null && hitresult.m_6662_() == HitResult.Type.ENTITY) {
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(this, p_109604_, hitresult, p_109601_, p_109600_, multibuffersource$buffersource);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onDrawHighlight(this, p_109604_, hitresult, p_109601_, p_109600_, multibuffersource$buffersource);
|
||||
}
|
||||
|
||||
PoseStack posestack = RenderSystem.m_157191_();
|
||||
@@ -1190,7 +_,7 @@
|
||||
@@ -1344,7 +_,7 @@
|
||||
this.f_109415_.m_83945_(this.f_109461_.m_91385_());
|
||||
RenderStateShard.f_110126_.m_110185_();
|
||||
profilerfiller.m_6182_("particles");
|
||||
@@ -107,7 +97,7 @@
|
||||
RenderStateShard.f_110126_.m_110188_();
|
||||
} else {
|
||||
profilerfiller.m_6182_("translucent");
|
||||
@@ -1204,7 +_,7 @@
|
||||
@@ -1358,7 +_,7 @@
|
||||
profilerfiller.m_6182_("string");
|
||||
this.m_172993_(RenderType.m_110503_(), p_109600_, d0, d1, d2, p_109607_);
|
||||
profilerfiller.m_6182_("particles");
|
||||
@@ -116,7 +106,7 @@
|
||||
}
|
||||
|
||||
posestack.m_85836_();
|
||||
@@ -1632,6 +_,11 @@
|
||||
@@ -1790,6 +_,11 @@
|
||||
|
||||
public void m_181409_(PoseStack p_181410_, Matrix4f p_181411_, float p_181412_, Runnable p_181413_) {
|
||||
p_181413_.run();
|
||||
@@ -128,7 +118,7 @@
|
||||
if (this.f_109461_.f_91073_.m_104583_().m_108883_() == DimensionSpecialEffects.SkyType.END) {
|
||||
this.m_109780_(p_181410_);
|
||||
} else if (this.f_109461_.f_91073_.m_104583_().m_108883_() == DimensionSpecialEffects.SkyType.NORMAL) {
|
||||
@@ -1746,6 +_,11 @@
|
||||
@@ -1904,6 +_,11 @@
|
||||
}
|
||||
|
||||
public void m_172954_(PoseStack p_172955_, Matrix4f p_172956_, float p_172957_, double p_172958_, double p_172959_, double p_172960_) {
|
||||
@@ -140,16 +130,16 @@
|
||||
float f = this.f_109465_.m_104583_().m_108871_();
|
||||
if (!Float.isNaN(f)) {
|
||||
RenderSystem.m_69464_();
|
||||
@@ -1923,7 +_,7 @@
|
||||
|
||||
while(iterator.hasNext()) {
|
||||
ChunkRenderDispatcher.RenderChunk chunkrenderdispatcher$renderchunk = iterator.next();
|
||||
- if (chunkrenderdispatcher$renderchunk.m_112842_()) {
|
||||
+ if (!net.minecraftforge.common.ForgeConfig.CLIENT.alwaysSetupTerrainOffThread.get() && chunkrenderdispatcher$renderchunk.m_112842_()) {
|
||||
this.f_109436_.m_112715_(chunkrenderdispatcher$renderchunk);
|
||||
@@ -2089,7 +_,7 @@
|
||||
}
|
||||
} else {
|
||||
chunkrenderdispatcher$renderchunk.m_112820_(this.f_109436_);
|
||||
@@ -2216,7 +_,12 @@
|
||||
BlockPos blockpos1 = chunkrenderdispatcher$renderchunk.m_112839_().m_142082_(8, 8, 8);
|
||||
- flag = blockpos1.m_123331_(blockpos) < 768.0D || chunkrenderdispatcher$renderchunk.m_112842_();
|
||||
+ flag = !net.minecraftforge.common.ForgeConfig.CLIENT.alwaysSetupTerrainOffThread.get() && (blockpos1.m_123331_(blockpos) < 768.0D || chunkrenderdispatcher$renderchunk.m_112842_()); // the target is the else block below, so invert the forge addition to get there early
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
@@ -2387,7 +_,12 @@
|
||||
this.f_109469_.m_110859_(p_109502_, p_109503_, p_109504_, p_109505_);
|
||||
}
|
||||
|
||||
@@ -162,7 +152,7 @@
|
||||
SoundInstance soundinstance = this.f_109410_.get(p_109516_);
|
||||
if (soundinstance != null) {
|
||||
this.f_109461_.m_91106_().m_120399_(soundinstance);
|
||||
@@ -2224,7 +_,7 @@
|
||||
@@ -2395,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (p_109515_ != null) {
|
||||
@@ -171,7 +161,7 @@
|
||||
if (recorditem != null) {
|
||||
this.f_109461_.f_91065_.m_93055_(recorditem.m_43050_());
|
||||
}
|
||||
@@ -2376,7 +_,7 @@
|
||||
@@ -2547,7 +_,7 @@
|
||||
break;
|
||||
case 1010:
|
||||
if (Item.m_41445_(p_109536_) instanceof RecordItem) {
|
||||
@@ -180,7 +170,7 @@
|
||||
} else {
|
||||
this.m_109514_((SoundEvent)null, p_109535_);
|
||||
}
|
||||
@@ -2546,7 +_,7 @@
|
||||
@@ -2717,7 +_,7 @@
|
||||
case 2001:
|
||||
BlockState blockstate = Block.m_49803_(p_109536_);
|
||||
if (!blockstate.m_60795_()) {
|
||||
@@ -189,7 +179,7 @@
|
||||
this.f_109465_.m_104677_(p_109535_, soundtype.m_56775_(), SoundSource.BLOCKS, (soundtype.m_56773_() + 1.0F) / 2.0F, soundtype.m_56774_() * 0.8F, false);
|
||||
}
|
||||
|
||||
@@ -2711,7 +_,7 @@
|
||||
@@ -2882,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/PostChain.java
|
||||
+++ b/net/minecraft/client/renderer/PostChain.java
|
||||
@@ -168,7 +_,8 @@
|
||||
@@ -169,7 +_,8 @@
|
||||
throw new ChainedJsonException("Render target '" + s4 + "' can't be used as depth buffer");
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
Resource resource = null;
|
||||
|
||||
try {
|
||||
@@ -278,6 +_,7 @@
|
||||
@@ -279,6 +_,7 @@
|
||||
public void m_110038_(String p_110039_, int p_110040_, int p_110041_) {
|
||||
RenderTarget rendertarget = new TextureTarget(p_110040_, p_110041_, true, Minecraft.f_91002_);
|
||||
rendertarget.m_83931_(0.0F, 0.0F, 0.0F, 0.0F);
|
||||
|
||||
Loaded 100 of 538 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user