Skip to content

Commit

Permalink
close #4334
Browse files Browse the repository at this point in the history
  • Loading branch information
yrsegal committed Sep 23, 2023
1 parent 37427c3 commit 55f7bc7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
package vazkii.quark.addons.oddities.module;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;

import com.google.common.collect.Lists;

import net.minecraft.ChatFormatting;
import net.minecraft.client.gui.screens.MenuScreens;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderers;
Expand Down Expand Up @@ -52,6 +45,12 @@
import vazkii.quark.base.module.QuarkModule;
import vazkii.quark.base.module.config.Config;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;

@LoadModule(category = ModuleCategory.ODDITIES, hasSubscriptions = true)
public class MatrixEnchantingModule extends QuarkModule {

Expand Down Expand Up @@ -111,7 +110,7 @@ public class MatrixEnchantingModule extends QuarkModule {

@Config(description = "Matrix Enchanting can be done with short (<= 3px blocks) instead of air around the enchanting table. Set this to false to disable this behaviour.")
public static boolean allowShortBlockEnchanting = true;

@Config(description = "Candles with soul sand below them or below the bookshelves dampen enchantments instead of influence them.")
public static boolean soulCandlesInvert = true;

Expand Down Expand Up @@ -155,14 +154,14 @@ public class MatrixEnchantingModule extends QuarkModule {
@Config(description = "How much each candle influences an enchantment. This works as a multiplier to its weight")
public static double influencePower = 0.125;

@Config(description = "If you set this to false, the vanilla Enchanting Table will no longer automatically convert to the Matrix Enchanting table. You'll have to add a recipe for the Matrix Enchanting Table to make use of this.")
@Config(description = "If you set this to false, the vanilla Enchanting Table will no longer automatically convert to the Matrix Enchanting table. You'll have to add a recipe for the Matrix Enchanting Table to make use of this.", flag = "matrix_enchanting_autoconvert")
public static boolean automaticallyConvert = true;

public static Map<DyeColor, Influence> candleInfluences;
public static Map<BlockState, CustomInfluence> customInfluences;

public static Block matrixEnchanter;

public static QuarkGenericTrigger influenceTrigger;

@Override
Expand All @@ -174,10 +173,10 @@ public void register() {

blockEntityType = BlockEntityType.Builder.of(MatrixEnchantingTableBlockEntity::new, matrixEnchanter).build(null);
RegistryHelper.register(blockEntityType, "matrix_enchanting", Registry.BLOCK_ENTITY_TYPE_REGISTRY);

influenceTrigger = QuarkAdvancementHandler.registerGenericTrigger("influence");
}

@Override
public void addAdditionalHints(BiConsumer<Item, Component> consumer) {
MutableComponent comp = Component.translatable("quark.jei.hint.matrix_enchanting");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,32 @@
"source": "block_entity"
}
],
"name": "minecraft:enchanting_table"
"name": "minecraft:enchanting_table",
"conditions": [
{
"condition": "quark:flag",
"flag": "matrix_enchanting_autoconvert"
}
]
},
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:copy_name",
"source": "block_entity"
}
],
"name": "quark:matrix_enchanter",
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "quark:flag",
"flag": "matrix_enchanting_autoconvert"
}
}
]
}
],
"conditions": [
Expand All @@ -22,4 +47,4 @@
]
}
]
}
}

0 comments on commit 55f7bc7

Please sign in to comment.