EMI compatibility

This commit is contained in:
thedarkcolour 2024-04-05 23:27:35 -07:00
parent 578c59d231
commit 11753bb4ef
No known key found for this signature in database
GPG Key ID: 6599A8E0516C8F38
12 changed files with 124 additions and 11 deletions

View File

@ -19,6 +19,8 @@ runs {
configureEach {
systemProperty 'forge.logging.console.level', 'debug'
jvmArgument '-XX:+AllowEnhancedClassRedefinition'
modSource project.sourceSets.main
}
@ -76,6 +78,10 @@ repositories {
url 'https://jitpack.io'
content { includeGroup 'com.github.thedarkcolour' }
}
maven {
name = 'TerraformersMC'
url = 'https://maven.terraformersmc.com'
}
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
@ -102,12 +108,14 @@ dependencies {
// JADE OPTIONAL
implementation("curse.maven:jade-324717:5109393")
// JEI OPTIONAL
compileOnly("mezz.jei:jei-${mc_version}-common-api:${jei_version}")
compileOnly("mezz.jei:jei-${mc_version}-neoforge-api:${jei_version}")
runtimeOnly("mezz.jei:jei-${mc_version}-neoforge:${jei_version}")
// REI OPTIONAL todo add
compileOnly("me.shedaniel:RoughlyEnoughItems-forge:${rei_version}")
compileOnly("me.shedaniel.cloth:cloth-config-neoforge:${cloth_config_version}")
// EMI OPTIONAL
compileOnly("dev.emi:emi-neoforge:${emi_version}:api")
runtimeOnly("dev.emi:emi-neoforge:${emi_version}")
//implementation("curse.maven:reipc-521393:4837449")
// KubeJS OPTIONAL todo add when KubeJS updates
//implementation("dev.architectury:architectury-neoforge:${architectury_version}")

View File

@ -10,6 +10,7 @@ loader_version_range=[2,)
jei_version=17.3.0.49
rei_version=14.0.688
emi_version=1.1.4+1.20.4
cloth_config_version=13.0.121
top_version=11.0.1-2

View File

@ -1,2 +1,2 @@
// 1.20.4 2024-03-17T23:56:02.8986265 ModKit Language: en_us for mod 'exdeorum'
43e0f1f023ef626ab7571ad14c1ecdf5cd594823 assets/exdeorum/lang/en_us.json
// 1.20.4 2024-04-05T23:17:35.8402168 ModKit Language: en_us for mod 'exdeorum'
b26b3ea427dcf21fe2bf7474735584d282e9fc6e assets/exdeorum/lang/en_us.json

View File

@ -232,5 +232,13 @@
"item.exdeorum.wooden_hammer": "Wooden Hammer",
"item.exdeorum.wooden_watering_can": "Wooden Watering Can",
"item.exdeorum.zinc_ore_chunk": "Zinc Ore Chunk",
"itemGroup.exdeorum.main": "Ex Deorum"
"itemGroup.exdeorum.main": "Ex Deorum",
"tag.item.exdeorum.barrels": "Barrels",
"tag.item.exdeorum.crooks": "Crooks",
"tag.item.exdeorum.end_cake_materials": "End Cake Materials",
"tag.item.exdeorum.hammers": "Hammers",
"tag.item.exdeorum.pebbles": "Pebbles",
"tag.item.exdeorum.sieve_meshes": "Sieve Meshes",
"tag.item.exdeorum.stone_barrels": "Stone Barrels",
"tag.item.exdeorum.wooden_barrels": "Wooden Barrels"
}

View File

@ -42,6 +42,7 @@ public class ModIds {
public static final String PAMS_HARVESTCRAFT_CROPS = "pamhc2crops";
public static final String NUCLEARCRAFT_NEOTERIC = "nuclearcraft";
public static final String JEI = "jei";
public static final String EMI = "emi";
public static final String INVENTORY_SORTER = "inventorysorter";
public static final String REI_PC = "rei_plugin_compatibilities";
}

View File

@ -0,0 +1,57 @@
/*
* Ex Deorum
* Copyright (c) 2024 thedarkcolour
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package thedarkcolour.exdeorum.compat.emi;
import dev.emi.emi.api.EmiEntrypoint;
import dev.emi.emi.api.EmiInitRegistry;
import dev.emi.emi.api.EmiPlugin;
import dev.emi.emi.api.EmiRegistry;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.ItemLike;
import thedarkcolour.exdeorum.compat.CompatUtil;
import java.util.HashSet;
import java.util.Set;
@EmiEntrypoint
public class ExDeorumEmiPlugin implements EmiPlugin {
@Override
public void register(EmiRegistry emiRegistry) {
}
@Override
public void initialize(EmiInitRegistry registry) {
Set<ItemLike> toRemove = new HashSet<>();
toRemove.addAll(CompatUtil.getAvailableBarrels(false));
toRemove.addAll(CompatUtil.getAvailableSieves(false, false));
toRemove.addAll(CompatUtil.getAvailableLavaCrucibles(false));
toRemove.addAll(CompatUtil.getAvailableWaterCrucibles(false));
Set<Item> toRemoveItems = new HashSet<>();
for (var itemLike : toRemove) {
toRemoveItems.add(itemLike.asItem());
}
registry.disableStacks(stack -> {
return toRemoveItems.contains(stack.getItemStack().getItem());
});
}
}

View File

@ -0,0 +1,21 @@
/*
* Ex Deorum
* Copyright (c) 2024 thedarkcolour
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@net.minecraft.MethodsReturnNonnullByDefault
@javax.annotation.ParametersAreNonnullByDefault
package thedarkcolour.exdeorum.compat.emi;

View File

@ -41,12 +41,14 @@ import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.LiquidBlock;
import net.minecraft.world.level.block.WallTorchBlock;
import net.neoforged.fml.ModList;
import net.neoforged.neoforge.fluids.FluidStack;
import thedarkcolour.exdeorum.ExDeorum;
import thedarkcolour.exdeorum.client.screen.MechanicalHammerScreen;
import thedarkcolour.exdeorum.client.screen.MechanicalSieveScreen;
import thedarkcolour.exdeorum.compat.CompatUtil;
import thedarkcolour.exdeorum.compat.GroupedSieveRecipe;
import thedarkcolour.exdeorum.compat.ModIds;
import thedarkcolour.exdeorum.data.TranslationKeys;
import thedarkcolour.exdeorum.item.WateringCanItem;
import thedarkcolour.exdeorum.recipe.RecipeUtil;
@ -239,7 +241,7 @@ public class ExDeorumJeiPlugin implements IModPlugin {
@Override
public Collection<IGuiClickableArea> getGuiClickableAreas(MechanicalSieveScreen containerScreen, double mouseX, double mouseY) {
IGuiClickableArea clickableArea = IGuiClickableArea.createBasic(MechanicalSieveScreen.RECIPE_CLICK_AREA_POS_X, MechanicalSieveScreen.RECIPE_CLICK_AREA_POS_Y, MechanicalSieveScreen.RECIPE_CLICK_AREA_WIDTH, MechanicalSieveScreen.RECIPE_CLICK_AREA_HEIGHT, SIEVE);
return List.of(clickableArea);
return ModList.get().isLoaded(ModIds.EMI) ? List.of() : List.of(clickableArea);
}
@Override
@ -255,7 +257,7 @@ public class ExDeorumJeiPlugin implements IModPlugin {
@Override
public Collection<IGuiClickableArea> getGuiClickableAreas(MechanicalHammerScreen containerScreen, double mouseX, double mouseY) {
IGuiClickableArea clickableArea = IGuiClickableArea.createBasic(MechanicalHammerScreen.RECIPE_CLICK_AREA_POS_X, MechanicalHammerScreen.RECIPE_CLICK_AREA_POS_Y, MechanicalHammerScreen.RECIPE_CLICK_AREA_WIDTH, MechanicalHammerScreen.RECIPE_CLICK_AREA_HEIGHT, HAMMER);
return List.of(clickableArea);
return ModList.get().isLoaded(ModIds.EMI) ? List.of() : List.of(clickableArea);
}
@Override

View File

@ -19,14 +19,12 @@
package thedarkcolour.exdeorum.data;
import net.minecraft.core.registries.Registries;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.data.event.GatherDataEvent;
import thedarkcolour.exdeorum.ExDeorum;
import thedarkcolour.exdeorum.data.recipe.Recipes;
import thedarkcolour.modkit.data.DataHelper;
public class Data {
// todo ensure this does not crash without ModKit
public static void generateData(GatherDataEvent event) {
// Two things used by data generators
var gen = event.getGenerator(); // writes to json

View File

@ -18,15 +18,29 @@
package thedarkcolour.exdeorum.data;
import net.minecraft.tags.TagKey;
import thedarkcolour.exdeorum.ExDeorum;
import thedarkcolour.exdeorum.client.screen.RedstoneControlWidget;
import thedarkcolour.exdeorum.material.DefaultMaterials;
import thedarkcolour.exdeorum.registry.EBlocks;
import thedarkcolour.exdeorum.registry.EFluids;
import thedarkcolour.exdeorum.tag.EItemTags;
import thedarkcolour.modkit.data.MKEnglishProvider;
class English {
static void addTranslations(MKEnglishProvider english) {
english.add("fluid_type." + ExDeorum.ID + ".witch_water", "Witch Water");
english.addTranslationHandler(TagKey.class, tag -> "tag.item." + tag.location().toString().replaceAll("[:/]", "."));
english.add(EItemTags.CROOKS, "Crooks");
english.add(EItemTags.HAMMERS, "Hammers");
english.add(EItemTags.SIEVE_MESHES, "Sieve Meshes");
english.add(EItemTags.PEBBLES, "Pebbles");
english.add(EItemTags.END_CAKE_MATERIAL, "End Cake Materials");
english.add(EItemTags.WOODEN_BARRELS, "Wooden Barrels");
english.add(EItemTags.STONE_BARRELS, "Stone Barrels");
english.add(EItemTags.BARRELS, "Barrels");
english.add(EFluids.WITCH_WATER_TYPE.get(), "Witch Water");
english.add(TranslationKeys.MAIN_CREATIVE_TAB, "Ex Deorum");
english.add(TranslationKeys.VOID_WORLD_TYPE, "Void World");

View File

@ -18,13 +18,11 @@
package thedarkcolour.exdeorum.data;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
import net.neoforged.neoforge.data.loading.DatagenModLoader;
import net.neoforged.neoforge.registries.DeferredBlock;
import net.neoforged.neoforge.registries.DeferredItem;

View File

@ -0,0 +1,5 @@
{
"added": [
"exdeorum:unfired_crucible"
]
}