updated dependencies

This commit is contained in:
Ell 2021-03-30 16:22:40 +02:00
parent 1ad751583b
commit 8c56d67133
7 changed files with 38 additions and 28 deletions

View file

@ -101,18 +101,18 @@ repositories {
}
dependencies {
minecraft 'net.minecraftforge:forge:1.16.3-34.0.9'
minecraft 'net.minecraftforge:forge:1.16.5-36.1.3'
compileOnly fg.deobf("mezz.jei:jei-1.16.2:7.3.2.25:api")
runtimeOnly fg.deobf("mezz.jei:jei-1.16.2:7.3.2.25")
compileOnly fg.deobf("mezz.jei:jei-1.16.5:7.6.1.75:api")
runtimeOnly fg.deobf("mezz.jei:jei-1.16.5:7.6.1.75")
compileOnly fg.deobf("vazkii.patchouli:Patchouli:1.16.2-47:api")
runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:1.16.2-47")
compileOnly fg.deobf("vazkii.patchouli:Patchouli:1.16.4-50:api")
runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:1.16.4-50")
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.16.3-4.0.2.0")
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.16.3-4.0.2.0:api")
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.16.5-4.0.5.0")
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.16.5-4.0.5.0:api")
compile fg.deobf("quarris.enchantability:Enchantability:8.5.25")
compile fg.deobf("quarris.enchantability:Enchantability:11.0.48")
}
// Example for how to get properties into the manifest for reading by the runtime..

View file

@ -35,7 +35,6 @@ public final class NaturesAura {
public static final String MOD_ID = NaturesAuraAPI.MOD_ID;
public static final String MOD_NAME = "Nature's Aura";
public static final String VERSION = "@VERSION@";
public static final Logger LOGGER = LogManager.getLogger(MOD_NAME);
public static final ItemGroup CREATIVE_TAB = new ItemGroup(MOD_ID) {
@ -45,7 +44,7 @@ public final class NaturesAura {
}
};
public static NaturesAura instance;
public static IProxy proxy = DistExecutor.runForDist(() -> ClientProxy::new, () -> ServerProxy::new);
public static IProxy proxy = DistExecutor.safeRunForDist(() -> ClientProxy::new, () -> ServerProxy::new);
public NaturesAura() {
instance = this;
@ -68,7 +67,7 @@ public final class NaturesAura {
Helper.registerCap(IAuraChunk.class);
Helper.registerCap(IWorldData.class);
Compat.setup();
Compat.setup(event);
PacketHandler.init();
new Multiblocks();
@ -78,7 +77,7 @@ public final class NaturesAura {
}
private void init(FMLCommonSetupEvent event) {
DeferredWorkQueue.runLater(ModConfig.instance::apply);
event.enqueueWork(ModConfig.instance::apply);
ModRecipes.init();
ModRegistry.init();

View file

@ -6,6 +6,7 @@ import de.ellpeck.naturesaura.compat.enchantibility.EnchantibilityCompat;
import de.ellpeck.naturesaura.compat.patchouli.PatchouliCompat;
import de.ellpeck.naturesaura.data.ItemTagProvider;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import java.util.HashMap;
import java.util.Map;
@ -21,9 +22,9 @@ public final class Compat {
.build();
private static final Map<String, ICompat> MODULES = new HashMap<>();
public static void setup() {
public static void setup(FMLCommonSetupEvent event) {
populateModules(ModList.get()::isLoaded);
MODULES.values().forEach(ICompat::setup);
MODULES.values().forEach(c -> c.setup(event));
}
public static void setupClient() {

View file

@ -17,9 +17,11 @@ import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.event.AttachCapabilitiesEvent;
import net.minecraftforge.fml.InterModComms;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import top.theillusivec4.curios.api.CuriosCapability;
import top.theillusivec4.curios.api.SlotContext;
import top.theillusivec4.curios.api.SlotTypeMessage;
import top.theillusivec4.curios.api.type.capability.ICurio;
@ -39,7 +41,7 @@ public class CuriosCompat implements ICompat {
.build();
@Override
public void setup() {
public void setup(FMLCommonSetupEvent event) {
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::sendImc);
MinecraftForge.EVENT_BUS.addGenericListener(ItemStack.class, this::onCapabilitiesAttach);
}
@ -65,7 +67,7 @@ public class CuriosCompat implements ICompat {
}
@Override
public boolean canRightClickEquip() {
public boolean canEquipFromUse(SlotContext slotContext) {
return true;
}

View file

@ -1,10 +1,11 @@
package de.ellpeck.naturesaura.compat;
import de.ellpeck.naturesaura.data.ItemTagProvider;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
public interface ICompat {
void setup();
void setup(FMLCommonSetupEvent event);
void setupClient();

View file

@ -5,14 +5,16 @@ import de.ellpeck.naturesaura.data.ItemTagProvider;
import de.ellpeck.naturesaura.enchant.ModEnchantments;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.fml.DeferredWorkQueue;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import quarris.enchantability.api.EnchantabilityApi;
import java.util.Collections;
public class EnchantibilityCompat implements ICompat {
@Override
public void setup() {
DeferredWorkQueue.runLater(() -> {
public void setup(FMLCommonSetupEvent event) {
event.enqueueWork(() -> {
EnchantabilityApi.registerEnchantEffect(EnchantibilityAuraMending.RES, ModEnchantments.AURA_MENDING, EnchantibilityAuraMending::new);
EnchantabilityApi.registerEffectComponent(EnchantibilityAuraMending.RES, TickEvent.PlayerTickEvent.class, EnchantibilityAuraMending::onPlayerTick, e -> Collections.singletonList(e.player));
});

View file

@ -26,19 +26,21 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.DeferredWorkQueue;
import net.minecraftforge.fml.client.gui.GuiUtils;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import vazkii.patchouli.api.BookDrawScreenEvent;
import vazkii.patchouli.api.IMultiblock;
import vazkii.patchouli.api.IVariable;
import vazkii.patchouli.api.PatchouliAPI;
import java.time.LocalDateTime;
import java.time.Month;
import java.util.Arrays;
import java.util.Collections;
import java.util.*;
import java.util.stream.Collectors;
public class PatchouliCompat implements ICompat {
private static final ResourceLocation BOOK = new ResourceLocation(NaturesAura.MOD_ID, "book");
private static final Map<ResourceLocation, IMultiblock> MULTIBLOCKS = new HashMap<>();
public static void addPatchouliMultiblock(ResourceLocation name, String[][] pattern, Object... rawMatchers) {
for (int i = 1; i < rawMatchers.length; i += 2) {
@ -46,13 +48,13 @@ public class PatchouliCompat implements ICompat {
Matcher matcher = (Matcher) rawMatchers[i];
Matcher.ICheck check = matcher.getCheck();
if (check == null)
rawMatchers[i] = PatchouliAPI.instance.anyMatcher();
rawMatchers[i] = PatchouliAPI.get().anyMatcher();
else
rawMatchers[i] = PatchouliAPI.instance.predicateMatcher(matcher.getDefaultState(),
rawMatchers[i] = PatchouliAPI.get().predicateMatcher(matcher.getDefaultState(),
state -> check.matches(null, null, null, null, state, (char) 0));
}
}
DeferredWorkQueue.runLater(() -> PatchouliAPI.instance.registerMultiblock(name, PatchouliAPI.instance.makeMultiblock(pattern, rawMatchers)));
MULTIBLOCKS.put(name, PatchouliAPI.get().makeMultiblock(pattern, rawMatchers));
}
public static <T extends IRecipe<?>> T getRecipe(String type, String name) {
@ -68,10 +70,13 @@ public class PatchouliCompat implements ICompat {
}
@Override
public void setup() {
DeferredWorkQueue.runLater(() -> {
PatchouliAPI.instance.setConfigFlag(NaturesAura.MOD_ID + ":rf_converter", ModConfig.instance.rfConverter.get());
PatchouliAPI.instance.setConfigFlag(NaturesAura.MOD_ID + ":chunk_loader", ModConfig.instance.chunkLoader.get());
public void setup(FMLCommonSetupEvent event) {
event.enqueueWork(() -> {
for (Map.Entry<ResourceLocation, IMultiblock> entry : MULTIBLOCKS.entrySet())
PatchouliAPI.get().registerMultiblock(entry.getKey(), entry.getValue());
PatchouliAPI.get().setConfigFlag(NaturesAura.MOD_ID + ":rf_converter", ModConfig.instance.rfConverter.get());
PatchouliAPI.get().setConfigFlag(NaturesAura.MOD_ID + ":chunk_loader", ModConfig.instance.chunkLoader.get());
});
}