Added optional removal of the current recipe unlock (#2758)

Should default to false in old and new configs, ie no new behaviour, but now I can deactivate it via config instead of using an unofficial distribution. Will probably come back to this once the toasts are finished...
This commit is contained in:
Ayutac 2022-01-20 20:56:47 +01:00 committed by GitHub
parent e3e5414cee
commit 6180141cd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -46,6 +46,7 @@ import net.minecraft.util.math.Direction;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
import reborncore.common.util.WorldUtils;
import techreborn.config.TechRebornConfig;
import techreborn.events.TRRecipeHandler;
import techreborn.init.ModSounds;
import techreborn.init.TRContent;
@ -149,7 +150,7 @@ public class BlockRubberLog extends PillarBlock {
if (!playerIn.getInventory().insertStack(TRContent.Parts.SAP.getStack())) {
WorldUtils.dropItem(TRContent.Parts.SAP.getStack(), worldIn, pos.offset(hitResult.getSide()));
}
if (playerIn instanceof ServerPlayerEntity) {
if (playerIn instanceof ServerPlayerEntity && !TechRebornConfig.vanillaUnlockRecipes) {
TRRecipeHandler.unlockTRRecipes((ServerPlayerEntity) playerIn);
}
return ActionResult.SUCCESS;

View file

@ -562,6 +562,9 @@ public class TechRebornConfig {
@Config(config = "misc", category = "general", key = "manualRefund", comment = "Allow refunding items used to craft the manual")
public static boolean allowManualRefund = true;
@Config(config = "misc", category = "general", key = "vanillaUnlockRecipes", comment = "Enable recipe unlocks only with vanilla mechanic, instead of getting all of them at once")
public static boolean vanillaUnlockRecipes = false;
@Config(config = "misc", category = "nuke", key = "fusetime", comment = "Nuke fuse time (ticks)")
public static int nukeFuseTime = 400;