Make license toml entry optional during 1.16.1

There are to many existing mods to make this required.
Yes, we are technically before a RB and can do breaking changes. However this is too large.
This commit is contained in:
LexManos 2020-07-28 00:16:18 -07:00
parent 95d2b6ae89
commit 4ffcdaa6da
4 changed files with 17 additions and 9 deletions

View file

@ -35,18 +35,17 @@
return p_208071_1_.func_175640_z(p_208071_2_) ? true : this.func_176566_a(p_208071_1_, p_208071_2_, blockstate, p_208071_3_, p_208071_4_ + 1); return p_208071_1_.func_175640_z(p_208071_2_) ? true : this.func_176566_a(p_208071_1_, p_208071_2_, blockstate, p_208071_3_, p_208071_4_ + 1);
} else { } else {
return false; return false;
@@ -156,6 +162,10 @@ @@ -156,6 +162,9 @@
return p_185499_1_.func_206870_a(field_176568_b, RailShape.SOUTH_EAST); return p_185499_1_.func_206870_a(field_176568_b, RailShape.SOUTH_EAST);
case NORTH_EAST: case NORTH_EAST:
return p_185499_1_.func_206870_a(field_176568_b, RailShape.SOUTH_WEST); return p_185499_1_.func_206870_a(field_176568_b, RailShape.SOUTH_WEST);
+ //Forge fix: MC-196102 + case NORTH_SOUTH: //Forge fix: MC-196102
+ case NORTH_SOUTH:
+ case EAST_WEST: + case EAST_WEST:
+ return p_185499_1_; + return p_185499_1_;
} }
case COUNTERCLOCKWISE_90: case COUNTERCLOCKWISE_90:
switch((RailShape)p_185499_1_.func_177229_b(field_176568_b)) { switch((RailShape)p_185499_1_.func_177229_b(field_176568_b)) {
@@ -255,4 +265,8 @@ @@ -255,4 +264,8 @@
protected void func_206840_a(StateContainer.Builder<Block, BlockState> p_206840_1_) { protected void func_206840_a(StateContainer.Builder<Block, BlockState> p_206840_1_) {
p_206840_1_.func_206894_a(field_176568_b, field_176569_M); p_206840_1_.func_206894_a(field_176568_b, field_176569_M);
} }

View file

@ -1,11 +1,10 @@
--- a/net/minecraft/block/RailBlock.java --- a/net/minecraft/block/RailBlock.java
+++ b/net/minecraft/block/RailBlock.java +++ b/net/minecraft/block/RailBlock.java
@@ -49,6 +49,10 @@ @@ -49,6 +49,9 @@
return p_185499_1_.func_206870_a(field_176565_b, RailShape.SOUTH_EAST); return p_185499_1_.func_206870_a(field_176565_b, RailShape.SOUTH_EAST);
case NORTH_EAST: case NORTH_EAST:
return p_185499_1_.func_206870_a(field_176565_b, RailShape.SOUTH_WEST); return p_185499_1_.func_206870_a(field_176565_b, RailShape.SOUTH_WEST);
+ //Forge fix: MC-196102 + case NORTH_SOUTH: //Forge fix: MC-196102
+ case NORTH_SOUTH:
+ case EAST_WEST: + case EAST_WEST:
+ return p_185499_1_; + return p_185499_1_;
} }

View file

@ -20,6 +20,8 @@
package net.minecraftforge.fml.loading.moddiscovery; package net.minecraftforge.fml.loading.moddiscovery;
import com.electronwill.nightconfig.core.UnmodifiableConfig; import com.electronwill.nightconfig.core.UnmodifiableConfig;
import net.minecraftforge.fml.loading.StringSubstitutor;
import net.minecraftforge.fml.loading.StringUtils; import net.minecraftforge.fml.loading.StringUtils;
import net.minecraftforge.forgespi.language.IConfigurable; import net.minecraftforge.forgespi.language.IConfigurable;
import net.minecraftforge.forgespi.language.IModFileInfo; import net.minecraftforge.forgespi.language.IModFileInfo;
@ -62,8 +64,16 @@ public class ModFileInfo implements IModFileInfo, IConfigurable
this.modLoaderVersion = config.<String>getConfigElement("loaderVersion") this.modLoaderVersion = config.<String>getConfigElement("loaderVersion")
.map(MavenVersionAdapter::createFromVersionSpec) .map(MavenVersionAdapter::createFromVersionSpec)
.orElseThrow(()->new InvalidModFileException("Missing ModLoader version in file", this)); .orElseThrow(()->new InvalidModFileException("Missing ModLoader version in file", this));
String mcVersion = StringSubstitutor.replace("${global.mcVersion}", null);
if ("1.16.1".equals(mcVersion)) {
this.license = config.<String>getConfigElement("license").orElse("All Rights Reserved (Default License, Modder Please specify)");
} else {
throw new IllegalStateException("Code exists that should not in " + mcVersion + " Delete other case.");
}
/* Make license non-optional in >1.16.1, delete the above if, and uncomment the below lines when updating.
this.license = config.<String>getConfigElement("license") this.license = config.<String>getConfigElement("license")
.orElseThrow(()->new InvalidModFileException("Missing License, please supply a license.", this)); .orElseThrow(()->new InvalidModFileException("Missing License, please supply a license.", this));
*/
this.showAsResourcePack = config.<Boolean>getConfigElement("showAsResourcePack").orElse(false); this.showAsResourcePack = config.<Boolean>getConfigElement("showAsResourcePack").orElse(false);
this.properties = config.<UnmodifiableConfig>getConfigElement("properties"). this.properties = config.<UnmodifiableConfig>getConfigElement("properties").
map(UnmodifiableConfig::valueMap).orElse(Collections.emptyMap()); map(UnmodifiableConfig::valueMap).orElse(Collections.emptyMap());

View file

@ -1,6 +1,6 @@
modLoader="minecraft" modLoader="minecraft"
loaderVersion="1" loaderVersion="1"
license="Mojang all rights reserved" license="Mojang Studios, All Rights Reserved"
[[mods]] [[mods]]
modId="minecraft" modId="minecraft"
version="${global.mcVersion}" version="${global.mcVersion}"