From f173bde8123d4cc6dfa8015ff9029acbc78d4776 Mon Sep 17 00:00:00 2001 From: LexManos Date: Fri, 15 Jan 2021 11:33:04 -0800 Subject: [PATCH] 1.16.5 Initial Update. --- build.gradle | 6 ++--- .../entity/monster/PhantomEntity.java.patch | 11 --------- .../fml/loading/VersionSupportMatrix.java | 24 ++++++++++++++----- .../net/minecraftforge/fml/ModLoader.java | 2 +- .../fml/javafmlmod/FMLModContainer.java | 14 +++++------ 5 files changed, 29 insertions(+), 28 deletions(-) delete mode 100644 patches/minecraft/net/minecraft/entity/monster/PhantomEntity.java.patch diff --git a/build.gradle b/build.gradle index e9ea12dacd..9aa0f76770 100644 --- a/build.gradle +++ b/build.gradle @@ -54,8 +54,8 @@ ext { } MAPPING_CHANNEL = 'snapshot' MAPPING_VERSION = '20201028-1.16.3' - MC_VERSION = '1.16.4' - MCP_VERSION = '20201102.104115' + MC_VERSION = '1.16.5' + MCP_VERSION = '20210115.111550' } project(':mcp') { @@ -197,7 +197,7 @@ project(':forge') { } ext { - SPEC_VERSION = '35.1' // This is overwritten by git tag, but here so dev time doesnt explode + SPEC_VERSION = '36.0' // This is overwritten by git tag, but here so dev time doesnt explode // The new versioning sceme is -.. // ForgeMC is a unique identifier for every MC version we have supported. // Essentially, the same as the old, except dropping the first number, and the builds are no longer unique. diff --git a/patches/minecraft/net/minecraft/entity/monster/PhantomEntity.java.patch b/patches/minecraft/net/minecraft/entity/monster/PhantomEntity.java.patch deleted file mode 100644 index ed8d5ac209..0000000000 --- a/patches/minecraft/net/minecraft/entity/monster/PhantomEntity.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/entity/monster/PhantomEntity.java -+++ b/net/minecraft/entity/monster/PhantomEntity.java -@@ -214,7 +214,7 @@ - this.field_203142_b = 60; - List list = PhantomEntity.this.field_70170_p.func_217373_a(this.field_220842_b, PhantomEntity.this, PhantomEntity.this.func_174813_aQ().func_72314_b(16.0D, 64.0D, 16.0D)); - if (!list.isEmpty()) { -- list.sort(Comparator.comparing(Entity::func_226278_cu_).reversed()); -+ list.sort(Comparator.comparing(Entity::func_226278_cu_).reversed()); - - for(PlayerEntity playerentity : list) { - if (PhantomEntity.this.func_213344_a(playerentity, EntityPredicate.field_221016_a)) { diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/VersionSupportMatrix.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/VersionSupportMatrix.java index d048df74be..c9f9192fe3 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/VersionSupportMatrix.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/VersionSupportMatrix.java @@ -24,20 +24,32 @@ import org.apache.maven.artifact.versioning.ArtifactVersion; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.apache.maven.artifact.versioning.VersionRange; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.function.BiPredicate; public class VersionSupportMatrix { - private static final HashMap overrideVersions = new HashMap<>(); + private static final HashMap> overrideVersions = new HashMap<>(); static { final ArtifactVersion version = new DefaultArtifactVersion(FMLLoader.mcVersion); - if (MavenVersionAdapter.createFromVersionSpec("[1.16.4]").containsVersion(version)) { - overrideVersions.put("languageloader.javafml", new DefaultArtifactVersion("34")); // we also work with javafml 34 - overrideVersions.put("mod.minecraft", new DefaultArtifactVersion("1.16.3")); // we work with anything declaring 1.16.3 - overrideVersions.put("mod.forge", new DefaultArtifactVersion("34.1.42")); // we work with anything that supports forge 34.1.42 + if (MavenVersionAdapter.createFromVersionSpec("[1.16.4,1.16.5]").containsVersion(version)) { + // 1.16.4 is Compatible with 1.16.3 + add("languageloader.javafml", "34"); + add("mod.minecraft", "1.16.3"); + add("mod.forge", "34.1.42"); + // 1.16.5 is Compatible with 1.16.4, and thus 1.16.3 + add("languageloader.javafml", "35"); + add("mod.minecraft", "1.16.4"); + add("mod.forge", "35.1.37"); } } + private static void add(String key, String value) { + overrideVersions.computeIfAbsent(key, k -> new ArrayList<>()).add(new DefaultArtifactVersion(value)); + } public static boolean testVersionSupportMatrix(VersionRange declaredRange, String lookupId, String type, BiPredicate standardLookup) { - return standardLookup.test(lookupId, declaredRange) || overrideVersions.containsKey(type +"." +lookupId) && declaredRange.containsVersion(overrideVersions.get(type +"." +lookupId)); + if (standardLookup.test(lookupId, declaredRange)) return true; + List custom = overrideVersions.get(type +"." +lookupId); + return custom == null ? false : custom.stream().anyMatch(declaredRange::containsVersion); } } diff --git a/src/main/java/net/minecraftforge/fml/ModLoader.java b/src/main/java/net/minecraftforge/fml/ModLoader.java index fa69954bfa..7fed44a10c 100644 --- a/src/main/java/net/minecraftforge/fml/ModLoader.java +++ b/src/main/java/net/minecraftforge/fml/ModLoader.java @@ -268,7 +268,7 @@ public class ModLoader { final Map modInfoMap = modFile.getModFileInfo().getMods().stream().collect(Collectors.toMap(IModInfo::getModId, Function.identity())); - LOGGER.debug(LOADING, "ModContainer is {}", ModContainer.class.getClassLoader()); + LOGGER.trace(LOADING, "ModContainer is {}", ModContainer.class.getClassLoader()); final List containers = modFile.getScanResult().getTargets() .entrySet() .stream() diff --git a/src/main/java/net/minecraftforge/fml/javafmlmod/FMLModContainer.java b/src/main/java/net/minecraftforge/fml/javafmlmod/FMLModContainer.java index 4acd64ad82..7b542e188c 100644 --- a/src/main/java/net/minecraftforge/fml/javafmlmod/FMLModContainer.java +++ b/src/main/java/net/minecraftforge/fml/javafmlmod/FMLModContainer.java @@ -59,7 +59,7 @@ public class FMLModContainer extends ModContainer try { modClass = Class.forName(className, true, modClassLoader); - LOGGER.debug(LOADING,"Loaded modclass {} with {}", modClass.getName(), modClass.getClassLoader()); + LOGGER.trace(LOADING,"Loaded modclass {} with {}", modClass.getName(), modClass.getClassLoader()); } catch (Throwable e) { @@ -77,9 +77,9 @@ public class FMLModContainer extends ModContainer { try { - LOGGER.debug(LOADING, "Loading mod instance {} of type {}", getModId(), modClass.getName()); + LOGGER.trace(LOADING, "Loading mod instance {} of type {}", getModId(), modClass.getName()); this.modInstance = modClass.newInstance(); - LOGGER.debug(LOADING, "Loaded mod instance {} of type {}", getModId(), modClass.getName()); + LOGGER.trace(LOADING, "Loaded mod instance {} of type {}", getModId(), modClass.getName()); } catch (Throwable e) { @@ -87,9 +87,9 @@ public class FMLModContainer extends ModContainer throw new ModLoadingException(modInfo, ModLoadingStage.CONSTRUCT, "fml.modloading.failedtoloadmod", e, modClass); } try { - LOGGER.debug(LOADING, "Injecting Automatic event subscribers for {}", getModId()); + LOGGER.trace(LOADING, "Injecting Automatic event subscribers for {}", getModId()); AutomaticEventSubscriber.inject(this, this.scanResults, this.modClass.getClassLoader()); - LOGGER.debug(LOADING, "Completed Automatic event subscribers for {}", getModId()); + LOGGER.trace(LOADING, "Completed Automatic event subscribers for {}", getModId()); } catch (Throwable e) { LOGGER.error(LOADING,"Failed to register automatic subscribers. ModID: {}, class {}", getModId(), modClass.getName(), e); throw new ModLoadingException(modInfo, ModLoadingStage.CONSTRUCT, "fml.modloading.failedtoloadmod", e, modClass); @@ -116,9 +116,9 @@ public class FMLModContainer extends ModContainer @Override protected void acceptEvent(final T e) { try { - LOGGER.debug(LOADING, "Firing event for modid {} : {}", this.getModId(), e); + LOGGER.trace(LOADING, "Firing event for modid {} : {}", this.getModId(), e); this.eventBus.post(e); - LOGGER.debug(LOADING, "Fired event for modid {} : {}", this.getModId(), e); + LOGGER.trace(LOADING, "Fired event for modid {} : {}", this.getModId(), e); } catch (Throwable t) { LOGGER.error(LOADING,"Caught exception during event {} dispatch for modid {}", e, this.getModId(), t); throw new ModLoadingException(modInfo, modLoadingStage, "fml.modloading.errorduringevent", t);