Skip to content

Commit

Permalink
revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
YocyCraft committed Dec 22, 2024
1 parent 9d990fd commit 4155163
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/main/java/dev/dubhe/anvilcraft/AnvilCraft.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
import dev.dubhe.anvilcraft.init.ModNetworks;
import dev.dubhe.anvilcraft.init.ModRecipeTypes;
import dev.dubhe.anvilcraft.init.ModVillagers;
import dev.dubhe.anvilcraft.integration.CompatMods;
import dev.dubhe.anvilcraft.integration.top.AnvilCraftTopPlugin;
import dev.dubhe.anvilcraft.recipe.anvil.cache.RecipeCaches;
import dev.dubhe.anvilcraft.util.ModInteractionMap;

import dev.dubhe.anvilcraft.util.Util;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.PackType;
Expand Down Expand Up @@ -137,7 +137,7 @@ public static void addReloadListeners(@NotNull AddReloadListenerEvent event) {
public static void loadComplete(@NotNull FMLLoadCompleteEvent event) {
event.enqueueWork(() -> {
ModInteractionMap.initInteractionMap();
if (CompatMods.THE_ONE_PROBE.isLoaded()) {
if (Util.isLoaded("theoneprobe")) {
LOGGER.info("TheOneProbe found. Loading AnvilCraft TheOneProbe plugin...");
AnvilCraftTopPlugin.init();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import com.mojang.logging.LogUtils;
import dev.dubhe.anvilcraft.AnvilCraft;
import dev.dubhe.anvilcraft.integration.CompatMods;
import dev.dubhe.anvilcraft.integration.iris.IrisState;
import dev.dubhe.anvilcraft.util.Util;
import lombok.Getter;
import net.minecraft.client.Minecraft;
import org.slf4j.Logger;
Expand All @@ -15,7 +15,7 @@ public class RenderState {
private static final Logger logger = LogUtils.getLogger();

static {
IRIS_PRESENT = CompatMods.IRIS.isLoaded();
IRIS_PRESENT = Util.isLoaded("iris");
}

public static boolean isIrisPresent() {
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/dev/dubhe/anvilcraft/init/ModBlockTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import dev.dubhe.anvilcraft.AnvilCraft;

import dev.dubhe.anvilcraft.integration.CompatMods;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
Expand All @@ -11,6 +10,8 @@
import org.jetbrains.annotations.NotNull;

public class ModBlockTags {

private static final String MEKANISM_MODID = "mekanism";
// mod tags
public static final TagKey<Block> UNDER_CAULDRON = bind("under_cauldron");
public static final TagKey<Block> MAGNET = bind("magnet");
Expand Down Expand Up @@ -68,7 +69,7 @@ public class ModBlockTags {
}

private static @NotNull TagKey<Block> bindMekanism(String id){
return TagKey.create(Registries.BLOCK, CompatMods.MEKANISM.of(id));
return TagKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath(MEKANISM_MODID, id));
}

private static @NotNull TagKey<Block> bind(String id) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/dev/dubhe/anvilcraft/item/GuideBookItem.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev.dubhe.anvilcraft.item;

import dev.dubhe.anvilcraft.integration.CompatMods;
import dev.dubhe.anvilcraft.integration.patchouli.PatchouliUtil;

import dev.dubhe.anvilcraft.util.Util;
import net.minecraft.ChatFormatting;
import net.minecraft.MethodsReturnNonnullByDefault;
import net.minecraft.network.chat.Component;
Expand All @@ -27,7 +27,7 @@ public GuideBookItem(Properties properties) {
@Override
public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand usedHand) {
if (player instanceof ServerPlayer serverPlayer) {
if (CompatMods.PATCHOULI.isLoaded()) {
if (Util.isLoaded("patchouli")) {
PatchouliUtil.openBook(serverPlayer);
return new InteractionResultHolder<>(InteractionResult.CONSUME, player.getItemInHand(usedHand));
} else {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/dev/dubhe/anvilcraft/util/Util.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.dubhe.anvilcraft.util;

import dev.dubhe.anvilcraft.integration.CompatMods;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.InteractionResult;
Expand All @@ -22,7 +21,7 @@

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Util {
public static final Lazy<Boolean> jadePresent = new Lazy<>(() -> CompatMods.JADE.isLoaded() || CompatMods.WTHIT.isLoaded());
public static final Lazy<Boolean> jadePresent = new Lazy<>(() -> isLoaded("jade") || isLoaded("wthit"));
private static final StackWalker STACK_WALKER = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE);
public static final Direction[] HORIZONTAL_DIRECTIONS = new Direction[] {
Direction.SOUTH,
Expand Down

0 comments on commit 4155163

Please sign in to comment.