EMI compatibility

This commit is contained in:
thedarkcolour 2024-04-05 23:27:35 -07:00
parent f33576e228
commit ccdae3be40
No known key found for this signature in database
GPG Key ID: 6599A8E0516C8F38
9 changed files with 124 additions and 8 deletions

View File

@ -24,6 +24,8 @@ minecraft {
client {
workingDirectory project.file('run')
jvmArgument '-XX:+AllowEnhancedClassRedefinition'
property 'forge.logging.console.level', 'debug'
mods {
@ -36,6 +38,8 @@ minecraft {
server {
workingDirectory project.file('run/server')
jvmArgument '-XX:+AllowEnhancedClassRedefinition'
property 'forge.logging.console.level', 'debug'
mods {
@ -131,6 +135,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"
@ -164,6 +172,9 @@ dependencies {
implementation(fg.deobf("me.shedaniel:RoughlyEnoughItems-forge:${rei_version}"))
implementation(fg.deobf("me.shedaniel.cloth:cloth-config-forge:${cloth_config_version}"))
implementation(fg.deobf("curse.maven:reipc-521393:4837449"))
// EMI OPTIONAL
compileOnly("dev.emi:emi-forge:${emi_version}:api")
runtimeOnly("dev.emi:emi-forge:${emi_version}")
// KubeJS OPTIONAL
implementation fg.deobf("dev.architectury:architectury-forge:${architectury_version}")
implementation fg.deobf("dev.latvian.mods:rhino-forge:${rhino_version}")

View File

@ -8,12 +8,10 @@ mc_version=1.20.1
forge_version=47.1.43
parchment_mappings=1.20.1-2023.06.26
geckolib_version=4.2
modonomicon_version=1.36.0
jei_version=15.2.0.23
rei_version=12.0.684
emi_version=1.1.4+1.20.1
cloth_config_version=11.1.118
curios_version=5.2.0-beta.3
top_version=10.0.1-3
kubejs_version=2001.6.3-build.47

View File

@ -278,5 +278,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

@ -44,6 +44,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

@ -43,11 +43,13 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.LiquidBlock;
import net.minecraft.world.level.block.WallTorchBlock;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.ModList;
import thedarkcolour.exdeorum.ExDeorum;
import thedarkcolour.exdeorum.client.screen.MechanicalHammerScreen;
import thedarkcolour.exdeorum.client.screen.MechanicalSieveScreen;
import thedarkcolour.exdeorum.compat.CompatHelper;
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;
@ -243,7 +245,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
@ -259,7 +261,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

@ -18,14 +18,27 @@
package thedarkcolour.exdeorum.data;
import thedarkcolour.exdeorum.ExDeorum;
import net.minecraft.tags.TagKey;
import thedarkcolour.exdeorum.client.screen.RedstoneControlWidget;
import thedarkcolour.exdeorum.material.DefaultMaterials;
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

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