1.14: Fixed recipe condition bug (issue #65).

This commit is contained in:
stfwi 2019-11-20 19:53:33 +01:00
parent eadec80234
commit 1c71841ed8
7 changed files with 21 additions and 7 deletions

View file

@ -599,7 +599,7 @@ public class ModContent
}; };
private static final Object dev_content[] = { private static final Object dev_content[] = {
SIGN_MINDSTEP, SIGN_MINDSTEP, // @todo: somehow make this sign look good.
PANZERGLASS_SLAB, // @todo: check if another class is needed due to is_side_visible PANZERGLASS_SLAB, // @todo: check if another class is needed due to is_side_visible
TREATED_WOOD_FLOOR, // @todo: check if textures need improvement TREATED_WOOD_FLOOR, // @todo: check if textures need improvement
TEST_BLOCK,TEST_BLOCK_TEI, TEST_BLOCK,TEST_BLOCK_TEI,

View file

@ -5,4 +5,4 @@ version_minecraft=1.14.4
version_forge_minecraft=1.14.4-28.1.90 version_forge_minecraft=1.14.4-28.1.90
version_fml_mappings=20190719-1.14.3 version_fml_mappings=20190719-1.14.3
version_jei=1.14.4:6.0.0.10 version_jei=1.14.4:6.0.0.10
version_engineersdecor=1.0.16-b4 version_engineersdecor=1.0.16-b5

View file

@ -1,6 +1,7 @@
{ {
"homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/", "homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/",
"1.14.4": { "1.14.4": {
"1.0.16-b5": "[F] Fixed recipe condition bug (issue #65, thx Nachtflame for the report, and gigaherz & killjoy for the help).",
"1.0.16-b4": "[U] Updated to Forge 1.14.4-28.1.90/20190719-1.14.3.\n[M] Increased slag brick recipe yield to 8.\n[M] Parent specs in model files adapted.", "1.0.16-b4": "[U] Updated to Forge 1.14.4-28.1.90/20190719-1.14.3.\n[M] Increased slag brick recipe yield to 8.\n[M] Parent specs in model files adapted.",
"1.0.16-b3": "[A] Config options (opt-outs and tweaks) added.\n[M] Increased clinker brick recipe yield to 8 for the builders needs.", "1.0.16-b3": "[A] Config options (opt-outs and tweaks) added.\n[M] Increased clinker brick recipe yield to 8 for the builders needs.",
"1.0.16-b2": "[A] Added Gas Concrete (including wall, stairs, slab, and slab slice).\n[F] Fixed Small Block Breaker active model.\n[F] Fixed item-on-ground display glitch (issue #61, thx Federsavo for the hint).\n[F] Added two missing recipes.", "1.0.16-b2": "[A] Added Gas Concrete (including wall, stairs, slab, and slab slice).\n[F] Fixed Small Block Breaker active model.\n[F] Fixed item-on-ground display glitch (issue #61, thx Federsavo for the hint).\n[F] Added two missing recipes.",
@ -34,6 +35,6 @@
}, },
"promos": { "promos": {
"1.14.4-recommended": "", "1.14.4-recommended": "",
"1.14.4-latest": "1.0.16-b4" "1.14.4-latest": "1.0.16-b5"
} }
} }

View file

@ -11,6 +11,9 @@ Mod sources for Minecraft version 1.14.4.
## Version history ## Version history
- v1.0.16-b5 [F] Fixed recipe condition bug (issue #65, thx Nachtflame for the report,
and gigaherz & killjoy for the help).
- v1.0.16-b4 [U] Updated to Forge 1.14.4-28.1.90/20190719-1.14.3. - v1.0.16-b4 [U] Updated to Forge 1.14.4-28.1.90/20190719-1.14.3.
[M] Increased slag brick recipe yield to 8. [M] Increased slag brick recipe yield to 8.
[M] Parent specs in model files adapted. [M] Parent specs in model files adapted.

View file

@ -17,7 +17,6 @@ import net.minecraft.block.Block;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.common.ForgeConfigSpec;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import wile.engineersdecor.blocks.BlockDecorMilker.BTileEntity;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
@ -461,7 +460,7 @@ public class ModConfig
"Note this is a permanent standby power, not only when the device does something. " + "Note this is a permanent standby power, not only when the device does something. " +
"Use zero to disable energy dependency and energy handling of the machine. " + "Use zero to disable energy dependency and energy handling of the machine. " +
"The config value can be changed on-the-fly for tuning.") "The config value can be changed on-the-fly for tuning.")
.defineInRange("milking_machine_energy_consumption", BTileEntity.DEFAULT_ENERGY_CONSUMPTION, 0, 128); .defineInRange("milking_machine_energy_consumption", BlockDecorMilker.BTileEntity.DEFAULT_ENERGY_CONSUMPTION, 0, 128);
builder.pop(); builder.pop();
} }
} }
@ -564,6 +563,9 @@ public class ModConfig
public static boolean withExperimental() public static boolean withExperimental()
{ return with_experimental_features_; } { return with_experimental_features_; }
public static boolean withoutRecipes()
{ return without_recipes_; }
//-------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------
// Cache // Cache
//-------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------
@ -573,6 +575,7 @@ public class ModConfig
public static boolean without_crafting_table = false; public static boolean without_crafting_table = false;
public static boolean immersiveengineering_installed = false; public static boolean immersiveengineering_installed = false;
private static boolean with_experimental_features_ = false; private static boolean with_experimental_features_ = false;
private static boolean without_recipes_ = false;
public static final CompoundNBT getServerConfig() // config that may be synchronized from server to client via net pkg. public static final CompoundNBT getServerConfig() // config that may be synchronized from server to client via net pkg.
{ return server_config_; } { return server_config_; }
@ -592,6 +595,7 @@ public class ModConfig
without_crafting_table = isOptedOut(ModContent.TREATED_WOOD_CRAFTING_TABLE); without_crafting_table = isOptedOut(ModContent.TREATED_WOOD_CRAFTING_TABLE);
immersiveengineering_installed = ModAuxiliaries.isModLoaded("immersiveengineering"); immersiveengineering_installed = ModAuxiliaries.isModLoaded("immersiveengineering");
with_experimental_features_ = COMMON.with_experimental.get(); with_experimental_features_ = COMMON.with_experimental.get();
without_recipes_ = COMMON.without_recipes.get();
if(with_experimental_features_) { if(with_experimental_features_) {
ModEngineersDecor.logger().info("Config: EXPERIMENTAL FEATURES ENABLED."); ModEngineersDecor.logger().info("Config: EXPERIMENTAL FEATURES ENABLED.");
} }

View file

@ -57,11 +57,16 @@ public class OptionalRecipeCondition implements ICondition
@Override @Override
public boolean test() public boolean test()
{ {
if(ModConfig.withoutRecipes()) return false;
if((experimental) && (!ModConfig.withExperimental())) return false; if((experimental) && (!ModConfig.withExperimental())) return false;
final IForgeRegistry<Block> block_registry = ForgeRegistries.BLOCKS; final IForgeRegistry<Block> block_registry = ForgeRegistries.BLOCKS;
final IForgeRegistry<Item> item_registry = ForgeRegistries.ITEMS; final IForgeRegistry<Item> item_registry = ForgeRegistries.ITEMS;
if(result != null) { if(result != null) {
if((!block_registry.containsKey(result)) && (!item_registry.containsKey(result))) return false; // required result not registered boolean item_registered = item_registry.containsKey(result);
boolean block_registered = block_registry.containsKey(result);
if((!block_registered) && (!item_registered)) return false; // required result not registered
if(item_registered && ModConfig.isOptedOut(item_registry.getValue(result))) return false;
if(block_registered && ModConfig.isOptedOut(block_registry.getValue(result))) return false;
} }
if(!all_required.isEmpty()) { if(!all_required.isEmpty()) {
for(ResourceLocation rl:all_required) { for(ResourceLocation rl:all_required) {

View file

@ -4,7 +4,7 @@
"1.12.2-recommended": "1.0.15", "1.12.2-recommended": "1.0.15",
"1.12.2-latest": "1.0.16-b3", "1.12.2-latest": "1.0.16-b3",
"1.14.4-recommended": "", "1.14.4-recommended": "",
"1.14.4-latest": "1.0.16-b4" "1.14.4-latest": "1.0.16-b5"
}, },
"1.12.2": { "1.12.2": {
"1.0.16-b3": "[M] Increased slag brick recipe yield to 8.\n[A] Small Block Placer can plant Cocoa.\n[F] Fixed Small Block Placer seed detection issue (issue #64, thx Federsavo).\n[F] Fixed incorrectly enabled alternative recipes for fluid accumulator and check valve when IE is installed.\n[M] Slightly nerfed the Small Solar Panel default peak power output (does not affect existing configurations).", "1.0.16-b3": "[M] Increased slag brick recipe yield to 8.\n[A] Small Block Placer can plant Cocoa.\n[F] Fixed Small Block Placer seed detection issue (issue #64, thx Federsavo).\n[F] Fixed incorrectly enabled alternative recipes for fluid accumulator and check valve when IE is installed.\n[M] Slightly nerfed the Small Solar Panel default peak power output (does not affect existing configurations).",
@ -74,6 +74,7 @@
"1.0.0-b1": "[A] Initial structure.\n[A] Added clinker bricks and clinker brick stairs.\n[A] Added slag bricks and slag brick stairs.\n[A] Added metal rung ladder.\n[A] Added staggered metal steps ladder.\n[A] Added treated wood ladder.\n[A] Added treated wood pole.\n[A] Added treated wood table." "1.0.0-b1": "[A] Initial structure.\n[A] Added clinker bricks and clinker brick stairs.\n[A] Added slag bricks and slag brick stairs.\n[A] Added metal rung ladder.\n[A] Added staggered metal steps ladder.\n[A] Added treated wood ladder.\n[A] Added treated wood pole.\n[A] Added treated wood table."
}, },
"1.14.4": { "1.14.4": {
"1.0.16-b5": "[F] Fixed recipe condition bug (issue #65, thx Nachtflame for the report, and gigaherz & killjoy for the help).",
"1.0.16-b4": "[U] Updated to Forge 1.14.4-28.1.90/20190719-1.14.3.\n[M] Increased slag brick recipe yield to 8.\n[M] Parent specs in model files adapted.", "1.0.16-b4": "[U] Updated to Forge 1.14.4-28.1.90/20190719-1.14.3.\n[M] Increased slag brick recipe yield to 8.\n[M] Parent specs in model files adapted.",
"1.0.16-b3": "[A] Config options (opt-outs and tweaks) added.\n[M] Increased clinker brick recipe yield to 8 for the builders needs.", "1.0.16-b3": "[A] Config options (opt-outs and tweaks) added.\n[M] Increased clinker brick recipe yield to 8 for the builders needs.",
"1.0.16-b2": "[A] Added Gas Concrete (including wall, stairs, slab, and slab slice).\n[F] Fixed Small Block Breaker active model.\n[F] Fixed item-on-ground display glitch (issue #61, thx Federsavo for the hint).\n[F] Added two missing recipes.", "1.0.16-b2": "[A] Added Gas Concrete (including wall, stairs, slab, and slab slice).\n[F] Fixed Small Block Breaker active model.\n[F] Fixed item-on-ground display glitch (issue #61, thx Federsavo for the hint).\n[F] Added two missing recipes.",