Compare commits

..
21 Commits
Author SHA1 Message Date
Ruling-0 6472f9eede Bump MaterialLib to 0.24.0-mu 2026-10-11 18:25:18 -05:00
Ruling-0 cdde638c16 Bump MaterialLib to 0.21.0-mu 2026-10-09 21:16:29 -05:00
Ruling-0 d665ee4536 Bump MaterialLib to 0.20.0-mu 2026-10-09 19:02:33 -05:00
Ruling-0 5b7b560342 Merge remote-tracking branch 'origin/master' into mu 2026-10-09 18:56:04 -05:00
Ruling-0 66bc8b7137 Bump MaterialLib to 0.19.0-mu 2026-10-06 14:57:27 -05:00
Ruling-0 a7e6e97d18 Bump MaterialLib to 0.18.0-mu 2026-10-04 12:34:45 -05:00
Ruling-0 c30cb80084 Bump MaterialLib to 0.17.0-mu 2026-10-04 12:15:46 -05:00
Ruling-0 503fb98712 Bump MaterialLib to 0.16.0-mu 2026-10-04 02:48:16 -05:00
Ruling-0 53f303ce4c Bump MaterialLib to 0.15.0-mu 2026-09-30 13:01:46 -05:00
Ruling-0 378737a39f Bump MaterialLib to 0.14.0-mu 2026-09-30 11:03:26 -05:00
Ruling-0 4c22609b28 Bump MaterialLib to 0.13.0-mu 2026-09-29 16:57:13 -05:00
Ruling-0 e9c07c9d17 Bump MaterialLib to 0.12.0-mu 2026-09-29 07:22:34 -05:00
Ruling-0 59f1475df0 Merge remote-tracking branch 'origin/master' into mu 2026-09-28 07:38:26 -05:00
Ruling-0 d41c723194 Bump MaterialLib to 0.11.0-mu 2026-09-22 09:54:06 -05:00
Ruling-0 7e4e73bc0f Merge remote-tracking branch 'origin/master' into mu 2026-09-20 11:21:17 -05:00
Ruling-0 b96937cb7f Merge remote-tracking branch 'origin/master' into mu 2026-09-09 12:51:58 -05:00
Ruling-0 5450124254 Bump MaterialLib to 0.10.0-mu 2026-08-29 22:33:22 -05:00
Ruling-0 fd7ed181de Merge remote-tracking branch 'origin/master' into mu 2026-08-29 22:19:19 -05:00
Ruling-0 ae2866aa8d Doc and code style pass 2026-08-20 17:54:40 -05:00
Ruling-0 398dc6d786 Resolve MaterialLib item references in recipe config XML 2026-08-17 20:18:04 -05:00
Ruling-0 af707f80c8 Add MaterialLib as a compile only dependency 2026-08-17 20:18:04 -05:00
8 changed files with 77 additions and 119 deletions

No files matched your search

+2 -1
View File
@@ -28,8 +28,9 @@ dependencies {
compileOnly(rfg.deobf('curse.maven:computercraft-67504:2269339')) // https://www.curseforge.com/minecraft/mc-mods/computercraft/files/2269339
compileOnly(rfg.deobf('curse.maven:mekanism-268560:2475797')) // https://www.curseforge.com/minecraft/mc-mods/mekanism/files/2475797
compileOnly(rfg.deobf('maven.modrinth:immibis-microblocks:59.1.2')) // https://modrinth.com/mod/immibis-microblocks/version/59.1.2
compileOnly('com.github.GTNewHorizons:BetterBuildersWands:0.13.12-GTNH:dev@jar')
compileOnlyApi('com.github.GTNewHorizons:Angelica:2.2.10:api') {transitive = false}
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.196:dev")
compileOnly('curse.maven:automagy-222153:2285272')
compileOnly('com.ruling_0:MaterialLib:0.24.0-mu:dev')
}
+1
View File
@@ -1,4 +1,5 @@
// Add any additional repositories for your dependencies here
repositories {
mavenLocal()
}
@@ -47,7 +47,6 @@ import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import crazypants.enderio.api.IMC;
import crazypants.enderio.betterbuilderswands.PaintedCustomMapping;
import crazypants.enderio.block.BlockDarkSteelAnvil;
import crazypants.enderio.block.BlockDarkSteelLadder;
import crazypants.enderio.block.BlockDarkSteelPressurePlate;
@@ -134,6 +133,7 @@ import crazypants.enderio.machine.painter.BlockPaintedWall;
import crazypants.enderio.machine.painter.BlockPainter;
import crazypants.enderio.machine.painter.PaintSourceValidator;
import crazypants.enderio.machine.ranged.RangeEntity;
import crazypants.enderio.machine.recipe.RecipeConfigParser;
import crazypants.enderio.machine.reservoir.BlockReservoir;
import crazypants.enderio.machine.slicensplice.BlockSliceAndSplice;
import crazypants.enderio.machine.slicensplice.SliceAndSpliceRecipeManager;
@@ -191,8 +191,7 @@ import crazypants.util.EE3Util;
after:Waila@[1.5.8,);\
after:Thaumcraft;\
after:appliedenergistics2@[rv2-beta-8,);\
after:Railcraft@[9.16.7,);\
after:betterbuilderswands@[0.13.12,)\
after:Railcraft@[9.16.7,)\
""", guiFactory = "crazypants.enderio.config.ConfigFactoryEIO")
public class EnderIO {
@@ -768,6 +767,7 @@ public class EnderIO {
FarmersRegistry.addFarmers();
SoulBinderRecipeManager.getInstance().addDefaultRecipes();
PaintSourceValidator.instance.loadConfig();
RecipeConfigParser.logMaterialLibSummary();
if (fluidXpJuice == null) { // should have been registered by open blocks
fluidXpJuice = FluidRegistry.getFluid(getXPJuiceName());
@@ -841,9 +841,6 @@ public class EnderIO {
Log.info("Failed to registered Capacitor Banks as Tinkers Construct Flux Upgrades");
}
}
if (Loader.isModLoaded("betterbuilderswands")) {
PaintedCustomMapping.registerMappings();
}
ThaumcraftCompat.load();
}
@@ -1,101 +0,0 @@
package crazypants.enderio.betterbuilderswands;
import java.util.function.BiFunction;
import java.util.function.IntFunction;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import com.github.bsideup.jabel.Desugar;
import crazypants.enderio.EnderIO;
import crazypants.enderio.machine.painter.BlockPaintedCarpet;
import crazypants.enderio.machine.painter.BlockPaintedFence;
import crazypants.enderio.machine.painter.BlockPaintedFenceGate;
import crazypants.enderio.machine.painter.BlockPaintedGlowstone;
import crazypants.enderio.machine.painter.BlockPaintedSlab;
import crazypants.enderio.machine.painter.BlockPaintedStair;
import crazypants.enderio.machine.painter.BlockPaintedWall;
import crazypants.enderio.machine.painter.TileEntityPaintedBlock;
import portablejim.bbw.BetterBuildersWandsMod;
import portablejim.bbw.basics.Point3d;
import portablejim.bbw.core.conversion.ICustomMapping;
import portablejim.bbw.shims.IPlayerShim;
import portablejim.bbw.shims.IWorldShim;
@Desugar
public record PaintedCustomMapping(Block lookBlock, BiFunction<Block, Integer, ItemStack> itemStackGetter, int meta)
implements ICustomMapping {
@Override
public Block getLookBlock() {
return lookBlock;
}
@Override
public int getMeta() {
return meta;
}
@Override
public ItemStack getItems(IWorldShim world, IPlayerShim player, Point3d point) {
if (world.getTile(point) instanceof TileEntityPaintedBlock painted) {
return itemStackGetter.apply(painted.getSourceBlock(), painted.getSourceBlockMetadata());
}
return null;
}
@Override
public boolean shouldCopyTileNBT() {
return true;
}
public static void registerMappings() {
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedGlowstone,
BlockPaintedGlowstone::createItemStackForSourceBlock,
i));
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedStair,
BlockPaintedStair::createItemStackForSourceBlock,
i));
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedFence,
BlockPaintedFence::createItemStackForSourceBlock,
i));
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedFenceGate,
BlockPaintedFenceGate::createItemStackForSourceBlock,
i));
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedCarpet,
BlockPaintedCarpet::createItemStackForSourceBlock,
i));
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedSlab,
BlockPaintedSlab::createItemStackForSourceBlock,
i));
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedWall,
BlockPaintedWall::createItemStackForSourceBlock,
i));
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedDoubleSlab,
BlockPaintedSlab::createItemStackForSourceBlock,
i));
}
private static void register(IntFunction<ICustomMapping> mapping) {
for (int i = 0; i < 16; i++) {
BetterBuildersWandsMod.instance.mappingManager.setMapping(mapping.apply(i));
}
}
}
@@ -47,8 +47,8 @@ public class ExistingItemFilter implements IItemFilter {
private boolean isStackInInventory(NetworkedInventory ni, ItemStack item) {
int[] slots = ni.getInventory().getAccessibleSlotsFromSide(ni.getInventorySide());
for (int slot : slots) {
ItemStack stack = ni.getInventory().getStackInSlot(slot);
for (int i = 0; i < slots.length; i++) {
ItemStack stack = ni.getInventory().getStackInSlot(i);
if (stackEqual(item, stack)) {
return true;
}
@@ -116,8 +116,8 @@ public class ExistingItemFilter implements IItemFilter {
snapshot = new ArrayList<>();
}
int[] slots = ni.getInventory().getAccessibleSlotsFromSide(ni.getInventorySide());
for (int slot : slots) {
ItemStack stack = ni.getInventory().getStackInSlot(slot);
for (int i = 0; i < slots.length; i++) {
ItemStack stack = ni.getInventory().getStackInSlot(i);
if (stack != null && !isStackInSnapshot(stack)) {
snapshot.add(stack);
}
@@ -31,15 +31,12 @@ public class BasicManyToOneRecipe implements IManyToOneRecipe {
@Override
public boolean isValidRecipeComponents(ItemStack... items) {
List<RecipeInput> inputs = new ArrayList<RecipeInput>(Arrays.asList(recipe.getInputs()));
for (int slot = 0; slot < items.length; slot++) {
ItemStack is = items[slot];
List<RecipeInput> inputs = new ArrayList<>(Arrays.asList(recipe.getInputs()));
for (ItemStack is : items) {
if (is != null) {
RecipeInput remove = null;
for (RecipeInput ri : inputs) {
int riSlot = ri.getSlotNumber();
// Match by item type and, if the recipe specifies a slot, also by slot index
if (ri.isInput(is) && (riSlot == -1 || riSlot == slot)) {
if (ri.isInput(is)) {
remove = ri;
break;
}
@@ -0,0 +1,17 @@
package crazypants.enderio.machine.recipe;
import net.minecraft.item.ItemStack;
import com.ruling_0.materiallib.api.StackResolver;
/// Resolves the stack a `modID="ml"` config entry names. The only EnderIO class referencing MaterialLib types, so
/// the soft dependency classloads only behind a `Loader.isModLoaded` check.
final class MaterialLibStacks {
private MaterialLibStacks() {}
/// The stack of the named material in the named shape, or null when the pair resolves to nothing.
static ItemStack getStack(String materialName, String shapeToken, int stackSize) {
return StackResolver.getStack(materialName, shapeToken, stackSize);
}
}
@@ -28,6 +28,7 @@ import org.xml.sax.helpers.DefaultHandler;
import com.enderio.core.common.util.OreDictionaryHelper;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import crazypants.enderio.Log;
import crazypants.enderio.machine.crusher.CrusherRecipeManager;
@@ -63,6 +64,14 @@ public class RecipeConfigParser extends DefaultHandler {
public static final String AT_EXP = "exp";
public static final String AT_ALLOW_MISSING = "allowMissing";
/// The `modID` under which an `itemName` of the form `<material>:<shape>` names a MaterialLib stack.
private static final String MOD_ID_ML = "ml";
private static final String MATERIAL_LIB_MODID = "materiallib";
private static int materialLibResolved = 0;
private static int materialLibInvalid = 0;
// Log prefix
private static final String LP = "RecipeParser: ";
@@ -423,7 +432,11 @@ public class RecipeConfigParser extends DefaultHandler {
String modId = getStringValue(AT_MOD_ID, attributes, null);
String name = getStringValue(AT_ITEM_NAME, attributes, null);
if (modId != null && name != null) {
if (MOD_ID_ML.equals(modId)) {
res = getMaterialLibStack(name, stackSize);
// A MaterialLib stack carries its material in the metadata, so itemMeta="*" cannot apply.
useMeta = true;
} else if (modId != null && name != null) {
Item i = GameRegistry.findItem(modId, name);
if (i != null) {
@@ -447,6 +460,39 @@ public class RecipeConfigParser extends DefaultHandler {
getIntValue(AT_SLOT, attributes, -1));
}
/// The stack `itemName` names, or null when MaterialLib is absent, the name is malformed, or the pair resolves
/// to nothing.
private static ItemStack getMaterialLibStack(String itemName, int stackSize) {
if (itemName == null || !Loader.isModLoaded(MATERIAL_LIB_MODID)) {
return null;
}
String[] parts = itemName.split(":", -1);
if (parts.length != 2 || parts[0].isEmpty() || parts[1].isEmpty()) {
Log.warn(LP + "Malformed MaterialLib reference \"" + itemName + "\", expected <material>:<shape>");
materialLibInvalid++;
return null;
}
ItemStack res = MaterialLibStacks.getStack(parts[0], parts[1], stackSize);
if (res == null) {
materialLibInvalid++;
} else {
materialLibResolved++;
}
return res;
}
/// Logs how many MaterialLib references the recipe configs named. Call once config loading has finished.
public static void logMaterialLibSummary() {
if (materialLibResolved + materialLibInvalid > 0) {
Log.info(
LP + "Resolved "
+ materialLibResolved
+ " MaterialLib entries ("
+ materialLibInvalid
+ " invalid)");
}
}
public static boolean getBooleanValue(String qName, Attributes attributes, boolean def) {
String val = attributes.getValue(qName);
if (val == null) {